From ca5ed50655b744ae4d3242b2105676a43d1482e0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 22 Aug 2020 19:23:22 -0400 Subject: web_service: Move web_result.h into web_service This is the only place it's actively used. It's also more appropriate for web-related structures to be within the web service target. Especially given this one doesn't rely on anything in the common library. --- src/web_service/web_backend.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/web_service/web_backend.h') diff --git a/src/web_service/web_backend.h b/src/web_service/web_backend.h index 04121f17e..81f58583c 100644 --- a/src/web_service/web_backend.h +++ b/src/web_service/web_backend.h @@ -7,12 +7,10 @@ #include #include -namespace Common { -struct WebResult; -} - namespace WebService { +struct WebResult; + class Client { public: Client(std::string host, std::string username, std::string token); @@ -25,8 +23,7 @@ public: * @param allow_anonymous If true, allow anonymous unauthenticated requests. * @return the result of the request. */ - Common::WebResult PostJson(const std::string& path, const std::string& data, - bool allow_anonymous); + WebResult PostJson(const std::string& path, const std::string& data, bool allow_anonymous); /** * Gets JSON from the specified path. @@ -34,7 +31,7 @@ public: * @param allow_anonymous If true, allow anonymous unauthenticated requests. * @return the result of the request. */ - Common::WebResult GetJson(const std::string& path, bool allow_anonymous); + WebResult GetJson(const std::string& path, bool allow_anonymous); /** * Deletes JSON to the specified path. @@ -43,8 +40,7 @@ public: * @param allow_anonymous If true, allow anonymous unauthenticated requests. * @return the result of the request. */ - Common::WebResult DeleteJson(const std::string& path, const std::string& data, - bool allow_anonymous); + WebResult DeleteJson(const std::string& path, const std::string& data, bool allow_anonymous); /** * Gets a plain string from the specified path. @@ -52,7 +48,7 @@ public: * @param allow_anonymous If true, allow anonymous unauthenticated requests. * @return the result of the request. */ - Common::WebResult GetPlain(const std::string& path, bool allow_anonymous); + WebResult GetPlain(const std::string& path, bool allow_anonymous); /** * Gets an PNG image from the specified path. @@ -60,14 +56,14 @@ public: * @param allow_anonymous If true, allow anonymous unauthenticated requests. * @return the result of the request. */ - Common::WebResult GetImage(const std::string& path, bool allow_anonymous); + WebResult GetImage(const std::string& path, bool allow_anonymous); /** * Requests an external JWT for the specific audience provided. * @param audience the audience of the JWT requested. * @return the result of the request. */ - Common::WebResult GetExternalJWT(const std::string& audience); + WebResult GetExternalJWT(const std::string& audience); private: struct Impl; -- cgit v1.2.3