1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/eventbridge/EventBridge_EXPORTS.h> 8 #include <aws/eventbridge/model/PlacementConstraintType.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 namespace Utils 15 { 16 namespace Json 17 { 18 class JsonValue; 19 class JsonView; 20 } // namespace Json 21 } // namespace Utils 22 namespace EventBridge 23 { 24 namespace Model 25 { 26 27 /** 28 * <p>An object representing a constraint on task placement. To learn more, see <a 29 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html">Task 30 * Placement Constraints</a> in the Amazon Elastic Container Service Developer 31 * Guide.</p><p><h3>See Also:</h3> <a 32 * href="http://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PlacementConstraint">AWS 33 * API Reference</a></p> 34 */ 35 class AWS_EVENTBRIDGE_API PlacementConstraint 36 { 37 public: 38 PlacementConstraint(); 39 PlacementConstraint(Aws::Utils::Json::JsonView jsonValue); 40 PlacementConstraint& operator=(Aws::Utils::Json::JsonView jsonValue); 41 Aws::Utils::Json::JsonValue Jsonize() const; 42 43 44 /** 45 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 46 * particular group is running on a different container instance. Use memberOf to 47 * restrict the selection to a group of valid candidates. </p> 48 */ GetType()49 inline const PlacementConstraintType& GetType() const{ return m_type; } 50 51 /** 52 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 53 * particular group is running on a different container instance. Use memberOf to 54 * restrict the selection to a group of valid candidates. </p> 55 */ TypeHasBeenSet()56 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } 57 58 /** 59 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 60 * particular group is running on a different container instance. Use memberOf to 61 * restrict the selection to a group of valid candidates. </p> 62 */ SetType(const PlacementConstraintType & value)63 inline void SetType(const PlacementConstraintType& value) { m_typeHasBeenSet = true; m_type = value; } 64 65 /** 66 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 67 * particular group is running on a different container instance. Use memberOf to 68 * restrict the selection to a group of valid candidates. </p> 69 */ SetType(PlacementConstraintType && value)70 inline void SetType(PlacementConstraintType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } 71 72 /** 73 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 74 * particular group is running on a different container instance. Use memberOf to 75 * restrict the selection to a group of valid candidates. </p> 76 */ WithType(const PlacementConstraintType & value)77 inline PlacementConstraint& WithType(const PlacementConstraintType& value) { SetType(value); return *this;} 78 79 /** 80 * <p>The type of constraint. Use distinctInstance to ensure that each task in a 81 * particular group is running on a different container instance. Use memberOf to 82 * restrict the selection to a group of valid candidates. </p> 83 */ WithType(PlacementConstraintType && value)84 inline PlacementConstraint& WithType(PlacementConstraintType&& value) { SetType(std::move(value)); return *this;} 85 86 87 /** 88 * <p>A cluster query language expression to apply to the constraint. You cannot 89 * specify an expression if the constraint type is <code>distinctInstance</code>. 90 * To learn more, see <a 91 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 92 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 93 */ GetExpression()94 inline const Aws::String& GetExpression() const{ return m_expression; } 95 96 /** 97 * <p>A cluster query language expression to apply to the constraint. You cannot 98 * specify an expression if the constraint type is <code>distinctInstance</code>. 99 * To learn more, see <a 100 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 101 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 102 */ ExpressionHasBeenSet()103 inline bool ExpressionHasBeenSet() const { return m_expressionHasBeenSet; } 104 105 /** 106 * <p>A cluster query language expression to apply to the constraint. You cannot 107 * specify an expression if the constraint type is <code>distinctInstance</code>. 108 * To learn more, see <a 109 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 110 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 111 */ SetExpression(const Aws::String & value)112 inline void SetExpression(const Aws::String& value) { m_expressionHasBeenSet = true; m_expression = value; } 113 114 /** 115 * <p>A cluster query language expression to apply to the constraint. You cannot 116 * specify an expression if the constraint type is <code>distinctInstance</code>. 117 * To learn more, see <a 118 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 119 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 120 */ SetExpression(Aws::String && value)121 inline void SetExpression(Aws::String&& value) { m_expressionHasBeenSet = true; m_expression = std::move(value); } 122 123 /** 124 * <p>A cluster query language expression to apply to the constraint. You cannot 125 * specify an expression if the constraint type is <code>distinctInstance</code>. 126 * To learn more, see <a 127 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 128 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 129 */ SetExpression(const char * value)130 inline void SetExpression(const char* value) { m_expressionHasBeenSet = true; m_expression.assign(value); } 131 132 /** 133 * <p>A cluster query language expression to apply to the constraint. You cannot 134 * specify an expression if the constraint type is <code>distinctInstance</code>. 135 * To learn more, see <a 136 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 137 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 138 */ WithExpression(const Aws::String & value)139 inline PlacementConstraint& WithExpression(const Aws::String& value) { SetExpression(value); return *this;} 140 141 /** 142 * <p>A cluster query language expression to apply to the constraint. You cannot 143 * specify an expression if the constraint type is <code>distinctInstance</code>. 144 * To learn more, see <a 145 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 146 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 147 */ WithExpression(Aws::String && value)148 inline PlacementConstraint& WithExpression(Aws::String&& value) { SetExpression(std::move(value)); return *this;} 149 150 /** 151 * <p>A cluster query language expression to apply to the constraint. You cannot 152 * specify an expression if the constraint type is <code>distinctInstance</code>. 153 * To learn more, see <a 154 * href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html">Cluster 155 * Query Language</a> in the Amazon Elastic Container Service Developer Guide. </p> 156 */ WithExpression(const char * value)157 inline PlacementConstraint& WithExpression(const char* value) { SetExpression(value); return *this;} 158 159 private: 160 161 PlacementConstraintType m_type; 162 bool m_typeHasBeenSet; 163 164 Aws::String m_expression; 165 bool m_expressionHasBeenSet; 166 }; 167 168 } // namespace Model 169 } // namespace EventBridge 170 } // namespace Aws 171