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

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

-- | A mount point for the data volumes in the container.
--
-- /See:/ 'newAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' smart constructor.
data AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails = AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails'
  { -- | The path on the container to mount the host volume at.
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
containerPath :: Prelude.Maybe Prelude.Text,
    -- | The name of the volume to mount. Must match the name of a volume listed
    -- in @VolumeDetails@ for the task definition.
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
sourceVolume :: Prelude.Maybe Prelude.Text,
    -- | Whether the container has read-only access to the volume.
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Bool
readOnly :: Prelude.Maybe Prelude.Bool
  }
  deriving (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Bool
(AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> Bool)
-> Eq AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Bool
$c/= :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Bool
== :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Bool
$c== :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
ReadPrec AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
ReadS [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
(Int
 -> ReadS
      AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> ReadS
     [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
-> ReadPrec
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> ReadPrec
     [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
-> Read AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
$creadListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
readPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
$creadPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
readList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
$creadList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
readsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
$creadsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> ShowS
[AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
-> ShowS
AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> String
(Int
 -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> String)
-> ([AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
    -> ShowS)
-> Show AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
-> ShowS
$cshowList :: [AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails]
-> ShowS
show :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> String
$cshow :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> String
showsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> Rep
      AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x)
-> (forall x.
    Rep AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x
    -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Generic
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall x.
AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' 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:
--
-- 'containerPath', 'awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_containerPath' - The path on the container to mount the host volume at.
--
-- 'sourceVolume', 'awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_sourceVolume' - The name of the volume to mount. Must match the name of a volume listed
-- in @VolumeDetails@ for the task definition.
--
-- 'readOnly', 'awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_readOnly' - Whether the container has read-only access to the volume.
newAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails ::
  AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
newAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
newAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails =
  AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails'
    { $sel:containerPath:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Text
containerPath =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceVolume:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Text
sourceVolume =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:readOnly:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Bool
readOnly =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The path on the container to mount the host volume at.
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_containerPath :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_containerPath :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_containerPath = (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {Maybe Text
containerPath :: Maybe Text
$sel:containerPath:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
containerPath} -> Maybe Text
containerPath) (\s :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s@AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s {$sel:containerPath:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Text
containerPath = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)

-- | The name of the volume to mount. Must match the name of a volume listed
-- in @VolumeDetails@ for the task definition.
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_sourceVolume :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_sourceVolume :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_sourceVolume = (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {Maybe Text
sourceVolume :: Maybe Text
$sel:sourceVolume:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
sourceVolume} -> Maybe Text
sourceVolume) (\s :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s@AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s {$sel:sourceVolume:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Text
sourceVolume = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)

-- | Whether the container has read-only access to the volume.
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_readOnly :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails (Prelude.Maybe Prelude.Bool)
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_readOnly :: (Maybe Bool -> f (Maybe Bool))
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
awsEcsTaskDefinitionContainerDefinitionsMountPointsDetails_readOnly = (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
 -> Maybe Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
    -> Maybe Bool
    -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {Maybe Bool
readOnly :: Maybe Bool
$sel:readOnly:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Bool
readOnly} -> Maybe Bool
readOnly) (\s :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s@AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {} Maybe Bool
a -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
s {$sel:readOnly:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: Maybe Bool
readOnly = Maybe Bool
a} :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)

instance
  Core.FromJSON
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
  where
  parseJSON :: Value
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Value
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
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
"ContainerPath")
              Parser
  (Maybe Text
   -> Maybe Bool
   -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
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
"SourceVolume")
              Parser
  (Maybe Bool
   -> AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails)
-> Parser (Maybe Bool)
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReadOnly")
      )

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails

instance
  Core.ToJSON
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
  where
  toJSON :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails -> Value
toJSON
    AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' {Maybe Bool
Maybe Text
readOnly :: Maybe Bool
sourceVolume :: Maybe Text
containerPath :: Maybe Text
$sel:readOnly:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Bool
$sel:sourceVolume:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
$sel:containerPath:AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails' :: AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails
-> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"ContainerPath" 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
containerPath,
              (Text
"SourceVolume" 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
sourceVolume,
              (Text
"ReadOnly" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
readOnly
            ]
        )