{-# 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.AwsEcsClusterClusterSettingsDetails
-- 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.AwsEcsClusterClusterSettingsDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Indicates whether to enable CloudWatch Container Insights for the ECS
-- cluster.
--
-- /See:/ 'newAwsEcsClusterClusterSettingsDetails' smart constructor.
data AwsEcsClusterClusterSettingsDetails = AwsEcsClusterClusterSettingsDetails'
  { -- | The value of the setting.
    AwsEcsClusterClusterSettingsDetails -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | The name of the setting.
    AwsEcsClusterClusterSettingsDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsClusterClusterSettingsDetails
-> AwsEcsClusterClusterSettingsDetails -> Bool
(AwsEcsClusterClusterSettingsDetails
 -> AwsEcsClusterClusterSettingsDetails -> Bool)
-> (AwsEcsClusterClusterSettingsDetails
    -> AwsEcsClusterClusterSettingsDetails -> Bool)
-> Eq AwsEcsClusterClusterSettingsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsClusterClusterSettingsDetails
-> AwsEcsClusterClusterSettingsDetails -> Bool
$c/= :: AwsEcsClusterClusterSettingsDetails
-> AwsEcsClusterClusterSettingsDetails -> Bool
== :: AwsEcsClusterClusterSettingsDetails
-> AwsEcsClusterClusterSettingsDetails -> Bool
$c== :: AwsEcsClusterClusterSettingsDetails
-> AwsEcsClusterClusterSettingsDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsClusterClusterSettingsDetails]
ReadPrec AwsEcsClusterClusterSettingsDetails
Int -> ReadS AwsEcsClusterClusterSettingsDetails
ReadS [AwsEcsClusterClusterSettingsDetails]
(Int -> ReadS AwsEcsClusterClusterSettingsDetails)
-> ReadS [AwsEcsClusterClusterSettingsDetails]
-> ReadPrec AwsEcsClusterClusterSettingsDetails
-> ReadPrec [AwsEcsClusterClusterSettingsDetails]
-> Read AwsEcsClusterClusterSettingsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsClusterClusterSettingsDetails]
$creadListPrec :: ReadPrec [AwsEcsClusterClusterSettingsDetails]
readPrec :: ReadPrec AwsEcsClusterClusterSettingsDetails
$creadPrec :: ReadPrec AwsEcsClusterClusterSettingsDetails
readList :: ReadS [AwsEcsClusterClusterSettingsDetails]
$creadList :: ReadS [AwsEcsClusterClusterSettingsDetails]
readsPrec :: Int -> ReadS AwsEcsClusterClusterSettingsDetails
$creadsPrec :: Int -> ReadS AwsEcsClusterClusterSettingsDetails
Prelude.Read, Int -> AwsEcsClusterClusterSettingsDetails -> ShowS
[AwsEcsClusterClusterSettingsDetails] -> ShowS
AwsEcsClusterClusterSettingsDetails -> String
(Int -> AwsEcsClusterClusterSettingsDetails -> ShowS)
-> (AwsEcsClusterClusterSettingsDetails -> String)
-> ([AwsEcsClusterClusterSettingsDetails] -> ShowS)
-> Show AwsEcsClusterClusterSettingsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsClusterClusterSettingsDetails] -> ShowS
$cshowList :: [AwsEcsClusterClusterSettingsDetails] -> ShowS
show :: AwsEcsClusterClusterSettingsDetails -> String
$cshow :: AwsEcsClusterClusterSettingsDetails -> String
showsPrec :: Int -> AwsEcsClusterClusterSettingsDetails -> ShowS
$cshowsPrec :: Int -> AwsEcsClusterClusterSettingsDetails -> ShowS
Prelude.Show, (forall x.
 AwsEcsClusterClusterSettingsDetails
 -> Rep AwsEcsClusterClusterSettingsDetails x)
-> (forall x.
    Rep AwsEcsClusterClusterSettingsDetails x
    -> AwsEcsClusterClusterSettingsDetails)
-> Generic AwsEcsClusterClusterSettingsDetails
forall x.
Rep AwsEcsClusterClusterSettingsDetails x
-> AwsEcsClusterClusterSettingsDetails
forall x.
AwsEcsClusterClusterSettingsDetails
-> Rep AwsEcsClusterClusterSettingsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsClusterClusterSettingsDetails x
-> AwsEcsClusterClusterSettingsDetails
$cfrom :: forall x.
AwsEcsClusterClusterSettingsDetails
-> Rep AwsEcsClusterClusterSettingsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsClusterClusterSettingsDetails' 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:
--
-- 'value', 'awsEcsClusterClusterSettingsDetails_value' - The value of the setting.
--
-- 'name', 'awsEcsClusterClusterSettingsDetails_name' - The name of the setting.
newAwsEcsClusterClusterSettingsDetails ::
  AwsEcsClusterClusterSettingsDetails
newAwsEcsClusterClusterSettingsDetails :: AwsEcsClusterClusterSettingsDetails
newAwsEcsClusterClusterSettingsDetails =
  AwsEcsClusterClusterSettingsDetails' :: Maybe Text -> Maybe Text -> AwsEcsClusterClusterSettingsDetails
AwsEcsClusterClusterSettingsDetails'
    { $sel:value:AwsEcsClusterClusterSettingsDetails' :: Maybe Text
value =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsEcsClusterClusterSettingsDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The value of the setting.
awsEcsClusterClusterSettingsDetails_value :: Lens.Lens' AwsEcsClusterClusterSettingsDetails (Prelude.Maybe Prelude.Text)
awsEcsClusterClusterSettingsDetails_value :: (Maybe Text -> f (Maybe Text))
-> AwsEcsClusterClusterSettingsDetails
-> f AwsEcsClusterClusterSettingsDetails
awsEcsClusterClusterSettingsDetails_value = (AwsEcsClusterClusterSettingsDetails -> Maybe Text)
-> (AwsEcsClusterClusterSettingsDetails
    -> Maybe Text -> AwsEcsClusterClusterSettingsDetails)
-> Lens
     AwsEcsClusterClusterSettingsDetails
     AwsEcsClusterClusterSettingsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterClusterSettingsDetails' {Maybe Text
value :: Maybe Text
$sel:value:AwsEcsClusterClusterSettingsDetails' :: AwsEcsClusterClusterSettingsDetails -> Maybe Text
value} -> Maybe Text
value) (\s :: AwsEcsClusterClusterSettingsDetails
s@AwsEcsClusterClusterSettingsDetails' {} Maybe Text
a -> AwsEcsClusterClusterSettingsDetails
s {$sel:value:AwsEcsClusterClusterSettingsDetails' :: Maybe Text
value = Maybe Text
a} :: AwsEcsClusterClusterSettingsDetails)

-- | The name of the setting.
awsEcsClusterClusterSettingsDetails_name :: Lens.Lens' AwsEcsClusterClusterSettingsDetails (Prelude.Maybe Prelude.Text)
awsEcsClusterClusterSettingsDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsEcsClusterClusterSettingsDetails
-> f AwsEcsClusterClusterSettingsDetails
awsEcsClusterClusterSettingsDetails_name = (AwsEcsClusterClusterSettingsDetails -> Maybe Text)
-> (AwsEcsClusterClusterSettingsDetails
    -> Maybe Text -> AwsEcsClusterClusterSettingsDetails)
-> Lens
     AwsEcsClusterClusterSettingsDetails
     AwsEcsClusterClusterSettingsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsClusterClusterSettingsDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsEcsClusterClusterSettingsDetails' :: AwsEcsClusterClusterSettingsDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsEcsClusterClusterSettingsDetails
s@AwsEcsClusterClusterSettingsDetails' {} Maybe Text
a -> AwsEcsClusterClusterSettingsDetails
s {$sel:name:AwsEcsClusterClusterSettingsDetails' :: Maybe Text
name = Maybe Text
a} :: AwsEcsClusterClusterSettingsDetails)

instance
  Core.FromJSON
    AwsEcsClusterClusterSettingsDetails
  where
  parseJSON :: Value -> Parser AwsEcsClusterClusterSettingsDetails
parseJSON =
    String
-> (Object -> Parser AwsEcsClusterClusterSettingsDetails)
-> Value
-> Parser AwsEcsClusterClusterSettingsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsClusterClusterSettingsDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> AwsEcsClusterClusterSettingsDetails
AwsEcsClusterClusterSettingsDetails'
            (Maybe Text -> Maybe Text -> AwsEcsClusterClusterSettingsDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsEcsClusterClusterSettingsDetails)
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
"Value") Parser (Maybe Text -> AwsEcsClusterClusterSettingsDetails)
-> Parser (Maybe Text)
-> Parser AwsEcsClusterClusterSettingsDetails
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
"Name")
      )

instance
  Prelude.Hashable
    AwsEcsClusterClusterSettingsDetails

instance
  Prelude.NFData
    AwsEcsClusterClusterSettingsDetails

instance
  Core.ToJSON
    AwsEcsClusterClusterSettingsDetails
  where
  toJSON :: AwsEcsClusterClusterSettingsDetails -> Value
toJSON AwsEcsClusterClusterSettingsDetails' {Maybe Text
name :: Maybe Text
value :: Maybe Text
$sel:name:AwsEcsClusterClusterSettingsDetails' :: AwsEcsClusterClusterSettingsDetails -> Maybe Text
$sel:value:AwsEcsClusterClusterSettingsDetails' :: AwsEcsClusterClusterSettingsDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Value" 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
value,
            (Text
"Name" 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
name
          ]
      )