AWS SDK for C++  1.9.15
AWS SDK for C++
AmazonWebServiceResult.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #include <utility>
11 
12 namespace Aws
13 {
17  template <typename PAYLOAD_TYPE>
19  {
20  public:
21  AmazonWebServiceResult() : m_responseCode(Http::HttpResponseCode::REQUEST_NOT_MADE) {}
22 
26  AmazonWebServiceResult(const PAYLOAD_TYPE& payload, const Http::HeaderValueCollection& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
27  m_payload(payload),
28  m_responseHeaders(headers),
29  m_responseCode(responseCode)
30  {}
31 
35  AmazonWebServiceResult(PAYLOAD_TYPE&& payload, Http::HeaderValueCollection&& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
36  m_payload(std::forward<PAYLOAD_TYPE>(payload)),
37  m_responseHeaders(std::forward<Http::HeaderValueCollection>(headers)),
38  m_responseCode(responseCode)
39  {}
40 
42  m_payload(result.m_payload),
43  m_responseHeaders(result.m_responseHeaders),
44  m_responseCode(result.m_responseCode)
45  {}
46 
48  m_payload(std::move(result.m_payload)),
49  m_responseHeaders(std::move(result.m_responseHeaders)),
50  m_responseCode(result.m_responseCode)
51  {}
52 
56  inline const PAYLOAD_TYPE& GetPayload() const { return m_payload; }
60  inline PAYLOAD_TYPE TakeOwnershipOfPayload() { return std::move(m_payload); }
64  inline const Http::HeaderValueCollection& GetHeaderValueCollection() const { return m_responseHeaders; }
68  inline Http::HttpResponseCode GetResponseCode() const { return m_responseCode; }
69 
70  private:
71  PAYLOAD_TYPE m_payload;
72  Http::HeaderValueCollection m_responseHeaders;
73  Http::HttpResponseCode m_responseCode;
74  };
75 
76 
77 }
Aws::AmazonWebServiceResult::AmazonWebServiceResult
AmazonWebServiceResult(const AmazonWebServiceResult &result)
Definition: AmazonWebServiceResult.h:41
Aws::AmazonWebServiceResult
Definition: AmazonWebServiceResult.h:19
Aws::AmazonWebServiceResult::AmazonWebServiceResult
AmazonWebServiceResult(PAYLOAD_TYPE &&payload, Http::HeaderValueCollection &&headers, Http::HttpResponseCode responseCode=Http::HttpResponseCode::OK)
Definition: AmazonWebServiceResult.h:35
Aws::Http::HeaderValueCollection
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
Definition: HttpTypes.h:53
Aws::AmazonWebServiceResult::GetPayload
const PAYLOAD_TYPE & GetPayload() const
Definition: AmazonWebServiceResult.h:56
Aws::Http::HttpResponseCode
HttpResponseCode
Definition: HttpResponse.h:30
Aws::AmazonWebServiceResult::AmazonWebServiceResult
AmazonWebServiceResult(const PAYLOAD_TYPE &payload, const Http::HeaderValueCollection &headers, Http::HttpResponseCode responseCode=Http::HttpResponseCode::OK)
Definition: AmazonWebServiceResult.h:26
Aws::AmazonWebServiceResult::GetHeaderValueCollection
const Http::HeaderValueCollection & GetHeaderValueCollection() const
Definition: AmazonWebServiceResult.h:64
Aws::AmazonWebServiceResult::AmazonWebServiceResult
AmazonWebServiceResult(AmazonWebServiceResult &&result)
Definition: AmazonWebServiceResult.h:47
HttpResponse.h
Aws::AmazonWebServiceResult::AmazonWebServiceResult
AmazonWebServiceResult()
Definition: AmazonWebServiceResult.h:21
Aws
Definition: AccessManagementClient.h:15
HttpTypes.h
Aws::AmazonWebServiceResult::TakeOwnershipOfPayload
PAYLOAD_TYPE TakeOwnershipOfPayload()
Definition: AmazonWebServiceResult.h:60
Aws::AmazonWebServiceResult::GetResponseCode
Http::HttpResponseCode GetResponseCode() const
Definition: AmazonWebServiceResult.h:68