{-# 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.CreateTaskSet
-- 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)
--
-- Create a task set in the specified cluster and service. This is used
-- when a service uses the @EXTERNAL@ deployment controller type. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html Amazon ECS Deployment Types>
-- in the /Amazon Elastic Container Service Developer Guide/.
module Amazonka.ECS.CreateTaskSet
  ( -- * Creating a Request
    CreateTaskSet (..),
    newCreateTaskSet,

    -- * Request Lenses
    createTaskSet_clientToken,
    createTaskSet_platformVersion,
    createTaskSet_scale,
    createTaskSet_loadBalancers,
    createTaskSet_launchType,
    createTaskSet_externalId,
    createTaskSet_networkConfiguration,
    createTaskSet_serviceRegistries,
    createTaskSet_capacityProviderStrategy,
    createTaskSet_tags,
    createTaskSet_service,
    createTaskSet_cluster,
    createTaskSet_taskDefinition,

    -- * Destructuring the Response
    CreateTaskSetResponse (..),
    newCreateTaskSetResponse,

    -- * Response Lenses
    createTaskSetResponse_taskSet,
    createTaskSetResponse_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:/ 'newCreateTaskSet' smart constructor.
data CreateTaskSet = CreateTaskSet'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Up to 32 ASCII characters are allowed.
    CreateTaskSet -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The platform version that the tasks in the task set should use. A
    -- platform version is specified only for tasks using the Fargate launch
    -- type. If one isn\'t specified, the @LATEST@ platform version is used by
    -- default.
    CreateTaskSet -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
    -- | A floating-point percentage of the desired number of tasks to place and
    -- keep running in the task set.
    CreateTaskSet -> Maybe Scale
scale :: Prelude.Maybe Scale,
    -- | A load balancer object representing the load balancer to use with the
    -- task set. The supported load balancer types are either an Application
    -- Load Balancer or a Network Load Balancer.
    CreateTaskSet -> Maybe [LoadBalancer]
loadBalancers :: Prelude.Maybe [LoadBalancer],
    -- | The launch type that new tasks in the task set will use. 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/.
    --
    -- If a @launchType@ is specified, the @capacityProviderStrategy@ parameter
    -- must be omitted.
    CreateTaskSet -> Maybe LaunchType
launchType :: Prelude.Maybe LaunchType,
    -- | An optional non-unique tag that identifies this task set in external
    -- systems. If the task set is associated with a service discovery
    -- registry, the tasks in this task set will have the
    -- @ECS_TASK_SET_EXTERNAL_ID@ Cloud Map attribute set to the provided
    -- value.
    CreateTaskSet -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
    -- | An object representing the network configuration for a task set.
    CreateTaskSet -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | The details of the service discovery registries to assign to this task
    -- set. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
    CreateTaskSet -> Maybe [ServiceRegistry]
serviceRegistries :: Prelude.Maybe [ServiceRegistry],
    -- | The capacity provider strategy to use for the task set.
    --
    -- A capacity provider strategy consists of one or more capacity providers
    -- along with the @base@ and @weight@ to assign to them. A capacity
    -- provider must be associated with the cluster to be used in a capacity
    -- provider strategy. The PutClusterCapacityProviders API is used to
    -- associate a capacity provider with a cluster. Only capacity providers
    -- with an @ACTIVE@ or @UPDATING@ status can be used.
    --
    -- 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.
    --
    -- If specifying a capacity provider that uses an Auto Scaling group, the
    -- capacity provider must already be created. New capacity providers can be
    -- created with the CreateCapacityProvider API operation.
    --
    -- To use a Fargate capacity provider, specify either the @FARGATE@ or
    -- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
    -- available to all accounts and only need to be associated with a cluster
    -- to be used.
    --
    -- The PutClusterCapacityProviders API operation is used to update the list
    -- of available capacity providers for a cluster after the cluster is
    -- created.
    CreateTaskSet -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem],
    -- | The metadata that you apply to the task set to help you categorize and
    -- organize them. Each tag consists of a key and an optional value, both of
    -- which you define. When a service is deleted, the tags are deleted as
    -- well.
    --
    -- 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.
    CreateTaskSet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The short name or full Amazon Resource Name (ARN) of the service to
    -- create the task set in.
    CreateTaskSet -> Text
service :: Prelude.Text,
    -- | The short name or full Amazon Resource Name (ARN) of the cluster that
    -- hosts the service to create the task set in.
    CreateTaskSet -> Text
cluster :: Prelude.Text,
    -- | The task definition for the tasks in the task set to use.
    CreateTaskSet -> Text
taskDefinition :: Prelude.Text
  }
  deriving (CreateTaskSet -> CreateTaskSet -> Bool
(CreateTaskSet -> CreateTaskSet -> Bool)
-> (CreateTaskSet -> CreateTaskSet -> Bool) -> Eq CreateTaskSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTaskSet -> CreateTaskSet -> Bool
$c/= :: CreateTaskSet -> CreateTaskSet -> Bool
== :: CreateTaskSet -> CreateTaskSet -> Bool
$c== :: CreateTaskSet -> CreateTaskSet -> Bool
Prelude.Eq, ReadPrec [CreateTaskSet]
ReadPrec CreateTaskSet
Int -> ReadS CreateTaskSet
ReadS [CreateTaskSet]
(Int -> ReadS CreateTaskSet)
-> ReadS [CreateTaskSet]
-> ReadPrec CreateTaskSet
-> ReadPrec [CreateTaskSet]
-> Read CreateTaskSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTaskSet]
$creadListPrec :: ReadPrec [CreateTaskSet]
readPrec :: ReadPrec CreateTaskSet
$creadPrec :: ReadPrec CreateTaskSet
readList :: ReadS [CreateTaskSet]
$creadList :: ReadS [CreateTaskSet]
readsPrec :: Int -> ReadS CreateTaskSet
$creadsPrec :: Int -> ReadS CreateTaskSet
Prelude.Read, Int -> CreateTaskSet -> ShowS
[CreateTaskSet] -> ShowS
CreateTaskSet -> String
(Int -> CreateTaskSet -> ShowS)
-> (CreateTaskSet -> String)
-> ([CreateTaskSet] -> ShowS)
-> Show CreateTaskSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTaskSet] -> ShowS
$cshowList :: [CreateTaskSet] -> ShowS
show :: CreateTaskSet -> String
$cshow :: CreateTaskSet -> String
showsPrec :: Int -> CreateTaskSet -> ShowS
$cshowsPrec :: Int -> CreateTaskSet -> ShowS
Prelude.Show, (forall x. CreateTaskSet -> Rep CreateTaskSet x)
-> (forall x. Rep CreateTaskSet x -> CreateTaskSet)
-> Generic CreateTaskSet
forall x. Rep CreateTaskSet x -> CreateTaskSet
forall x. CreateTaskSet -> Rep CreateTaskSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTaskSet x -> CreateTaskSet
$cfrom :: forall x. CreateTaskSet -> Rep CreateTaskSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateTaskSet' 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:
--
-- 'clientToken', 'createTaskSet_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 32 ASCII characters are allowed.
--
-- 'platformVersion', 'createTaskSet_platformVersion' - The platform version that the tasks in the task set should use. A
-- platform version is specified only for tasks using the Fargate launch
-- type. If one isn\'t specified, the @LATEST@ platform version is used by
-- default.
--
-- 'scale', 'createTaskSet_scale' - A floating-point percentage of the desired number of tasks to place and
-- keep running in the task set.
--
-- 'loadBalancers', 'createTaskSet_loadBalancers' - A load balancer object representing the load balancer to use with the
-- task set. The supported load balancer types are either an Application
-- Load Balancer or a Network Load Balancer.
--
-- 'launchType', 'createTaskSet_launchType' - The launch type that new tasks in the task set will use. 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/.
--
-- If a @launchType@ is specified, the @capacityProviderStrategy@ parameter
-- must be omitted.
--
-- 'externalId', 'createTaskSet_externalId' - An optional non-unique tag that identifies this task set in external
-- systems. If the task set is associated with a service discovery
-- registry, the tasks in this task set will have the
-- @ECS_TASK_SET_EXTERNAL_ID@ Cloud Map attribute set to the provided
-- value.
--
-- 'networkConfiguration', 'createTaskSet_networkConfiguration' - An object representing the network configuration for a task set.
--
-- 'serviceRegistries', 'createTaskSet_serviceRegistries' - The details of the service discovery registries to assign to this task
-- set. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
--
-- 'capacityProviderStrategy', 'createTaskSet_capacityProviderStrategy' - The capacity provider strategy to use for the task set.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- 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.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
--
-- The PutClusterCapacityProviders API operation is used to update the list
-- of available capacity providers for a cluster after the cluster is
-- created.
--
-- 'tags', 'createTaskSet_tags' - The metadata that you apply to the task set to help you categorize and
-- organize them. Each tag consists of a key and an optional value, both of
-- which you define. When a service is deleted, the tags are deleted as
-- well.
--
-- 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.
--
-- 'service', 'createTaskSet_service' - The short name or full Amazon Resource Name (ARN) of the service to
-- create the task set in.
--
-- 'cluster', 'createTaskSet_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster that
-- hosts the service to create the task set in.
--
-- 'taskDefinition', 'createTaskSet_taskDefinition' - The task definition for the tasks in the task set to use.
newCreateTaskSet ::
  -- | 'service'
  Prelude.Text ->
  -- | 'cluster'
  Prelude.Text ->
  -- | 'taskDefinition'
  Prelude.Text ->
  CreateTaskSet
newCreateTaskSet :: Text -> Text -> Text -> CreateTaskSet
newCreateTaskSet Text
pService_ Text
pCluster_ Text
pTaskDefinition_ =
  CreateTaskSet' :: Maybe Text
-> Maybe Text
-> Maybe Scale
-> Maybe [LoadBalancer]
-> Maybe LaunchType
-> Maybe Text
-> Maybe NetworkConfiguration
-> Maybe [ServiceRegistry]
-> Maybe [CapacityProviderStrategyItem]
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> CreateTaskSet
CreateTaskSet'
    { $sel:clientToken:CreateTaskSet' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platformVersion:CreateTaskSet' :: Maybe Text
platformVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scale:CreateTaskSet' :: Maybe Scale
scale = Maybe Scale
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancers:CreateTaskSet' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
forall a. Maybe a
Prelude.Nothing,
      $sel:launchType:CreateTaskSet' :: Maybe LaunchType
launchType = Maybe LaunchType
forall a. Maybe a
Prelude.Nothing,
      $sel:externalId:CreateTaskSet' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:CreateTaskSet' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRegistries:CreateTaskSet' :: Maybe [ServiceRegistry]
serviceRegistries = Maybe [ServiceRegistry]
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviderStrategy:CreateTaskSet' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateTaskSet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:service:CreateTaskSet' :: Text
service = Text
pService_,
      $sel:cluster:CreateTaskSet' :: Text
cluster = Text
pCluster_,
      $sel:taskDefinition:CreateTaskSet' :: Text
taskDefinition = Text
pTaskDefinition_
    }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 32 ASCII characters are allowed.
createTaskSet_clientToken :: Lens.Lens' CreateTaskSet (Prelude.Maybe Prelude.Text)
createTaskSet_clientToken :: (Maybe Text -> f (Maybe Text)) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_clientToken = (CreateTaskSet -> Maybe Text)
-> (CreateTaskSet -> Maybe Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateTaskSet' :: CreateTaskSet -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe Text
a -> CreateTaskSet
s {$sel:clientToken:CreateTaskSet' :: Maybe Text
clientToken = Maybe Text
a} :: CreateTaskSet)

-- | The platform version that the tasks in the task set should use. A
-- platform version is specified only for tasks using the Fargate launch
-- type. If one isn\'t specified, the @LATEST@ platform version is used by
-- default.
createTaskSet_platformVersion :: Lens.Lens' CreateTaskSet (Prelude.Maybe Prelude.Text)
createTaskSet_platformVersion :: (Maybe Text -> f (Maybe Text)) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_platformVersion = (CreateTaskSet -> Maybe Text)
-> (CreateTaskSet -> Maybe Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:CreateTaskSet' :: CreateTaskSet -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe Text
a -> CreateTaskSet
s {$sel:platformVersion:CreateTaskSet' :: Maybe Text
platformVersion = Maybe Text
a} :: CreateTaskSet)

-- | A floating-point percentage of the desired number of tasks to place and
-- keep running in the task set.
createTaskSet_scale :: Lens.Lens' CreateTaskSet (Prelude.Maybe Scale)
createTaskSet_scale :: (Maybe Scale -> f (Maybe Scale))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_scale = (CreateTaskSet -> Maybe Scale)
-> (CreateTaskSet -> Maybe Scale -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet (Maybe Scale) (Maybe Scale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe Scale
scale :: Maybe Scale
$sel:scale:CreateTaskSet' :: CreateTaskSet -> Maybe Scale
scale} -> Maybe Scale
scale) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe Scale
a -> CreateTaskSet
s {$sel:scale:CreateTaskSet' :: Maybe Scale
scale = Maybe Scale
a} :: CreateTaskSet)

-- | A load balancer object representing the load balancer to use with the
-- task set. The supported load balancer types are either an Application
-- Load Balancer or a Network Load Balancer.
createTaskSet_loadBalancers :: Lens.Lens' CreateTaskSet (Prelude.Maybe [LoadBalancer])
createTaskSet_loadBalancers :: (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_loadBalancers = (CreateTaskSet -> Maybe [LoadBalancer])
-> (CreateTaskSet -> Maybe [LoadBalancer] -> CreateTaskSet)
-> Lens
     CreateTaskSet
     CreateTaskSet
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe [LoadBalancer]
loadBalancers :: Maybe [LoadBalancer]
$sel:loadBalancers:CreateTaskSet' :: CreateTaskSet -> Maybe [LoadBalancer]
loadBalancers} -> Maybe [LoadBalancer]
loadBalancers) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe [LoadBalancer]
a -> CreateTaskSet
s {$sel:loadBalancers:CreateTaskSet' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
a} :: CreateTaskSet) ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
 -> CreateTaskSet -> f CreateTaskSet)
-> ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
    -> Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> CreateTaskSet
-> f CreateTaskSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
-> Iso
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
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 [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The launch type that new tasks in the task set will use. 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/.
--
-- If a @launchType@ is specified, the @capacityProviderStrategy@ parameter
-- must be omitted.
createTaskSet_launchType :: Lens.Lens' CreateTaskSet (Prelude.Maybe LaunchType)
createTaskSet_launchType :: (Maybe LaunchType -> f (Maybe LaunchType))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_launchType = (CreateTaskSet -> Maybe LaunchType)
-> (CreateTaskSet -> Maybe LaunchType -> CreateTaskSet)
-> Lens
     CreateTaskSet CreateTaskSet (Maybe LaunchType) (Maybe LaunchType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe LaunchType
launchType :: Maybe LaunchType
$sel:launchType:CreateTaskSet' :: CreateTaskSet -> Maybe LaunchType
launchType} -> Maybe LaunchType
launchType) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe LaunchType
a -> CreateTaskSet
s {$sel:launchType:CreateTaskSet' :: Maybe LaunchType
launchType = Maybe LaunchType
a} :: CreateTaskSet)

-- | An optional non-unique tag that identifies this task set in external
-- systems. If the task set is associated with a service discovery
-- registry, the tasks in this task set will have the
-- @ECS_TASK_SET_EXTERNAL_ID@ Cloud Map attribute set to the provided
-- value.
createTaskSet_externalId :: Lens.Lens' CreateTaskSet (Prelude.Maybe Prelude.Text)
createTaskSet_externalId :: (Maybe Text -> f (Maybe Text)) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_externalId = (CreateTaskSet -> Maybe Text)
-> (CreateTaskSet -> Maybe Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe Text
externalId :: Maybe Text
$sel:externalId:CreateTaskSet' :: CreateTaskSet -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe Text
a -> CreateTaskSet
s {$sel:externalId:CreateTaskSet' :: Maybe Text
externalId = Maybe Text
a} :: CreateTaskSet)

-- | An object representing the network configuration for a task set.
createTaskSet_networkConfiguration :: Lens.Lens' CreateTaskSet (Prelude.Maybe NetworkConfiguration)
createTaskSet_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_networkConfiguration = (CreateTaskSet -> Maybe NetworkConfiguration)
-> (CreateTaskSet -> Maybe NetworkConfiguration -> CreateTaskSet)
-> Lens
     CreateTaskSet
     CreateTaskSet
     (Maybe NetworkConfiguration)
     (Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:CreateTaskSet' :: CreateTaskSet -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe NetworkConfiguration
a -> CreateTaskSet
s {$sel:networkConfiguration:CreateTaskSet' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: CreateTaskSet)

-- | The details of the service discovery registries to assign to this task
-- set. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
createTaskSet_serviceRegistries :: Lens.Lens' CreateTaskSet (Prelude.Maybe [ServiceRegistry])
createTaskSet_serviceRegistries :: (Maybe [ServiceRegistry] -> f (Maybe [ServiceRegistry]))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_serviceRegistries = (CreateTaskSet -> Maybe [ServiceRegistry])
-> (CreateTaskSet -> Maybe [ServiceRegistry] -> CreateTaskSet)
-> Lens
     CreateTaskSet
     CreateTaskSet
     (Maybe [ServiceRegistry])
     (Maybe [ServiceRegistry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe [ServiceRegistry]
serviceRegistries :: Maybe [ServiceRegistry]
$sel:serviceRegistries:CreateTaskSet' :: CreateTaskSet -> Maybe [ServiceRegistry]
serviceRegistries} -> Maybe [ServiceRegistry]
serviceRegistries) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe [ServiceRegistry]
a -> CreateTaskSet
s {$sel:serviceRegistries:CreateTaskSet' :: Maybe [ServiceRegistry]
serviceRegistries = Maybe [ServiceRegistry]
a} :: CreateTaskSet) ((Maybe [ServiceRegistry] -> f (Maybe [ServiceRegistry]))
 -> CreateTaskSet -> f CreateTaskSet)
-> ((Maybe [ServiceRegistry] -> f (Maybe [ServiceRegistry]))
    -> Maybe [ServiceRegistry] -> f (Maybe [ServiceRegistry]))
-> (Maybe [ServiceRegistry] -> f (Maybe [ServiceRegistry]))
-> CreateTaskSet
-> f CreateTaskSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ServiceRegistry]
  [ServiceRegistry]
  [ServiceRegistry]
  [ServiceRegistry]
-> Iso
     (Maybe [ServiceRegistry])
     (Maybe [ServiceRegistry])
     (Maybe [ServiceRegistry])
     (Maybe [ServiceRegistry])
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
  [ServiceRegistry]
  [ServiceRegistry]
  [ServiceRegistry]
  [ServiceRegistry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The capacity provider strategy to use for the task set.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- 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.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
--
-- The PutClusterCapacityProviders API operation is used to update the list
-- of available capacity providers for a cluster after the cluster is
-- created.
createTaskSet_capacityProviderStrategy :: Lens.Lens' CreateTaskSet (Prelude.Maybe [CapacityProviderStrategyItem])
createTaskSet_capacityProviderStrategy :: (Maybe [CapacityProviderStrategyItem]
 -> f (Maybe [CapacityProviderStrategyItem]))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_capacityProviderStrategy = (CreateTaskSet -> Maybe [CapacityProviderStrategyItem])
-> (CreateTaskSet
    -> Maybe [CapacityProviderStrategyItem] -> CreateTaskSet)
-> Lens
     CreateTaskSet
     CreateTaskSet
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:capacityProviderStrategy:CreateTaskSet' :: CreateTaskSet -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe [CapacityProviderStrategyItem]
a -> CreateTaskSet
s {$sel:capacityProviderStrategy:CreateTaskSet' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: CreateTaskSet) ((Maybe [CapacityProviderStrategyItem]
  -> f (Maybe [CapacityProviderStrategyItem]))
 -> CreateTaskSet -> f CreateTaskSet)
-> ((Maybe [CapacityProviderStrategyItem]
     -> f (Maybe [CapacityProviderStrategyItem]))
    -> Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> (Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> CreateTaskSet
-> f CreateTaskSet
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

-- | The metadata that you apply to the task set to help you categorize and
-- organize them. Each tag consists of a key and an optional value, both of
-- which you define. When a service is deleted, the tags are deleted as
-- well.
--
-- 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.
createTaskSet_tags :: Lens.Lens' CreateTaskSet (Prelude.Maybe [Tag])
createTaskSet_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateTaskSet -> f CreateTaskSet
createTaskSet_tags = (CreateTaskSet -> Maybe [Tag])
-> (CreateTaskSet -> Maybe [Tag] -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateTaskSet' :: CreateTaskSet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateTaskSet
s@CreateTaskSet' {} Maybe [Tag]
a -> CreateTaskSet
s {$sel:tags:CreateTaskSet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateTaskSet) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateTaskSet -> f CreateTaskSet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateTaskSet
-> f CreateTaskSet
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 short name or full Amazon Resource Name (ARN) of the service to
-- create the task set in.
createTaskSet_service :: Lens.Lens' CreateTaskSet Prelude.Text
createTaskSet_service :: (Text -> f Text) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_service = (CreateTaskSet -> Text)
-> (CreateTaskSet -> Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Text
service :: Text
$sel:service:CreateTaskSet' :: CreateTaskSet -> Text
service} -> Text
service) (\s :: CreateTaskSet
s@CreateTaskSet' {} Text
a -> CreateTaskSet
s {$sel:service:CreateTaskSet' :: Text
service = Text
a} :: CreateTaskSet)

-- | The short name or full Amazon Resource Name (ARN) of the cluster that
-- hosts the service to create the task set in.
createTaskSet_cluster :: Lens.Lens' CreateTaskSet Prelude.Text
createTaskSet_cluster :: (Text -> f Text) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_cluster = (CreateTaskSet -> Text)
-> (CreateTaskSet -> Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Text
cluster :: Text
$sel:cluster:CreateTaskSet' :: CreateTaskSet -> Text
cluster} -> Text
cluster) (\s :: CreateTaskSet
s@CreateTaskSet' {} Text
a -> CreateTaskSet
s {$sel:cluster:CreateTaskSet' :: Text
cluster = Text
a} :: CreateTaskSet)

-- | The task definition for the tasks in the task set to use.
createTaskSet_taskDefinition :: Lens.Lens' CreateTaskSet Prelude.Text
createTaskSet_taskDefinition :: (Text -> f Text) -> CreateTaskSet -> f CreateTaskSet
createTaskSet_taskDefinition = (CreateTaskSet -> Text)
-> (CreateTaskSet -> Text -> CreateTaskSet)
-> Lens CreateTaskSet CreateTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSet' {Text
taskDefinition :: Text
$sel:taskDefinition:CreateTaskSet' :: CreateTaskSet -> Text
taskDefinition} -> Text
taskDefinition) (\s :: CreateTaskSet
s@CreateTaskSet' {} Text
a -> CreateTaskSet
s {$sel:taskDefinition:CreateTaskSet' :: Text
taskDefinition = Text
a} :: CreateTaskSet)

instance Core.AWSRequest CreateTaskSet where
  type
    AWSResponse CreateTaskSet =
      CreateTaskSetResponse
  request :: CreateTaskSet -> Request CreateTaskSet
request = Service -> CreateTaskSet -> Request CreateTaskSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateTaskSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTaskSet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateTaskSet))
-> Logger
-> Service
-> Proxy CreateTaskSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTaskSet)))
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 TaskSet -> Int -> CreateTaskSetResponse
CreateTaskSetResponse'
            (Maybe TaskSet -> Int -> CreateTaskSetResponse)
-> Either String (Maybe TaskSet)
-> Either String (Int -> CreateTaskSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TaskSet)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskSet")
            Either String (Int -> CreateTaskSetResponse)
-> Either String Int -> Either String CreateTaskSetResponse
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 CreateTaskSet

instance Prelude.NFData CreateTaskSet

instance Core.ToHeaders CreateTaskSet where
  toHeaders :: CreateTaskSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateTaskSet -> 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.CreateTaskSet" ::
                          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 CreateTaskSet where
  toJSON :: CreateTaskSet -> Value
toJSON CreateTaskSet' {Maybe [CapacityProviderStrategyItem]
Maybe [LoadBalancer]
Maybe [ServiceRegistry]
Maybe [Tag]
Maybe Text
Maybe LaunchType
Maybe NetworkConfiguration
Maybe Scale
Text
taskDefinition :: Text
cluster :: Text
service :: Text
tags :: Maybe [Tag]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
serviceRegistries :: Maybe [ServiceRegistry]
networkConfiguration :: Maybe NetworkConfiguration
externalId :: Maybe Text
launchType :: Maybe LaunchType
loadBalancers :: Maybe [LoadBalancer]
scale :: Maybe Scale
platformVersion :: Maybe Text
clientToken :: Maybe Text
$sel:taskDefinition:CreateTaskSet' :: CreateTaskSet -> Text
$sel:cluster:CreateTaskSet' :: CreateTaskSet -> Text
$sel:service:CreateTaskSet' :: CreateTaskSet -> Text
$sel:tags:CreateTaskSet' :: CreateTaskSet -> Maybe [Tag]
$sel:capacityProviderStrategy:CreateTaskSet' :: CreateTaskSet -> Maybe [CapacityProviderStrategyItem]
$sel:serviceRegistries:CreateTaskSet' :: CreateTaskSet -> Maybe [ServiceRegistry]
$sel:networkConfiguration:CreateTaskSet' :: CreateTaskSet -> Maybe NetworkConfiguration
$sel:externalId:CreateTaskSet' :: CreateTaskSet -> Maybe Text
$sel:launchType:CreateTaskSet' :: CreateTaskSet -> Maybe LaunchType
$sel:loadBalancers:CreateTaskSet' :: CreateTaskSet -> Maybe [LoadBalancer]
$sel:scale:CreateTaskSet' :: CreateTaskSet -> Maybe Scale
$sel:platformVersion:CreateTaskSet' :: CreateTaskSet -> Maybe Text
$sel:clientToken:CreateTaskSet' :: CreateTaskSet -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            (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
"scale" Text -> Scale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Scale -> Pair) -> Maybe Scale -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Scale
scale,
            (Text
"loadBalancers" Text -> [LoadBalancer] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([LoadBalancer] -> Pair) -> Maybe [LoadBalancer] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LoadBalancer]
loadBalancers,
            (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
"externalId" 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
externalId,
            (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
"serviceRegistries" Text -> [ServiceRegistry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ServiceRegistry] -> Pair)
-> Maybe [ServiceRegistry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServiceRegistry]
serviceRegistries,
            (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
"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
"service" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
service),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"cluster" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cluster),
            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 CreateTaskSet where
  toPath :: CreateTaskSet -> ByteString
toPath = ByteString -> CreateTaskSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateTaskSetResponse' smart constructor.
data CreateTaskSetResponse = CreateTaskSetResponse'
  { -- | Information about a set of Amazon ECS tasks in either an CodeDeploy or
    -- an @EXTERNAL@ deployment. A task set includes details such as the
    -- desired number of tasks, how many tasks are running, and whether the
    -- task set serves production traffic.
    CreateTaskSetResponse -> Maybe TaskSet
taskSet :: Prelude.Maybe TaskSet,
    -- | The response's http status code.
    CreateTaskSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateTaskSetResponse -> CreateTaskSetResponse -> Bool
(CreateTaskSetResponse -> CreateTaskSetResponse -> Bool)
-> (CreateTaskSetResponse -> CreateTaskSetResponse -> Bool)
-> Eq CreateTaskSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTaskSetResponse -> CreateTaskSetResponse -> Bool
$c/= :: CreateTaskSetResponse -> CreateTaskSetResponse -> Bool
== :: CreateTaskSetResponse -> CreateTaskSetResponse -> Bool
$c== :: CreateTaskSetResponse -> CreateTaskSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateTaskSetResponse]
ReadPrec CreateTaskSetResponse
Int -> ReadS CreateTaskSetResponse
ReadS [CreateTaskSetResponse]
(Int -> ReadS CreateTaskSetResponse)
-> ReadS [CreateTaskSetResponse]
-> ReadPrec CreateTaskSetResponse
-> ReadPrec [CreateTaskSetResponse]
-> Read CreateTaskSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTaskSetResponse]
$creadListPrec :: ReadPrec [CreateTaskSetResponse]
readPrec :: ReadPrec CreateTaskSetResponse
$creadPrec :: ReadPrec CreateTaskSetResponse
readList :: ReadS [CreateTaskSetResponse]
$creadList :: ReadS [CreateTaskSetResponse]
readsPrec :: Int -> ReadS CreateTaskSetResponse
$creadsPrec :: Int -> ReadS CreateTaskSetResponse
Prelude.Read, Int -> CreateTaskSetResponse -> ShowS
[CreateTaskSetResponse] -> ShowS
CreateTaskSetResponse -> String
(Int -> CreateTaskSetResponse -> ShowS)
-> (CreateTaskSetResponse -> String)
-> ([CreateTaskSetResponse] -> ShowS)
-> Show CreateTaskSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTaskSetResponse] -> ShowS
$cshowList :: [CreateTaskSetResponse] -> ShowS
show :: CreateTaskSetResponse -> String
$cshow :: CreateTaskSetResponse -> String
showsPrec :: Int -> CreateTaskSetResponse -> ShowS
$cshowsPrec :: Int -> CreateTaskSetResponse -> ShowS
Prelude.Show, (forall x. CreateTaskSetResponse -> Rep CreateTaskSetResponse x)
-> (forall x. Rep CreateTaskSetResponse x -> CreateTaskSetResponse)
-> Generic CreateTaskSetResponse
forall x. Rep CreateTaskSetResponse x -> CreateTaskSetResponse
forall x. CreateTaskSetResponse -> Rep CreateTaskSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTaskSetResponse x -> CreateTaskSetResponse
$cfrom :: forall x. CreateTaskSetResponse -> Rep CreateTaskSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateTaskSetResponse' 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:
--
-- 'taskSet', 'createTaskSetResponse_taskSet' - Information about a set of Amazon ECS tasks in either an CodeDeploy or
-- an @EXTERNAL@ deployment. A task set includes details such as the
-- desired number of tasks, how many tasks are running, and whether the
-- task set serves production traffic.
--
-- 'httpStatus', 'createTaskSetResponse_httpStatus' - The response's http status code.
newCreateTaskSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateTaskSetResponse
newCreateTaskSetResponse :: Int -> CreateTaskSetResponse
newCreateTaskSetResponse Int
pHttpStatus_ =
  CreateTaskSetResponse' :: Maybe TaskSet -> Int -> CreateTaskSetResponse
CreateTaskSetResponse'
    { $sel:taskSet:CreateTaskSetResponse' :: Maybe TaskSet
taskSet = Maybe TaskSet
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateTaskSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about a set of Amazon ECS tasks in either an CodeDeploy or
-- an @EXTERNAL@ deployment. A task set includes details such as the
-- desired number of tasks, how many tasks are running, and whether the
-- task set serves production traffic.
createTaskSetResponse_taskSet :: Lens.Lens' CreateTaskSetResponse (Prelude.Maybe TaskSet)
createTaskSetResponse_taskSet :: (Maybe TaskSet -> f (Maybe TaskSet))
-> CreateTaskSetResponse -> f CreateTaskSetResponse
createTaskSetResponse_taskSet = (CreateTaskSetResponse -> Maybe TaskSet)
-> (CreateTaskSetResponse
    -> Maybe TaskSet -> CreateTaskSetResponse)
-> Lens
     CreateTaskSetResponse
     CreateTaskSetResponse
     (Maybe TaskSet)
     (Maybe TaskSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTaskSetResponse' {Maybe TaskSet
taskSet :: Maybe TaskSet
$sel:taskSet:CreateTaskSetResponse' :: CreateTaskSetResponse -> Maybe TaskSet
taskSet} -> Maybe TaskSet
taskSet) (\s :: CreateTaskSetResponse
s@CreateTaskSetResponse' {} Maybe TaskSet
a -> CreateTaskSetResponse
s {$sel:taskSet:CreateTaskSetResponse' :: Maybe TaskSet
taskSet = Maybe TaskSet
a} :: CreateTaskSetResponse)

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

instance Prelude.NFData CreateTaskSetResponse