From fc4c1c5fb9ca406e054a5764032dd829a6782771 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Fri, 16 Sep 2022 23:47:07 +0200 Subject: [PATCH] Add documentation to the APIRequest constructor --- src/common/APIRequest.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/APIRequest.hpp b/src/common/APIRequest.hpp index cb118c457..9d8ec9b97 100644 --- a/src/common/APIRequest.hpp +++ b/src/common/APIRequest.hpp @@ -44,6 +44,15 @@ public: APIRequest(const APIRequest &other) = delete; APIRequest &operator=(const APIRequest &other) = delete; + /** + * @brief Constructs an APIRequest instance and a APIRequestData. + * + * @param[successTransformer] a function that will transform a NetworkResult into the desired type (OkType), for example decode JSON + * @param[errorTransformer] an optional function that will transform a NetworkResult into the desired type (ErrorType) + * @param[onFinally] an optional function that will be called regardless of the status. This is explicitly different from calling finally(...) as this is for cleanup of the decoding/transformer logic, they are separate + * + * APIRequest is a wrapper around NetworkRequest + */ explicit APIRequest( QUrl url, NetworkRequestType requestType, std::function successTransformer,