1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/wafv2/WAFV2_EXPORTS.h> 8 #include <aws/wafv2/model/ResponseContentType.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 namespace Utils 15 { 16 namespace Json 17 { 18 class JsonValue; 19 class JsonView; 20 } // namespace Json 21 } // namespace Utils 22 namespace WAFV2 23 { 24 namespace Model 25 { 26 27 /** 28 * <p>The response body to use in a custom response to a web request. This is 29 * referenced by key from <a>CustomResponse</a> 30 * <code>CustomResponseBodyKey</code>.</p><p><h3>See Also:</h3> <a 31 * href="http://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CustomResponseBody">AWS 32 * API Reference</a></p> 33 */ 34 class AWS_WAFV2_API CustomResponseBody 35 { 36 public: 37 CustomResponseBody(); 38 CustomResponseBody(Aws::Utils::Json::JsonView jsonValue); 39 CustomResponseBody& operator=(Aws::Utils::Json::JsonView jsonValue); 40 Aws::Utils::Json::JsonValue Jsonize() const; 41 42 43 /** 44 * <p>The type of content in the payload that you are defining in the 45 * <code>Content</code> string.</p> 46 */ GetContentType()47 inline const ResponseContentType& GetContentType() const{ return m_contentType; } 48 49 /** 50 * <p>The type of content in the payload that you are defining in the 51 * <code>Content</code> string.</p> 52 */ ContentTypeHasBeenSet()53 inline bool ContentTypeHasBeenSet() const { return m_contentTypeHasBeenSet; } 54 55 /** 56 * <p>The type of content in the payload that you are defining in the 57 * <code>Content</code> string.</p> 58 */ SetContentType(const ResponseContentType & value)59 inline void SetContentType(const ResponseContentType& value) { m_contentTypeHasBeenSet = true; m_contentType = value; } 60 61 /** 62 * <p>The type of content in the payload that you are defining in the 63 * <code>Content</code> string.</p> 64 */ SetContentType(ResponseContentType && value)65 inline void SetContentType(ResponseContentType&& value) { m_contentTypeHasBeenSet = true; m_contentType = std::move(value); } 66 67 /** 68 * <p>The type of content in the payload that you are defining in the 69 * <code>Content</code> string.</p> 70 */ WithContentType(const ResponseContentType & value)71 inline CustomResponseBody& WithContentType(const ResponseContentType& value) { SetContentType(value); return *this;} 72 73 /** 74 * <p>The type of content in the payload that you are defining in the 75 * <code>Content</code> string.</p> 76 */ WithContentType(ResponseContentType && value)77 inline CustomResponseBody& WithContentType(ResponseContentType&& value) { SetContentType(std::move(value)); return *this;} 78 79 80 /** 81 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 82 * in JSON content. To do this, you must specify JSON content in the 83 * <code>ContentType</code> setting. </p> <p>For information about the limits on 84 * count and size for custom request and response settings, see <a 85 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 86 * quotas</a> in the <a 87 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 88 * Developer Guide</a>. </p> 89 */ GetContent()90 inline const Aws::String& GetContent() const{ return m_content; } 91 92 /** 93 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 94 * in JSON content. To do this, you must specify JSON content in the 95 * <code>ContentType</code> setting. </p> <p>For information about the limits on 96 * count and size for custom request and response settings, see <a 97 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 98 * quotas</a> in the <a 99 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 100 * Developer Guide</a>. </p> 101 */ ContentHasBeenSet()102 inline bool ContentHasBeenSet() const { return m_contentHasBeenSet; } 103 104 /** 105 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 106 * in JSON content. To do this, you must specify JSON content in the 107 * <code>ContentType</code> setting. </p> <p>For information about the limits on 108 * count and size for custom request and response settings, see <a 109 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 110 * quotas</a> in the <a 111 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 112 * Developer Guide</a>. </p> 113 */ SetContent(const Aws::String & value)114 inline void SetContent(const Aws::String& value) { m_contentHasBeenSet = true; m_content = value; } 115 116 /** 117 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 118 * in JSON content. To do this, you must specify JSON content in the 119 * <code>ContentType</code> setting. </p> <p>For information about the limits on 120 * count and size for custom request and response settings, see <a 121 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 122 * quotas</a> in the <a 123 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 124 * Developer Guide</a>. </p> 125 */ SetContent(Aws::String && value)126 inline void SetContent(Aws::String&& value) { m_contentHasBeenSet = true; m_content = std::move(value); } 127 128 /** 129 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 130 * in JSON content. To do this, you must specify JSON content in the 131 * <code>ContentType</code> setting. </p> <p>For information about the limits on 132 * count and size for custom request and response settings, see <a 133 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 134 * quotas</a> in the <a 135 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 136 * Developer Guide</a>. </p> 137 */ SetContent(const char * value)138 inline void SetContent(const char* value) { m_contentHasBeenSet = true; m_content.assign(value); } 139 140 /** 141 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 142 * in JSON content. To do this, you must specify JSON content in the 143 * <code>ContentType</code> setting. </p> <p>For information about the limits on 144 * count and size for custom request and response settings, see <a 145 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 146 * quotas</a> in the <a 147 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 148 * Developer Guide</a>. </p> 149 */ WithContent(const Aws::String & value)150 inline CustomResponseBody& WithContent(const Aws::String& value) { SetContent(value); return *this;} 151 152 /** 153 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 154 * in JSON content. To do this, you must specify JSON content in the 155 * <code>ContentType</code> setting. </p> <p>For information about the limits on 156 * count and size for custom request and response settings, see <a 157 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 158 * quotas</a> in the <a 159 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 160 * Developer Guide</a>. </p> 161 */ WithContent(Aws::String && value)162 inline CustomResponseBody& WithContent(Aws::String&& value) { SetContent(std::move(value)); return *this;} 163 164 /** 165 * <p>The payload of the custom response. </p> <p>You can use JSON escape strings 166 * in JSON content. To do this, you must specify JSON content in the 167 * <code>ContentType</code> setting. </p> <p>For information about the limits on 168 * count and size for custom request and response settings, see <a 169 * href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF 170 * quotas</a> in the <a 171 * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">WAF 172 * Developer Guide</a>. </p> 173 */ WithContent(const char * value)174 inline CustomResponseBody& WithContent(const char* value) { SetContent(value); return *this;} 175 176 private: 177 178 ResponseContentType m_contentType; 179 bool m_contentTypeHasBeenSet; 180 181 Aws::String m_content; 182 bool m_contentHasBeenSet; 183 }; 184 185 } // namespace Model 186 } // namespace WAFV2 187 } // namespace Aws 188