winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Interface.h (1666B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "Rest/Schema/1_0/Interface.h"
      5 
      6 namespace AppInstaller::Repository::Rest::Schema::V1_1
      7 {
      8     // Interface to this schema version exposed through IRestClient.
      9     struct Interface : public V1_0::Interface
     10     {
     11         Interface(const std::string& restApi, const Http::HttpClientHelper& helper, IRestClient::Information information, const Http::HttpClientHelper::HttpRequestHeaders& additionalHeaders = {});
     12 
     13         Interface(const Interface&) = delete;
     14         Interface& operator=(const Interface&) = delete;
     15 
     16         Interface(Interface&&) = default;
     17         Interface& operator=(Interface&&) = default;
     18 
     19         Utility::Version GetVersion() const override;
     20         IRestClient::Information GetSourceInformation() const override;
     21 
     22     protected:
     23         // Check query params against source information and update if necessary.
     24         std::map<std::string_view, std::string> GetValidatedQueryParams(const std::map<std::string_view, std::string>& params) const override;
     25 
     26         // Check search request against source information and get json search body.
     27         web::json::value GetValidatedSearchBody(const SearchRequest& searchRequest) const override;
     28 
     29         SearchResult GetSearchResult(const web::json::value& searchResponseObject) const override;
     30         std::vector<Manifest::Manifest> GetParsedManifests(const web::json::value& manifestsResponseObject) const override;
     31 
     32         PackageMatchField ConvertStringToPackageMatchField(std::string_view field) const;
     33 
     34         IRestClient::Information m_information;
     35     };
     36 }