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

Describes the action for a rule. Each rule must include exactly one of the * following types of actions: forward or fixed-response, * and it must be the last action to be performed.

See Also:

AWS * API Reference

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

Describes the rule action that returns a custom HTTP response.

*/ inline const FixedResponseAction& GetFixedResponse() const{ return m_fixedResponse; } /** *

Describes the rule action that returns a custom HTTP response.

*/ inline bool FixedResponseHasBeenSet() const { return m_fixedResponseHasBeenSet; } /** *

Describes the rule action that returns a custom HTTP response.

*/ inline void SetFixedResponse(const FixedResponseAction& value) { m_fixedResponseHasBeenSet = true; m_fixedResponse = value; } /** *

Describes the rule action that returns a custom HTTP response.

*/ inline void SetFixedResponse(FixedResponseAction&& value) { m_fixedResponseHasBeenSet = true; m_fixedResponse = std::move(value); } /** *

Describes the rule action that returns a custom HTTP response.

*/ inline RuleAction& WithFixedResponse(const FixedResponseAction& value) { SetFixedResponse(value); return *this;} /** *

Describes the rule action that returns a custom HTTP response.

*/ inline RuleAction& WithFixedResponse(FixedResponseAction&& value) { SetFixedResponse(std::move(value)); return *this;} /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline const ForwardAction& GetForward() const{ return m_forward; } /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline bool ForwardHasBeenSet() const { return m_forwardHasBeenSet; } /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline void SetForward(const ForwardAction& value) { m_forwardHasBeenSet = true; m_forward = value; } /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline void SetForward(ForwardAction&& value) { m_forwardHasBeenSet = true; m_forward = std::move(value); } /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline RuleAction& WithForward(const ForwardAction& value) { SetForward(value); return *this;} /** *

The forward action. Traffic that matches the rule is forwarded to the * specified target groups.

*/ inline RuleAction& WithForward(ForwardAction&& value) { SetForward(std::move(value)); return *this;} private: FixedResponseAction m_fixedResponse; bool m_fixedResponseHasBeenSet = false; ForwardAction m_forward; bool m_forwardHasBeenSet = false; }; } // namespace Model } // namespace VPCLattice } // namespace Aws