/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ECS { namespace Model { /** *

The overrides that are sent to a container. An empty container override can * be passed in. An example of an empty container override is * {"containerOverrides": [ ] }. If a non-empty container override is * specified, the name parameter must be included.

See * Also:

AWS * API Reference

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

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline ContainerOverride& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline ContainerOverride& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the container that receives the override. This parameter is * required if any override is specified.

*/ inline ContainerOverride& WithName(const char* value) { SetName(value); return *this;} /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline const Aws::Vector& GetCommand() const{ return m_command; } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline bool CommandHasBeenSet() const { return m_commandHasBeenSet; } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline void SetCommand(const Aws::Vector& value) { m_commandHasBeenSet = true; m_command = value; } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline void SetCommand(Aws::Vector&& value) { m_commandHasBeenSet = true; m_command = std::move(value); } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline ContainerOverride& WithCommand(const Aws::Vector& value) { SetCommand(value); return *this;} /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline ContainerOverride& WithCommand(Aws::Vector&& value) { SetCommand(std::move(value)); return *this;} /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline ContainerOverride& AddCommand(const Aws::String& value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline ContainerOverride& AddCommand(Aws::String&& value) { m_commandHasBeenSet = true; m_command.push_back(std::move(value)); return *this; } /** *

The command to send to the container that overrides the default command from * the Docker image or the task definition. You must also specify a container * name.

*/ inline ContainerOverride& AddCommand(const char* value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline const Aws::Vector& GetEnvironment() const{ return m_environment; } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline bool EnvironmentHasBeenSet() const { return m_environmentHasBeenSet; } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline void SetEnvironment(const Aws::Vector& value) { m_environmentHasBeenSet = true; m_environment = value; } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline void SetEnvironment(Aws::Vector&& value) { m_environmentHasBeenSet = true; m_environment = std::move(value); } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline ContainerOverride& WithEnvironment(const Aws::Vector& value) { SetEnvironment(value); return *this;} /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline ContainerOverride& WithEnvironment(Aws::Vector&& value) { SetEnvironment(std::move(value)); return *this;} /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline ContainerOverride& AddEnvironment(const KeyValuePair& value) { m_environmentHasBeenSet = true; m_environment.push_back(value); return *this; } /** *

The environment variables to send to the container. You can add new * environment variables, which are added to the container at launch, or you can * override the existing environment variables from the Docker image or the task * definition. You must also specify a container name.

*/ inline ContainerOverride& AddEnvironment(KeyValuePair&& value) { m_environmentHasBeenSet = true; m_environment.push_back(std::move(value)); return *this; } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline const Aws::Vector& GetEnvironmentFiles() const{ return m_environmentFiles; } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline bool EnvironmentFilesHasBeenSet() const { return m_environmentFilesHasBeenSet; } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline void SetEnvironmentFiles(const Aws::Vector& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles = value; } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline void SetEnvironmentFiles(Aws::Vector&& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles = std::move(value); } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline ContainerOverride& WithEnvironmentFiles(const Aws::Vector& value) { SetEnvironmentFiles(value); return *this;} /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline ContainerOverride& WithEnvironmentFiles(Aws::Vector&& value) { SetEnvironmentFiles(std::move(value)); return *this;} /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline ContainerOverride& AddEnvironmentFiles(const EnvironmentFile& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles.push_back(value); return *this; } /** *

A list of files containing the environment variables to pass to a container, * instead of the value from the container definition.

*/ inline ContainerOverride& AddEnvironmentFiles(EnvironmentFile&& value) { m_environmentFilesHasBeenSet = true; m_environmentFiles.push_back(std::move(value)); return *this; } /** *

The number of cpu units reserved for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline int GetCpu() const{ return m_cpu; } /** *

The number of cpu units reserved for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline bool CpuHasBeenSet() const { return m_cpuHasBeenSet; } /** *

The number of cpu units reserved for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline void SetCpu(int value) { m_cpuHasBeenSet = true; m_cpu = value; } /** *

The number of cpu units reserved for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline ContainerOverride& WithCpu(int value) { SetCpu(value); return *this;} /** *

The hard limit (in MiB) of memory to present to the container, instead of the * default value from the task definition. If your container attempts to exceed the * memory specified here, the container is killed. You must also specify a * container name.

*/ inline int GetMemory() const{ return m_memory; } /** *

The hard limit (in MiB) of memory to present to the container, instead of the * default value from the task definition. If your container attempts to exceed the * memory specified here, the container is killed. You must also specify a * container name.

*/ inline bool MemoryHasBeenSet() const { return m_memoryHasBeenSet; } /** *

The hard limit (in MiB) of memory to present to the container, instead of the * default value from the task definition. If your container attempts to exceed the * memory specified here, the container is killed. You must also specify a * container name.

*/ inline void SetMemory(int value) { m_memoryHasBeenSet = true; m_memory = value; } /** *

The hard limit (in MiB) of memory to present to the container, instead of the * default value from the task definition. If your container attempts to exceed the * memory specified here, the container is killed. You must also specify a * container name.

*/ inline ContainerOverride& WithMemory(int value) { SetMemory(value); return *this;} /** *

The soft limit (in MiB) of memory to reserve for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline int GetMemoryReservation() const{ return m_memoryReservation; } /** *

The soft limit (in MiB) of memory to reserve for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline bool MemoryReservationHasBeenSet() const { return m_memoryReservationHasBeenSet; } /** *

The soft limit (in MiB) of memory to reserve for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline void SetMemoryReservation(int value) { m_memoryReservationHasBeenSet = true; m_memoryReservation = value; } /** *

The soft limit (in MiB) of memory to reserve for the container, instead of * the default value from the task definition. You must also specify a container * name.

*/ inline ContainerOverride& WithMemoryReservation(int value) { SetMemoryReservation(value); return *this;} /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline const Aws::Vector& GetResourceRequirements() const{ return m_resourceRequirements; } /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline bool ResourceRequirementsHasBeenSet() const { return m_resourceRequirementsHasBeenSet; } /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline void SetResourceRequirements(const Aws::Vector& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements = value; } /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline void SetResourceRequirements(Aws::Vector&& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements = std::move(value); } /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline ContainerOverride& WithResourceRequirements(const Aws::Vector& value) { SetResourceRequirements(value); return *this;} /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline ContainerOverride& WithResourceRequirements(Aws::Vector&& value) { SetResourceRequirements(std::move(value)); return *this;} /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline ContainerOverride& AddResourceRequirements(const ResourceRequirement& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements.push_back(value); return *this; } /** *

The type and amount of a resource to assign to a container, instead of the * default value from the task definition. The only supported resource is a * GPU.

*/ inline ContainerOverride& AddResourceRequirements(ResourceRequirement&& value) { m_resourceRequirementsHasBeenSet = true; m_resourceRequirements.push_back(std::move(value)); return *this; } private: Aws::String m_name; bool m_nameHasBeenSet = false; Aws::Vector m_command; bool m_commandHasBeenSet = false; Aws::Vector m_environment; bool m_environmentHasBeenSet = false; Aws::Vector m_environmentFiles; bool m_environmentFilesHasBeenSet = false; int m_cpu; bool m_cpuHasBeenSet = false; int m_memory; bool m_memoryHasBeenSet = false; int m_memoryReservation; bool m_memoryReservationHasBeenSet = false; Aws::Vector m_resourceRequirements; bool m_resourceRequirementsHasBeenSet = false; }; } // namespace Model } // namespace ECS } // namespace Aws