{-# 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.SecurityHub.Types.AwsEcsClusterDetails
-- 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.SecurityHub.Types.AwsEcsClusterDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsEcsClusterClusterSettingsDetails
import Amazonka.SecurityHub.Types.AwsEcsClusterConfigurationDetails
import Amazonka.SecurityHub.Types.AwsEcsClusterDefaultCapacityProviderStrategyDetails

-- | provides details about an ECS cluster.
--
-- /See:/ 'newAwsEcsClusterDetails' smart constructor.
data AwsEcsClusterDetails = AwsEcsClusterDetails'
  { -- | The setting to use to create the cluster. Specifically used to configure
    -- whether to enable CloudWatch Container Insights for the cluster.
    AwsEcsClusterDetails -> Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings :: Prelude.Maybe [AwsEcsClusterClusterSettingsDetails],
    -- | The default capacity provider strategy for the cluster. The default
    -- capacity provider strategy is used when services or tasks are run
    -- without a specified launch type or capacity provider strategy.
    AwsEcsClusterDetails
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy :: Prelude.Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails],
    -- | The run command configuration for the cluster.
    AwsEcsClusterDetails -> Maybe AwsEcsClusterConfigurationDetails
configuration :: Prelude.Maybe AwsEcsClusterConfigurationDetails,
    -- | The short name of one or more capacity providers to associate with the
    -- cluster.
    AwsEcsClusterDetails -> Maybe [Text]
capacityProviders :: Prelude.Maybe [Prelude.Text]
  }
  deriving (AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool
(AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool)
-> (AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool)
-> Eq AwsEcsClusterDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool
$c/= :: AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool
== :: AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool
$c== :: AwsEcsClusterDetails -> AwsEcsClusterDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsClusterDetails]
ReadPrec AwsEcsClusterDetails
Int -> ReadS AwsEcsClusterDetails
ReadS [AwsEcsClusterDetails]
(Int -> ReadS AwsEcsClusterDetails)
-> ReadS [AwsEcsClusterDetails]
-> ReadPrec AwsEcsClusterDetails
-> ReadPrec [AwsEcsClusterDetails]
-> Read AwsEcsClusterDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsClusterDetails]
$creadListPrec :: ReadPrec [AwsEcsClusterDetails]
readPrec :: ReadPrec AwsEcsClusterDetails
$creadPrec :: ReadPrec AwsEcsClusterDetails
readList :: ReadS [AwsEcsClusterDetails]
$creadList :: ReadS [AwsEcsClusterDetails]
readsPrec :: Int -> ReadS AwsEcsClusterDetails
$creadsPrec :: Int -> ReadS AwsEcsClusterDetails
Prelude.Read, Int -> AwsEcsClusterDetails -> ShowS
[AwsEcsClusterDetails] -> ShowS
AwsEcsClusterDetails -> String
(Int -> AwsEcsClusterDetails -> ShowS)
-> (AwsEcsClusterDetails -> String)
-> ([AwsEcsClusterDetails] -> ShowS)
-> Show AwsEcsClusterDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsClusterDetails] -> ShowS
$cshowList :: [AwsEcsClusterDetails] -> ShowS
show :: AwsEcsClusterDetails -> String
$cshow :: AwsEcsClusterDetails -> String
showsPrec :: Int -> AwsEcsClusterDetails -> ShowS
$cshowsPrec :: Int -> AwsEcsClusterDetails -> ShowS
Prelude.Show, (forall x. AwsEcsClusterDetails -> Rep AwsEcsClusterDetails x)
-> (forall x. Rep AwsEcsClusterDetails x -> AwsEcsClusterDetails)
-> Generic AwsEcsClusterDetails
forall x. Rep AwsEcsClusterDetails x -> AwsEcsClusterDetails
forall x. AwsEcsClusterDetails -> Rep AwsEcsClusterDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsEcsClusterDetails x -> AwsEcsClusterDetails
$cfrom :: forall x. AwsEcsClusterDetails -> Rep AwsEcsClusterDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsClusterDetails' 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:
--
-- 'clusterSettings', 'awsEcsClusterDetails_clusterSettings' - The setting to use to create the cluster. Specifically used to configure
-- whether to enable CloudWatch Container Insights for the cluster.
--
-- 'defaultCapacityProviderStrategy', 'awsEcsClusterDetails_defaultCapacityProviderStrategy' - The default capacity provider strategy for the cluster. The default
-- capacity provider strategy is used when services or tasks are run
-- without a specified launch type or capacity provider strategy.
--
-- 'configuration', 'awsEcsClusterDetails_configuration' - The run command configuration for the cluster.
--
-- 'capacityProviders', 'awsEcsClusterDetails_capacityProviders' - The short name of one or more capacity providers to associate with the
-- cluster.
newAwsEcsClusterDetails ::
  AwsEcsClusterDetails
newAwsEcsClusterDetails :: AwsEcsClusterDetails
newAwsEcsClusterDetails =
  AwsEcsClusterDetails' :: Maybe [AwsEcsClusterClusterSettingsDetails]
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
-> Maybe AwsEcsClusterConfigurationDetails
-> Maybe [Text]
-> AwsEcsClusterDetails
AwsEcsClusterDetails'
    { $sel:clusterSettings:AwsEcsClusterDetails' :: Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings =
        Maybe [AwsEcsClusterClusterSettingsDetails]
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultCapacityProviderStrategy:AwsEcsClusterDetails' :: Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy = Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:AwsEcsClusterDetails' :: Maybe AwsEcsClusterConfigurationDetails
configuration = Maybe AwsEcsClusterConfigurationDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviders:AwsEcsClusterDetails' :: Maybe [Text]
capacityProviders = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The setting to use to create the cluster. Specifically used to configure
-- whether to enable CloudWatch Container Insights for the cluster.
awsEcsClusterDetails_clusterSettings :: Lens.Lens' AwsEcsClusterDetails (Prelude.Maybe [AwsEcsClusterClusterSettingsDetails])
awsEcsClusterDetails_clusterSettings :: (Maybe [AwsEcsClusterClusterSettingsDetails]
 -> f (Maybe [AwsEcsClusterClusterSettingsDetails]))
-> AwsEcsClusterDetails -> f AwsEcsClusterDetails
awsEcsClusterDetails_clusterSettings = (AwsEcsClusterDetails
 -> Maybe [AwsEcsClusterClusterSettingsDetails])
-> (AwsEcsClusterDetails
    -> Maybe [AwsEcsClusterClusterSettingsDetails]
    -> AwsEcsClusterDetails)
-> Lens
     AwsEcsClusterDetails
     AwsEcsClusterDetails
     (Maybe [AwsEcsClusterClusterSettingsDetails])
     (Maybe [AwsEcsClusterClusterSettingsDetails])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterDetails' {Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings :: Maybe [AwsEcsClusterClusterSettingsDetails]
$sel:clusterSettings:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings} -> Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings) (\s :: AwsEcsClusterDetails
s@AwsEcsClusterDetails' {} Maybe [AwsEcsClusterClusterSettingsDetails]
a -> AwsEcsClusterDetails
s {$sel:clusterSettings:AwsEcsClusterDetails' :: Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings = Maybe [AwsEcsClusterClusterSettingsDetails]
a} :: AwsEcsClusterDetails) ((Maybe [AwsEcsClusterClusterSettingsDetails]
  -> f (Maybe [AwsEcsClusterClusterSettingsDetails]))
 -> AwsEcsClusterDetails -> f AwsEcsClusterDetails)
-> ((Maybe [AwsEcsClusterClusterSettingsDetails]
     -> f (Maybe [AwsEcsClusterClusterSettingsDetails]))
    -> Maybe [AwsEcsClusterClusterSettingsDetails]
    -> f (Maybe [AwsEcsClusterClusterSettingsDetails]))
-> (Maybe [AwsEcsClusterClusterSettingsDetails]
    -> f (Maybe [AwsEcsClusterClusterSettingsDetails]))
-> AwsEcsClusterDetails
-> f AwsEcsClusterDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
-> Iso
     (Maybe [AwsEcsClusterClusterSettingsDetails])
     (Maybe [AwsEcsClusterClusterSettingsDetails])
     (Maybe [AwsEcsClusterClusterSettingsDetails])
     (Maybe [AwsEcsClusterClusterSettingsDetails])
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
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
  [AwsEcsClusterClusterSettingsDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The default capacity provider strategy for the cluster. The default
-- capacity provider strategy is used when services or tasks are run
-- without a specified launch type or capacity provider strategy.
awsEcsClusterDetails_defaultCapacityProviderStrategy :: Lens.Lens' AwsEcsClusterDetails (Prelude.Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
awsEcsClusterDetails_defaultCapacityProviderStrategy :: (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
 -> f (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
-> AwsEcsClusterDetails -> f AwsEcsClusterDetails
awsEcsClusterDetails_defaultCapacityProviderStrategy = (AwsEcsClusterDetails
 -> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
-> (AwsEcsClusterDetails
    -> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
    -> AwsEcsClusterDetails)
-> Lens
     AwsEcsClusterDetails
     AwsEcsClusterDetails
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterDetails' {Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy :: Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
$sel:defaultCapacityProviderStrategy:AwsEcsClusterDetails' :: AwsEcsClusterDetails
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy} -> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy) (\s :: AwsEcsClusterDetails
s@AwsEcsClusterDetails' {} Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
a -> AwsEcsClusterDetails
s {$sel:defaultCapacityProviderStrategy:AwsEcsClusterDetails' :: Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy = Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
a} :: AwsEcsClusterDetails) ((Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  -> f (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
 -> AwsEcsClusterDetails -> f AwsEcsClusterDetails)
-> ((Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
     -> f (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
    -> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
    -> f (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
-> (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
    -> f (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
-> AwsEcsClusterDetails
-> f AwsEcsClusterDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
-> Iso
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
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
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
  [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The run command configuration for the cluster.
awsEcsClusterDetails_configuration :: Lens.Lens' AwsEcsClusterDetails (Prelude.Maybe AwsEcsClusterConfigurationDetails)
awsEcsClusterDetails_configuration :: (Maybe AwsEcsClusterConfigurationDetails
 -> f (Maybe AwsEcsClusterConfigurationDetails))
-> AwsEcsClusterDetails -> f AwsEcsClusterDetails
awsEcsClusterDetails_configuration = (AwsEcsClusterDetails -> Maybe AwsEcsClusterConfigurationDetails)
-> (AwsEcsClusterDetails
    -> Maybe AwsEcsClusterConfigurationDetails -> AwsEcsClusterDetails)
-> Lens
     AwsEcsClusterDetails
     AwsEcsClusterDetails
     (Maybe AwsEcsClusterConfigurationDetails)
     (Maybe AwsEcsClusterConfigurationDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterDetails' {Maybe AwsEcsClusterConfigurationDetails
configuration :: Maybe AwsEcsClusterConfigurationDetails
$sel:configuration:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe AwsEcsClusterConfigurationDetails
configuration} -> Maybe AwsEcsClusterConfigurationDetails
configuration) (\s :: AwsEcsClusterDetails
s@AwsEcsClusterDetails' {} Maybe AwsEcsClusterConfigurationDetails
a -> AwsEcsClusterDetails
s {$sel:configuration:AwsEcsClusterDetails' :: Maybe AwsEcsClusterConfigurationDetails
configuration = Maybe AwsEcsClusterConfigurationDetails
a} :: AwsEcsClusterDetails)

-- | The short name of one or more capacity providers to associate with the
-- cluster.
awsEcsClusterDetails_capacityProviders :: Lens.Lens' AwsEcsClusterDetails (Prelude.Maybe [Prelude.Text])
awsEcsClusterDetails_capacityProviders :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsClusterDetails -> f AwsEcsClusterDetails
awsEcsClusterDetails_capacityProviders = (AwsEcsClusterDetails -> Maybe [Text])
-> (AwsEcsClusterDetails -> Maybe [Text] -> AwsEcsClusterDetails)
-> Lens
     AwsEcsClusterDetails
     AwsEcsClusterDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterDetails' {Maybe [Text]
capacityProviders :: Maybe [Text]
$sel:capacityProviders:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe [Text]
capacityProviders} -> Maybe [Text]
capacityProviders) (\s :: AwsEcsClusterDetails
s@AwsEcsClusterDetails' {} Maybe [Text]
a -> AwsEcsClusterDetails
s {$sel:capacityProviders:AwsEcsClusterDetails' :: Maybe [Text]
capacityProviders = Maybe [Text]
a} :: AwsEcsClusterDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEcsClusterDetails -> f AwsEcsClusterDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsClusterDetails
-> f AwsEcsClusterDetails
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

instance Core.FromJSON AwsEcsClusterDetails where
  parseJSON :: Value -> Parser AwsEcsClusterDetails
parseJSON =
    String
-> (Object -> Parser AwsEcsClusterDetails)
-> Value
-> Parser AwsEcsClusterDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsClusterDetails"
      ( \Object
x ->
          Maybe [AwsEcsClusterClusterSettingsDetails]
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
-> Maybe AwsEcsClusterConfigurationDetails
-> Maybe [Text]
-> AwsEcsClusterDetails
AwsEcsClusterDetails'
            (Maybe [AwsEcsClusterClusterSettingsDetails]
 -> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
 -> Maybe AwsEcsClusterConfigurationDetails
 -> Maybe [Text]
 -> AwsEcsClusterDetails)
-> Parser (Maybe [AwsEcsClusterClusterSettingsDetails])
-> Parser
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
      -> Maybe AwsEcsClusterConfigurationDetails
      -> Maybe [Text]
      -> AwsEcsClusterDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [AwsEcsClusterClusterSettingsDetails]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClusterSettings"
                            Parser (Maybe (Maybe [AwsEcsClusterClusterSettingsDetails]))
-> Maybe [AwsEcsClusterClusterSettingsDetails]
-> Parser (Maybe [AwsEcsClusterClusterSettingsDetails])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsEcsClusterClusterSettingsDetails]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
   -> Maybe AwsEcsClusterConfigurationDetails
   -> Maybe [Text]
   -> AwsEcsClusterDetails)
-> Parser
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
-> Parser
     (Maybe AwsEcsClusterConfigurationDetails
      -> Maybe [Text] -> AwsEcsClusterDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe
        (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefaultCapacityProviderStrategy"
                            Parser
  (Maybe
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]))
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
-> Parser
     (Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe AwsEcsClusterConfigurationDetails
   -> Maybe [Text] -> AwsEcsClusterDetails)
-> Parser (Maybe AwsEcsClusterConfigurationDetails)
-> Parser (Maybe [Text] -> AwsEcsClusterDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsEcsClusterConfigurationDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration")
            Parser (Maybe [Text] -> AwsEcsClusterDetails)
-> Parser (Maybe [Text]) -> Parser AwsEcsClusterDetails
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
                        )
      )

instance Prelude.Hashable AwsEcsClusterDetails

instance Prelude.NFData AwsEcsClusterDetails

instance Core.ToJSON AwsEcsClusterDetails where
  toJSON :: AwsEcsClusterDetails -> Value
toJSON AwsEcsClusterDetails' {Maybe [Text]
Maybe [AwsEcsClusterClusterSettingsDetails]
Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
Maybe AwsEcsClusterConfigurationDetails
capacityProviders :: Maybe [Text]
configuration :: Maybe AwsEcsClusterConfigurationDetails
defaultCapacityProviderStrategy :: Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
clusterSettings :: Maybe [AwsEcsClusterClusterSettingsDetails]
$sel:capacityProviders:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe [Text]
$sel:configuration:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe AwsEcsClusterConfigurationDetails
$sel:defaultCapacityProviderStrategy:AwsEcsClusterDetails' :: AwsEcsClusterDetails
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
$sel:clusterSettings:AwsEcsClusterDetails' :: AwsEcsClusterDetails -> Maybe [AwsEcsClusterClusterSettingsDetails]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClusterSettings" Text -> [AwsEcsClusterClusterSettingsDetails] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsEcsClusterClusterSettingsDetails] -> Pair)
-> Maybe [AwsEcsClusterClusterSettingsDetails] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsEcsClusterClusterSettingsDetails]
clusterSettings,
            (Text
"DefaultCapacityProviderStrategy" Text
-> [AwsEcsClusterDefaultCapacityProviderStrategyDetails] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsEcsClusterDefaultCapacityProviderStrategyDetails] -> Pair)
-> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsEcsClusterDefaultCapacityProviderStrategyDetails]
defaultCapacityProviderStrategy,
            (Text
"Configuration" Text -> AwsEcsClusterConfigurationDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AwsEcsClusterConfigurationDetails -> Pair)
-> Maybe AwsEcsClusterConfigurationDetails -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsEcsClusterConfigurationDetails
configuration,
            (Text
"CapacityProviders" 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]
capacityProviders
          ]
      )