/** * 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 a forward action. You can use forward actions to route requests to * one or more target groups.

See Also:

AWS * API Reference

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

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline const Aws::Vector& GetTargetGroups() const{ return m_targetGroups; } /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline bool TargetGroupsHasBeenSet() const { return m_targetGroupsHasBeenSet; } /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline void SetTargetGroups(const Aws::Vector& value) { m_targetGroupsHasBeenSet = true; m_targetGroups = value; } /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline void SetTargetGroups(Aws::Vector&& value) { m_targetGroupsHasBeenSet = true; m_targetGroups = std::move(value); } /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline ForwardAction& WithTargetGroups(const Aws::Vector& value) { SetTargetGroups(value); return *this;} /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline ForwardAction& WithTargetGroups(Aws::Vector&& value) { SetTargetGroups(std::move(value)); return *this;} /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline ForwardAction& AddTargetGroups(const WeightedTargetGroup& value) { m_targetGroupsHasBeenSet = true; m_targetGroups.push_back(value); return *this; } /** *

The target groups. Traffic matching the rule is forwarded to the specified * target groups. With forward actions, you can assign a weight that controls the * prioritization and selection of each target group. This means that requests are * distributed to individual target groups based on their weights. For example, if * two target groups have the same weight, each target group receives half of the * traffic.

The default value is 1. This means that if only one target group * is provided, there is no need to set the weight; 100% of traffic will go to that * target group.

*/ inline ForwardAction& AddTargetGroups(WeightedTargetGroup&& value) { m_targetGroupsHasBeenSet = true; m_targetGroups.push_back(std::move(value)); return *this; } private: Aws::Vector m_targetGroups; bool m_targetGroupsHasBeenSet = false; }; } // namespace Model } // namespace VPCLattice } // namespace Aws