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

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

-- |
--
-- /See:/ 'newAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' smart constructor.
data AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails = AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails'
  { -- | Whether to use the Amazon ECS task IAM role defined in a task definition
    -- when mounting the Amazon EFS file system.
    AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Maybe Text
iam :: Prelude.Maybe Prelude.Text,
    -- | The Amazon EFS access point identifier to use.
    AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Maybe Text
accessPointId :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Bool
(AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> Bool)
-> (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
    -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
    -> Bool)
-> Eq
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Bool
$c/= :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Bool
== :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Bool
$c== :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
ReadPrec
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
Int
-> ReadS
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
ReadS
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
(Int
 -> ReadS
      AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)
-> ReadS
     [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
-> ReadPrec
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> ReadPrec
     [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
-> Read
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
$creadListPrec :: ReadPrec
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
readPrec :: ReadPrec
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
$creadPrec :: ReadPrec
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
readList :: ReadS
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
$creadList :: ReadS
  [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
readsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
$creadsPrec :: Int
-> ReadS
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> ShowS
[AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
-> ShowS
AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> String
(Int
 -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
    -> String)
-> ([AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
    -> ShowS)
-> Show
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
-> ShowS
$cshowList :: [AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails]
-> ShowS
show :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> String
$cshow :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> String
showsPrec :: Int
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> Rep
      AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
      x)
-> (forall x.
    Rep
      AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
      x
    -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)
-> Generic
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
forall x.
Rep
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
  x
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
forall x.
AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Rep
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
  x
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Rep
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' 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:
--
-- 'iam', 'awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_iam' - Whether to use the Amazon ECS task IAM role defined in a task definition
-- when mounting the Amazon EFS file system.
--
-- 'accessPointId', 'awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_accessPointId' - The Amazon EFS access point identifier to use.
newAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails ::
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
newAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
newAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails =
  AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: Maybe Text
-> Maybe Text
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails'
    { $sel:iam:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: Maybe Text
iam =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accessPointId:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: Maybe Text
accessPointId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether to use the Amazon ECS task IAM role defined in a task definition
-- when mounting the Amazon EFS file system.
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_iam :: Lens.Lens' AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_iam :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> f AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_iam = (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)
-> Lens
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' {Maybe Text
iam :: Maybe Text
$sel:iam:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Maybe Text
iam} -> Maybe Text
iam) (\s :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
s@AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
s {$sel:iam:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: Maybe Text
iam = Maybe Text
a} :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)

-- | The Amazon EFS access point identifier to use.
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_accessPointId :: Lens.Lens' AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_accessPointId :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> f AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
awsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails_accessPointId = (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)
-> Lens
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' {Maybe Text
accessPointId :: Maybe Text
$sel:accessPointId:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
-> Maybe Text
accessPointId} -> Maybe Text
accessPointId) (\s :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
s@AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails
s {$sel:accessPointId:AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails' :: Maybe Text
accessPointId = Maybe Text
a} :: AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails)

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

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails

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