azure-core
response.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
10 #pragma once
11 
12 #include "azure/core/http/http.hpp"
13 #include "azure/core/nullable.hpp"
14 #include <memory> // for unique_ptr
15 #include <stdexcept>
16 #include <utility> // for move
17 
18 namespace Azure {
25 template <class T> class Response final {
26 
27 public:
29  T Value;
31  std::unique_ptr<Azure::Core::Http::RawResponse> RawResponse;
32 
39  explicit Response(T value, std::unique_ptr<Azure::Core::Http::RawResponse> rawResponse)
40  : Value(std::move(value)), RawResponse(std::move(rawResponse))
41  {
42  }
43 };
44 
45 } // namespace Azure
Azure::Response
Represents the result of an Azure operation over HTTP by wrapping the raw HTTP response from a reques...
Definition: response.hpp:25
Azure::Response::RawResponse
std::unique_ptr< Azure::Core::Http::RawResponse > RawResponse
The HTTP response returned by the service.
Definition: response.hpp:31
Azure::Response::Value
T Value
The value returned by the service.
Definition: response.hpp:29
Azure
Azure SDK abstractions.
Definition: azure_assert.hpp:55
http.hpp
HTTP request and response functionality.
nullable.hpp
Manages an optional contained value, i.e. a value that may or may not be present.
Azure::Response::Response
Response(T value, std::unique_ptr< Azure::Core::Http::RawResponse > rawResponse)
Constructs a Response with the value and raw response returned by the service.
Definition: response.hpp:39