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

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

-- |
-- Module      : Amazonka.CloudWatchEvents.Types.EcsParameters
-- 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)
module Amazonka.CloudWatchEvents.Types.EcsParameters where

import Amazonka.CloudWatchEvents.Types.CapacityProviderStrategyItem
import Amazonka.CloudWatchEvents.Types.LaunchType
import Amazonka.CloudWatchEvents.Types.NetworkConfiguration
import Amazonka.CloudWatchEvents.Types.PlacementConstraint
import Amazonka.CloudWatchEvents.Types.PlacementStrategy
import Amazonka.CloudWatchEvents.Types.PropagateTags
import Amazonka.CloudWatchEvents.Types.Tag
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The custom parameters to be used when the target is an Amazon ECS task.
--
-- /See:/ 'newEcsParameters' smart constructor.
data EcsParameters = EcsParameters'
  { -- | Specifies an ECS task group for the task. The maximum length is 255
    -- characters.
    EcsParameters -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to propagate the tags from the task definition to the
    -- task. If no value is specified, the tags are not propagated. Tags can
    -- only be propagated to the task during task creation. To add tags to a
    -- task after task creation, use the TagResource API action.
    EcsParameters -> Maybe PropagateTags
propagateTags :: Prelude.Maybe PropagateTags,
    -- | Specifies the platform version for the task. Specify only the numeric
    -- portion of the platform version, such as @1.1.0@.
    --
    -- This structure is used only if @LaunchType@ is @FARGATE@. For more
    -- information about valid platform versions, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    EcsParameters -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to enable Amazon ECS managed tags for the task. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
    -- in the Amazon Elastic Container Service Developer Guide.
    EcsParameters -> Maybe Bool
enableECSManagedTags :: Prelude.Maybe Prelude.Bool,
    -- | The reference ID to use for the task.
    EcsParameters -> Maybe Text
referenceId :: Prelude.Maybe Prelude.Text,
    -- | An array of placement constraint objects to use for the task. You can
    -- specify up to 10 constraints per task (including constraints in the task
    -- definition and those specified at runtime).
    EcsParameters -> Maybe [PlacementConstraint]
placementConstraints :: Prelude.Maybe [PlacementConstraint],
    -- | The placement strategy objects to use for the task. You can specify a
    -- maximum of five strategy rules per task.
    EcsParameters -> Maybe [PlacementStrategy]
placementStrategy :: Prelude.Maybe [PlacementStrategy],
    -- | Specifies the launch type on which your task is running. The launch type
    -- that you specify here must match one of the launch type
    -- (compatibilities) of the target task. The @FARGATE@ value is supported
    -- only in the Regions where Fargate witt Amazon ECS is supported. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html Fargate on Amazon ECS>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    EcsParameters -> Maybe LaunchType
launchType :: Prelude.Maybe LaunchType,
    -- | The capacity provider strategy to use for the task.
    --
    -- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
    -- must be omitted. If no @capacityProviderStrategy@ or launchType is
    -- specified, the @defaultCapacityProviderStrategy@ for the cluster is
    -- used.
    EcsParameters -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem],
    -- | The number of tasks to create based on @TaskDefinition@. The default is
    -- 1.
    EcsParameters -> Maybe Natural
taskCount :: Prelude.Maybe Prelude.Natural,
    -- | Use this structure if the Amazon ECS task uses the @awsvpc@ network
    -- mode. This structure specifies the VPC subnets and security groups
    -- associated with the task, and whether a public IP address is to be used.
    -- This structure is required if @LaunchType@ is @FARGATE@ because the
    -- @awsvpc@ mode is required for Fargate tasks.
    --
    -- If you specify @NetworkConfiguration@ when the target ECS task does not
    -- use the @awsvpc@ network mode, the task fails.
    EcsParameters -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | 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. To learn more, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags RunTask>
    -- in the Amazon ECS API Reference.
    EcsParameters -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Whether or not to enable the execute command functionality for the
    -- containers in this task. If true, this enables execute command
    -- functionality on all containers in the task.
    EcsParameters -> Maybe Bool
enableExecuteCommand :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the task definition to use if the event target is an Amazon
    -- ECS task.
    EcsParameters -> Text
taskDefinitionArn :: Prelude.Text
  }
  deriving (EcsParameters -> EcsParameters -> Bool
(EcsParameters -> EcsParameters -> Bool)
-> (EcsParameters -> EcsParameters -> Bool) -> Eq EcsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EcsParameters -> EcsParameters -> Bool
$c/= :: EcsParameters -> EcsParameters -> Bool
== :: EcsParameters -> EcsParameters -> Bool
$c== :: EcsParameters -> EcsParameters -> Bool
Prelude.Eq, ReadPrec [EcsParameters]
ReadPrec EcsParameters
Int -> ReadS EcsParameters
ReadS [EcsParameters]
(Int -> ReadS EcsParameters)
-> ReadS [EcsParameters]
-> ReadPrec EcsParameters
-> ReadPrec [EcsParameters]
-> Read EcsParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EcsParameters]
$creadListPrec :: ReadPrec [EcsParameters]
readPrec :: ReadPrec EcsParameters
$creadPrec :: ReadPrec EcsParameters
readList :: ReadS [EcsParameters]
$creadList :: ReadS [EcsParameters]
readsPrec :: Int -> ReadS EcsParameters
$creadsPrec :: Int -> ReadS EcsParameters
Prelude.Read, Int -> EcsParameters -> ShowS
[EcsParameters] -> ShowS
EcsParameters -> String
(Int -> EcsParameters -> ShowS)
-> (EcsParameters -> String)
-> ([EcsParameters] -> ShowS)
-> Show EcsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EcsParameters] -> ShowS
$cshowList :: [EcsParameters] -> ShowS
show :: EcsParameters -> String
$cshow :: EcsParameters -> String
showsPrec :: Int -> EcsParameters -> ShowS
$cshowsPrec :: Int -> EcsParameters -> ShowS
Prelude.Show, (forall x. EcsParameters -> Rep EcsParameters x)
-> (forall x. Rep EcsParameters x -> EcsParameters)
-> Generic EcsParameters
forall x. Rep EcsParameters x -> EcsParameters
forall x. EcsParameters -> Rep EcsParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EcsParameters x -> EcsParameters
$cfrom :: forall x. EcsParameters -> Rep EcsParameters x
Prelude.Generic)

-- |
-- Create a value of 'EcsParameters' 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:
--
-- 'group'', 'ecsParameters_group' - Specifies an ECS task group for the task. The maximum length is 255
-- characters.
--
-- 'propagateTags', 'ecsParameters_propagateTags' - Specifies whether to propagate the tags from the task definition to the
-- task. If no value is specified, the tags are not propagated. Tags can
-- only be propagated to the task during task creation. To add tags to a
-- task after task creation, use the TagResource API action.
--
-- 'platformVersion', 'ecsParameters_platformVersion' - Specifies the platform version for the task. Specify only the numeric
-- portion of the platform version, such as @1.1.0@.
--
-- This structure is used only if @LaunchType@ is @FARGATE@. For more
-- information about valid platform versions, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'enableECSManagedTags', 'ecsParameters_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', 'ecsParameters_referenceId' - The reference ID to use for the task.
--
-- 'placementConstraints', 'ecsParameters_placementConstraints' - An array of placement constraint objects to use for the task. You can
-- specify up to 10 constraints per task (including constraints in the task
-- definition and those specified at runtime).
--
-- 'placementStrategy', 'ecsParameters_placementStrategy' - The placement strategy objects to use for the task. You can specify a
-- maximum of five strategy rules per task.
--
-- 'launchType', 'ecsParameters_launchType' - Specifies the launch type on which your task is running. The launch type
-- that you specify here must match one of the launch type
-- (compatibilities) of the target task. The @FARGATE@ value is supported
-- only in the Regions where Fargate witt Amazon ECS is supported. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html Fargate on Amazon ECS>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'capacityProviderStrategy', 'ecsParameters_capacityProviderStrategy' - The capacity provider strategy to use for the task.
--
-- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
-- must be omitted. If no @capacityProviderStrategy@ or launchType is
-- specified, the @defaultCapacityProviderStrategy@ for the cluster is
-- used.
--
-- 'taskCount', 'ecsParameters_taskCount' - The number of tasks to create based on @TaskDefinition@. The default is
-- 1.
--
-- 'networkConfiguration', 'ecsParameters_networkConfiguration' - Use this structure if the Amazon ECS task uses the @awsvpc@ network
-- mode. This structure specifies the VPC subnets and security groups
-- associated with the task, and whether a public IP address is to be used.
-- This structure is required if @LaunchType@ is @FARGATE@ because the
-- @awsvpc@ mode is required for Fargate tasks.
--
-- If you specify @NetworkConfiguration@ when the target ECS task does not
-- use the @awsvpc@ network mode, the task fails.
--
-- 'tags', 'ecsParameters_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. To learn more, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags RunTask>
-- in the Amazon ECS API Reference.
--
-- 'enableExecuteCommand', 'ecsParameters_enableExecuteCommand' - Whether or not to enable the execute command functionality for the
-- containers in this task. If true, this enables execute command
-- functionality on all containers in the task.
--
-- 'taskDefinitionArn', 'ecsParameters_taskDefinitionArn' - The ARN of the task definition to use if the event target is an Amazon
-- ECS task.
newEcsParameters ::
  -- | 'taskDefinitionArn'
  Prelude.Text ->
  EcsParameters
newEcsParameters :: Text -> EcsParameters
newEcsParameters Text
pTaskDefinitionArn_ =
  EcsParameters' :: Maybe Text
-> Maybe PropagateTags
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [PlacementConstraint]
-> Maybe [PlacementStrategy]
-> Maybe LaunchType
-> Maybe [CapacityProviderStrategyItem]
-> Maybe Natural
-> Maybe NetworkConfiguration
-> Maybe [Tag]
-> Maybe Bool
-> Text
-> EcsParameters
EcsParameters'
    { $sel:group':EcsParameters' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:propagateTags:EcsParameters' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
forall a. Maybe a
Prelude.Nothing,
      $sel:platformVersion:EcsParameters' :: Maybe Text
platformVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableECSManagedTags:EcsParameters' :: Maybe Bool
enableECSManagedTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:referenceId:EcsParameters' :: Maybe Text
referenceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:placementConstraints:EcsParameters' :: Maybe [PlacementConstraint]
placementConstraints = Maybe [PlacementConstraint]
forall a. Maybe a
Prelude.Nothing,
      $sel:placementStrategy:EcsParameters' :: Maybe [PlacementStrategy]
placementStrategy = Maybe [PlacementStrategy]
forall a. Maybe a
Prelude.Nothing,
      $sel:launchType:EcsParameters' :: Maybe LaunchType
launchType = Maybe LaunchType
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviderStrategy:EcsParameters' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskCount:EcsParameters' :: Maybe Natural
taskCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:EcsParameters' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:EcsParameters' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableExecuteCommand:EcsParameters' :: Maybe Bool
enableExecuteCommand = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:taskDefinitionArn:EcsParameters' :: Text
taskDefinitionArn = Text
pTaskDefinitionArn_
    }

-- | Specifies an ECS task group for the task. The maximum length is 255
-- characters.
ecsParameters_group :: Lens.Lens' EcsParameters (Prelude.Maybe Prelude.Text)
ecsParameters_group :: (Maybe Text -> f (Maybe Text)) -> EcsParameters -> f EcsParameters
ecsParameters_group = (EcsParameters -> Maybe Text)
-> (EcsParameters -> Maybe Text -> EcsParameters)
-> Lens EcsParameters EcsParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe Text
group' :: Maybe Text
$sel:group':EcsParameters' :: EcsParameters -> Maybe Text
group'} -> Maybe Text
group') (\s :: EcsParameters
s@EcsParameters' {} Maybe Text
a -> EcsParameters
s {$sel:group':EcsParameters' :: Maybe Text
group' = Maybe Text
a} :: EcsParameters)

-- | Specifies whether to propagate the tags from the task definition to the
-- task. If no value is specified, the tags are not propagated. Tags can
-- only be propagated to the task during task creation. To add tags to a
-- task after task creation, use the TagResource API action.
ecsParameters_propagateTags :: Lens.Lens' EcsParameters (Prelude.Maybe PropagateTags)
ecsParameters_propagateTags :: (Maybe PropagateTags -> f (Maybe PropagateTags))
-> EcsParameters -> f EcsParameters
ecsParameters_propagateTags = (EcsParameters -> Maybe PropagateTags)
-> (EcsParameters -> Maybe PropagateTags -> EcsParameters)
-> Lens
     EcsParameters
     EcsParameters
     (Maybe PropagateTags)
     (Maybe PropagateTags)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe PropagateTags
propagateTags :: Maybe PropagateTags
$sel:propagateTags:EcsParameters' :: EcsParameters -> Maybe PropagateTags
propagateTags} -> Maybe PropagateTags
propagateTags) (\s :: EcsParameters
s@EcsParameters' {} Maybe PropagateTags
a -> EcsParameters
s {$sel:propagateTags:EcsParameters' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
a} :: EcsParameters)

-- | Specifies the platform version for the task. Specify only the numeric
-- portion of the platform version, such as @1.1.0@.
--
-- This structure is used only if @LaunchType@ is @FARGATE@. For more
-- information about valid platform versions, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
ecsParameters_platformVersion :: Lens.Lens' EcsParameters (Prelude.Maybe Prelude.Text)
ecsParameters_platformVersion :: (Maybe Text -> f (Maybe Text)) -> EcsParameters -> f EcsParameters
ecsParameters_platformVersion = (EcsParameters -> Maybe Text)
-> (EcsParameters -> Maybe Text -> EcsParameters)
-> Lens EcsParameters EcsParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:EcsParameters' :: EcsParameters -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: EcsParameters
s@EcsParameters' {} Maybe Text
a -> EcsParameters
s {$sel:platformVersion:EcsParameters' :: Maybe Text
platformVersion = Maybe Text
a} :: EcsParameters)

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

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

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

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

-- | Specifies the launch type on which your task is running. The launch type
-- that you specify here must match one of the launch type
-- (compatibilities) of the target task. The @FARGATE@ value is supported
-- only in the Regions where Fargate witt Amazon ECS is supported. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html Fargate on Amazon ECS>
-- in the /Amazon Elastic Container Service Developer Guide/.
ecsParameters_launchType :: Lens.Lens' EcsParameters (Prelude.Maybe LaunchType)
ecsParameters_launchType :: (Maybe LaunchType -> f (Maybe LaunchType))
-> EcsParameters -> f EcsParameters
ecsParameters_launchType = (EcsParameters -> Maybe LaunchType)
-> (EcsParameters -> Maybe LaunchType -> EcsParameters)
-> Lens
     EcsParameters EcsParameters (Maybe LaunchType) (Maybe LaunchType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe LaunchType
launchType :: Maybe LaunchType
$sel:launchType:EcsParameters' :: EcsParameters -> Maybe LaunchType
launchType} -> Maybe LaunchType
launchType) (\s :: EcsParameters
s@EcsParameters' {} Maybe LaunchType
a -> EcsParameters
s {$sel:launchType:EcsParameters' :: Maybe LaunchType
launchType = Maybe LaunchType
a} :: EcsParameters)

-- | The capacity provider strategy to use for the task.
--
-- If a @capacityProviderStrategy@ is specified, the @launchType@ parameter
-- must be omitted. If no @capacityProviderStrategy@ or launchType is
-- specified, the @defaultCapacityProviderStrategy@ for the cluster is
-- used.
ecsParameters_capacityProviderStrategy :: Lens.Lens' EcsParameters (Prelude.Maybe [CapacityProviderStrategyItem])
ecsParameters_capacityProviderStrategy :: (Maybe [CapacityProviderStrategyItem]
 -> f (Maybe [CapacityProviderStrategyItem]))
-> EcsParameters -> f EcsParameters
ecsParameters_capacityProviderStrategy = (EcsParameters -> Maybe [CapacityProviderStrategyItem])
-> (EcsParameters
    -> Maybe [CapacityProviderStrategyItem] -> EcsParameters)
-> Lens
     EcsParameters
     EcsParameters
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:capacityProviderStrategy:EcsParameters' :: EcsParameters -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy) (\s :: EcsParameters
s@EcsParameters' {} Maybe [CapacityProviderStrategyItem]
a -> EcsParameters
s {$sel:capacityProviderStrategy:EcsParameters' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: EcsParameters) ((Maybe [CapacityProviderStrategyItem]
  -> f (Maybe [CapacityProviderStrategyItem]))
 -> EcsParameters -> f EcsParameters)
-> ((Maybe [CapacityProviderStrategyItem]
     -> f (Maybe [CapacityProviderStrategyItem]))
    -> Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> (Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> EcsParameters
-> f EcsParameters
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 number of tasks to create based on @TaskDefinition@. The default is
-- 1.
ecsParameters_taskCount :: Lens.Lens' EcsParameters (Prelude.Maybe Prelude.Natural)
ecsParameters_taskCount :: (Maybe Natural -> f (Maybe Natural))
-> EcsParameters -> f EcsParameters
ecsParameters_taskCount = (EcsParameters -> Maybe Natural)
-> (EcsParameters -> Maybe Natural -> EcsParameters)
-> Lens EcsParameters EcsParameters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe Natural
taskCount :: Maybe Natural
$sel:taskCount:EcsParameters' :: EcsParameters -> Maybe Natural
taskCount} -> Maybe Natural
taskCount) (\s :: EcsParameters
s@EcsParameters' {} Maybe Natural
a -> EcsParameters
s {$sel:taskCount:EcsParameters' :: Maybe Natural
taskCount = Maybe Natural
a} :: EcsParameters)

-- | Use this structure if the Amazon ECS task uses the @awsvpc@ network
-- mode. This structure specifies the VPC subnets and security groups
-- associated with the task, and whether a public IP address is to be used.
-- This structure is required if @LaunchType@ is @FARGATE@ because the
-- @awsvpc@ mode is required for Fargate tasks.
--
-- If you specify @NetworkConfiguration@ when the target ECS task does not
-- use the @awsvpc@ network mode, the task fails.
ecsParameters_networkConfiguration :: Lens.Lens' EcsParameters (Prelude.Maybe NetworkConfiguration)
ecsParameters_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> EcsParameters -> f EcsParameters
ecsParameters_networkConfiguration = (EcsParameters -> Maybe NetworkConfiguration)
-> (EcsParameters -> Maybe NetworkConfiguration -> EcsParameters)
-> Lens
     EcsParameters
     EcsParameters
     (Maybe NetworkConfiguration)
     (Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:EcsParameters' :: EcsParameters -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: EcsParameters
s@EcsParameters' {} Maybe NetworkConfiguration
a -> EcsParameters
s {$sel:networkConfiguration:EcsParameters' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: EcsParameters)

-- | 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. To learn more, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags RunTask>
-- in the Amazon ECS API Reference.
ecsParameters_tags :: Lens.Lens' EcsParameters (Prelude.Maybe [Tag])
ecsParameters_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> EcsParameters -> f EcsParameters
ecsParameters_tags = (EcsParameters -> Maybe [Tag])
-> (EcsParameters -> Maybe [Tag] -> EcsParameters)
-> Lens EcsParameters EcsParameters (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:EcsParameters' :: EcsParameters -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: EcsParameters
s@EcsParameters' {} Maybe [Tag]
a -> EcsParameters
s {$sel:tags:EcsParameters' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: EcsParameters) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> EcsParameters -> f EcsParameters)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> EcsParameters
-> f EcsParameters
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

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

-- | The ARN of the task definition to use if the event target is an Amazon
-- ECS task.
ecsParameters_taskDefinitionArn :: Lens.Lens' EcsParameters Prelude.Text
ecsParameters_taskDefinitionArn :: (Text -> f Text) -> EcsParameters -> f EcsParameters
ecsParameters_taskDefinitionArn = (EcsParameters -> Text)
-> (EcsParameters -> Text -> EcsParameters)
-> Lens EcsParameters EcsParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsParameters' {Text
taskDefinitionArn :: Text
$sel:taskDefinitionArn:EcsParameters' :: EcsParameters -> Text
taskDefinitionArn} -> Text
taskDefinitionArn) (\s :: EcsParameters
s@EcsParameters' {} Text
a -> EcsParameters
s {$sel:taskDefinitionArn:EcsParameters' :: Text
taskDefinitionArn = Text
a} :: EcsParameters)

instance Core.FromJSON EcsParameters where
  parseJSON :: Value -> Parser EcsParameters
parseJSON =
    String
-> (Object -> Parser EcsParameters)
-> Value
-> Parser EcsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EcsParameters"
      ( \Object
x ->
          Maybe Text
-> Maybe PropagateTags
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [PlacementConstraint]
-> Maybe [PlacementStrategy]
-> Maybe LaunchType
-> Maybe [CapacityProviderStrategyItem]
-> Maybe Natural
-> Maybe NetworkConfiguration
-> Maybe [Tag]
-> Maybe Bool
-> Text
-> EcsParameters
EcsParameters'
            (Maybe Text
 -> Maybe PropagateTags
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [PlacementConstraint]
 -> Maybe [PlacementStrategy]
 -> Maybe LaunchType
 -> Maybe [CapacityProviderStrategyItem]
 -> Maybe Natural
 -> Maybe NetworkConfiguration
 -> Maybe [Tag]
 -> Maybe Bool
 -> Text
 -> EcsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe PropagateTags
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [PlacementConstraint]
      -> Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Group")
            Parser
  (Maybe PropagateTags
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [PlacementConstraint]
   -> Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe PropagateTags)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [PlacementConstraint]
      -> Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PropagateTags)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PropagateTags")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [PlacementConstraint]
   -> Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [PlacementConstraint]
      -> Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlatformVersion")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [PlacementConstraint]
   -> Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [PlacementConstraint]
      -> Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnableECSManagedTags")
            Parser
  (Maybe Text
   -> Maybe [PlacementConstraint]
   -> Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe [PlacementConstraint]
      -> Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReferenceId")
            Parser
  (Maybe [PlacementConstraint]
   -> Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe [PlacementConstraint])
-> Parser
     (Maybe [PlacementStrategy]
      -> Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlacementConstraint]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlacementConstraints"
                            Parser (Maybe (Maybe [PlacementConstraint]))
-> Maybe [PlacementConstraint]
-> Parser (Maybe [PlacementConstraint])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlacementConstraint]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [PlacementStrategy]
   -> Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe [PlacementStrategy])
-> Parser
     (Maybe LaunchType
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlacementStrategy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlacementStrategy"
                            Parser (Maybe (Maybe [PlacementStrategy]))
-> Maybe [PlacementStrategy] -> Parser (Maybe [PlacementStrategy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlacementStrategy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe LaunchType
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe LaunchType)
-> Parser
     (Maybe [CapacityProviderStrategyItem]
      -> Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LaunchType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LaunchType")
            Parser
  (Maybe [CapacityProviderStrategyItem]
   -> Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe [CapacityProviderStrategyItem])
-> Parser
     (Maybe Natural
      -> Maybe NetworkConfiguration
      -> Maybe [Tag]
      -> Maybe Bool
      -> Text
      -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [CapacityProviderStrategyItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CapacityProviderStrategy"
                            Parser (Maybe (Maybe [CapacityProviderStrategyItem]))
-> Maybe [CapacityProviderStrategyItem]
-> Parser (Maybe [CapacityProviderStrategyItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CapacityProviderStrategyItem]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Natural
   -> Maybe NetworkConfiguration
   -> Maybe [Tag]
   -> Maybe Bool
   -> Text
   -> EcsParameters)
-> Parser (Maybe Natural)
-> Parser
     (Maybe NetworkConfiguration
      -> Maybe [Tag] -> Maybe Bool -> Text -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskCount")
            Parser
  (Maybe NetworkConfiguration
   -> Maybe [Tag] -> Maybe Bool -> Text -> EcsParameters)
-> Parser (Maybe NetworkConfiguration)
-> Parser (Maybe [Tag] -> Maybe Bool -> Text -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NetworkConfiguration")
            Parser (Maybe [Tag] -> Maybe Bool -> Text -> EcsParameters)
-> Parser (Maybe [Tag])
-> Parser (Maybe Bool -> Text -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Bool -> Text -> EcsParameters)
-> Parser (Maybe Bool) -> Parser (Text -> EcsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnableExecuteCommand")
            Parser (Text -> EcsParameters)
-> Parser Text -> Parser EcsParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TaskDefinitionArn")
      )

instance Prelude.Hashable EcsParameters

instance Prelude.NFData EcsParameters

instance Core.ToJSON EcsParameters where
  toJSON :: EcsParameters -> Value
toJSON EcsParameters' {Maybe Bool
Maybe Natural
Maybe [CapacityProviderStrategyItem]
Maybe [PlacementConstraint]
Maybe [PlacementStrategy]
Maybe [Tag]
Maybe Text
Maybe LaunchType
Maybe NetworkConfiguration
Maybe PropagateTags
Text
taskDefinitionArn :: Text
enableExecuteCommand :: Maybe Bool
tags :: Maybe [Tag]
networkConfiguration :: Maybe NetworkConfiguration
taskCount :: Maybe Natural
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
launchType :: Maybe LaunchType
placementStrategy :: Maybe [PlacementStrategy]
placementConstraints :: Maybe [PlacementConstraint]
referenceId :: Maybe Text
enableECSManagedTags :: Maybe Bool
platformVersion :: Maybe Text
propagateTags :: Maybe PropagateTags
group' :: Maybe Text
$sel:taskDefinitionArn:EcsParameters' :: EcsParameters -> Text
$sel:enableExecuteCommand:EcsParameters' :: EcsParameters -> Maybe Bool
$sel:tags:EcsParameters' :: EcsParameters -> Maybe [Tag]
$sel:networkConfiguration:EcsParameters' :: EcsParameters -> Maybe NetworkConfiguration
$sel:taskCount:EcsParameters' :: EcsParameters -> Maybe Natural
$sel:capacityProviderStrategy:EcsParameters' :: EcsParameters -> Maybe [CapacityProviderStrategyItem]
$sel:launchType:EcsParameters' :: EcsParameters -> Maybe LaunchType
$sel:placementStrategy:EcsParameters' :: EcsParameters -> Maybe [PlacementStrategy]
$sel:placementConstraints:EcsParameters' :: EcsParameters -> Maybe [PlacementConstraint]
$sel:referenceId:EcsParameters' :: EcsParameters -> Maybe Text
$sel:enableECSManagedTags:EcsParameters' :: EcsParameters -> Maybe Bool
$sel:platformVersion:EcsParameters' :: EcsParameters -> Maybe Text
$sel:propagateTags:EcsParameters' :: EcsParameters -> Maybe PropagateTags
$sel:group':EcsParameters' :: EcsParameters -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"PropagateTags" Text -> PropagateTags -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PropagateTags -> Pair) -> Maybe PropagateTags -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PropagateTags
propagateTags,
            (Text
"PlatformVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platformVersion,
            (Text
"EnableECSManagedTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableECSManagedTags,
            (Text
"ReferenceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
referenceId,
            (Text
"PlacementConstraints" Text -> [PlacementConstraint] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlacementConstraint] -> Pair)
-> Maybe [PlacementConstraint] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementConstraint]
placementConstraints,
            (Text
"PlacementStrategy" Text -> [PlacementStrategy] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlacementStrategy] -> Pair)
-> Maybe [PlacementStrategy] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementStrategy]
placementStrategy,
            (Text
"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
"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
"TaskCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
taskCount,
            (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
"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,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TaskDefinitionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskDefinitionArn)
          ]
      )