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

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

-- | A file that contain environment variables to pass to a container.
--
-- /See:/ 'newAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' smart constructor.
data AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails = AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails'
  { -- | The ARN of the S3 object that contains the environment variable file.
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | The type of environment file.
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Bool
(AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
    -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
    -> Bool)
-> Eq
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Bool
$c/= :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Bool
== :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Bool
$c== :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
(Int
 -> ReadS
      AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)
-> ReadS
     [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
-> ReadPrec
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> ReadPrec
     [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
-> Read
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
$creadListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
readPrec :: ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
$creadPrec :: ReadPrec
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
readList :: ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
$creadList :: ReadS
  [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
readsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
$creadsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> ShowS
[AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
-> ShowS
AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> String
(Int
 -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
    -> String)
-> ([AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
    -> ShowS)
-> Show
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
-> ShowS
$cshowList :: [AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails]
-> ShowS
show :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> String
$cshow :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> String
showsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> Rep
      AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x)
-> (forall x.
    Rep
      AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x
    -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)
-> Generic
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
forall x.
Rep
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
forall x.
AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Rep
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Rep
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' 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', 'awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_value' - The ARN of the S3 object that contains the environment variable file.
--
-- 'type'', 'awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_type' - The type of environment file.
newAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails ::
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
newAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
newAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails =
  AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: Maybe Text
-> Maybe Text
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails'
    { $sel:value:AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: Maybe Text
value =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: Maybe Text
type' =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the S3 object that contains the environment variable file.
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_value :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_value :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_value = (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' {Maybe Text
value :: Maybe Text
$sel:value:AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Maybe Text
value} -> Maybe Text
value) (\s :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
s@AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
s {$sel:value:AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: Maybe Text
value = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)

-- | The type of environment file.
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_type :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_type :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
awsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails_type = (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
     AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' {Maybe Text
type' :: Maybe Text
$sel:type':AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
s@AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
s {$sel:type':AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: Maybe Text
type' = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails)

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

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails

instance
  Core.ToJSON
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
  where
  toJSON :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Value
toJSON
    AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' {Maybe Text
type' :: Maybe Text
value :: Maybe Text
$sel:type':AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> Maybe Text
$sel:value:AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails' :: AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails
-> 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
"Type" 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
type'
            ]
        )