{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ECS.RunTask
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts a new task using the specified task definition.
--
-- You can allow Amazon ECS to place tasks for you, or you can customize
-- how Amazon ECS places tasks using placement constraints and placement
-- strategies. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html Scheduling Tasks>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- Alternatively, you can use StartTask to use your own scheduler or place
-- tasks manually on specific container instances.
--
-- The Amazon ECS API follows an eventual consistency model, due to the
-- distributed nature of the system supporting the API. This means that the
-- result of an API command you run that affects your Amazon ECS resources
-- might not be immediately visible to all subsequent commands you run.
-- Keep this in mind when you carry out an API command that immediately
-- follows a previous API command.
--
-- To manage eventual consistency, you can do the following:
--
-- -   Confirm the state of the resource before you run a command to modify
--     it. Run the DescribeTasks command using an exponential backoff
--     algorithm to ensure that you allow enough time for the previous
--     command to propagate through the system. To do this, run the
--     DescribeTasks command repeatedly, starting with a couple of seconds
--     of wait time and increasing gradually up to five minutes of wait
--     time.
--
-- -   Add wait time between subsequent commands, even if the DescribeTasks
--     command returns an accurate response. Apply an exponential backoff
--     algorithm starting with a couple of seconds of wait time, and
--     increase gradually up to about five minutes of wait time.
module Amazonka.ECS.RunTask
  ( -- * Creating a Request
    RunTask (..),
    newRunTask,

    -- * Request Lenses
    runTask_overrides,
    runTask_group,
    runTask_cluster,
    runTask_propagateTags,
    runTask_platformVersion,
    runTask_enableECSManagedTags,
    runTask_count,
    runTask_referenceId,
    runTask_placementConstraints,
    runTask_placementStrategy,
    runTask_startedBy,
    runTask_launchType,
    runTask_networkConfiguration,
    runTask_capacityProviderStrategy,
    runTask_enableExecuteCommand,
    runTask_tags,
    runTask_taskDefinition,

    -- * Destructuring the Response
    RunTaskResponse (..),
    newRunTaskResponse,

    -- * Response Lenses
    runTaskResponse_failures,
    runTaskResponse_tasks,
    runTaskResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newRunTask' smart constructor.
data RunTask = RunTask'
  { -- | A list of container overrides in JSON format that specify the name of a
    -- container in the specified task definition and the overrides it should
    -- receive. You can override the default command for a container (that is
    -- specified in the task definition or Docker image) with a @command@
    -- override. You can also override existing environment variables (that are
    -- specified in the task definition or Docker image) on a container or add
    -- new environment variables to it with an @environment@ override.
    --
    -- A total of 8192 characters are allowed for overrides. This limit
    -- includes the JSON formatting characters of the override structure.
    RunTask -> Maybe TaskOverride
overrides :: Prelude.Maybe TaskOverride,
    -- | The name of the task group to associate with the task. The default value
    -- is the family name of the task definition (for example,
    -- @family:my-family-name@).
    RunTask -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
    -- | The short name or full Amazon Resource Name (ARN) of the cluster on
    -- which to run your task. If you do not specify a cluster, the default
    -- cluster is assumed.
    RunTask -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to propagate the tags from the task definition to the
    -- task. If no value is specified, the tags are not propagated. Tags can
    -- only be propagated to the task during task creation. To add tags to a
    -- task after task creation, use the TagResource API action.
    --
    -- An error will be received if you specify the @SERVICE@ option when
    -- running a task.
    RunTask -> Maybe PropagateTags
propagateTags :: Prelude.Maybe PropagateTags,
    -- | The platform version the task should use. A platform version is only
    -- specified for tasks hosted on Fargate. If one is not specified, the
    -- @LATEST@ platform version is used by default. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate platform versions>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    RunTask -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to enable Amazon ECS managed tags for the task. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    RunTask -> Maybe Bool
enableECSManagedTags :: Prelude.Maybe Prelude.Bool,
    -- | The number of instantiations of the specified task to place on your
    -- cluster. You can specify up to 10 tasks per call.
    RunTask -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | The reference ID to use for the task. The reference ID can have a
    -- maximum length of 1024 characters.
    RunTask -> Maybe Text
referenceId :: Prelude.Maybe Prelude.Text,
    -- | An array of placement constraint objects to use for the task. You can
    -- specify up to 10 constraints per task (including constraints in the task
    -- definition and those specified at runtime).
    RunTask -> Maybe [PlacementConstraint]
placementConstraints :: Prelude.Maybe [PlacementConstraint],
    -- | The placement strategy objects to use for the task. You can specify a
    -- maximum of 5 strategy rules per task.
    RunTask -> Maybe [PlacementStrategy]
placementStrategy :: Prelude.Maybe [PlacementStrategy],
    -- | An optional tag specified when a task is started. For example, if you
    -- automatically trigger a task to run a batch process job, you could apply
    -- a unique identifier for that job to your task with the @startedBy@
    -- parameter. You can then identify which tasks belong to that job by
    -- filtering the results of a ListTasks call with the @startedBy@ value. Up
    -- to 36 letters (uppercase and lowercase), numbers, hyphens, and
    -- underscores are allowed.
    --
    -- If a task is started by an Amazon ECS service, then the @startedBy@
    -- parameter contains the deployment ID of the service that starts it.
    RunTask -> Maybe Text
startedBy :: Prelude.Maybe Prelude.Text,
    -- | The infrastructure on which to run your standalone task. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS launch types>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    --
    -- The @FARGATE@ launch type runs your tasks on Fargate On-Demand
    -- infrastructure.
    --
    -- Fargate Spot infrastructure is available for use but a capacity provider
    -- strategy must be used. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-capacity-providers.html Fargate capacity providers>
    -- in the /Amazon ECS User Guide for Fargate/.
    --
    -- The @EC2@ launch type runs your tasks on Amazon EC2 instances registered
    -- to your cluster.
    --
    -- The @EXTERNAL@ launch type runs your tasks on your on-premise server or
    -- virtual machine (VM) capacity registered to your cluster.
    --
    -- A task can use either a launch type or a capacity provider strategy. If
    -- a @launchType@ is specified, the @capacityProviderStrategy@ parameter
    -- must be omitted.
    --
    -- When you use cluster auto scaling, you must specify
    -- @capacityProviderStrategy@ and not @launchType@.
    RunTask -> Maybe LaunchType
launchType :: Prelude.Maybe LaunchType,
    -- | The network configuration for the task. This parameter is required for
    -- task definitions that use the @awsvpc@ network mode to receive their own
    -- elastic network interface, and it is not supported for other network
    -- modes. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html Task networking>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    RunTask -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | The capacity provider strategy to use for the task.
    --
    -- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
    -- must be omitted. If no @capacityProviderStrategy@ or @launchType@ is
    -- specified, the @defaultCapacityProviderStrategy@ for the cluster is
    -- used.
    --
    -- When you use cluster auto scaling, you must specify
    -- @capacityProviderStrategy@ and not @launchType@.
    --
    -- A capacity provider strategy may contain a maximum of 6 capacity
    -- providers.
    RunTask -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem],
    -- | Whether or not to enable the execute command functionality for the
    -- containers in this task. If @true@, this enables execute command
    -- functionality on all containers in the task.
    RunTask -> Maybe Bool
enableExecuteCommand :: Prelude.Maybe Prelude.Bool,
    -- | The metadata that you apply to the task to help you categorize and
    -- organize them. Each tag consists of a key and an optional value, both of
    -- which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case-sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for either keys or values as it is reserved for
    --     Amazon Web Services use. You cannot edit or delete tag keys or
    --     values with this prefix. Tags with this prefix do not count against
    --     your tags per resource limit.
    RunTask -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The @family@ and @revision@ (@family:revision@) or full ARN of the task
    -- definition to run. If a @revision@ is not specified, the latest @ACTIVE@
    -- revision is used.
    --
    -- The full ARN value must match the value that you specified ias the
    -- @Resource@ of the IAM principal\'s permissions policy. For example, if
    -- the @Resource@ is
    -- arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName:*,
    -- the @taskDefinition@ ARN value must be
    -- @arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName@.
    RunTask -> Text
taskDefinition :: Prelude.Text
  }
  deriving (RunTask -> RunTask -> Bool
(RunTask -> RunTask -> Bool)
-> (RunTask -> RunTask -> Bool) -> Eq RunTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunTask -> RunTask -> Bool
$c/= :: RunTask -> RunTask -> Bool
== :: RunTask -> RunTask -> Bool
$c== :: RunTask -> RunTask -> Bool
Prelude.Eq, ReadPrec [RunTask]
ReadPrec RunTask
Int -> ReadS RunTask
ReadS [RunTask]
(Int -> ReadS RunTask)
-> ReadS [RunTask]
-> ReadPrec RunTask
-> ReadPrec [RunTask]
-> Read RunTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunTask]
$creadListPrec :: ReadPrec [RunTask]
readPrec :: ReadPrec RunTask
$creadPrec :: ReadPrec RunTask
readList :: ReadS [RunTask]
$creadList :: ReadS [RunTask]
readsPrec :: Int -> ReadS RunTask
$creadsPrec :: Int -> ReadS RunTask
Prelude.Read, Int -> RunTask -> ShowS
[RunTask] -> ShowS
RunTask -> String
(Int -> RunTask -> ShowS)
-> (RunTask -> String) -> ([RunTask] -> ShowS) -> Show RunTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunTask] -> ShowS
$cshowList :: [RunTask] -> ShowS
show :: RunTask -> String
$cshow :: RunTask -> String
showsPrec :: Int -> RunTask -> ShowS
$cshowsPrec :: Int -> RunTask -> ShowS
Prelude.Show, (forall x. RunTask -> Rep RunTask x)
-> (forall x. Rep RunTask x -> RunTask) -> Generic RunTask
forall x. Rep RunTask x -> RunTask
forall x. RunTask -> Rep RunTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunTask x -> RunTask
$cfrom :: forall x. RunTask -> Rep RunTask x
Prelude.Generic)

-- |
-- Create a value of 'RunTask' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'overrides', 'runTask_overrides' - A list of container overrides in JSON format that specify the name of a
-- container in the specified task definition and the overrides it should
-- receive. You can override the default command for a container (that is
-- specified in the task definition or Docker image) with a @command@
-- override. You can also override existing environment variables (that are
-- specified in the task definition or Docker image) on a container or add
-- new environment variables to it with an @environment@ override.
--
-- A total of 8192 characters are allowed for overrides. This limit
-- includes the JSON formatting characters of the override structure.
--
-- 'group'', 'runTask_group' - The name of the task group to associate with the task. The default value
-- is the family name of the task definition (for example,
-- @family:my-family-name@).
--
-- 'cluster', 'runTask_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster on
-- which to run your task. If you do not specify a cluster, the default
-- cluster is assumed.
--
-- 'propagateTags', 'runTask_propagateTags' - Specifies whether to propagate the tags from the task definition to the
-- task. If no value is specified, the tags are not propagated. Tags can
-- only be propagated to the task during task creation. To add tags to a
-- task after task creation, use the TagResource API action.
--
-- An error will be received if you specify the @SERVICE@ option when
-- running a task.
--
-- 'platformVersion', 'runTask_platformVersion' - The platform version the task should use. A platform version is only
-- specified for tasks hosted on Fargate. If one is not specified, the
-- @LATEST@ platform version is used by default. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate platform versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'enableECSManagedTags', 'runTask_enableECSManagedTags' - Specifies whether to enable Amazon ECS managed tags for the task. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'count', 'runTask_count' - The number of instantiations of the specified task to place on your
-- cluster. You can specify up to 10 tasks per call.
--
-- 'referenceId', 'runTask_referenceId' - The reference ID to use for the task. The reference ID can have a
-- maximum length of 1024 characters.
--
-- 'placementConstraints', 'runTask_placementConstraints' - An array of placement constraint objects to use for the task. You can
-- specify up to 10 constraints per task (including constraints in the task
-- definition and those specified at runtime).
--
-- 'placementStrategy', 'runTask_placementStrategy' - The placement strategy objects to use for the task. You can specify a
-- maximum of 5 strategy rules per task.
--
-- 'startedBy', 'runTask_startedBy' - An optional tag specified when a task is started. For example, if you
-- automatically trigger a task to run a batch process job, you could apply
-- a unique identifier for that job to your task with the @startedBy@
-- parameter. You can then identify which tasks belong to that job by
-- filtering the results of a ListTasks call with the @startedBy@ value. Up
-- to 36 letters (uppercase and lowercase), numbers, hyphens, and
-- underscores are allowed.
--
-- If a task is started by an Amazon ECS service, then the @startedBy@
-- parameter contains the deployment ID of the service that starts it.
--
-- 'launchType', 'runTask_launchType' - The infrastructure on which to run your standalone task. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS launch types>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- The @FARGATE@ launch type runs your tasks on Fargate On-Demand
-- infrastructure.
--
-- Fargate Spot infrastructure is available for use but a capacity provider
-- strategy must be used. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-capacity-providers.html Fargate capacity providers>
-- in the /Amazon ECS User Guide for Fargate/.
--
-- The @EC2@ launch type runs your tasks on Amazon EC2 instances registered
-- to your cluster.
--
-- The @EXTERNAL@ launch type runs your tasks on your on-premise server or
-- virtual machine (VM) capacity registered to your cluster.
--
-- A task can use either a launch type or a capacity provider strategy. If
-- a @launchType@ is specified, the @capacityProviderStrategy@ parameter
-- must be omitted.
--
-- When you use cluster auto scaling, you must specify
-- @capacityProviderStrategy@ and not @launchType@.
--
-- 'networkConfiguration', 'runTask_networkConfiguration' - The network configuration for the task. This parameter is required for
-- task definitions that use the @awsvpc@ network mode to receive their own
-- elastic network interface, and it is not supported for other network
-- modes. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html Task networking>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'capacityProviderStrategy', 'runTask_capacityProviderStrategy' - The capacity provider strategy to use for the task.
--
-- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
-- must be omitted. If no @capacityProviderStrategy@ or @launchType@ is
-- specified, the @defaultCapacityProviderStrategy@ for the cluster is
-- used.
--
-- When you use cluster auto scaling, you must specify
-- @capacityProviderStrategy@ and not @launchType@.
--
-- A capacity provider strategy may contain a maximum of 6 capacity
-- providers.
--
-- 'enableExecuteCommand', 'runTask_enableExecuteCommand' - Whether or not to enable the execute command functionality for the
-- containers in this task. If @true@, this enables execute command
-- functionality on all containers in the task.
--
-- 'tags', 'runTask_tags' - The metadata that you apply to the task to help you categorize and
-- organize them. Each tag consists of a key and an optional value, both of
-- which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
--
-- 'taskDefinition', 'runTask_taskDefinition' - The @family@ and @revision@ (@family:revision@) or full ARN of the task
-- definition to run. If a @revision@ is not specified, the latest @ACTIVE@
-- revision is used.
--
-- The full ARN value must match the value that you specified ias the
-- @Resource@ of the IAM principal\'s permissions policy. For example, if
-- the @Resource@ is
-- arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName:*,
-- the @taskDefinition@ ARN value must be
-- @arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName@.
newRunTask ::
  -- | 'taskDefinition'
  Prelude.Text ->
  RunTask
newRunTask :: Text -> RunTask
newRunTask Text
pTaskDefinition_ =
  RunTask' :: Maybe TaskOverride
-> Maybe Text
-> Maybe Text
-> Maybe PropagateTags
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe [PlacementConstraint]
-> Maybe [PlacementStrategy]
-> Maybe Text
-> Maybe LaunchType
-> Maybe NetworkConfiguration
-> Maybe [CapacityProviderStrategyItem]
-> Maybe Bool
-> Maybe [Tag]
-> Text
-> RunTask
RunTask'
    { $sel:overrides:RunTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
forall a. Maybe a
Prelude.Nothing,
      $sel:group':RunTask' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cluster:RunTask' :: Maybe Text
cluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:propagateTags:RunTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
forall a. Maybe a
Prelude.Nothing,
      $sel:platformVersion:RunTask' :: Maybe Text
platformVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableECSManagedTags:RunTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:count:RunTask' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:referenceId:RunTask' :: Maybe Text
referenceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:placementConstraints:RunTask' :: Maybe [PlacementConstraint]
placementConstraints = Maybe [PlacementConstraint]
forall a. Maybe a
Prelude.Nothing,
      $sel:placementStrategy:RunTask' :: Maybe [PlacementStrategy]
placementStrategy = Maybe [PlacementStrategy]
forall a. Maybe a
Prelude.Nothing,
      $sel:startedBy:RunTask' :: Maybe Text
startedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:launchType:RunTask' :: Maybe LaunchType
launchType = Maybe LaunchType
forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:RunTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviderStrategy:RunTask' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableExecuteCommand:RunTask' :: Maybe Bool
enableExecuteCommand = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RunTask' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskDefinition:RunTask' :: Text
taskDefinition = Text
pTaskDefinition_
    }

-- | A list of container overrides in JSON format that specify the name of a
-- container in the specified task definition and the overrides it should
-- receive. You can override the default command for a container (that is
-- specified in the task definition or Docker image) with a @command@
-- override. You can also override existing environment variables (that are
-- specified in the task definition or Docker image) on a container or add
-- new environment variables to it with an @environment@ override.
--
-- A total of 8192 characters are allowed for overrides. This limit
-- includes the JSON formatting characters of the override structure.
runTask_overrides :: Lens.Lens' RunTask (Prelude.Maybe TaskOverride)
runTask_overrides :: (Maybe TaskOverride -> f (Maybe TaskOverride))
-> RunTask -> f RunTask
runTask_overrides = (RunTask -> Maybe TaskOverride)
-> (RunTask -> Maybe TaskOverride -> RunTask)
-> Lens RunTask RunTask (Maybe TaskOverride) (Maybe TaskOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe TaskOverride
overrides :: Maybe TaskOverride
$sel:overrides:RunTask' :: RunTask -> Maybe TaskOverride
overrides} -> Maybe TaskOverride
overrides) (\s :: RunTask
s@RunTask' {} Maybe TaskOverride
a -> RunTask
s {$sel:overrides:RunTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
a} :: RunTask)

-- | The name of the task group to associate with the task. The default value
-- is the family name of the task definition (for example,
-- @family:my-family-name@).
runTask_group :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Text)
runTask_group :: (Maybe Text -> f (Maybe Text)) -> RunTask -> f RunTask
runTask_group = (RunTask -> Maybe Text)
-> (RunTask -> Maybe Text -> RunTask)
-> Lens RunTask RunTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Text
group' :: Maybe Text
$sel:group':RunTask' :: RunTask -> Maybe Text
group'} -> Maybe Text
group') (\s :: RunTask
s@RunTask' {} Maybe Text
a -> RunTask
s {$sel:group':RunTask' :: Maybe Text
group' = Maybe Text
a} :: RunTask)

-- | The short name or full Amazon Resource Name (ARN) of the cluster on
-- which to run your task. If you do not specify a cluster, the default
-- cluster is assumed.
runTask_cluster :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Text)
runTask_cluster :: (Maybe Text -> f (Maybe Text)) -> RunTask -> f RunTask
runTask_cluster = (RunTask -> Maybe Text)
-> (RunTask -> Maybe Text -> RunTask)
-> Lens RunTask RunTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Text
cluster :: Maybe Text
$sel:cluster:RunTask' :: RunTask -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: RunTask
s@RunTask' {} Maybe Text
a -> RunTask
s {$sel:cluster:RunTask' :: Maybe Text
cluster = Maybe Text
a} :: RunTask)

-- | Specifies whether to propagate the tags from the task definition to the
-- task. If no value is specified, the tags are not propagated. Tags can
-- only be propagated to the task during task creation. To add tags to a
-- task after task creation, use the TagResource API action.
--
-- An error will be received if you specify the @SERVICE@ option when
-- running a task.
runTask_propagateTags :: Lens.Lens' RunTask (Prelude.Maybe PropagateTags)
runTask_propagateTags :: (Maybe PropagateTags -> f (Maybe PropagateTags))
-> RunTask -> f RunTask
runTask_propagateTags = (RunTask -> Maybe PropagateTags)
-> (RunTask -> Maybe PropagateTags -> RunTask)
-> Lens RunTask RunTask (Maybe PropagateTags) (Maybe PropagateTags)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe PropagateTags
propagateTags :: Maybe PropagateTags
$sel:propagateTags:RunTask' :: RunTask -> Maybe PropagateTags
propagateTags} -> Maybe PropagateTags
propagateTags) (\s :: RunTask
s@RunTask' {} Maybe PropagateTags
a -> RunTask
s {$sel:propagateTags:RunTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
a} :: RunTask)

-- | The platform version the task should use. A platform version is only
-- specified for tasks hosted on Fargate. If one is not specified, the
-- @LATEST@ platform version is used by default. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate platform versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
runTask_platformVersion :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Text)
runTask_platformVersion :: (Maybe Text -> f (Maybe Text)) -> RunTask -> f RunTask
runTask_platformVersion = (RunTask -> Maybe Text)
-> (RunTask -> Maybe Text -> RunTask)
-> Lens RunTask RunTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:RunTask' :: RunTask -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: RunTask
s@RunTask' {} Maybe Text
a -> RunTask
s {$sel:platformVersion:RunTask' :: Maybe Text
platformVersion = Maybe Text
a} :: RunTask)

-- | Specifies whether to enable Amazon ECS managed tags for the task. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
-- in the /Amazon Elastic Container Service Developer Guide/.
runTask_enableECSManagedTags :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Bool)
runTask_enableECSManagedTags :: (Maybe Bool -> f (Maybe Bool)) -> RunTask -> f RunTask
runTask_enableECSManagedTags = (RunTask -> Maybe Bool)
-> (RunTask -> Maybe Bool -> RunTask)
-> Lens RunTask RunTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Bool
enableECSManagedTags :: Maybe Bool
$sel:enableECSManagedTags:RunTask' :: RunTask -> Maybe Bool
enableECSManagedTags} -> Maybe Bool
enableECSManagedTags) (\s :: RunTask
s@RunTask' {} Maybe Bool
a -> RunTask
s {$sel:enableECSManagedTags:RunTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
a} :: RunTask)

-- | The number of instantiations of the specified task to place on your
-- cluster. You can specify up to 10 tasks per call.
runTask_count :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Int)
runTask_count :: (Maybe Int -> f (Maybe Int)) -> RunTask -> f RunTask
runTask_count = (RunTask -> Maybe Int)
-> (RunTask -> Maybe Int -> RunTask)
-> Lens RunTask RunTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Int
count :: Maybe Int
$sel:count:RunTask' :: RunTask -> Maybe Int
count} -> Maybe Int
count) (\s :: RunTask
s@RunTask' {} Maybe Int
a -> RunTask
s {$sel:count:RunTask' :: Maybe Int
count = Maybe Int
a} :: RunTask)

-- | The reference ID to use for the task. The reference ID can have a
-- maximum length of 1024 characters.
runTask_referenceId :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Text)
runTask_referenceId :: (Maybe Text -> f (Maybe Text)) -> RunTask -> f RunTask
runTask_referenceId = (RunTask -> Maybe Text)
-> (RunTask -> Maybe Text -> RunTask)
-> Lens RunTask RunTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Text
referenceId :: Maybe Text
$sel:referenceId:RunTask' :: RunTask -> Maybe Text
referenceId} -> Maybe Text
referenceId) (\s :: RunTask
s@RunTask' {} Maybe Text
a -> RunTask
s {$sel:referenceId:RunTask' :: Maybe Text
referenceId = Maybe Text
a} :: RunTask)

-- | An array of placement constraint objects to use for the task. You can
-- specify up to 10 constraints per task (including constraints in the task
-- definition and those specified at runtime).
runTask_placementConstraints :: Lens.Lens' RunTask (Prelude.Maybe [PlacementConstraint])
runTask_placementConstraints :: (Maybe [PlacementConstraint] -> f (Maybe [PlacementConstraint]))
-> RunTask -> f RunTask
runTask_placementConstraints = (RunTask -> Maybe [PlacementConstraint])
-> (RunTask -> Maybe [PlacementConstraint] -> RunTask)
-> Lens
     RunTask
     RunTask
     (Maybe [PlacementConstraint])
     (Maybe [PlacementConstraint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe [PlacementConstraint]
placementConstraints :: Maybe [PlacementConstraint]
$sel:placementConstraints:RunTask' :: RunTask -> Maybe [PlacementConstraint]
placementConstraints} -> Maybe [PlacementConstraint]
placementConstraints) (\s :: RunTask
s@RunTask' {} Maybe [PlacementConstraint]
a -> RunTask
s {$sel:placementConstraints:RunTask' :: Maybe [PlacementConstraint]
placementConstraints = Maybe [PlacementConstraint]
a} :: RunTask) ((Maybe [PlacementConstraint] -> f (Maybe [PlacementConstraint]))
 -> RunTask -> f RunTask)
-> ((Maybe [PlacementConstraint]
     -> f (Maybe [PlacementConstraint]))
    -> Maybe [PlacementConstraint] -> f (Maybe [PlacementConstraint]))
-> (Maybe [PlacementConstraint] -> f (Maybe [PlacementConstraint]))
-> RunTask
-> f RunTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlacementConstraint]
  [PlacementConstraint]
  [PlacementConstraint]
  [PlacementConstraint]
-> Iso
     (Maybe [PlacementConstraint])
     (Maybe [PlacementConstraint])
     (Maybe [PlacementConstraint])
     (Maybe [PlacementConstraint])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [PlacementConstraint]
  [PlacementConstraint]
  [PlacementConstraint]
  [PlacementConstraint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The placement strategy objects to use for the task. You can specify a
-- maximum of 5 strategy rules per task.
runTask_placementStrategy :: Lens.Lens' RunTask (Prelude.Maybe [PlacementStrategy])
runTask_placementStrategy :: (Maybe [PlacementStrategy] -> f (Maybe [PlacementStrategy]))
-> RunTask -> f RunTask
runTask_placementStrategy = (RunTask -> Maybe [PlacementStrategy])
-> (RunTask -> Maybe [PlacementStrategy] -> RunTask)
-> Lens
     RunTask
     RunTask
     (Maybe [PlacementStrategy])
     (Maybe [PlacementStrategy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe [PlacementStrategy]
placementStrategy :: Maybe [PlacementStrategy]
$sel:placementStrategy:RunTask' :: RunTask -> Maybe [PlacementStrategy]
placementStrategy} -> Maybe [PlacementStrategy]
placementStrategy) (\s :: RunTask
s@RunTask' {} Maybe [PlacementStrategy]
a -> RunTask
s {$sel:placementStrategy:RunTask' :: Maybe [PlacementStrategy]
placementStrategy = Maybe [PlacementStrategy]
a} :: RunTask) ((Maybe [PlacementStrategy] -> f (Maybe [PlacementStrategy]))
 -> RunTask -> f RunTask)
-> ((Maybe [PlacementStrategy] -> f (Maybe [PlacementStrategy]))
    -> Maybe [PlacementStrategy] -> f (Maybe [PlacementStrategy]))
-> (Maybe [PlacementStrategy] -> f (Maybe [PlacementStrategy]))
-> RunTask
-> f RunTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlacementStrategy]
  [PlacementStrategy]
  [PlacementStrategy]
  [PlacementStrategy]
-> Iso
     (Maybe [PlacementStrategy])
     (Maybe [PlacementStrategy])
     (Maybe [PlacementStrategy])
     (Maybe [PlacementStrategy])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [PlacementStrategy]
  [PlacementStrategy]
  [PlacementStrategy]
  [PlacementStrategy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional tag specified when a task is started. For example, if you
-- automatically trigger a task to run a batch process job, you could apply
-- a unique identifier for that job to your task with the @startedBy@
-- parameter. You can then identify which tasks belong to that job by
-- filtering the results of a ListTasks call with the @startedBy@ value. Up
-- to 36 letters (uppercase and lowercase), numbers, hyphens, and
-- underscores are allowed.
--
-- If a task is started by an Amazon ECS service, then the @startedBy@
-- parameter contains the deployment ID of the service that starts it.
runTask_startedBy :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Text)
runTask_startedBy :: (Maybe Text -> f (Maybe Text)) -> RunTask -> f RunTask
runTask_startedBy = (RunTask -> Maybe Text)
-> (RunTask -> Maybe Text -> RunTask)
-> Lens RunTask RunTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Text
startedBy :: Maybe Text
$sel:startedBy:RunTask' :: RunTask -> Maybe Text
startedBy} -> Maybe Text
startedBy) (\s :: RunTask
s@RunTask' {} Maybe Text
a -> RunTask
s {$sel:startedBy:RunTask' :: Maybe Text
startedBy = Maybe Text
a} :: RunTask)

-- | The infrastructure on which to run your standalone task. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS launch types>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- The @FARGATE@ launch type runs your tasks on Fargate On-Demand
-- infrastructure.
--
-- Fargate Spot infrastructure is available for use but a capacity provider
-- strategy must be used. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-capacity-providers.html Fargate capacity providers>
-- in the /Amazon ECS User Guide for Fargate/.
--
-- The @EC2@ launch type runs your tasks on Amazon EC2 instances registered
-- to your cluster.
--
-- The @EXTERNAL@ launch type runs your tasks on your on-premise server or
-- virtual machine (VM) capacity registered to your cluster.
--
-- A task can use either a launch type or a capacity provider strategy. If
-- a @launchType@ is specified, the @capacityProviderStrategy@ parameter
-- must be omitted.
--
-- When you use cluster auto scaling, you must specify
-- @capacityProviderStrategy@ and not @launchType@.
runTask_launchType :: Lens.Lens' RunTask (Prelude.Maybe LaunchType)
runTask_launchType :: (Maybe LaunchType -> f (Maybe LaunchType)) -> RunTask -> f RunTask
runTask_launchType = (RunTask -> Maybe LaunchType)
-> (RunTask -> Maybe LaunchType -> RunTask)
-> Lens RunTask RunTask (Maybe LaunchType) (Maybe LaunchType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe LaunchType
launchType :: Maybe LaunchType
$sel:launchType:RunTask' :: RunTask -> Maybe LaunchType
launchType} -> Maybe LaunchType
launchType) (\s :: RunTask
s@RunTask' {} Maybe LaunchType
a -> RunTask
s {$sel:launchType:RunTask' :: Maybe LaunchType
launchType = Maybe LaunchType
a} :: RunTask)

-- | The network configuration for the task. This parameter is required for
-- task definitions that use the @awsvpc@ network mode to receive their own
-- elastic network interface, and it is not supported for other network
-- modes. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html Task networking>
-- in the /Amazon Elastic Container Service Developer Guide/.
runTask_networkConfiguration :: Lens.Lens' RunTask (Prelude.Maybe NetworkConfiguration)
runTask_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> RunTask -> f RunTask
runTask_networkConfiguration = (RunTask -> Maybe NetworkConfiguration)
-> (RunTask -> Maybe NetworkConfiguration -> RunTask)
-> Lens
     RunTask
     RunTask
     (Maybe NetworkConfiguration)
     (Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:RunTask' :: RunTask -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: RunTask
s@RunTask' {} Maybe NetworkConfiguration
a -> RunTask
s {$sel:networkConfiguration:RunTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: RunTask)

-- | The capacity provider strategy to use for the task.
--
-- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
-- must be omitted. If no @capacityProviderStrategy@ or @launchType@ is
-- specified, the @defaultCapacityProviderStrategy@ for the cluster is
-- used.
--
-- When you use cluster auto scaling, you must specify
-- @capacityProviderStrategy@ and not @launchType@.
--
-- A capacity provider strategy may contain a maximum of 6 capacity
-- providers.
runTask_capacityProviderStrategy :: Lens.Lens' RunTask (Prelude.Maybe [CapacityProviderStrategyItem])
runTask_capacityProviderStrategy :: (Maybe [CapacityProviderStrategyItem]
 -> f (Maybe [CapacityProviderStrategyItem]))
-> RunTask -> f RunTask
runTask_capacityProviderStrategy = (RunTask -> Maybe [CapacityProviderStrategyItem])
-> (RunTask -> Maybe [CapacityProviderStrategyItem] -> RunTask)
-> Lens
     RunTask
     RunTask
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:capacityProviderStrategy:RunTask' :: RunTask -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy) (\s :: RunTask
s@RunTask' {} Maybe [CapacityProviderStrategyItem]
a -> RunTask
s {$sel:capacityProviderStrategy:RunTask' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: RunTask) ((Maybe [CapacityProviderStrategyItem]
  -> f (Maybe [CapacityProviderStrategyItem]))
 -> RunTask -> f RunTask)
-> ((Maybe [CapacityProviderStrategyItem]
     -> f (Maybe [CapacityProviderStrategyItem]))
    -> Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> (Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> RunTask
-> f RunTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
-> Iso
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether or not to enable the execute command functionality for the
-- containers in this task. If @true@, this enables execute command
-- functionality on all containers in the task.
runTask_enableExecuteCommand :: Lens.Lens' RunTask (Prelude.Maybe Prelude.Bool)
runTask_enableExecuteCommand :: (Maybe Bool -> f (Maybe Bool)) -> RunTask -> f RunTask
runTask_enableExecuteCommand = (RunTask -> Maybe Bool)
-> (RunTask -> Maybe Bool -> RunTask)
-> Lens RunTask RunTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe Bool
enableExecuteCommand :: Maybe Bool
$sel:enableExecuteCommand:RunTask' :: RunTask -> Maybe Bool
enableExecuteCommand} -> Maybe Bool
enableExecuteCommand) (\s :: RunTask
s@RunTask' {} Maybe Bool
a -> RunTask
s {$sel:enableExecuteCommand:RunTask' :: Maybe Bool
enableExecuteCommand = Maybe Bool
a} :: RunTask)

-- | The metadata that you apply to the task to help you categorize and
-- organize them. Each tag consists of a key and an optional value, both of
-- which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
runTask_tags :: Lens.Lens' RunTask (Prelude.Maybe [Tag])
runTask_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> RunTask -> f RunTask
runTask_tags = (RunTask -> Maybe [Tag])
-> (RunTask -> Maybe [Tag] -> RunTask)
-> Lens RunTask RunTask (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:RunTask' :: RunTask -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: RunTask
s@RunTask' {} Maybe [Tag]
a -> RunTask
s {$sel:tags:RunTask' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: RunTask) ((Maybe [Tag] -> f (Maybe [Tag])) -> RunTask -> f RunTask)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> RunTask
-> f RunTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @family@ and @revision@ (@family:revision@) or full ARN of the task
-- definition to run. If a @revision@ is not specified, the latest @ACTIVE@
-- revision is used.
--
-- The full ARN value must match the value that you specified ias the
-- @Resource@ of the IAM principal\'s permissions policy. For example, if
-- the @Resource@ is
-- arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName:*,
-- the @taskDefinition@ ARN value must be
-- @arn:aws:ecs:us-east-1:111122223333:task-definition\/TaskFamilyName@.
runTask_taskDefinition :: Lens.Lens' RunTask Prelude.Text
runTask_taskDefinition :: (Text -> f Text) -> RunTask -> f RunTask
runTask_taskDefinition = (RunTask -> Text)
-> (RunTask -> Text -> RunTask) -> Lens RunTask RunTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTask' {Text
taskDefinition :: Text
$sel:taskDefinition:RunTask' :: RunTask -> Text
taskDefinition} -> Text
taskDefinition) (\s :: RunTask
s@RunTask' {} Text
a -> RunTask
s {$sel:taskDefinition:RunTask' :: Text
taskDefinition = Text
a} :: RunTask)

instance Core.AWSRequest RunTask where
  type AWSResponse RunTask = RunTaskResponse
  request :: RunTask -> Request RunTask
request = Service -> RunTask -> Request RunTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RunTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RunTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RunTask))
-> Logger
-> Service
-> Proxy RunTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RunTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Failure] -> Maybe [Task] -> Int -> RunTaskResponse
RunTaskResponse'
            (Maybe [Failure] -> Maybe [Task] -> Int -> RunTaskResponse)
-> Either String (Maybe [Failure])
-> Either String (Maybe [Task] -> Int -> RunTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Failure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failures" Either String (Maybe (Maybe [Failure]))
-> Maybe [Failure] -> Either String (Maybe [Failure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Failure]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe [Task] -> Int -> RunTaskResponse)
-> Either String (Maybe [Task])
-> Either String (Int -> RunTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Task]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tasks" Either String (Maybe (Maybe [Task]))
-> Maybe [Task] -> Either String (Maybe [Task])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Task]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> RunTaskResponse)
-> Either String Int -> Either String RunTaskResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable RunTask

instance Prelude.NFData RunTask

instance Core.ToHeaders RunTask where
  toHeaders :: RunTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RunTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.RunTask" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON RunTask where
  toJSON :: RunTask -> Value
toJSON RunTask' {Maybe Bool
Maybe Int
Maybe [CapacityProviderStrategyItem]
Maybe [PlacementConstraint]
Maybe [PlacementStrategy]
Maybe [Tag]
Maybe Text
Maybe LaunchType
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe TaskOverride
Text
taskDefinition :: Text
tags :: Maybe [Tag]
enableExecuteCommand :: Maybe Bool
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
networkConfiguration :: Maybe NetworkConfiguration
launchType :: Maybe LaunchType
startedBy :: Maybe Text
placementStrategy :: Maybe [PlacementStrategy]
placementConstraints :: Maybe [PlacementConstraint]
referenceId :: Maybe Text
count :: Maybe Int
enableECSManagedTags :: Maybe Bool
platformVersion :: Maybe Text
propagateTags :: Maybe PropagateTags
cluster :: Maybe Text
group' :: Maybe Text
overrides :: Maybe TaskOverride
$sel:taskDefinition:RunTask' :: RunTask -> Text
$sel:tags:RunTask' :: RunTask -> Maybe [Tag]
$sel:enableExecuteCommand:RunTask' :: RunTask -> Maybe Bool
$sel:capacityProviderStrategy:RunTask' :: RunTask -> Maybe [CapacityProviderStrategyItem]
$sel:networkConfiguration:RunTask' :: RunTask -> Maybe NetworkConfiguration
$sel:launchType:RunTask' :: RunTask -> Maybe LaunchType
$sel:startedBy:RunTask' :: RunTask -> Maybe Text
$sel:placementStrategy:RunTask' :: RunTask -> Maybe [PlacementStrategy]
$sel:placementConstraints:RunTask' :: RunTask -> Maybe [PlacementConstraint]
$sel:referenceId:RunTask' :: RunTask -> Maybe Text
$sel:count:RunTask' :: RunTask -> Maybe Int
$sel:enableECSManagedTags:RunTask' :: RunTask -> Maybe Bool
$sel:platformVersion:RunTask' :: RunTask -> Maybe Text
$sel:propagateTags:RunTask' :: RunTask -> Maybe PropagateTags
$sel:cluster:RunTask' :: RunTask -> Maybe Text
$sel:group':RunTask' :: RunTask -> Maybe Text
$sel:overrides:RunTask' :: RunTask -> Maybe TaskOverride
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"overrides" Text -> TaskOverride -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskOverride -> Pair) -> Maybe TaskOverride -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskOverride
overrides,
            (Text
"group" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
group',
            (Text
"cluster" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cluster,
            (Text
"propagateTags" Text -> PropagateTags -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PropagateTags -> Pair) -> Maybe PropagateTags -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PropagateTags
propagateTags,
            (Text
"platformVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platformVersion,
            (Text
"enableECSManagedTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableECSManagedTags,
            (Text
"count" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
count,
            (Text
"referenceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
referenceId,
            (Text
"placementConstraints" Text -> [PlacementConstraint] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlacementConstraint] -> Pair)
-> Maybe [PlacementConstraint] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementConstraint]
placementConstraints,
            (Text
"placementStrategy" Text -> [PlacementStrategy] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlacementStrategy] -> Pair)
-> Maybe [PlacementStrategy] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementStrategy]
placementStrategy,
            (Text
"startedBy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
startedBy,
            (Text
"launchType" Text -> LaunchType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LaunchType -> Pair) -> Maybe LaunchType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LaunchType
launchType,
            (Text
"networkConfiguration" Text -> NetworkConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NetworkConfiguration -> Pair)
-> Maybe NetworkConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkConfiguration
networkConfiguration,
            (Text
"capacityProviderStrategy" Text -> [CapacityProviderStrategyItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([CapacityProviderStrategyItem] -> Pair)
-> Maybe [CapacityProviderStrategyItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy,
            (Text
"enableExecuteCommand" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableExecuteCommand,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"taskDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskDefinition)
          ]
      )

instance Core.ToPath RunTask where
  toPath :: RunTask -> ByteString
toPath = ByteString -> RunTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery RunTask where
  toQuery :: RunTask -> QueryString
toQuery = QueryString -> RunTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newRunTaskResponse' smart constructor.
data RunTaskResponse = RunTaskResponse'
  { -- | Any failures associated with the call.
    RunTaskResponse -> Maybe [Failure]
failures :: Prelude.Maybe [Failure],
    -- | A full description of the tasks that were run. The tasks that were
    -- successfully placed on your cluster are described here.
    RunTaskResponse -> Maybe [Task]
tasks :: Prelude.Maybe [Task],
    -- | The response's http status code.
    RunTaskResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RunTaskResponse -> RunTaskResponse -> Bool
(RunTaskResponse -> RunTaskResponse -> Bool)
-> (RunTaskResponse -> RunTaskResponse -> Bool)
-> Eq RunTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunTaskResponse -> RunTaskResponse -> Bool
$c/= :: RunTaskResponse -> RunTaskResponse -> Bool
== :: RunTaskResponse -> RunTaskResponse -> Bool
$c== :: RunTaskResponse -> RunTaskResponse -> Bool
Prelude.Eq, ReadPrec [RunTaskResponse]
ReadPrec RunTaskResponse
Int -> ReadS RunTaskResponse
ReadS [RunTaskResponse]
(Int -> ReadS RunTaskResponse)
-> ReadS [RunTaskResponse]
-> ReadPrec RunTaskResponse
-> ReadPrec [RunTaskResponse]
-> Read RunTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunTaskResponse]
$creadListPrec :: ReadPrec [RunTaskResponse]
readPrec :: ReadPrec RunTaskResponse
$creadPrec :: ReadPrec RunTaskResponse
readList :: ReadS [RunTaskResponse]
$creadList :: ReadS [RunTaskResponse]
readsPrec :: Int -> ReadS RunTaskResponse
$creadsPrec :: Int -> ReadS RunTaskResponse
Prelude.Read, Int -> RunTaskResponse -> ShowS
[RunTaskResponse] -> ShowS
RunTaskResponse -> String
(Int -> RunTaskResponse -> ShowS)
-> (RunTaskResponse -> String)
-> ([RunTaskResponse] -> ShowS)
-> Show RunTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunTaskResponse] -> ShowS
$cshowList :: [RunTaskResponse] -> ShowS
show :: RunTaskResponse -> String
$cshow :: RunTaskResponse -> String
showsPrec :: Int -> RunTaskResponse -> ShowS
$cshowsPrec :: Int -> RunTaskResponse -> ShowS
Prelude.Show, (forall x. RunTaskResponse -> Rep RunTaskResponse x)
-> (forall x. Rep RunTaskResponse x -> RunTaskResponse)
-> Generic RunTaskResponse
forall x. Rep RunTaskResponse x -> RunTaskResponse
forall x. RunTaskResponse -> Rep RunTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunTaskResponse x -> RunTaskResponse
$cfrom :: forall x. RunTaskResponse -> Rep RunTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'RunTaskResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'failures', 'runTaskResponse_failures' - Any failures associated with the call.
--
-- 'tasks', 'runTaskResponse_tasks' - A full description of the tasks that were run. The tasks that were
-- successfully placed on your cluster are described here.
--
-- 'httpStatus', 'runTaskResponse_httpStatus' - The response's http status code.
newRunTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RunTaskResponse
newRunTaskResponse :: Int -> RunTaskResponse
newRunTaskResponse Int
pHttpStatus_ =
  RunTaskResponse' :: Maybe [Failure] -> Maybe [Task] -> Int -> RunTaskResponse
RunTaskResponse'
    { $sel:failures:RunTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
forall a. Maybe a
Prelude.Nothing,
      $sel:tasks:RunTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RunTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Any failures associated with the call.
runTaskResponse_failures :: Lens.Lens' RunTaskResponse (Prelude.Maybe [Failure])
runTaskResponse_failures :: (Maybe [Failure] -> f (Maybe [Failure]))
-> RunTaskResponse -> f RunTaskResponse
runTaskResponse_failures = (RunTaskResponse -> Maybe [Failure])
-> (RunTaskResponse -> Maybe [Failure] -> RunTaskResponse)
-> Lens
     RunTaskResponse RunTaskResponse (Maybe [Failure]) (Maybe [Failure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTaskResponse' {Maybe [Failure]
failures :: Maybe [Failure]
$sel:failures:RunTaskResponse' :: RunTaskResponse -> Maybe [Failure]
failures} -> Maybe [Failure]
failures) (\s :: RunTaskResponse
s@RunTaskResponse' {} Maybe [Failure]
a -> RunTaskResponse
s {$sel:failures:RunTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
a} :: RunTaskResponse) ((Maybe [Failure] -> f (Maybe [Failure]))
 -> RunTaskResponse -> f RunTaskResponse)
-> ((Maybe [Failure] -> f (Maybe [Failure]))
    -> Maybe [Failure] -> f (Maybe [Failure]))
-> (Maybe [Failure] -> f (Maybe [Failure]))
-> RunTaskResponse
-> f RunTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Failure] [Failure] [Failure] [Failure]
-> Iso
     (Maybe [Failure])
     (Maybe [Failure])
     (Maybe [Failure])
     (Maybe [Failure])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Failure] [Failure] [Failure] [Failure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A full description of the tasks that were run. The tasks that were
-- successfully placed on your cluster are described here.
runTaskResponse_tasks :: Lens.Lens' RunTaskResponse (Prelude.Maybe [Task])
runTaskResponse_tasks :: (Maybe [Task] -> f (Maybe [Task]))
-> RunTaskResponse -> f RunTaskResponse
runTaskResponse_tasks = (RunTaskResponse -> Maybe [Task])
-> (RunTaskResponse -> Maybe [Task] -> RunTaskResponse)
-> Lens
     RunTaskResponse RunTaskResponse (Maybe [Task]) (Maybe [Task])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTaskResponse' {Maybe [Task]
tasks :: Maybe [Task]
$sel:tasks:RunTaskResponse' :: RunTaskResponse -> Maybe [Task]
tasks} -> Maybe [Task]
tasks) (\s :: RunTaskResponse
s@RunTaskResponse' {} Maybe [Task]
a -> RunTaskResponse
s {$sel:tasks:RunTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
a} :: RunTaskResponse) ((Maybe [Task] -> f (Maybe [Task]))
 -> RunTaskResponse -> f RunTaskResponse)
-> ((Maybe [Task] -> f (Maybe [Task]))
    -> Maybe [Task] -> f (Maybe [Task]))
-> (Maybe [Task] -> f (Maybe [Task]))
-> RunTaskResponse
-> f RunTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Task] [Task] [Task] [Task]
-> Iso (Maybe [Task]) (Maybe [Task]) (Maybe [Task]) (Maybe [Task])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Task] [Task] [Task] [Task]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
runTaskResponse_httpStatus :: Lens.Lens' RunTaskResponse Prelude.Int
runTaskResponse_httpStatus :: (Int -> f Int) -> RunTaskResponse -> f RunTaskResponse
runTaskResponse_httpStatus = (RunTaskResponse -> Int)
-> (RunTaskResponse -> Int -> RunTaskResponse)
-> Lens RunTaskResponse RunTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:RunTaskResponse' :: RunTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RunTaskResponse
s@RunTaskResponse' {} Int
a -> RunTaskResponse
s {$sel:httpStatus:RunTaskResponse' :: Int
httpStatus = Int
a} :: RunTaskResponse)

instance Prelude.NFData RunTaskResponse