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

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

-- | A secret to pass to the log configuration.
--
-- /See:/ 'newAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' smart constructor.
data AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails = AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails'
  { -- | The name of the secret.
    AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The secret to expose to the container.
    --
    -- The value is either the full ARN of the Secrets Manager secret or the
    -- full ARN of the parameter in the Systems Manager Parameter Store.
    AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Maybe Text
valueFrom :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Bool
(AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
 -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
 -> Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
    -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
    -> Bool)
-> Eq
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Bool
$c/= :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Bool
== :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Bool
$c== :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
(Int
 -> ReadS
      AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails)
-> ReadS
     [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
-> ReadPrec
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> ReadPrec
     [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
-> Read
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
$creadListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
readPrec :: ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
$creadPrec :: ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
readList :: ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
$creadList :: ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
readsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
$creadsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> ShowS
[AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
-> ShowS
AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> String
(Int
 -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
    -> String)
-> ([AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
    -> ShowS)
-> Show
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
-> ShowS
$cshowList :: [AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails]
-> ShowS
show :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> String
$cshow :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> String
showsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
 -> Rep
      AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
      x)
-> (forall x.
    Rep
      AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
      x
    -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails)
-> Generic
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
forall x.
Rep
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
  x
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
forall x.
AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Rep
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
     x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
  x
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Rep
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
     x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' 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:
--
-- 'name', 'awsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails_name' - The name of the secret.
--
-- 'valueFrom', 'awsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails_valueFrom' - The secret to expose to the container.
--
-- The value is either the full ARN of the Secrets Manager secret or the
-- full ARN of the parameter in the Systems Manager Parameter Store.
newAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails ::
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
newAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
newAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails =
  AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' :: Maybe Text
-> Maybe Text
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails'
    { $sel:name:AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:valueFrom:AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' :: Maybe Text
valueFrom =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The secret to expose to the container.
--
-- The value is either the full ARN of the Secrets Manager secret or the
-- full ARN of the parameter in the Systems Manager Parameter Store.
awsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails_valueFrom :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails_valueFrom :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
awsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails_valueFrom = (AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
     AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' {Maybe Text
valueFrom :: Maybe Text
$sel:valueFrom:AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
-> Maybe Text
valueFrom} -> Maybe Text
valueFrom) (\s :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
s@AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails
s {$sel:valueFrom:AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails' :: Maybe Text
valueFrom = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails)

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

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails

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