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/ecs/ECS_EXPORTS.h>
8 #include <aws/ecs/ECSRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/core/utils/memory/stl/AWSVector.h>
11 #include <aws/ecs/model/CapacityProviderStrategyItem.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace ECS
17 {
18 namespace Model
19 {
20 
21   /**
22    */
23   class AWS_ECS_API PutClusterCapacityProvidersRequest : public ECSRequest
24   {
25   public:
26     PutClusterCapacityProvidersRequest();
27 
28     // Service request name is the Operation name which will send this request out,
29     // each operation should has unique request name, so that we can get operation's name from this request.
30     // Note: this is not true for response, multiple operations may have the same response name,
31     // so we can not get operation's name from response.
GetServiceRequestName()32     inline virtual const char* GetServiceRequestName() const override { return "PutClusterCapacityProviders"; }
33 
34     Aws::String SerializePayload() const override;
35 
36     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
37 
38 
39     /**
40      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
41      * the capacity provider settings for. If you do not specify a cluster, the default
42      * cluster is assumed.</p>
43      */
GetCluster()44     inline const Aws::String& GetCluster() const{ return m_cluster; }
45 
46     /**
47      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
48      * the capacity provider settings for. If you do not specify a cluster, the default
49      * cluster is assumed.</p>
50      */
ClusterHasBeenSet()51     inline bool ClusterHasBeenSet() const { return m_clusterHasBeenSet; }
52 
53     /**
54      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
55      * the capacity provider settings for. If you do not specify a cluster, the default
56      * cluster is assumed.</p>
57      */
SetCluster(const Aws::String & value)58     inline void SetCluster(const Aws::String& value) { m_clusterHasBeenSet = true; m_cluster = value; }
59 
60     /**
61      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
62      * the capacity provider settings for. If you do not specify a cluster, the default
63      * cluster is assumed.</p>
64      */
SetCluster(Aws::String && value)65     inline void SetCluster(Aws::String&& value) { m_clusterHasBeenSet = true; m_cluster = std::move(value); }
66 
67     /**
68      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
69      * the capacity provider settings for. If you do not specify a cluster, the default
70      * cluster is assumed.</p>
71      */
SetCluster(const char * value)72     inline void SetCluster(const char* value) { m_clusterHasBeenSet = true; m_cluster.assign(value); }
73 
74     /**
75      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
76      * the capacity provider settings for. If you do not specify a cluster, the default
77      * cluster is assumed.</p>
78      */
WithCluster(const Aws::String & value)79     inline PutClusterCapacityProvidersRequest& WithCluster(const Aws::String& value) { SetCluster(value); return *this;}
80 
81     /**
82      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
83      * the capacity provider settings for. If you do not specify a cluster, the default
84      * cluster is assumed.</p>
85      */
WithCluster(Aws::String && value)86     inline PutClusterCapacityProvidersRequest& WithCluster(Aws::String&& value) { SetCluster(std::move(value)); return *this;}
87 
88     /**
89      * <p>The short name or full Amazon Resource Name (ARN) of the cluster to modify
90      * the capacity provider settings for. If you do not specify a cluster, the default
91      * cluster is assumed.</p>
92      */
WithCluster(const char * value)93     inline PutClusterCapacityProvidersRequest& WithCluster(const char* value) { SetCluster(value); return *this;}
94 
95 
96     /**
97      * <p>The name of one or more capacity providers to associate with the cluster.</p>
98      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
99      * capacity provider must already be created. New capacity providers can be created
100      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
101      * capacity provider, specify either the <code>FARGATE</code> or
102      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
103      * available to all accounts and only need to be associated with a cluster to be
104      * used.</p>
105      */
GetCapacityProviders()106     inline const Aws::Vector<Aws::String>& GetCapacityProviders() const{ return m_capacityProviders; }
107 
108     /**
109      * <p>The name of one or more capacity providers to associate with the cluster.</p>
110      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
111      * capacity provider must already be created. New capacity providers can be created
112      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
113      * capacity provider, specify either the <code>FARGATE</code> or
114      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
115      * available to all accounts and only need to be associated with a cluster to be
116      * used.</p>
117      */
CapacityProvidersHasBeenSet()118     inline bool CapacityProvidersHasBeenSet() const { return m_capacityProvidersHasBeenSet; }
119 
120     /**
121      * <p>The name of one or more capacity providers to associate with the cluster.</p>
122      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
123      * capacity provider must already be created. New capacity providers can be created
124      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
125      * capacity provider, specify either the <code>FARGATE</code> or
126      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
127      * available to all accounts and only need to be associated with a cluster to be
128      * used.</p>
129      */
SetCapacityProviders(const Aws::Vector<Aws::String> & value)130     inline void SetCapacityProviders(const Aws::Vector<Aws::String>& value) { m_capacityProvidersHasBeenSet = true; m_capacityProviders = value; }
131 
132     /**
133      * <p>The name of one or more capacity providers to associate with the cluster.</p>
134      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
135      * capacity provider must already be created. New capacity providers can be created
136      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
137      * capacity provider, specify either the <code>FARGATE</code> or
138      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
139      * available to all accounts and only need to be associated with a cluster to be
140      * used.</p>
141      */
SetCapacityProviders(Aws::Vector<Aws::String> && value)142     inline void SetCapacityProviders(Aws::Vector<Aws::String>&& value) { m_capacityProvidersHasBeenSet = true; m_capacityProviders = std::move(value); }
143 
144     /**
145      * <p>The name of one or more capacity providers to associate with the cluster.</p>
146      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
147      * capacity provider must already be created. New capacity providers can be created
148      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
149      * capacity provider, specify either the <code>FARGATE</code> or
150      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
151      * available to all accounts and only need to be associated with a cluster to be
152      * used.</p>
153      */
WithCapacityProviders(const Aws::Vector<Aws::String> & value)154     inline PutClusterCapacityProvidersRequest& WithCapacityProviders(const Aws::Vector<Aws::String>& value) { SetCapacityProviders(value); return *this;}
155 
156     /**
157      * <p>The name of one or more capacity providers to associate with the cluster.</p>
158      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
159      * capacity provider must already be created. New capacity providers can be created
160      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
161      * capacity provider, specify either the <code>FARGATE</code> or
162      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
163      * available to all accounts and only need to be associated with a cluster to be
164      * used.</p>
165      */
WithCapacityProviders(Aws::Vector<Aws::String> && value)166     inline PutClusterCapacityProvidersRequest& WithCapacityProviders(Aws::Vector<Aws::String>&& value) { SetCapacityProviders(std::move(value)); return *this;}
167 
168     /**
169      * <p>The name of one or more capacity providers to associate with the cluster.</p>
170      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
171      * capacity provider must already be created. New capacity providers can be created
172      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
173      * capacity provider, specify either the <code>FARGATE</code> or
174      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
175      * available to all accounts and only need to be associated with a cluster to be
176      * used.</p>
177      */
AddCapacityProviders(const Aws::String & value)178     inline PutClusterCapacityProvidersRequest& AddCapacityProviders(const Aws::String& value) { m_capacityProvidersHasBeenSet = true; m_capacityProviders.push_back(value); return *this; }
179 
180     /**
181      * <p>The name of one or more capacity providers to associate with the cluster.</p>
182      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
183      * capacity provider must already be created. New capacity providers can be created
184      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
185      * capacity provider, specify either the <code>FARGATE</code> or
186      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
187      * available to all accounts and only need to be associated with a cluster to be
188      * used.</p>
189      */
AddCapacityProviders(Aws::String && value)190     inline PutClusterCapacityProvidersRequest& AddCapacityProviders(Aws::String&& value) { m_capacityProvidersHasBeenSet = true; m_capacityProviders.push_back(std::move(value)); return *this; }
191 
192     /**
193      * <p>The name of one or more capacity providers to associate with the cluster.</p>
194      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
195      * capacity provider must already be created. New capacity providers can be created
196      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
197      * capacity provider, specify either the <code>FARGATE</code> or
198      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
199      * available to all accounts and only need to be associated with a cluster to be
200      * used.</p>
201      */
AddCapacityProviders(const char * value)202     inline PutClusterCapacityProvidersRequest& AddCapacityProviders(const char* value) { m_capacityProvidersHasBeenSet = true; m_capacityProviders.push_back(value); return *this; }
203 
204 
205     /**
206      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
207      * creating a service or running a task on a cluster, if no capacity provider or
208      * launch type is specified then the default capacity provider strategy for the
209      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
210      * capacity providers along with the <code>base</code> and <code>weight</code> to
211      * assign to them. A capacity provider must be associated with the cluster to be
212      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
213      * is used to associate a capacity provider with a cluster. Only capacity providers
214      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
215      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
216      * capacity provider must already be created. New capacity providers can be created
217      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
218      * capacity provider, specify either the <code>FARGATE</code> or
219      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
220      * available to all accounts and only need to be associated with a cluster to be
221      * used.</p>
222      */
GetDefaultCapacityProviderStrategy()223     inline const Aws::Vector<CapacityProviderStrategyItem>& GetDefaultCapacityProviderStrategy() const{ return m_defaultCapacityProviderStrategy; }
224 
225     /**
226      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
227      * creating a service or running a task on a cluster, if no capacity provider or
228      * launch type is specified then the default capacity provider strategy for the
229      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
230      * capacity providers along with the <code>base</code> and <code>weight</code> to
231      * assign to them. A capacity provider must be associated with the cluster to be
232      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
233      * is used to associate a capacity provider with a cluster. Only capacity providers
234      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
235      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
236      * capacity provider must already be created. New capacity providers can be created
237      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
238      * capacity provider, specify either the <code>FARGATE</code> or
239      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
240      * available to all accounts and only need to be associated with a cluster to be
241      * used.</p>
242      */
DefaultCapacityProviderStrategyHasBeenSet()243     inline bool DefaultCapacityProviderStrategyHasBeenSet() const { return m_defaultCapacityProviderStrategyHasBeenSet; }
244 
245     /**
246      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
247      * creating a service or running a task on a cluster, if no capacity provider or
248      * launch type is specified then the default capacity provider strategy for the
249      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
250      * capacity providers along with the <code>base</code> and <code>weight</code> to
251      * assign to them. A capacity provider must be associated with the cluster to be
252      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
253      * is used to associate a capacity provider with a cluster. Only capacity providers
254      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
255      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
256      * capacity provider must already be created. New capacity providers can be created
257      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
258      * capacity provider, specify either the <code>FARGATE</code> or
259      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
260      * available to all accounts and only need to be associated with a cluster to be
261      * used.</p>
262      */
SetDefaultCapacityProviderStrategy(const Aws::Vector<CapacityProviderStrategyItem> & value)263     inline void SetDefaultCapacityProviderStrategy(const Aws::Vector<CapacityProviderStrategyItem>& value) { m_defaultCapacityProviderStrategyHasBeenSet = true; m_defaultCapacityProviderStrategy = value; }
264 
265     /**
266      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
267      * creating a service or running a task on a cluster, if no capacity provider or
268      * launch type is specified then the default capacity provider strategy for the
269      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
270      * capacity providers along with the <code>base</code> and <code>weight</code> to
271      * assign to them. A capacity provider must be associated with the cluster to be
272      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
273      * is used to associate a capacity provider with a cluster. Only capacity providers
274      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
275      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
276      * capacity provider must already be created. New capacity providers can be created
277      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
278      * capacity provider, specify either the <code>FARGATE</code> or
279      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
280      * available to all accounts and only need to be associated with a cluster to be
281      * used.</p>
282      */
SetDefaultCapacityProviderStrategy(Aws::Vector<CapacityProviderStrategyItem> && value)283     inline void SetDefaultCapacityProviderStrategy(Aws::Vector<CapacityProviderStrategyItem>&& value) { m_defaultCapacityProviderStrategyHasBeenSet = true; m_defaultCapacityProviderStrategy = std::move(value); }
284 
285     /**
286      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
287      * creating a service or running a task on a cluster, if no capacity provider or
288      * launch type is specified then the default capacity provider strategy for the
289      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
290      * capacity providers along with the <code>base</code> and <code>weight</code> to
291      * assign to them. A capacity provider must be associated with the cluster to be
292      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
293      * is used to associate a capacity provider with a cluster. Only capacity providers
294      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
295      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
296      * capacity provider must already be created. New capacity providers can be created
297      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
298      * capacity provider, specify either the <code>FARGATE</code> or
299      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
300      * available to all accounts and only need to be associated with a cluster to be
301      * used.</p>
302      */
WithDefaultCapacityProviderStrategy(const Aws::Vector<CapacityProviderStrategyItem> & value)303     inline PutClusterCapacityProvidersRequest& WithDefaultCapacityProviderStrategy(const Aws::Vector<CapacityProviderStrategyItem>& value) { SetDefaultCapacityProviderStrategy(value); return *this;}
304 
305     /**
306      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
307      * creating a service or running a task on a cluster, if no capacity provider or
308      * launch type is specified then the default capacity provider strategy for the
309      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
310      * capacity providers along with the <code>base</code> and <code>weight</code> to
311      * assign to them. A capacity provider must be associated with the cluster to be
312      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
313      * is used to associate a capacity provider with a cluster. Only capacity providers
314      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
315      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
316      * capacity provider must already be created. New capacity providers can be created
317      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
318      * capacity provider, specify either the <code>FARGATE</code> or
319      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
320      * available to all accounts and only need to be associated with a cluster to be
321      * used.</p>
322      */
WithDefaultCapacityProviderStrategy(Aws::Vector<CapacityProviderStrategyItem> && value)323     inline PutClusterCapacityProvidersRequest& WithDefaultCapacityProviderStrategy(Aws::Vector<CapacityProviderStrategyItem>&& value) { SetDefaultCapacityProviderStrategy(std::move(value)); return *this;}
324 
325     /**
326      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
327      * creating a service or running a task on a cluster, if no capacity provider or
328      * launch type is specified then the default capacity provider strategy for the
329      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
330      * capacity providers along with the <code>base</code> and <code>weight</code> to
331      * assign to them. A capacity provider must be associated with the cluster to be
332      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
333      * is used to associate a capacity provider with a cluster. Only capacity providers
334      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
335      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
336      * capacity provider must already be created. New capacity providers can be created
337      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
338      * capacity provider, specify either the <code>FARGATE</code> or
339      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
340      * available to all accounts and only need to be associated with a cluster to be
341      * used.</p>
342      */
AddDefaultCapacityProviderStrategy(const CapacityProviderStrategyItem & value)343     inline PutClusterCapacityProvidersRequest& AddDefaultCapacityProviderStrategy(const CapacityProviderStrategyItem& value) { m_defaultCapacityProviderStrategyHasBeenSet = true; m_defaultCapacityProviderStrategy.push_back(value); return *this; }
344 
345     /**
346      * <p>The capacity provider strategy to use by default for the cluster.</p> <p>When
347      * creating a service or running a task on a cluster, if no capacity provider or
348      * launch type is specified then the default capacity provider strategy for the
349      * cluster is used.</p> <p>A capacity provider strategy consists of one or more
350      * capacity providers along with the <code>base</code> and <code>weight</code> to
351      * assign to them. A capacity provider must be associated with the cluster to be
352      * used in a capacity provider strategy. The <a>PutClusterCapacityProviders</a> API
353      * is used to associate a capacity provider with a cluster. Only capacity providers
354      * with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
355      * <p>If specifying a capacity provider that uses an Auto Scaling group, the
356      * capacity provider must already be created. New capacity providers can be created
357      * with the <a>CreateCapacityProvider</a> API operation.</p> <p>To use a Fargate
358      * capacity provider, specify either the <code>FARGATE</code> or
359      * <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are
360      * available to all accounts and only need to be associated with a cluster to be
361      * used.</p>
362      */
AddDefaultCapacityProviderStrategy(CapacityProviderStrategyItem && value)363     inline PutClusterCapacityProvidersRequest& AddDefaultCapacityProviderStrategy(CapacityProviderStrategyItem&& value) { m_defaultCapacityProviderStrategyHasBeenSet = true; m_defaultCapacityProviderStrategy.push_back(std::move(value)); return *this; }
364 
365   private:
366 
367     Aws::String m_cluster;
368     bool m_clusterHasBeenSet;
369 
370     Aws::Vector<Aws::String> m_capacityProviders;
371     bool m_capacityProvidersHasBeenSet;
372 
373     Aws::Vector<CapacityProviderStrategyItem> m_defaultCapacityProviderStrategy;
374     bool m_defaultCapacityProviderStrategyHasBeenSet;
375   };
376 
377 } // namespace Model
378 } // namespace ECS
379 } // namespace Aws
380