{-# 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.StartTask
-- 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 from the specified task definition on the specified
-- container instance or instances.
--
-- Alternatively, you can use RunTask to place tasks for you. 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/.
module Amazonka.ECS.StartTask
  ( -- * Creating a Request
    StartTask (..),
    newStartTask,

    -- * Request Lenses
    startTask_overrides,
    startTask_group,
    startTask_cluster,
    startTask_propagateTags,
    startTask_enableECSManagedTags,
    startTask_referenceId,
    startTask_startedBy,
    startTask_networkConfiguration,
    startTask_enableExecuteCommand,
    startTask_tags,
    startTask_containerInstances,
    startTask_taskDefinition,

    -- * Destructuring the Response
    StartTaskResponse (..),
    newStartTaskResponse,

    -- * Response Lenses
    startTaskResponse_failures,
    startTaskResponse_tasks,
    startTaskResponse_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:/ 'newStartTask' smart constructor.
data StartTask = StartTask'
  { -- | 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.
    StartTask -> 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).
    StartTask -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
    -- | The short name or full Amazon Resource Name (ARN) of the cluster on
    -- which to start your task. If you do not specify a cluster, the default
    -- cluster is assumed.
    StartTask -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to propagate the tags from the task definition or the
    -- service to the task. If no value is specified, the tags are not
    -- propagated.
    StartTask -> Maybe PropagateTags
propagateTags :: Prelude.Maybe PropagateTags,
    -- | 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/.
    StartTask -> Maybe Bool
enableECSManagedTags :: Prelude.Maybe Prelude.Bool,
    -- | The reference ID to use for the task.
    StartTask -> Maybe Text
referenceId :: Prelude.Maybe Prelude.Text,
    -- | 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.
    StartTask -> Maybe Text
startedBy :: Prelude.Maybe Prelude.Text,
    -- | The VPC subnet and security group configuration for tasks that receive
    -- their own elastic network interface by using the @awsvpc@ networking
    -- mode.
    StartTask -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | Whether or not the execute command functionality is enabled for the
    -- task. If @true@, this enables execute command functionality on all
    -- containers in the task.
    StartTask -> 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.
    StartTask -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The container instance IDs or full ARN entries for the container
    -- instances on which you would like to place your task. You can specify up
    -- to 10 container instances.
    StartTask -> [Text]
containerInstances :: [Prelude.Text],
    -- | The @family@ and @revision@ (@family:revision@) or full ARN of the task
    -- definition to start. If a @revision@ is not specified, the latest
    -- @ACTIVE@ revision is used.
    StartTask -> Text
taskDefinition :: Prelude.Text
  }
  deriving (StartTask -> StartTask -> Bool
(StartTask -> StartTask -> Bool)
-> (StartTask -> StartTask -> Bool) -> Eq StartTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTask -> StartTask -> Bool
$c/= :: StartTask -> StartTask -> Bool
== :: StartTask -> StartTask -> Bool
$c== :: StartTask -> StartTask -> Bool
Prelude.Eq, ReadPrec [StartTask]
ReadPrec StartTask
Int -> ReadS StartTask
ReadS [StartTask]
(Int -> ReadS StartTask)
-> ReadS [StartTask]
-> ReadPrec StartTask
-> ReadPrec [StartTask]
-> Read StartTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTask]
$creadListPrec :: ReadPrec [StartTask]
readPrec :: ReadPrec StartTask
$creadPrec :: ReadPrec StartTask
readList :: ReadS [StartTask]
$creadList :: ReadS [StartTask]
readsPrec :: Int -> ReadS StartTask
$creadsPrec :: Int -> ReadS StartTask
Prelude.Read, Int -> StartTask -> ShowS
[StartTask] -> ShowS
StartTask -> String
(Int -> StartTask -> ShowS)
-> (StartTask -> String)
-> ([StartTask] -> ShowS)
-> Show StartTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTask] -> ShowS
$cshowList :: [StartTask] -> ShowS
show :: StartTask -> String
$cshow :: StartTask -> String
showsPrec :: Int -> StartTask -> ShowS
$cshowsPrec :: Int -> StartTask -> ShowS
Prelude.Show, (forall x. StartTask -> Rep StartTask x)
-> (forall x. Rep StartTask x -> StartTask) -> Generic StartTask
forall x. Rep StartTask x -> StartTask
forall x. StartTask -> Rep StartTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTask x -> StartTask
$cfrom :: forall x. StartTask -> Rep StartTask x
Prelude.Generic)

-- |
-- Create a value of 'StartTask' 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', 'startTask_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'', 'startTask_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', 'startTask_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster on
-- which to start your task. If you do not specify a cluster, the default
-- cluster is assumed.
--
-- 'propagateTags', 'startTask_propagateTags' - Specifies whether to propagate the tags from the task definition or the
-- service to the task. If no value is specified, the tags are not
-- propagated.
--
-- 'enableECSManagedTags', 'startTask_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/.
--
-- 'referenceId', 'startTask_referenceId' - The reference ID to use for the task.
--
-- 'startedBy', 'startTask_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.
--
-- 'networkConfiguration', 'startTask_networkConfiguration' - The VPC subnet and security group configuration for tasks that receive
-- their own elastic network interface by using the @awsvpc@ networking
-- mode.
--
-- 'enableExecuteCommand', 'startTask_enableExecuteCommand' - Whether or not the execute command functionality is enabled for the
-- task. If @true@, this enables execute command functionality on all
-- containers in the task.
--
-- 'tags', 'startTask_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.
--
-- 'containerInstances', 'startTask_containerInstances' - The container instance IDs or full ARN entries for the container
-- instances on which you would like to place your task. You can specify up
-- to 10 container instances.
--
-- 'taskDefinition', 'startTask_taskDefinition' - The @family@ and @revision@ (@family:revision@) or full ARN of the task
-- definition to start. If a @revision@ is not specified, the latest
-- @ACTIVE@ revision is used.
newStartTask ::
  -- | 'taskDefinition'
  Prelude.Text ->
  StartTask
newStartTask :: Text -> StartTask
newStartTask Text
pTaskDefinition_ =
  StartTask' :: Maybe TaskOverride
-> Maybe Text
-> Maybe Text
-> Maybe PropagateTags
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe NetworkConfiguration
-> Maybe Bool
-> Maybe [Tag]
-> [Text]
-> Text
-> StartTask
StartTask'
    { $sel:overrides:StartTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
forall a. Maybe a
Prelude.Nothing,
      $sel:group':StartTask' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cluster:StartTask' :: Maybe Text
cluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:propagateTags:StartTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
forall a. Maybe a
Prelude.Nothing,
      $sel:enableECSManagedTags:StartTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:referenceId:StartTask' :: Maybe Text
referenceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startedBy:StartTask' :: Maybe Text
startedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:StartTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:enableExecuteCommand:StartTask' :: Maybe Bool
enableExecuteCommand = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartTask' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:containerInstances:StartTask' :: [Text]
containerInstances = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:taskDefinition:StartTask' :: 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.
startTask_overrides :: Lens.Lens' StartTask (Prelude.Maybe TaskOverride)
startTask_overrides :: (Maybe TaskOverride -> f (Maybe TaskOverride))
-> StartTask -> f StartTask
startTask_overrides = (StartTask -> Maybe TaskOverride)
-> (StartTask -> Maybe TaskOverride -> StartTask)
-> Lens
     StartTask StartTask (Maybe TaskOverride) (Maybe TaskOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe TaskOverride
overrides :: Maybe TaskOverride
$sel:overrides:StartTask' :: StartTask -> Maybe TaskOverride
overrides} -> Maybe TaskOverride
overrides) (\s :: StartTask
s@StartTask' {} Maybe TaskOverride
a -> StartTask
s {$sel:overrides:StartTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
a} :: StartTask)

-- | 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).
startTask_group :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_group :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_group = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
group' :: Maybe Text
$sel:group':StartTask' :: StartTask -> Maybe Text
group'} -> Maybe Text
group') (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:group':StartTask' :: Maybe Text
group' = Maybe Text
a} :: StartTask)

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

-- | Specifies whether to propagate the tags from the task definition or the
-- service to the task. If no value is specified, the tags are not
-- propagated.
startTask_propagateTags :: Lens.Lens' StartTask (Prelude.Maybe PropagateTags)
startTask_propagateTags :: (Maybe PropagateTags -> f (Maybe PropagateTags))
-> StartTask -> f StartTask
startTask_propagateTags = (StartTask -> Maybe PropagateTags)
-> (StartTask -> Maybe PropagateTags -> StartTask)
-> Lens
     StartTask StartTask (Maybe PropagateTags) (Maybe PropagateTags)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe PropagateTags
propagateTags :: Maybe PropagateTags
$sel:propagateTags:StartTask' :: StartTask -> Maybe PropagateTags
propagateTags} -> Maybe PropagateTags
propagateTags) (\s :: StartTask
s@StartTask' {} Maybe PropagateTags
a -> StartTask
s {$sel:propagateTags:StartTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
a} :: StartTask)

-- | 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/.
startTask_enableECSManagedTags :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Bool)
startTask_enableECSManagedTags :: (Maybe Bool -> f (Maybe Bool)) -> StartTask -> f StartTask
startTask_enableECSManagedTags = (StartTask -> Maybe Bool)
-> (StartTask -> Maybe Bool -> StartTask)
-> Lens StartTask StartTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Bool
enableECSManagedTags :: Maybe Bool
$sel:enableECSManagedTags:StartTask' :: StartTask -> Maybe Bool
enableECSManagedTags} -> Maybe Bool
enableECSManagedTags) (\s :: StartTask
s@StartTask' {} Maybe Bool
a -> StartTask
s {$sel:enableECSManagedTags:StartTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
a} :: StartTask)

-- | The reference ID to use for the task.
startTask_referenceId :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_referenceId :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_referenceId = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
referenceId :: Maybe Text
$sel:referenceId:StartTask' :: StartTask -> Maybe Text
referenceId} -> Maybe Text
referenceId) (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:referenceId:StartTask' :: Maybe Text
referenceId = Maybe Text
a} :: StartTask)

-- | 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.
startTask_startedBy :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_startedBy :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_startedBy = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
startedBy :: Maybe Text
$sel:startedBy:StartTask' :: StartTask -> Maybe Text
startedBy} -> Maybe Text
startedBy) (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:startedBy:StartTask' :: Maybe Text
startedBy = Maybe Text
a} :: StartTask)

-- | The VPC subnet and security group configuration for tasks that receive
-- their own elastic network interface by using the @awsvpc@ networking
-- mode.
startTask_networkConfiguration :: Lens.Lens' StartTask (Prelude.Maybe NetworkConfiguration)
startTask_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> StartTask -> f StartTask
startTask_networkConfiguration = (StartTask -> Maybe NetworkConfiguration)
-> (StartTask -> Maybe NetworkConfiguration -> StartTask)
-> Lens
     StartTask
     StartTask
     (Maybe NetworkConfiguration)
     (Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:StartTask' :: StartTask -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: StartTask
s@StartTask' {} Maybe NetworkConfiguration
a -> StartTask
s {$sel:networkConfiguration:StartTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: StartTask)

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

-- | 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.
startTask_tags :: Lens.Lens' StartTask (Prelude.Maybe [Tag])
startTask_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> StartTask -> f StartTask
startTask_tags = (StartTask -> Maybe [Tag])
-> (StartTask -> Maybe [Tag] -> StartTask)
-> Lens StartTask StartTask (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartTask' :: StartTask -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartTask
s@StartTask' {} Maybe [Tag]
a -> StartTask
s {$sel:tags:StartTask' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartTask) ((Maybe [Tag] -> f (Maybe [Tag])) -> StartTask -> f StartTask)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> StartTask
-> f StartTask
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 container instance IDs or full ARN entries for the container
-- instances on which you would like to place your task. You can specify up
-- to 10 container instances.
startTask_containerInstances :: Lens.Lens' StartTask [Prelude.Text]
startTask_containerInstances :: ([Text] -> f [Text]) -> StartTask -> f StartTask
startTask_containerInstances = (StartTask -> [Text])
-> (StartTask -> [Text] -> StartTask)
-> Lens StartTask StartTask [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {[Text]
containerInstances :: [Text]
$sel:containerInstances:StartTask' :: StartTask -> [Text]
containerInstances} -> [Text]
containerInstances) (\s :: StartTask
s@StartTask' {} [Text]
a -> StartTask
s {$sel:containerInstances:StartTask' :: [Text]
containerInstances = [Text]
a} :: StartTask) (([Text] -> f [Text]) -> StartTask -> f StartTask)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> StartTask
-> f StartTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
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 start. If a @revision@ is not specified, the latest
-- @ACTIVE@ revision is used.
startTask_taskDefinition :: Lens.Lens' StartTask Prelude.Text
startTask_taskDefinition :: (Text -> f Text) -> StartTask -> f StartTask
startTask_taskDefinition = (StartTask -> Text)
-> (StartTask -> Text -> StartTask)
-> Lens StartTask StartTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Text
taskDefinition :: Text
$sel:taskDefinition:StartTask' :: StartTask -> Text
taskDefinition} -> Text
taskDefinition) (\s :: StartTask
s@StartTask' {} Text
a -> StartTask
s {$sel:taskDefinition:StartTask' :: Text
taskDefinition = Text
a} :: StartTask)

instance Core.AWSRequest StartTask where
  type AWSResponse StartTask = StartTaskResponse
  request :: StartTask -> Request StartTask
request = Service -> StartTask -> Request StartTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartTask))
-> Logger
-> Service
-> Proxy StartTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartTask)))
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 -> StartTaskResponse
StartTaskResponse'
            (Maybe [Failure] -> Maybe [Task] -> Int -> StartTaskResponse)
-> Either String (Maybe [Failure])
-> Either String (Maybe [Task] -> Int -> StartTaskResponse)
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 -> StartTaskResponse)
-> Either String (Maybe [Task])
-> Either String (Int -> StartTaskResponse)
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 -> StartTaskResponse)
-> Either String Int -> Either String StartTaskResponse
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 StartTask

instance Prelude.NFData StartTask

instance Core.ToHeaders StartTask where
  toHeaders :: StartTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartTask -> 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.StartTask" ::
                          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 StartTask where
  toJSON :: StartTask -> Value
toJSON StartTask' {[Text]
Maybe Bool
Maybe [Tag]
Maybe Text
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe TaskOverride
Text
taskDefinition :: Text
containerInstances :: [Text]
tags :: Maybe [Tag]
enableExecuteCommand :: Maybe Bool
networkConfiguration :: Maybe NetworkConfiguration
startedBy :: Maybe Text
referenceId :: Maybe Text
enableECSManagedTags :: Maybe Bool
propagateTags :: Maybe PropagateTags
cluster :: Maybe Text
group' :: Maybe Text
overrides :: Maybe TaskOverride
$sel:taskDefinition:StartTask' :: StartTask -> Text
$sel:containerInstances:StartTask' :: StartTask -> [Text]
$sel:tags:StartTask' :: StartTask -> Maybe [Tag]
$sel:enableExecuteCommand:StartTask' :: StartTask -> Maybe Bool
$sel:networkConfiguration:StartTask' :: StartTask -> Maybe NetworkConfiguration
$sel:startedBy:StartTask' :: StartTask -> Maybe Text
$sel:referenceId:StartTask' :: StartTask -> Maybe Text
$sel:enableECSManagedTags:StartTask' :: StartTask -> Maybe Bool
$sel:propagateTags:StartTask' :: StartTask -> Maybe PropagateTags
$sel:cluster:StartTask' :: StartTask -> Maybe Text
$sel:group':StartTask' :: StartTask -> Maybe Text
$sel:overrides:StartTask' :: StartTask -> 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
"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
"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
"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
"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
"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
"containerInstances" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
containerInstances),
            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 StartTask where
  toPath :: StartTask -> ByteString
toPath = ByteString -> StartTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'StartTaskResponse' 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', 'startTaskResponse_failures' - Any failures associated with the call.
--
-- 'tasks', 'startTaskResponse_tasks' - A full description of the tasks that were started. Each task that was
-- successfully placed on your container instances is described.
--
-- 'httpStatus', 'startTaskResponse_httpStatus' - The response's http status code.
newStartTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartTaskResponse
newStartTaskResponse :: Int -> StartTaskResponse
newStartTaskResponse Int
pHttpStatus_ =
  StartTaskResponse' :: Maybe [Failure] -> Maybe [Task] -> Int -> StartTaskResponse
StartTaskResponse'
    { $sel:failures:StartTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
forall a. Maybe a
Prelude.Nothing,
      $sel:tasks:StartTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Any failures associated with the call.
startTaskResponse_failures :: Lens.Lens' StartTaskResponse (Prelude.Maybe [Failure])
startTaskResponse_failures :: (Maybe [Failure] -> f (Maybe [Failure]))
-> StartTaskResponse -> f StartTaskResponse
startTaskResponse_failures = (StartTaskResponse -> Maybe [Failure])
-> (StartTaskResponse -> Maybe [Failure] -> StartTaskResponse)
-> Lens
     StartTaskResponse
     StartTaskResponse
     (Maybe [Failure])
     (Maybe [Failure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Maybe [Failure]
failures :: Maybe [Failure]
$sel:failures:StartTaskResponse' :: StartTaskResponse -> Maybe [Failure]
failures} -> Maybe [Failure]
failures) (\s :: StartTaskResponse
s@StartTaskResponse' {} Maybe [Failure]
a -> StartTaskResponse
s {$sel:failures:StartTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
a} :: StartTaskResponse) ((Maybe [Failure] -> f (Maybe [Failure]))
 -> StartTaskResponse -> f StartTaskResponse)
-> ((Maybe [Failure] -> f (Maybe [Failure]))
    -> Maybe [Failure] -> f (Maybe [Failure]))
-> (Maybe [Failure] -> f (Maybe [Failure]))
-> StartTaskResponse
-> f StartTaskResponse
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 started. Each task that was
-- successfully placed on your container instances is described.
startTaskResponse_tasks :: Lens.Lens' StartTaskResponse (Prelude.Maybe [Task])
startTaskResponse_tasks :: (Maybe [Task] -> f (Maybe [Task]))
-> StartTaskResponse -> f StartTaskResponse
startTaskResponse_tasks = (StartTaskResponse -> Maybe [Task])
-> (StartTaskResponse -> Maybe [Task] -> StartTaskResponse)
-> Lens
     StartTaskResponse StartTaskResponse (Maybe [Task]) (Maybe [Task])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Maybe [Task]
tasks :: Maybe [Task]
$sel:tasks:StartTaskResponse' :: StartTaskResponse -> Maybe [Task]
tasks} -> Maybe [Task]
tasks) (\s :: StartTaskResponse
s@StartTaskResponse' {} Maybe [Task]
a -> StartTaskResponse
s {$sel:tasks:StartTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
a} :: StartTaskResponse) ((Maybe [Task] -> f (Maybe [Task]))
 -> StartTaskResponse -> f StartTaskResponse)
-> ((Maybe [Task] -> f (Maybe [Task]))
    -> Maybe [Task] -> f (Maybe [Task]))
-> (Maybe [Task] -> f (Maybe [Task]))
-> StartTaskResponse
-> f StartTaskResponse
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.
startTaskResponse_httpStatus :: Lens.Lens' StartTaskResponse Prelude.Int
startTaskResponse_httpStatus :: (Int -> f Int) -> StartTaskResponse -> f StartTaskResponse
startTaskResponse_httpStatus = (StartTaskResponse -> Int)
-> (StartTaskResponse -> Int -> StartTaskResponse)
-> Lens StartTaskResponse StartTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartTaskResponse' :: StartTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartTaskResponse
s@StartTaskResponse' {} Int
a -> StartTaskResponse
s {$sel:httpStatus:StartTaskResponse' :: Int
httpStatus = Int
a} :: StartTaskResponse)

instance Prelude.NFData StartTaskResponse