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/core/utils/memory/stl/AWSString.h>
9 #include <aws/core/utils/memory/stl/AWSVector.h>
10 #include <aws/ecs/model/KeyValuePair.h>
11 #include <aws/ecs/model/EnvironmentFile.h>
12 #include <aws/ecs/model/ResourceRequirement.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace Utils
18 {
19 namespace Json
20 {
21   class JsonValue;
22   class JsonView;
23 } // namespace Json
24 } // namespace Utils
25 namespace ECS
26 {
27 namespace Model
28 {
29 
30   /**
31    * <p>The overrides that should be sent to a container. An empty container override
32    * can be passed in. An example of an empty container override would be
33    * <code>{"containerOverrides": [ ] }</code>. If a non-empty container override is
34    * specified, the <code>name</code> parameter must be included.</p><p><h3>See
35    * Also:</h3>   <a
36    * href="http://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ContainerOverride">AWS
37    * API Reference</a></p>
38    */
39   class AWS_ECS_API ContainerOverride
40   {
41   public:
42     ContainerOverride();
43     ContainerOverride(Aws::Utils::Json::JsonView jsonValue);
44     ContainerOverride& operator=(Aws::Utils::Json::JsonView jsonValue);
45     Aws::Utils::Json::JsonValue Jsonize() const;
46 
47 
48     /**
49      * <p>The name of the container that receives the override. This parameter is
50      * required if any override is specified.</p>
51      */
GetName()52     inline const Aws::String& GetName() const{ return m_name; }
53 
54     /**
55      * <p>The name of the container that receives the override. This parameter is
56      * required if any override is specified.</p>
57      */
NameHasBeenSet()58     inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
59 
60     /**
61      * <p>The name of the container that receives the override. This parameter is
62      * required if any override is specified.</p>
63      */
SetName(const Aws::String & value)64     inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
65 
66     /**
67      * <p>The name of the container that receives the override. This parameter is
68      * required if any override is specified.</p>
69      */
SetName(Aws::String && value)70     inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
71 
72     /**
73      * <p>The name of the container that receives the override. This parameter is
74      * required if any override is specified.</p>
75      */
SetName(const char * value)76     inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
77 
78     /**
79      * <p>The name of the container that receives the override. This parameter is
80      * required if any override is specified.</p>
81      */
WithName(const Aws::String & value)82     inline ContainerOverride& WithName(const Aws::String& value) { SetName(value); return *this;}
83 
84     /**
85      * <p>The name of the container that receives the override. This parameter is
86      * required if any override is specified.</p>
87      */
WithName(Aws::String && value)88     inline ContainerOverride& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
89 
90     /**
91      * <p>The name of the container that receives the override. This parameter is
92      * required if any override is specified.</p>
93      */
WithName(const char * value)94     inline ContainerOverride& WithName(const char* value) { SetName(value); return *this;}
95 
96 
97     /**
98      * <p>The command to send to the container that overrides the default command from
99      * the Docker image or the task definition. You must also specify a container
100      * name.</p>
101      */
GetCommand()102     inline const Aws::Vector<Aws::String>& GetCommand() const{ return m_command; }
103 
104     /**
105      * <p>The command to send to the container that overrides the default command from
106      * the Docker image or the task definition. You must also specify a container
107      * name.</p>
108      */
CommandHasBeenSet()109     inline bool CommandHasBeenSet() const { return m_commandHasBeenSet; }
110 
111     /**
112      * <p>The command to send to the container that overrides the default command from
113      * the Docker image or the task definition. You must also specify a container
114      * name.</p>
115      */
SetCommand(const Aws::Vector<Aws::String> & value)116     inline void SetCommand(const Aws::Vector<Aws::String>& value) { m_commandHasBeenSet = true; m_command = value; }
117 
118     /**
119      * <p>The command to send to the container that overrides the default command from
120      * the Docker image or the task definition. You must also specify a container
121      * name.</p>
122      */
SetCommand(Aws::Vector<Aws::String> && value)123     inline void SetCommand(Aws::Vector<Aws::String>&& value) { m_commandHasBeenSet = true; m_command = std::move(value); }
124 
125     /**
126      * <p>The command to send to the container that overrides the default command from
127      * the Docker image or the task definition. You must also specify a container
128      * name.</p>
129      */
WithCommand(const Aws::Vector<Aws::String> & value)130     inline ContainerOverride& WithCommand(const Aws::Vector<Aws::String>& value) { SetCommand(value); return *this;}
131 
132     /**
133      * <p>The command to send to the container that overrides the default command from
134      * the Docker image or the task definition. You must also specify a container
135      * name.</p>
136      */
WithCommand(Aws::Vector<Aws::String> && value)137     inline ContainerOverride& WithCommand(Aws::Vector<Aws::String>&& value) { SetCommand(std::move(value)); return *this;}
138 
139     /**
140      * <p>The command to send to the container that overrides the default command from
141      * the Docker image or the task definition. You must also specify a container
142      * name.</p>
143      */
AddCommand(const Aws::String & value)144     inline ContainerOverride& AddCommand(const Aws::String& value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; }
145 
146     /**
147      * <p>The command to send to the container that overrides the default command from
148      * the Docker image or the task definition. You must also specify a container
149      * name.</p>
150      */
AddCommand(Aws::String && value)151     inline ContainerOverride& AddCommand(Aws::String&& value) { m_commandHasBeenSet = true; m_command.push_back(std::move(value)); return *this; }
152 
153     /**
154      * <p>The command to send to the container that overrides the default command from
155      * the Docker image or the task definition. You must also specify a container
156      * name.</p>
157      */
AddCommand(const char * value)158     inline ContainerOverride& AddCommand(const char* value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; }
159 
160 
161     /**
162      * <p>The environment variables to send to the container. You can add new
163      * environment variables, which are added to the container at launch, or you can
164      * override the existing environment variables from the Docker image or the task
165      * definition. You must also specify a container name.</p>
166      */
GetEnvironment()167     inline const Aws::Vector<KeyValuePair>& GetEnvironment() const{ return m_environment; }
168 
169     /**
170      * <p>The environment variables to send to the container. You can add new
171      * environment variables, which are added to the container at launch, or you can
172      * override the existing environment variables from the Docker image or the task
173      * definition. You must also specify a container name.</p>
174      */
EnvironmentHasBeenSet()175     inline bool EnvironmentHasBeenSet() const { return m_environmentHasBeenSet; }
176 
177     /**
178      * <p>The environment variables to send to the container. You can add new
179      * environment variables, which are added to the container at launch, or you can
180      * override the existing environment variables from the Docker image or the task
181      * definition. You must also specify a container name.</p>
182      */
SetEnvironment(const Aws::Vector<KeyValuePair> & value)183     inline void SetEnvironment(const Aws::Vector<KeyValuePair>& value) { m_environmentHasBeenSet = true; m_environment = value; }
184 
185     /**
186      * <p>The environment variables to send to the container. You can add new
187      * environment variables, which are added to the container at launch, or you can
188      * override the existing environment variables from the Docker image or the task
189      * definition. You must also specify a container name.</p>
190      */
SetEnvironment(Aws::Vector<KeyValuePair> && value)191     inline void SetEnvironment(Aws::Vector<KeyValuePair>&& value) { m_environmentHasBeenSet = true; m_environment = std::move(value); }
192 
193     /**
194      * <p>The environment variables to send to the container. You can add new
195      * environment variables, which are added to the container at launch, or you can
196      * override the existing environment variables from the Docker image or the task
197      * definition. You must also specify a container name.</p>
198      */
WithEnvironment(const Aws::Vector<KeyValuePair> & value)199     inline ContainerOverride& WithEnvironment(const Aws::Vector<KeyValuePair>& value) { SetEnvironment(value); return *this;}
200 
201     /**
202      * <p>The environment variables to send to the container. You can add new
203      * environment variables, which are added to the container at launch, or you can
204      * override the existing environment variables from the Docker image or the task
205      * definition. You must also specify a container name.</p>
206      */
WithEnvironment(Aws::Vector<KeyValuePair> && value)207     inline ContainerOverride& WithEnvironment(Aws::Vector<KeyValuePair>&& value) { SetEnvironment(std::move(value)); return *this;}
208 
209     /**
210      * <p>The environment variables to send to the container. You can add new
211      * environment variables, which are added to the container at launch, or you can
212      * override the existing environment variables from the Docker image or the task
213      * definition. You must also specify a container name.</p>
214      */
AddEnvironment(const KeyValuePair & value)215     inline ContainerOverride& AddEnvironment(const KeyValuePair& value) { m_environmentHasBeenSet = true; m_environment.push_back(value); return *this; }
216 
217     /**
218      * <p>The environment variables to send to the container. You can add new
219      * environment variables, which are added to the container at launch, or you can
220      * override the existing environment variables from the Docker image or the task
221      * definition. You must also specify a container name.</p>
222      */
AddEnvironment(KeyValuePair && value)223     inline ContainerOverride& AddEnvironment(KeyValuePair&& value) { m_environmentHasBeenSet = true; m_environment.push_back(std::move(value)); return *this; }
224 
225 
226     /**
227      * <p>A list of files containing the environment variables to pass to a container,
228      * instead of the value from the container definition.</p>
229      */
GetEnvironmentFiles()230     inline const Aws::Vector<EnvironmentFile>& GetEnvironmentFiles() const{ return m_environmentFiles; }
231 
232     /**
233      * <p>A list of files containing the environment variables to pass to a container,
234      * instead of the value from the container definition.</p>
235      */
EnvironmentFilesHasBeenSet()236     inline bool EnvironmentFilesHasBeenSet() const { return m_environmentFilesHasBeenSet; }
237 
238     /**
239      * <p>A list of files containing the environment variables to pass to a container,
240      * instead of the value from the container definition.</p>
241      */
SetEnvironmentFiles(const Aws::Vector<EnvironmentFile> & value)242     inline void SetEnvironmentFiles(const Aws::Vector<EnvironmentFile>& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles = value; }
243 
244     /**
245      * <p>A list of files containing the environment variables to pass to a container,
246      * instead of the value from the container definition.</p>
247      */
SetEnvironmentFiles(Aws::Vector<EnvironmentFile> && value)248     inline void SetEnvironmentFiles(Aws::Vector<EnvironmentFile>&& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles = std::move(value); }
249 
250     /**
251      * <p>A list of files containing the environment variables to pass to a container,
252      * instead of the value from the container definition.</p>
253      */
WithEnvironmentFiles(const Aws::Vector<EnvironmentFile> & value)254     inline ContainerOverride& WithEnvironmentFiles(const Aws::Vector<EnvironmentFile>& value) { SetEnvironmentFiles(value); return *this;}
255 
256     /**
257      * <p>A list of files containing the environment variables to pass to a container,
258      * instead of the value from the container definition.</p>
259      */
WithEnvironmentFiles(Aws::Vector<EnvironmentFile> && value)260     inline ContainerOverride& WithEnvironmentFiles(Aws::Vector<EnvironmentFile>&& value) { SetEnvironmentFiles(std::move(value)); return *this;}
261 
262     /**
263      * <p>A list of files containing the environment variables to pass to a container,
264      * instead of the value from the container definition.</p>
265      */
AddEnvironmentFiles(const EnvironmentFile & value)266     inline ContainerOverride& AddEnvironmentFiles(const EnvironmentFile& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles.push_back(value); return *this; }
267 
268     /**
269      * <p>A list of files containing the environment variables to pass to a container,
270      * instead of the value from the container definition.</p>
271      */
AddEnvironmentFiles(EnvironmentFile && value)272     inline ContainerOverride& AddEnvironmentFiles(EnvironmentFile&& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles.push_back(std::move(value)); return *this; }
273 
274 
275     /**
276      * <p>The number of <code>cpu</code> units reserved for the container, instead of
277      * the default value from the task definition. You must also specify a container
278      * name.</p>
279      */
GetCpu()280     inline int GetCpu() const{ return m_cpu; }
281 
282     /**
283      * <p>The number of <code>cpu</code> units reserved for the container, instead of
284      * the default value from the task definition. You must also specify a container
285      * name.</p>
286      */
CpuHasBeenSet()287     inline bool CpuHasBeenSet() const { return m_cpuHasBeenSet; }
288 
289     /**
290      * <p>The number of <code>cpu</code> units reserved for the container, instead of
291      * the default value from the task definition. You must also specify a container
292      * name.</p>
293      */
SetCpu(int value)294     inline void SetCpu(int value) { m_cpuHasBeenSet = true; m_cpu = value; }
295 
296     /**
297      * <p>The number of <code>cpu</code> units reserved for the container, instead of
298      * the default value from the task definition. You must also specify a container
299      * name.</p>
300      */
WithCpu(int value)301     inline ContainerOverride& WithCpu(int value) { SetCpu(value); return *this;}
302 
303 
304     /**
305      * <p>The hard limit (in MiB) of memory to present to the container, instead of the
306      * default value from the task definition. If your container attempts to exceed the
307      * memory specified here, the container is killed. You must also specify a
308      * container name.</p>
309      */
GetMemory()310     inline int GetMemory() const{ return m_memory; }
311 
312     /**
313      * <p>The hard limit (in MiB) of memory to present to the container, instead of the
314      * default value from the task definition. If your container attempts to exceed the
315      * memory specified here, the container is killed. You must also specify a
316      * container name.</p>
317      */
MemoryHasBeenSet()318     inline bool MemoryHasBeenSet() const { return m_memoryHasBeenSet; }
319 
320     /**
321      * <p>The hard limit (in MiB) of memory to present to the container, instead of the
322      * default value from the task definition. If your container attempts to exceed the
323      * memory specified here, the container is killed. You must also specify a
324      * container name.</p>
325      */
SetMemory(int value)326     inline void SetMemory(int value) { m_memoryHasBeenSet = true; m_memory = value; }
327 
328     /**
329      * <p>The hard limit (in MiB) of memory to present to the container, instead of the
330      * default value from the task definition. If your container attempts to exceed the
331      * memory specified here, the container is killed. You must also specify a
332      * container name.</p>
333      */
WithMemory(int value)334     inline ContainerOverride& WithMemory(int value) { SetMemory(value); return *this;}
335 
336 
337     /**
338      * <p>The soft limit (in MiB) of memory to reserve for the container, instead of
339      * the default value from the task definition. You must also specify a container
340      * name.</p>
341      */
GetMemoryReservation()342     inline int GetMemoryReservation() const{ return m_memoryReservation; }
343 
344     /**
345      * <p>The soft limit (in MiB) of memory to reserve for the container, instead of
346      * the default value from the task definition. You must also specify a container
347      * name.</p>
348      */
MemoryReservationHasBeenSet()349     inline bool MemoryReservationHasBeenSet() const { return m_memoryReservationHasBeenSet; }
350 
351     /**
352      * <p>The soft limit (in MiB) of memory to reserve for the container, instead of
353      * the default value from the task definition. You must also specify a container
354      * name.</p>
355      */
SetMemoryReservation(int value)356     inline void SetMemoryReservation(int value) { m_memoryReservationHasBeenSet = true; m_memoryReservation = value; }
357 
358     /**
359      * <p>The soft limit (in MiB) of memory to reserve for the container, instead of
360      * the default value from the task definition. You must also specify a container
361      * name.</p>
362      */
WithMemoryReservation(int value)363     inline ContainerOverride& WithMemoryReservation(int value) { SetMemoryReservation(value); return *this;}
364 
365 
366     /**
367      * <p>The type and amount of a resource to assign to a container, instead of the
368      * default value from the task definition. The only supported resource is a
369      * GPU.</p>
370      */
GetResourceRequirements()371     inline const Aws::Vector<ResourceRequirement>& GetResourceRequirements() const{ return m_resourceRequirements; }
372 
373     /**
374      * <p>The type and amount of a resource to assign to a container, instead of the
375      * default value from the task definition. The only supported resource is a
376      * GPU.</p>
377      */
ResourceRequirementsHasBeenSet()378     inline bool ResourceRequirementsHasBeenSet() const { return m_resourceRequirementsHasBeenSet; }
379 
380     /**
381      * <p>The type and amount of a resource to assign to a container, instead of the
382      * default value from the task definition. The only supported resource is a
383      * GPU.</p>
384      */
SetResourceRequirements(const Aws::Vector<ResourceRequirement> & value)385     inline void SetResourceRequirements(const Aws::Vector<ResourceRequirement>& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements = value; }
386 
387     /**
388      * <p>The type and amount of a resource to assign to a container, instead of the
389      * default value from the task definition. The only supported resource is a
390      * GPU.</p>
391      */
SetResourceRequirements(Aws::Vector<ResourceRequirement> && value)392     inline void SetResourceRequirements(Aws::Vector<ResourceRequirement>&& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements = std::move(value); }
393 
394     /**
395      * <p>The type and amount of a resource to assign to a container, instead of the
396      * default value from the task definition. The only supported resource is a
397      * GPU.</p>
398      */
WithResourceRequirements(const Aws::Vector<ResourceRequirement> & value)399     inline ContainerOverride& WithResourceRequirements(const Aws::Vector<ResourceRequirement>& value) { SetResourceRequirements(value); return *this;}
400 
401     /**
402      * <p>The type and amount of a resource to assign to a container, instead of the
403      * default value from the task definition. The only supported resource is a
404      * GPU.</p>
405      */
WithResourceRequirements(Aws::Vector<ResourceRequirement> && value)406     inline ContainerOverride& WithResourceRequirements(Aws::Vector<ResourceRequirement>&& value) { SetResourceRequirements(std::move(value)); return *this;}
407 
408     /**
409      * <p>The type and amount of a resource to assign to a container, instead of the
410      * default value from the task definition. The only supported resource is a
411      * GPU.</p>
412      */
AddResourceRequirements(const ResourceRequirement & value)413     inline ContainerOverride& AddResourceRequirements(const ResourceRequirement& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements.push_back(value); return *this; }
414 
415     /**
416      * <p>The type and amount of a resource to assign to a container, instead of the
417      * default value from the task definition. The only supported resource is a
418      * GPU.</p>
419      */
AddResourceRequirements(ResourceRequirement && value)420     inline ContainerOverride& AddResourceRequirements(ResourceRequirement&& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements.push_back(std::move(value)); return *this; }
421 
422   private:
423 
424     Aws::String m_name;
425     bool m_nameHasBeenSet;
426 
427     Aws::Vector<Aws::String> m_command;
428     bool m_commandHasBeenSet;
429 
430     Aws::Vector<KeyValuePair> m_environment;
431     bool m_environmentHasBeenSet;
432 
433     Aws::Vector<EnvironmentFile> m_environmentFiles;
434     bool m_environmentFilesHasBeenSet;
435 
436     int m_cpu;
437     bool m_cpuHasBeenSet;
438 
439     int m_memory;
440     bool m_memoryHasBeenSet;
441 
442     int m_memoryReservation;
443     bool m_memoryReservationHasBeenSet;
444 
445     Aws::Vector<ResourceRequirement> m_resourceRequirements;
446     bool m_resourceRequirementsHasBeenSet;
447   };
448 
449 } // namespace Model
450 } // namespace ECS
451 } // namespace Aws
452