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

The constraint on task placement in the task definition. For more * information, see Task * placement constraints in the Amazon Elastic Container Service Developer * Guide.

Task placement constraints aren't supported for tasks * run on Fargate.

See Also:

AWS * API Reference

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

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline const TaskDefinitionPlacementConstraintType& GetType() const{ return m_type; } /** *

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline void SetType(const TaskDefinitionPlacementConstraintType& value) { m_typeHasBeenSet = true; m_type = value; } /** *

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline void SetType(TaskDefinitionPlacementConstraintType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline TaskDefinitionPlacementConstraint& WithType(const TaskDefinitionPlacementConstraintType& value) { SetType(value); return *this;} /** *

The type of constraint. The MemberOf constraint restricts * selection to be from a group of valid candidates.

*/ inline TaskDefinitionPlacementConstraint& WithType(TaskDefinitionPlacementConstraintType&& value) { SetType(std::move(value)); return *this;} /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline const Aws::String& GetExpression() const{ return m_expression; } /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline bool ExpressionHasBeenSet() const { return m_expressionHasBeenSet; } /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline void SetExpression(const Aws::String& value) { m_expressionHasBeenSet = true; m_expression = value; } /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline void SetExpression(Aws::String&& value) { m_expressionHasBeenSet = true; m_expression = std::move(value); } /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline void SetExpression(const char* value) { m_expressionHasBeenSet = true; m_expression.assign(value); } /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline TaskDefinitionPlacementConstraint& WithExpression(const Aws::String& value) { SetExpression(value); return *this;} /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline TaskDefinitionPlacementConstraint& WithExpression(Aws::String&& value) { SetExpression(std::move(value)); return *this;} /** *

A cluster query language expression to apply to the constraint. For more * information, see Cluster * query language in the Amazon Elastic Container Service Developer * Guide.

*/ inline TaskDefinitionPlacementConstraint& WithExpression(const char* value) { SetExpression(value); return *this;} private: TaskDefinitionPlacementConstraintType m_type; bool m_typeHasBeenSet = false; Aws::String m_expression; bool m_expressionHasBeenSet = false; }; } // namespace Model } // namespace ECS } // namespace Aws