{-# 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.ECS.Types.Cluster
-- 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.ECS.Types.Cluster where

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.Attachment
import Amazonka.ECS.Types.CapacityProviderStrategyItem
import Amazonka.ECS.Types.ClusterConfiguration
import Amazonka.ECS.Types.ClusterSetting
import Amazonka.ECS.Types.KeyValuePair
import Amazonka.ECS.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A regional grouping of one or more container instances on which you can
-- run task requests. Each account receives a default cluster the first
-- time you use the Amazon ECS service, but you may also create other
-- clusters. Clusters may contain more than one instance type
-- simultaneously.
--
-- /See:/ 'newCluster' smart constructor.
data Cluster = Cluster'
  { -- | The status of the cluster. The following are the possible states that
    -- will be returned.
    --
    -- [ACTIVE]
    --     The cluster is ready to accept tasks and if applicable you can
    --     register container instances with the cluster.
    --
    -- [PROVISIONING]
    --     The cluster has capacity providers associated with it and the
    --     resources needed for the capacity provider are being created.
    --
    -- [DEPROVISIONING]
    --     The cluster has capacity providers associated with it and the
    --     resources needed for the capacity provider are being deleted.
    --
    -- [FAILED]
    --     The cluster has capacity providers associated with it and the
    --     resources needed for the capacity provider have failed to create.
    --
    -- [INACTIVE]
    --     The cluster has been deleted. Clusters with an @INACTIVE@ status may
    --     remain discoverable in your account for a period of time. However,
    --     this behavior is subject to change in the future, so you should not
    --     rely on @INACTIVE@ clusters persisting.
    Cluster -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) that identifies the cluster. The ARN
    -- contains the @arn:aws:ecs@ namespace, followed by the Region of the
    -- cluster, the Amazon Web Services account ID of the cluster owner, the
    -- @cluster@ namespace, and then the cluster name. For example,
    -- @arn:aws:ecs:region:012345678910:cluster\/test@.
    Cluster -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
    -- | The resources attached to a cluster. When using a capacity provider with
    -- a cluster, the Auto Scaling plan that is created will be returned as a
    -- cluster attachment.
    Cluster -> Maybe [Attachment]
attachments :: Prelude.Maybe [Attachment],
    -- | The number of tasks in the cluster that are in the @RUNNING@ state.
    Cluster -> Maybe Int
runningTasksCount :: Prelude.Maybe Prelude.Int,
    -- | The default capacity provider strategy for the cluster. When services or
    -- tasks are run in the cluster with no launch type or capacity provider
    -- strategy specified, the default capacity provider strategy is used.
    Cluster -> Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem],
    -- | The settings for the cluster. This parameter indicates whether
    -- CloudWatch Container Insights is enabled or disabled for a cluster.
    Cluster -> Maybe [ClusterSetting]
settings :: Prelude.Maybe [ClusterSetting],
    -- | The number of container instances registered into the cluster. This
    -- includes container instances in both @ACTIVE@ and @DRAINING@ status.
    Cluster -> Maybe Int
registeredContainerInstancesCount :: Prelude.Maybe Prelude.Int,
    -- | The number of tasks in the cluster that are in the @PENDING@ state.
    Cluster -> Maybe Int
pendingTasksCount :: Prelude.Maybe Prelude.Int,
    -- | A user-generated string that you use to identify your cluster.
    Cluster -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
    -- | Additional information about your clusters that are separated by launch
    -- type, including:
    --
    -- -   runningEC2TasksCount
    --
    -- -   RunningFargateTasksCount
    --
    -- -   pendingEC2TasksCount
    --
    -- -   pendingFargateTasksCount
    --
    -- -   activeEC2ServiceCount
    --
    -- -   activeFargateServiceCount
    --
    -- -   drainingEC2ServiceCount
    --
    -- -   drainingFargateServiceCount
    Cluster -> Maybe [KeyValuePair]
statistics :: Prelude.Maybe [KeyValuePair],
    -- | The execute command configuration for the cluster.
    Cluster -> Maybe ClusterConfiguration
configuration :: Prelude.Maybe ClusterConfiguration,
    -- | The status of the capacity providers associated with the cluster. The
    -- following are the states that will be returned:
    --
    -- [UPDATE_IN_PROGRESS]
    --     The available capacity providers for the cluster are updating. This
    --     occurs when the Auto Scaling plan is provisioning or deprovisioning.
    --
    -- [UPDATE_COMPLETE]
    --     The capacity providers have successfully updated.
    --
    -- [UPDATE_FAILED]
    --     The capacity provider updates failed.
    Cluster -> Maybe Text
attachmentsStatus :: Prelude.Maybe Prelude.Text,
    -- | The capacity providers associated with the cluster.
    Cluster -> Maybe [Text]
capacityProviders :: Prelude.Maybe [Prelude.Text],
    -- | The number of services that are running on the cluster in an @ACTIVE@
    -- state. You can view these services with ListServices.
    Cluster -> Maybe Int
activeServicesCount :: Prelude.Maybe Prelude.Int,
    -- | The metadata that you apply to the cluster to help you categorize and
    -- organize them. Each tag consists of a key and an optional value, both of
    -- which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case-sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for either keys or values as it is reserved for
    --     Amazon Web Services use. You cannot edit or delete tag keys or
    --     values with this prefix. Tags with this prefix do not count against
    --     your tags per resource limit.
    Cluster -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (Cluster -> Cluster -> Bool
(Cluster -> Cluster -> Bool)
-> (Cluster -> Cluster -> Bool) -> Eq Cluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Cluster -> Cluster -> Bool
$c/= :: Cluster -> Cluster -> Bool
== :: Cluster -> Cluster -> Bool
$c== :: Cluster -> Cluster -> Bool
Prelude.Eq, ReadPrec [Cluster]
ReadPrec Cluster
Int -> ReadS Cluster
ReadS [Cluster]
(Int -> ReadS Cluster)
-> ReadS [Cluster]
-> ReadPrec Cluster
-> ReadPrec [Cluster]
-> Read Cluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Cluster]
$creadListPrec :: ReadPrec [Cluster]
readPrec :: ReadPrec Cluster
$creadPrec :: ReadPrec Cluster
readList :: ReadS [Cluster]
$creadList :: ReadS [Cluster]
readsPrec :: Int -> ReadS Cluster
$creadsPrec :: Int -> ReadS Cluster
Prelude.Read, Int -> Cluster -> ShowS
[Cluster] -> ShowS
Cluster -> String
(Int -> Cluster -> ShowS)
-> (Cluster -> String) -> ([Cluster] -> ShowS) -> Show Cluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cluster] -> ShowS
$cshowList :: [Cluster] -> ShowS
show :: Cluster -> String
$cshow :: Cluster -> String
showsPrec :: Int -> Cluster -> ShowS
$cshowsPrec :: Int -> Cluster -> ShowS
Prelude.Show, (forall x. Cluster -> Rep Cluster x)
-> (forall x. Rep Cluster x -> Cluster) -> Generic Cluster
forall x. Rep Cluster x -> Cluster
forall x. Cluster -> Rep Cluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Cluster x -> Cluster
$cfrom :: forall x. Cluster -> Rep Cluster x
Prelude.Generic)

-- |
-- Create a value of 'Cluster' 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:
--
-- 'status', 'cluster_status' - The status of the cluster. The following are the possible states that
-- will be returned.
--
-- [ACTIVE]
--     The cluster is ready to accept tasks and if applicable you can
--     register container instances with the cluster.
--
-- [PROVISIONING]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider are being created.
--
-- [DEPROVISIONING]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider are being deleted.
--
-- [FAILED]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider have failed to create.
--
-- [INACTIVE]
--     The cluster has been deleted. Clusters with an @INACTIVE@ status may
--     remain discoverable in your account for a period of time. However,
--     this behavior is subject to change in the future, so you should not
--     rely on @INACTIVE@ clusters persisting.
--
-- 'clusterArn', 'cluster_clusterArn' - The Amazon Resource Name (ARN) that identifies the cluster. The ARN
-- contains the @arn:aws:ecs@ namespace, followed by the Region of the
-- cluster, the Amazon Web Services account ID of the cluster owner, the
-- @cluster@ namespace, and then the cluster name. For example,
-- @arn:aws:ecs:region:012345678910:cluster\/test@.
--
-- 'attachments', 'cluster_attachments' - The resources attached to a cluster. When using a capacity provider with
-- a cluster, the Auto Scaling plan that is created will be returned as a
-- cluster attachment.
--
-- 'runningTasksCount', 'cluster_runningTasksCount' - The number of tasks in the cluster that are in the @RUNNING@ state.
--
-- 'defaultCapacityProviderStrategy', 'cluster_defaultCapacityProviderStrategy' - The default capacity provider strategy for the cluster. When services or
-- tasks are run in the cluster with no launch type or capacity provider
-- strategy specified, the default capacity provider strategy is used.
--
-- 'settings', 'cluster_settings' - The settings for the cluster. This parameter indicates whether
-- CloudWatch Container Insights is enabled or disabled for a cluster.
--
-- 'registeredContainerInstancesCount', 'cluster_registeredContainerInstancesCount' - The number of container instances registered into the cluster. This
-- includes container instances in both @ACTIVE@ and @DRAINING@ status.
--
-- 'pendingTasksCount', 'cluster_pendingTasksCount' - The number of tasks in the cluster that are in the @PENDING@ state.
--
-- 'clusterName', 'cluster_clusterName' - A user-generated string that you use to identify your cluster.
--
-- 'statistics', 'cluster_statistics' - Additional information about your clusters that are separated by launch
-- type, including:
--
-- -   runningEC2TasksCount
--
-- -   RunningFargateTasksCount
--
-- -   pendingEC2TasksCount
--
-- -   pendingFargateTasksCount
--
-- -   activeEC2ServiceCount
--
-- -   activeFargateServiceCount
--
-- -   drainingEC2ServiceCount
--
-- -   drainingFargateServiceCount
--
-- 'configuration', 'cluster_configuration' - The execute command configuration for the cluster.
--
-- 'attachmentsStatus', 'cluster_attachmentsStatus' - The status of the capacity providers associated with the cluster. The
-- following are the states that will be returned:
--
-- [UPDATE_IN_PROGRESS]
--     The available capacity providers for the cluster are updating. This
--     occurs when the Auto Scaling plan is provisioning or deprovisioning.
--
-- [UPDATE_COMPLETE]
--     The capacity providers have successfully updated.
--
-- [UPDATE_FAILED]
--     The capacity provider updates failed.
--
-- 'capacityProviders', 'cluster_capacityProviders' - The capacity providers associated with the cluster.
--
-- 'activeServicesCount', 'cluster_activeServicesCount' - The number of services that are running on the cluster in an @ACTIVE@
-- state. You can view these services with ListServices.
--
-- 'tags', 'cluster_tags' - The metadata that you apply to the cluster to help you categorize and
-- organize them. Each tag consists of a key and an optional value, both of
-- which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
newCluster ::
  Cluster
newCluster :: Cluster
newCluster =
  Cluster' :: Maybe Text
-> Maybe Text
-> Maybe [Attachment]
-> Maybe Int
-> Maybe [CapacityProviderStrategyItem]
-> Maybe [ClusterSetting]
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [KeyValuePair]
-> Maybe ClusterConfiguration
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe [Tag]
-> Cluster
Cluster'
    { $sel:status:Cluster' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterArn:Cluster' :: Maybe Text
clusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachments:Cluster' :: Maybe [Attachment]
attachments = Maybe [Attachment]
forall a. Maybe a
Prelude.Nothing,
      $sel:runningTasksCount:Cluster' :: Maybe Int
runningTasksCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultCapacityProviderStrategy:Cluster' :: Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:settings:Cluster' :: Maybe [ClusterSetting]
settings = Maybe [ClusterSetting]
forall a. Maybe a
Prelude.Nothing,
      $sel:registeredContainerInstancesCount:Cluster' :: Maybe Int
registeredContainerInstancesCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:pendingTasksCount:Cluster' :: Maybe Int
pendingTasksCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:Cluster' :: Maybe Text
clusterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statistics:Cluster' :: Maybe [KeyValuePair]
statistics = Maybe [KeyValuePair]
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:Cluster' :: Maybe ClusterConfiguration
configuration = Maybe ClusterConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentsStatus:Cluster' :: Maybe Text
attachmentsStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviders:Cluster' :: Maybe [Text]
capacityProviders = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:activeServicesCount:Cluster' :: Maybe Int
activeServicesCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Cluster' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the cluster. The following are the possible states that
-- will be returned.
--
-- [ACTIVE]
--     The cluster is ready to accept tasks and if applicable you can
--     register container instances with the cluster.
--
-- [PROVISIONING]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider are being created.
--
-- [DEPROVISIONING]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider are being deleted.
--
-- [FAILED]
--     The cluster has capacity providers associated with it and the
--     resources needed for the capacity provider have failed to create.
--
-- [INACTIVE]
--     The cluster has been deleted. Clusters with an @INACTIVE@ status may
--     remain discoverable in your account for a period of time. However,
--     this behavior is subject to change in the future, so you should not
--     rely on @INACTIVE@ clusters persisting.
cluster_status :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_status :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_status = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
status :: Maybe Text
$sel:status:Cluster' :: Cluster -> Maybe Text
status} -> Maybe Text
status) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:status:Cluster' :: Maybe Text
status = Maybe Text
a} :: Cluster)

-- | The Amazon Resource Name (ARN) that identifies the cluster. The ARN
-- contains the @arn:aws:ecs@ namespace, followed by the Region of the
-- cluster, the Amazon Web Services account ID of the cluster owner, the
-- @cluster@ namespace, and then the cluster name. For example,
-- @arn:aws:ecs:region:012345678910:cluster\/test@.
cluster_clusterArn :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_clusterArn :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_clusterArn = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:Cluster' :: Cluster -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:clusterArn:Cluster' :: Maybe Text
clusterArn = Maybe Text
a} :: Cluster)

-- | The resources attached to a cluster. When using a capacity provider with
-- a cluster, the Auto Scaling plan that is created will be returned as a
-- cluster attachment.
cluster_attachments :: Lens.Lens' Cluster (Prelude.Maybe [Attachment])
cluster_attachments :: (Maybe [Attachment] -> f (Maybe [Attachment]))
-> Cluster -> f Cluster
cluster_attachments = (Cluster -> Maybe [Attachment])
-> (Cluster -> Maybe [Attachment] -> Cluster)
-> Lens Cluster Cluster (Maybe [Attachment]) (Maybe [Attachment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [Attachment]
attachments :: Maybe [Attachment]
$sel:attachments:Cluster' :: Cluster -> Maybe [Attachment]
attachments} -> Maybe [Attachment]
attachments) (\s :: Cluster
s@Cluster' {} Maybe [Attachment]
a -> Cluster
s {$sel:attachments:Cluster' :: Maybe [Attachment]
attachments = Maybe [Attachment]
a} :: Cluster) ((Maybe [Attachment] -> f (Maybe [Attachment]))
 -> Cluster -> f Cluster)
-> ((Maybe [Attachment] -> f (Maybe [Attachment]))
    -> Maybe [Attachment] -> f (Maybe [Attachment]))
-> (Maybe [Attachment] -> f (Maybe [Attachment]))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attachment] [Attachment] [Attachment] [Attachment]
-> Iso
     (Maybe [Attachment])
     (Maybe [Attachment])
     (Maybe [Attachment])
     (Maybe [Attachment])
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 [Attachment] [Attachment] [Attachment] [Attachment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of tasks in the cluster that are in the @RUNNING@ state.
cluster_runningTasksCount :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_runningTasksCount :: (Maybe Int -> f (Maybe Int)) -> Cluster -> f Cluster
cluster_runningTasksCount = (Cluster -> Maybe Int)
-> (Cluster -> Maybe Int -> Cluster)
-> Lens Cluster Cluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
runningTasksCount :: Maybe Int
$sel:runningTasksCount:Cluster' :: Cluster -> Maybe Int
runningTasksCount} -> Maybe Int
runningTasksCount) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:runningTasksCount:Cluster' :: Maybe Int
runningTasksCount = Maybe Int
a} :: Cluster)

-- | The default capacity provider strategy for the cluster. When services or
-- tasks are run in the cluster with no launch type or capacity provider
-- strategy specified, the default capacity provider strategy is used.
cluster_defaultCapacityProviderStrategy :: Lens.Lens' Cluster (Prelude.Maybe [CapacityProviderStrategyItem])
cluster_defaultCapacityProviderStrategy :: (Maybe [CapacityProviderStrategyItem]
 -> f (Maybe [CapacityProviderStrategyItem]))
-> Cluster -> f Cluster
cluster_defaultCapacityProviderStrategy = (Cluster -> Maybe [CapacityProviderStrategyItem])
-> (Cluster -> Maybe [CapacityProviderStrategyItem] -> Cluster)
-> Lens
     Cluster
     Cluster
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:defaultCapacityProviderStrategy:Cluster' :: Cluster -> Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy) (\s :: Cluster
s@Cluster' {} Maybe [CapacityProviderStrategyItem]
a -> Cluster
s {$sel:defaultCapacityProviderStrategy:Cluster' :: Maybe [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: Cluster) ((Maybe [CapacityProviderStrategyItem]
  -> f (Maybe [CapacityProviderStrategyItem]))
 -> Cluster -> f Cluster)
-> ((Maybe [CapacityProviderStrategyItem]
     -> f (Maybe [CapacityProviderStrategyItem]))
    -> Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> (Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> Cluster
-> f Cluster
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 settings for the cluster. This parameter indicates whether
-- CloudWatch Container Insights is enabled or disabled for a cluster.
cluster_settings :: Lens.Lens' Cluster (Prelude.Maybe [ClusterSetting])
cluster_settings :: (Maybe [ClusterSetting] -> f (Maybe [ClusterSetting]))
-> Cluster -> f Cluster
cluster_settings = (Cluster -> Maybe [ClusterSetting])
-> (Cluster -> Maybe [ClusterSetting] -> Cluster)
-> Lens
     Cluster Cluster (Maybe [ClusterSetting]) (Maybe [ClusterSetting])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [ClusterSetting]
settings :: Maybe [ClusterSetting]
$sel:settings:Cluster' :: Cluster -> Maybe [ClusterSetting]
settings} -> Maybe [ClusterSetting]
settings) (\s :: Cluster
s@Cluster' {} Maybe [ClusterSetting]
a -> Cluster
s {$sel:settings:Cluster' :: Maybe [ClusterSetting]
settings = Maybe [ClusterSetting]
a} :: Cluster) ((Maybe [ClusterSetting] -> f (Maybe [ClusterSetting]))
 -> Cluster -> f Cluster)
-> ((Maybe [ClusterSetting] -> f (Maybe [ClusterSetting]))
    -> Maybe [ClusterSetting] -> f (Maybe [ClusterSetting]))
-> (Maybe [ClusterSetting] -> f (Maybe [ClusterSetting]))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterSetting] [ClusterSetting] [ClusterSetting] [ClusterSetting]
-> Iso
     (Maybe [ClusterSetting])
     (Maybe [ClusterSetting])
     (Maybe [ClusterSetting])
     (Maybe [ClusterSetting])
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
  [ClusterSetting] [ClusterSetting] [ClusterSetting] [ClusterSetting]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of container instances registered into the cluster. This
-- includes container instances in both @ACTIVE@ and @DRAINING@ status.
cluster_registeredContainerInstancesCount :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_registeredContainerInstancesCount :: (Maybe Int -> f (Maybe Int)) -> Cluster -> f Cluster
cluster_registeredContainerInstancesCount = (Cluster -> Maybe Int)
-> (Cluster -> Maybe Int -> Cluster)
-> Lens Cluster Cluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
registeredContainerInstancesCount :: Maybe Int
$sel:registeredContainerInstancesCount:Cluster' :: Cluster -> Maybe Int
registeredContainerInstancesCount} -> Maybe Int
registeredContainerInstancesCount) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:registeredContainerInstancesCount:Cluster' :: Maybe Int
registeredContainerInstancesCount = Maybe Int
a} :: Cluster)

-- | The number of tasks in the cluster that are in the @PENDING@ state.
cluster_pendingTasksCount :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_pendingTasksCount :: (Maybe Int -> f (Maybe Int)) -> Cluster -> f Cluster
cluster_pendingTasksCount = (Cluster -> Maybe Int)
-> (Cluster -> Maybe Int -> Cluster)
-> Lens Cluster Cluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
pendingTasksCount :: Maybe Int
$sel:pendingTasksCount:Cluster' :: Cluster -> Maybe Int
pendingTasksCount} -> Maybe Int
pendingTasksCount) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:pendingTasksCount:Cluster' :: Maybe Int
pendingTasksCount = Maybe Int
a} :: Cluster)

-- | A user-generated string that you use to identify your cluster.
cluster_clusterName :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_clusterName :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_clusterName = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
clusterName :: Maybe Text
$sel:clusterName:Cluster' :: Cluster -> Maybe Text
clusterName} -> Maybe Text
clusterName) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:clusterName:Cluster' :: Maybe Text
clusterName = Maybe Text
a} :: Cluster)

-- | Additional information about your clusters that are separated by launch
-- type, including:
--
-- -   runningEC2TasksCount
--
-- -   RunningFargateTasksCount
--
-- -   pendingEC2TasksCount
--
-- -   pendingFargateTasksCount
--
-- -   activeEC2ServiceCount
--
-- -   activeFargateServiceCount
--
-- -   drainingEC2ServiceCount
--
-- -   drainingFargateServiceCount
cluster_statistics :: Lens.Lens' Cluster (Prelude.Maybe [KeyValuePair])
cluster_statistics :: (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> Cluster -> f Cluster
cluster_statistics = (Cluster -> Maybe [KeyValuePair])
-> (Cluster -> Maybe [KeyValuePair] -> Cluster)
-> Lens
     Cluster Cluster (Maybe [KeyValuePair]) (Maybe [KeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [KeyValuePair]
statistics :: Maybe [KeyValuePair]
$sel:statistics:Cluster' :: Cluster -> Maybe [KeyValuePair]
statistics} -> Maybe [KeyValuePair]
statistics) (\s :: Cluster
s@Cluster' {} Maybe [KeyValuePair]
a -> Cluster
s {$sel:statistics:Cluster' :: Maybe [KeyValuePair]
statistics = Maybe [KeyValuePair]
a} :: Cluster) ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
 -> Cluster -> f Cluster)
-> ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
    -> Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
-> Iso
     (Maybe [KeyValuePair])
     (Maybe [KeyValuePair])
     (Maybe [KeyValuePair])
     (Maybe [KeyValuePair])
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 [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The execute command configuration for the cluster.
cluster_configuration :: Lens.Lens' Cluster (Prelude.Maybe ClusterConfiguration)
cluster_configuration :: (Maybe ClusterConfiguration -> f (Maybe ClusterConfiguration))
-> Cluster -> f Cluster
cluster_configuration = (Cluster -> Maybe ClusterConfiguration)
-> (Cluster -> Maybe ClusterConfiguration -> Cluster)
-> Lens
     Cluster
     Cluster
     (Maybe ClusterConfiguration)
     (Maybe ClusterConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe ClusterConfiguration
configuration :: Maybe ClusterConfiguration
$sel:configuration:Cluster' :: Cluster -> Maybe ClusterConfiguration
configuration} -> Maybe ClusterConfiguration
configuration) (\s :: Cluster
s@Cluster' {} Maybe ClusterConfiguration
a -> Cluster
s {$sel:configuration:Cluster' :: Maybe ClusterConfiguration
configuration = Maybe ClusterConfiguration
a} :: Cluster)

-- | The status of the capacity providers associated with the cluster. The
-- following are the states that will be returned:
--
-- [UPDATE_IN_PROGRESS]
--     The available capacity providers for the cluster are updating. This
--     occurs when the Auto Scaling plan is provisioning or deprovisioning.
--
-- [UPDATE_COMPLETE]
--     The capacity providers have successfully updated.
--
-- [UPDATE_FAILED]
--     The capacity provider updates failed.
cluster_attachmentsStatus :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_attachmentsStatus :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_attachmentsStatus = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
attachmentsStatus :: Maybe Text
$sel:attachmentsStatus:Cluster' :: Cluster -> Maybe Text
attachmentsStatus} -> Maybe Text
attachmentsStatus) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:attachmentsStatus:Cluster' :: Maybe Text
attachmentsStatus = Maybe Text
a} :: Cluster)

-- | The capacity providers associated with the cluster.
cluster_capacityProviders :: Lens.Lens' Cluster (Prelude.Maybe [Prelude.Text])
cluster_capacityProviders :: (Maybe [Text] -> f (Maybe [Text])) -> Cluster -> f Cluster
cluster_capacityProviders = (Cluster -> Maybe [Text])
-> (Cluster -> Maybe [Text] -> Cluster)
-> Lens Cluster Cluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [Text]
capacityProviders :: Maybe [Text]
$sel:capacityProviders:Cluster' :: Cluster -> Maybe [Text]
capacityProviders} -> Maybe [Text]
capacityProviders) (\s :: Cluster
s@Cluster' {} Maybe [Text]
a -> Cluster
s {$sel:capacityProviders:Cluster' :: Maybe [Text]
capacityProviders = Maybe [Text]
a} :: Cluster) ((Maybe [Text] -> f (Maybe [Text])) -> Cluster -> f Cluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of services that are running on the cluster in an @ACTIVE@
-- state. You can view these services with ListServices.
cluster_activeServicesCount :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_activeServicesCount :: (Maybe Int -> f (Maybe Int)) -> Cluster -> f Cluster
cluster_activeServicesCount = (Cluster -> Maybe Int)
-> (Cluster -> Maybe Int -> Cluster)
-> Lens Cluster Cluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
activeServicesCount :: Maybe Int
$sel:activeServicesCount:Cluster' :: Cluster -> Maybe Int
activeServicesCount} -> Maybe Int
activeServicesCount) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:activeServicesCount:Cluster' :: Maybe Int
activeServicesCount = Maybe Int
a} :: Cluster)

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

instance Core.FromJSON Cluster where
  parseJSON :: Value -> Parser Cluster
parseJSON =
    String -> (Object -> Parser Cluster) -> Value -> Parser Cluster
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Cluster"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Attachment]
-> Maybe Int
-> Maybe [CapacityProviderStrategyItem]
-> Maybe [ClusterSetting]
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [KeyValuePair]
-> Maybe ClusterConfiguration
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe [Tag]
-> Cluster
Cluster'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Attachment]
 -> Maybe Int
 -> Maybe [CapacityProviderStrategyItem]
 -> Maybe [ClusterSetting]
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe [KeyValuePair]
 -> Maybe ClusterConfiguration
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe [Tag]
 -> Cluster)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Attachment]
      -> Maybe Int
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe [ClusterSetting]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
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
"status")
            Parser
  (Maybe Text
   -> Maybe [Attachment]
   -> Maybe Int
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe [ClusterSetting]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Attachment]
      -> Maybe Int
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe [ClusterSetting]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
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
"clusterArn")
            Parser
  (Maybe [Attachment]
   -> Maybe Int
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe [ClusterSetting]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe [Attachment])
-> Parser
     (Maybe Int
      -> Maybe [CapacityProviderStrategyItem]
      -> Maybe [ClusterSetting]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Attachment]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachments" Parser (Maybe (Maybe [Attachment]))
-> Maybe [Attachment] -> Parser (Maybe [Attachment])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Attachment]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Int
   -> Maybe [CapacityProviderStrategyItem]
   -> Maybe [ClusterSetting]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe Int)
-> Parser
     (Maybe [CapacityProviderStrategyItem]
      -> Maybe [ClusterSetting]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"runningTasksCount")
            Parser
  (Maybe [CapacityProviderStrategyItem]
   -> Maybe [ClusterSetting]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe [CapacityProviderStrategyItem])
-> Parser
     (Maybe [ClusterSetting]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
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
"defaultCapacityProviderStrategy"
                            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 [ClusterSetting]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe [ClusterSetting])
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ClusterSetting]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"settings" Parser (Maybe (Maybe [ClusterSetting]))
-> Maybe [ClusterSetting] -> Parser (Maybe [ClusterSetting])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ClusterSetting]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"registeredContainerInstancesCount")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pendingTasksCount")
            Parser
  (Maybe Text
   -> Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe Text)
-> Parser
     (Maybe [KeyValuePair]
      -> Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
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
"clusterName")
            Parser
  (Maybe [KeyValuePair]
   -> Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe [KeyValuePair])
-> Parser
     (Maybe ClusterConfiguration
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [Tag]
      -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [KeyValuePair]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statistics" Parser (Maybe (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> Parser (Maybe [KeyValuePair])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [KeyValuePair]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe ClusterConfiguration
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [Tag]
   -> Cluster)
-> Parser (Maybe ClusterConfiguration)
-> Parser
     (Maybe Text -> Maybe [Text] -> Maybe Int -> Maybe [Tag] -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClusterConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configuration")
            Parser
  (Maybe Text -> Maybe [Text] -> Maybe Int -> Maybe [Tag] -> Cluster)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Int -> Maybe [Tag] -> Cluster)
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
"attachmentsStatus")
            Parser (Maybe [Text] -> Maybe Int -> Maybe [Tag] -> Cluster)
-> Parser (Maybe [Text])
-> Parser (Maybe Int -> Maybe [Tag] -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"capacityProviders"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Int -> Maybe [Tag] -> Cluster)
-> Parser (Maybe Int) -> Parser (Maybe [Tag] -> Cluster)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"activeServicesCount")
            Parser (Maybe [Tag] -> Cluster)
-> Parser (Maybe [Tag]) -> Parser Cluster
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)
      )

instance Prelude.Hashable Cluster

instance Prelude.NFData Cluster