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

The action that WAF should take on a web request when it matches a rule's * statement. Settings at the web ACL level can override the rule action setting. *

See Also:

AWS * API Reference

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

Instructs WAF to block the web request.

*/ inline const BlockAction& GetBlock() const{ return m_block; } /** *

Instructs WAF to block the web request.

*/ inline bool BlockHasBeenSet() const { return m_blockHasBeenSet; } /** *

Instructs WAF to block the web request.

*/ inline void SetBlock(const BlockAction& value) { m_blockHasBeenSet = true; m_block = value; } /** *

Instructs WAF to block the web request.

*/ inline void SetBlock(BlockAction&& value) { m_blockHasBeenSet = true; m_block = std::move(value); } /** *

Instructs WAF to block the web request.

*/ inline RuleAction& WithBlock(const BlockAction& value) { SetBlock(value); return *this;} /** *

Instructs WAF to block the web request.

*/ inline RuleAction& WithBlock(BlockAction&& value) { SetBlock(std::move(value)); return *this;} /** *

Instructs WAF to allow the web request.

*/ inline const AllowAction& GetAllow() const{ return m_allow; } /** *

Instructs WAF to allow the web request.

*/ inline bool AllowHasBeenSet() const { return m_allowHasBeenSet; } /** *

Instructs WAF to allow the web request.

*/ inline void SetAllow(const AllowAction& value) { m_allowHasBeenSet = true; m_allow = value; } /** *

Instructs WAF to allow the web request.

*/ inline void SetAllow(AllowAction&& value) { m_allowHasBeenSet = true; m_allow = std::move(value); } /** *

Instructs WAF to allow the web request.

*/ inline RuleAction& WithAllow(const AllowAction& value) { SetAllow(value); return *this;} /** *

Instructs WAF to allow the web request.

*/ inline RuleAction& WithAllow(AllowAction&& value) { SetAllow(std::move(value)); return *this;} /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline const CountAction& GetCount() const{ return m_count; } /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline bool CountHasBeenSet() const { return m_countHasBeenSet; } /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline void SetCount(const CountAction& value) { m_countHasBeenSet = true; m_count = value; } /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline void SetCount(CountAction&& value) { m_countHasBeenSet = true; m_count = std::move(value); } /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline RuleAction& WithCount(const CountAction& value) { SetCount(value); return *this;} /** *

Instructs WAF to count the web request and then continue evaluating the * request using the remaining rules in the web ACL.

*/ inline RuleAction& WithCount(CountAction&& value) { SetCount(std::move(value)); return *this;} /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline const CaptchaAction& GetCaptcha() const{ return m_captcha; } /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline bool CaptchaHasBeenSet() const { return m_captchaHasBeenSet; } /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline void SetCaptcha(const CaptchaAction& value) { m_captchaHasBeenSet = true; m_captcha = value; } /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline void SetCaptcha(CaptchaAction&& value) { m_captchaHasBeenSet = true; m_captcha = std::move(value); } /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline RuleAction& WithCaptcha(const CaptchaAction& value) { SetCaptcha(value); return *this;} /** *

Instructs WAF to run a CAPTCHA check against the web * request.

*/ inline RuleAction& WithCaptcha(CaptchaAction&& value) { SetCaptcha(std::move(value)); return *this;} /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline const ChallengeAction& GetChallenge() const{ return m_challenge; } /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline bool ChallengeHasBeenSet() const { return m_challengeHasBeenSet; } /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline void SetChallenge(const ChallengeAction& value) { m_challengeHasBeenSet = true; m_challenge = value; } /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline void SetChallenge(ChallengeAction&& value) { m_challengeHasBeenSet = true; m_challenge = std::move(value); } /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline RuleAction& WithChallenge(const ChallengeAction& value) { SetChallenge(value); return *this;} /** *

Instructs WAF to run a Challenge check against the web * request.

*/ inline RuleAction& WithChallenge(ChallengeAction&& value) { SetChallenge(std::move(value)); return *this;} private: BlockAction m_block; bool m_blockHasBeenSet = false; AllowAction m_allow; bool m_allowHasBeenSet = false; CountAction m_count; bool m_countHasBeenSet = false; CaptchaAction m_captcha; bool m_captchaHasBeenSet = false; ChallengeAction m_challenge; bool m_challengeHasBeenSet = false; }; } // namespace Model } // namespace WAFV2 } // namespace Aws