/** * 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 AppMesh { namespace Model { /** *

An object that represents a target and its relative weight. Traffic is * distributed across targets according to their relative weight. For * example, a weighted target with a relative weight of 50 receives five * times as much traffic as one with a relative weight of 10. The total * weight for all targets combined must be less than or equal to 100.

See * Also:

AWS * API Reference

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

The virtual node to associate with the weighted target.

*/ inline const Aws::String& GetVirtualNode() const{ return m_virtualNode; } /** *

The virtual node to associate with the weighted target.

*/ inline bool VirtualNodeHasBeenSet() const { return m_virtualNodeHasBeenSet; } /** *

The virtual node to associate with the weighted target.

*/ inline void SetVirtualNode(const Aws::String& value) { m_virtualNodeHasBeenSet = true; m_virtualNode = value; } /** *

The virtual node to associate with the weighted target.

*/ inline void SetVirtualNode(Aws::String&& value) { m_virtualNodeHasBeenSet = true; m_virtualNode = std::move(value); } /** *

The virtual node to associate with the weighted target.

*/ inline void SetVirtualNode(const char* value) { m_virtualNodeHasBeenSet = true; m_virtualNode.assign(value); } /** *

The virtual node to associate with the weighted target.

*/ inline WeightedTarget& WithVirtualNode(const Aws::String& value) { SetVirtualNode(value); return *this;} /** *

The virtual node to associate with the weighted target.

*/ inline WeightedTarget& WithVirtualNode(Aws::String&& value) { SetVirtualNode(std::move(value)); return *this;} /** *

The virtual node to associate with the weighted target.

*/ inline WeightedTarget& WithVirtualNode(const char* value) { SetVirtualNode(value); return *this;} /** *

The relative weight of the weighted target.

*/ inline int GetWeight() const{ return m_weight; } /** *

The relative weight of the weighted target.

*/ inline bool WeightHasBeenSet() const { return m_weightHasBeenSet; } /** *

The relative weight of the weighted target.

*/ inline void SetWeight(int value) { m_weightHasBeenSet = true; m_weight = value; } /** *

The relative weight of the weighted target.

*/ inline WeightedTarget& WithWeight(int value) { SetWeight(value); return *this;} private: Aws::String m_virtualNode; bool m_virtualNodeHasBeenSet; int m_weight; bool m_weightHasBeenSet; }; } // namespace Model } // namespace AppMesh } // namespace Aws