AWS SDK for C++

AWS SDK for C++ Version 1.11.931

Loading...
Searching...
No Matches
CustomResponse.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/wafv2/WAFV2_EXPORTS.h>
10#include <aws/wafv2/model/CustomHTTPHeader.h>
11
12#include <utility>
13
14namespace Aws {
15namespace Utils {
16namespace Json {
17class JsonValue;
18class JsonView;
19} // namespace Json
20} // namespace Utils
21namespace WAFV2 {
22namespace Model {
23
35 public:
36 AWS_WAFV2_API CustomResponse() = default;
39 AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const;
40
42
48 inline int GetResponseCode() const { return m_responseCode; }
49 inline bool ResponseCodeHasBeenSet() const { return m_responseCodeHasBeenSet; }
50 inline void SetResponseCode(int value) {
51 m_responseCodeHasBeenSet = true;
52 m_responseCode = value;
53 }
54 inline CustomResponse& WithResponseCode(int value) {
55 SetResponseCode(value);
56 return *this;
57 }
59
61
70 inline const Aws::String& GetCustomResponseBodyKey() const { return m_customResponseBodyKey; }
71 inline bool CustomResponseBodyKeyHasBeenSet() const { return m_customResponseBodyKeyHasBeenSet; }
72 template <typename CustomResponseBodyKeyT = Aws::String>
73 void SetCustomResponseBodyKey(CustomResponseBodyKeyT&& value) {
74 m_customResponseBodyKeyHasBeenSet = true;
75 m_customResponseBodyKey = std::forward<CustomResponseBodyKeyT>(value);
76 }
77 template <typename CustomResponseBodyKeyT = Aws::String>
78 CustomResponse& WithCustomResponseBodyKey(CustomResponseBodyKeyT&& value) {
79 SetCustomResponseBodyKey(std::forward<CustomResponseBodyKeyT>(value));
80 return *this;
81 }
83
85
93 inline const Aws::Vector<CustomHTTPHeader>& GetResponseHeaders() const { return m_responseHeaders; }
94 inline bool ResponseHeadersHasBeenSet() const { return m_responseHeadersHasBeenSet; }
95 template <typename ResponseHeadersT = Aws::Vector<CustomHTTPHeader>>
96 void SetResponseHeaders(ResponseHeadersT&& value) {
97 m_responseHeadersHasBeenSet = true;
98 m_responseHeaders = std::forward<ResponseHeadersT>(value);
99 }
100 template <typename ResponseHeadersT = Aws::Vector<CustomHTTPHeader>>
101 CustomResponse& WithResponseHeaders(ResponseHeadersT&& value) {
102 SetResponseHeaders(std::forward<ResponseHeadersT>(value));
103 return *this;
104 }
105 template <typename ResponseHeadersT = CustomHTTPHeader>
106 CustomResponse& AddResponseHeaders(ResponseHeadersT&& value) {
107 m_responseHeadersHasBeenSet = true;
108 m_responseHeaders.emplace_back(std::forward<ResponseHeadersT>(value));
109 return *this;
110 }
112 private:
113 int m_responseCode{0};
114
115 Aws::String m_customResponseBodyKey;
116
117 Aws::Vector<CustomHTTPHeader> m_responseHeaders;
118 bool m_responseCodeHasBeenSet = false;
119 bool m_customResponseBodyKeyHasBeenSet = false;
120 bool m_responseHeadersHasBeenSet = false;
121};
122
123} // namespace Model
124} // namespace WAFV2
125} // namespace Aws
const Aws::String & GetCustomResponseBodyKey() const
void SetResponseHeaders(ResponseHeadersT &&value)
CustomResponse & WithResponseHeaders(ResponseHeadersT &&value)
const Aws::Vector< CustomHTTPHeader > & GetResponseHeaders() const
CustomResponse & WithCustomResponseBodyKey(CustomResponseBodyKeyT &&value)
AWS_WAFV2_API CustomResponse & operator=(Aws::Utils::Json::JsonView jsonValue)
AWS_WAFV2_API CustomResponse()=default
void SetCustomResponseBodyKey(CustomResponseBodyKeyT &&value)
CustomResponse & WithResponseCode(int value)
AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const
CustomResponse & AddResponseHeaders(ResponseHeadersT &&value)
AWS_WAFV2_API CustomResponse(Aws::Utils::Json::JsonView jsonValue)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue