6#include <azure/core/http/policies/policy.hpp>
11namespace Azure {
namespace Storage {
namespace _internal {
13 class StorageServiceVersionPolicy final :
public Azure::Core::Http::Policies::HttpPolicy {
15 explicit StorageServiceVersionPolicy(std::string apiVersion)
16 : m_apiVersion(std::move(apiVersion))
20 std::unique_ptr<Azure::Core::Http::Policies::HttpPolicy> Clone()
const override
22 return std::make_unique<StorageServiceVersionPolicy>(*
this);
25 std::unique_ptr<Azure::Core::Http::RawResponse> Send(
26 Azure::Core::Http::Request& request,
27 Azure::Core::Http::Policies::NextHttpPolicy nextPolicy,
28 const Azure::Core::Context& context)
const override
30 if (!m_apiVersion.empty())
32 request.SetHeader(HttpHeaderXMsVersion, m_apiVersion);
34 return nextPolicy.Send(request, context);
38 std::string m_apiVersion;