AWS SDK for C++
AWS SDK for C++
Loading...
Searching...
No Matches
AmazonWebServiceResult.h
Go to the documentation of this file.
1
6#pragma once
7
9#include <utility>
11
12namespace 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
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}
PAYLOAD_TYPE && TakeOwnershipOfPayload()
AmazonWebServiceResult(const AmazonWebServiceResult &result)
AmazonWebServiceResult(AmazonWebServiceResult &&result)
AmazonWebServiceResult(PAYLOAD_TYPE &&payload, Http::HeaderValueCollection &&headers, Http::HttpResponseCode responseCode=Http::HttpResponseCode::OK)
const Http::HeaderValueCollection & GetHeaderValueCollection() const
Http::HttpResponseCode GetResponseCode() const
AmazonWebServiceResult(const PAYLOAD_TYPE &payload, const Http::HeaderValueCollection &headers, Http::HttpResponseCode responseCode=Http::HttpResponseCode::OK)
const PAYLOAD_TYPE & GetPayload() const
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
Definition: HttpTypes.h:53