/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SecurityHub { namespace Model { /** *

A custom response to send to the client. You can define a custom response * for rule actions and default web ACL actions that are set to block. *

See Also:

AWS * API Reference

*/ class AwsWafv2CustomResponseDetails { public: AWS_SECURITYHUB_API AwsWafv2CustomResponseDetails(); AWS_SECURITYHUB_API AwsWafv2CustomResponseDetails(Aws::Utils::Json::JsonView jsonValue); AWS_SECURITYHUB_API AwsWafv2CustomResponseDetails& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_SECURITYHUB_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline const Aws::String& GetCustomResponseBodyKey() const{ return m_customResponseBodyKey; } /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline bool CustomResponseBodyKeyHasBeenSet() const { return m_customResponseBodyKeyHasBeenSet; } /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline void SetCustomResponseBodyKey(const Aws::String& value) { m_customResponseBodyKeyHasBeenSet = true; m_customResponseBodyKey = value; } /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline void SetCustomResponseBodyKey(Aws::String&& value) { m_customResponseBodyKeyHasBeenSet = true; m_customResponseBodyKey = std::move(value); } /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline void SetCustomResponseBodyKey(const char* value) { m_customResponseBodyKeyHasBeenSet = true; m_customResponseBodyKey.assign(value); } /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline AwsWafv2CustomResponseDetails& WithCustomResponseBodyKey(const Aws::String& value) { SetCustomResponseBodyKey(value); return *this;} /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline AwsWafv2CustomResponseDetails& WithCustomResponseBodyKey(Aws::String&& value) { SetCustomResponseBodyKey(std::move(value)); return *this;} /** *

References the response body that you want WAF to return to the web request * client. You can define a custom response for a rule action or a default web ACL * action that is set to block.

*/ inline AwsWafv2CustomResponseDetails& WithCustomResponseBodyKey(const char* value) { SetCustomResponseBodyKey(value); return *this;} /** *

The HTTP status code to return to the client. For a list of status codes * that you can use in your custom responses, see Supported * status codes for custom response in the WAF Developer Guide.

*/ inline int GetResponseCode() const{ return m_responseCode; } /** *

The HTTP status code to return to the client. For a list of status codes * that you can use in your custom responses, see Supported * status codes for custom response in the WAF Developer Guide.

*/ inline bool ResponseCodeHasBeenSet() const { return m_responseCodeHasBeenSet; } /** *

The HTTP status code to return to the client. For a list of status codes * that you can use in your custom responses, see Supported * status codes for custom response in the WAF Developer Guide.

*/ inline void SetResponseCode(int value) { m_responseCodeHasBeenSet = true; m_responseCode = value; } /** *

The HTTP status code to return to the client. For a list of status codes * that you can use in your custom responses, see Supported * status codes for custom response in the WAF Developer Guide.

*/ inline AwsWafv2CustomResponseDetails& WithResponseCode(int value) { SetResponseCode(value); return *this;} /** *

The HTTP headers to use in the response.

*/ inline const Aws::Vector& GetResponseHeaders() const{ return m_responseHeaders; } /** *

The HTTP headers to use in the response.

*/ inline bool ResponseHeadersHasBeenSet() const { return m_responseHeadersHasBeenSet; } /** *

The HTTP headers to use in the response.

*/ inline void SetResponseHeaders(const Aws::Vector& value) { m_responseHeadersHasBeenSet = true; m_responseHeaders = value; } /** *

The HTTP headers to use in the response.

*/ inline void SetResponseHeaders(Aws::Vector&& value) { m_responseHeadersHasBeenSet = true; m_responseHeaders = std::move(value); } /** *

The HTTP headers to use in the response.

*/ inline AwsWafv2CustomResponseDetails& WithResponseHeaders(const Aws::Vector& value) { SetResponseHeaders(value); return *this;} /** *

The HTTP headers to use in the response.

*/ inline AwsWafv2CustomResponseDetails& WithResponseHeaders(Aws::Vector&& value) { SetResponseHeaders(std::move(value)); return *this;} /** *

The HTTP headers to use in the response.

*/ inline AwsWafv2CustomResponseDetails& AddResponseHeaders(const AwsWafv2CustomHttpHeader& value) { m_responseHeadersHasBeenSet = true; m_responseHeaders.push_back(value); return *this; } /** *

The HTTP headers to use in the response.

*/ inline AwsWafv2CustomResponseDetails& AddResponseHeaders(AwsWafv2CustomHttpHeader&& value) { m_responseHeadersHasBeenSet = true; m_responseHeaders.push_back(std::move(value)); return *this; } private: Aws::String m_customResponseBodyKey; bool m_customResponseBodyKeyHasBeenSet = false; int m_responseCode; bool m_responseCodeHasBeenSet = false; Aws::Vector m_responseHeaders; bool m_responseHeadersHasBeenSet = false; }; } // namespace Model } // namespace SecurityHub } // namespace Aws