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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsEcsClusterConfigurationExecuteCommandConfigurationDetails

-- | The run command configuration for the cluster.
--
-- /See:/ 'newAwsEcsClusterConfigurationDetails' smart constructor.
data AwsEcsClusterConfigurationDetails = AwsEcsClusterConfigurationDetails'
  { -- | Contains the run command configuration for the cluster.
    AwsEcsClusterConfigurationDetails
-> Maybe
     AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
executeCommandConfiguration :: Prelude.Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
  }
  deriving (AwsEcsClusterConfigurationDetails
-> AwsEcsClusterConfigurationDetails -> Bool
(AwsEcsClusterConfigurationDetails
 -> AwsEcsClusterConfigurationDetails -> Bool)
-> (AwsEcsClusterConfigurationDetails
    -> AwsEcsClusterConfigurationDetails -> Bool)
-> Eq AwsEcsClusterConfigurationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsClusterConfigurationDetails
-> AwsEcsClusterConfigurationDetails -> Bool
$c/= :: AwsEcsClusterConfigurationDetails
-> AwsEcsClusterConfigurationDetails -> Bool
== :: AwsEcsClusterConfigurationDetails
-> AwsEcsClusterConfigurationDetails -> Bool
$c== :: AwsEcsClusterConfigurationDetails
-> AwsEcsClusterConfigurationDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsClusterConfigurationDetails]
ReadPrec AwsEcsClusterConfigurationDetails
Int -> ReadS AwsEcsClusterConfigurationDetails
ReadS [AwsEcsClusterConfigurationDetails]
(Int -> ReadS AwsEcsClusterConfigurationDetails)
-> ReadS [AwsEcsClusterConfigurationDetails]
-> ReadPrec AwsEcsClusterConfigurationDetails
-> ReadPrec [AwsEcsClusterConfigurationDetails]
-> Read AwsEcsClusterConfigurationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsClusterConfigurationDetails]
$creadListPrec :: ReadPrec [AwsEcsClusterConfigurationDetails]
readPrec :: ReadPrec AwsEcsClusterConfigurationDetails
$creadPrec :: ReadPrec AwsEcsClusterConfigurationDetails
readList :: ReadS [AwsEcsClusterConfigurationDetails]
$creadList :: ReadS [AwsEcsClusterConfigurationDetails]
readsPrec :: Int -> ReadS AwsEcsClusterConfigurationDetails
$creadsPrec :: Int -> ReadS AwsEcsClusterConfigurationDetails
Prelude.Read, Int -> AwsEcsClusterConfigurationDetails -> ShowS
[AwsEcsClusterConfigurationDetails] -> ShowS
AwsEcsClusterConfigurationDetails -> String
(Int -> AwsEcsClusterConfigurationDetails -> ShowS)
-> (AwsEcsClusterConfigurationDetails -> String)
-> ([AwsEcsClusterConfigurationDetails] -> ShowS)
-> Show AwsEcsClusterConfigurationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsClusterConfigurationDetails] -> ShowS
$cshowList :: [AwsEcsClusterConfigurationDetails] -> ShowS
show :: AwsEcsClusterConfigurationDetails -> String
$cshow :: AwsEcsClusterConfigurationDetails -> String
showsPrec :: Int -> AwsEcsClusterConfigurationDetails -> ShowS
$cshowsPrec :: Int -> AwsEcsClusterConfigurationDetails -> ShowS
Prelude.Show, (forall x.
 AwsEcsClusterConfigurationDetails
 -> Rep AwsEcsClusterConfigurationDetails x)
-> (forall x.
    Rep AwsEcsClusterConfigurationDetails x
    -> AwsEcsClusterConfigurationDetails)
-> Generic AwsEcsClusterConfigurationDetails
forall x.
Rep AwsEcsClusterConfigurationDetails x
-> AwsEcsClusterConfigurationDetails
forall x.
AwsEcsClusterConfigurationDetails
-> Rep AwsEcsClusterConfigurationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsClusterConfigurationDetails x
-> AwsEcsClusterConfigurationDetails
$cfrom :: forall x.
AwsEcsClusterConfigurationDetails
-> Rep AwsEcsClusterConfigurationDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsClusterConfigurationDetails' 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:
--
-- 'executeCommandConfiguration', 'awsEcsClusterConfigurationDetails_executeCommandConfiguration' - Contains the run command configuration for the cluster.
newAwsEcsClusterConfigurationDetails ::
  AwsEcsClusterConfigurationDetails
newAwsEcsClusterConfigurationDetails :: AwsEcsClusterConfigurationDetails
newAwsEcsClusterConfigurationDetails =
  AwsEcsClusterConfigurationDetails' :: Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
-> AwsEcsClusterConfigurationDetails
AwsEcsClusterConfigurationDetails'
    { $sel:executeCommandConfiguration:AwsEcsClusterConfigurationDetails' :: Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
executeCommandConfiguration =
        Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
forall a. Maybe a
Prelude.Nothing
    }

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

instance
  Core.FromJSON
    AwsEcsClusterConfigurationDetails
  where
  parseJSON :: Value -> Parser AwsEcsClusterConfigurationDetails
parseJSON =
    String
-> (Object -> Parser AwsEcsClusterConfigurationDetails)
-> Value
-> Parser AwsEcsClusterConfigurationDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsClusterConfigurationDetails"
      ( \Object
x ->
          Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
-> AwsEcsClusterConfigurationDetails
AwsEcsClusterConfigurationDetails'
            (Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
 -> AwsEcsClusterConfigurationDetails)
-> Parser
     (Maybe
        AwsEcsClusterConfigurationExecuteCommandConfigurationDetails)
-> Parser AwsEcsClusterConfigurationDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser
     (Maybe
        AwsEcsClusterConfigurationExecuteCommandConfigurationDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecuteCommandConfiguration")
      )

instance
  Prelude.Hashable
    AwsEcsClusterConfigurationDetails

instance
  Prelude.NFData
    AwsEcsClusterConfigurationDetails

instance
  Core.ToJSON
    AwsEcsClusterConfigurationDetails
  where
  toJSON :: AwsEcsClusterConfigurationDetails -> Value
toJSON AwsEcsClusterConfigurationDetails' {Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
executeCommandConfiguration :: Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
$sel:executeCommandConfiguration:AwsEcsClusterConfigurationDetails' :: AwsEcsClusterConfigurationDetails
-> Maybe
     AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ExecuteCommandConfiguration" Text
-> AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
 -> Pair)
-> Maybe
     AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsEcsClusterConfigurationExecuteCommandConfigurationDetails
executeCommandConfiguration
          ]
      )