SearchResponseParser.h (1062B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <AppInstallerVersions.h> 5 #include <winget/JsonUtil.h> 6 #include "Rest/Schema/IRestClient.h" 7 8 #include <memory> 9 #include <vector> 10 11 namespace AppInstaller::Repository::Rest::Schema 12 { 13 // Exposes functions for parsing JSON REST responses to IRestClient SearchResult. 14 struct SearchResponseParser 15 { 16 SearchResponseParser(const Utility::Version& schemaVersion); 17 18 SearchResponseParser(const SearchResponseParser&) = delete; 19 SearchResponseParser& operator=(const SearchResponseParser&) = delete; 20 21 SearchResponseParser(SearchResponseParser&&) noexcept; 22 SearchResponseParser& operator=(SearchResponseParser&&) noexcept; 23 24 ~SearchResponseParser(); 25 26 // Gets the search result for response object 27 IRestClient::SearchResult Deserialize(const web::json::value& searchResultJsonObject) const; 28 29 private: 30 struct impl; 31 std::unique_ptr<impl> m_pImpl; 32 }; 33 }