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

Specifies that WAF should block the request and optionally defines additional * custom handling for the response to the web request.

This is used in the * context of other settings, for example to specify values for RuleAction * and web ACL DefaultAction.

See Also:

AWS * API Reference

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

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline const CustomResponse& GetCustomResponse() const{ return m_customResponse; } /** *

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline bool CustomResponseHasBeenSet() const { return m_customResponseHasBeenSet; } /** *

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline void SetCustomResponse(const CustomResponse& value) { m_customResponseHasBeenSet = true; m_customResponse = value; } /** *

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline void SetCustomResponse(CustomResponse&& value) { m_customResponseHasBeenSet = true; m_customResponse = std::move(value); } /** *

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline BlockAction& WithCustomResponse(const CustomResponse& value) { SetCustomResponse(value); return *this;} /** *

Defines a custom response for the web request.

For information about * customizing web requests and responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*/ inline BlockAction& WithCustomResponse(CustomResponse&& value) { SetCustomResponse(std::move(value)); return *this;} private: CustomResponse m_customResponse; bool m_customResponseHasBeenSet = false; }; } // namespace Model } // namespace WAFV2 } // namespace Aws