{-# 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 #-}
module Amazonka.GreengrassV2.Types.LambdaVolumeMount where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.LambdaFilesystemPermission
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LambdaVolumeMount = LambdaVolumeMount'
{
LambdaVolumeMount -> Maybe Bool
addGroupOwner :: Prelude.Maybe Prelude.Bool,
LambdaVolumeMount -> Maybe LambdaFilesystemPermission
permission :: Prelude.Maybe LambdaFilesystemPermission,
LambdaVolumeMount -> Text
sourcePath :: Prelude.Text,
LambdaVolumeMount -> Text
destinationPath :: Prelude.Text
}
deriving (LambdaVolumeMount -> LambdaVolumeMount -> Bool
(LambdaVolumeMount -> LambdaVolumeMount -> Bool)
-> (LambdaVolumeMount -> LambdaVolumeMount -> Bool)
-> Eq LambdaVolumeMount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaVolumeMount -> LambdaVolumeMount -> Bool
$c/= :: LambdaVolumeMount -> LambdaVolumeMount -> Bool
== :: LambdaVolumeMount -> LambdaVolumeMount -> Bool
$c== :: LambdaVolumeMount -> LambdaVolumeMount -> Bool
Prelude.Eq, ReadPrec [LambdaVolumeMount]
ReadPrec LambdaVolumeMount
Int -> ReadS LambdaVolumeMount
ReadS [LambdaVolumeMount]
(Int -> ReadS LambdaVolumeMount)
-> ReadS [LambdaVolumeMount]
-> ReadPrec LambdaVolumeMount
-> ReadPrec [LambdaVolumeMount]
-> Read LambdaVolumeMount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaVolumeMount]
$creadListPrec :: ReadPrec [LambdaVolumeMount]
readPrec :: ReadPrec LambdaVolumeMount
$creadPrec :: ReadPrec LambdaVolumeMount
readList :: ReadS [LambdaVolumeMount]
$creadList :: ReadS [LambdaVolumeMount]
readsPrec :: Int -> ReadS LambdaVolumeMount
$creadsPrec :: Int -> ReadS LambdaVolumeMount
Prelude.Read, Int -> LambdaVolumeMount -> ShowS
[LambdaVolumeMount] -> ShowS
LambdaVolumeMount -> String
(Int -> LambdaVolumeMount -> ShowS)
-> (LambdaVolumeMount -> String)
-> ([LambdaVolumeMount] -> ShowS)
-> Show LambdaVolumeMount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaVolumeMount] -> ShowS
$cshowList :: [LambdaVolumeMount] -> ShowS
show :: LambdaVolumeMount -> String
$cshow :: LambdaVolumeMount -> String
showsPrec :: Int -> LambdaVolumeMount -> ShowS
$cshowsPrec :: Int -> LambdaVolumeMount -> ShowS
Prelude.Show, (forall x. LambdaVolumeMount -> Rep LambdaVolumeMount x)
-> (forall x. Rep LambdaVolumeMount x -> LambdaVolumeMount)
-> Generic LambdaVolumeMount
forall x. Rep LambdaVolumeMount x -> LambdaVolumeMount
forall x. LambdaVolumeMount -> Rep LambdaVolumeMount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaVolumeMount x -> LambdaVolumeMount
$cfrom :: forall x. LambdaVolumeMount -> Rep LambdaVolumeMount x
Prelude.Generic)
newLambdaVolumeMount ::
Prelude.Text ->
Prelude.Text ->
LambdaVolumeMount
newLambdaVolumeMount :: Text -> Text -> LambdaVolumeMount
newLambdaVolumeMount Text
pSourcePath_ Text
pDestinationPath_ =
LambdaVolumeMount' :: Maybe Bool
-> Maybe LambdaFilesystemPermission
-> Text
-> Text
-> LambdaVolumeMount
LambdaVolumeMount'
{ $sel:addGroupOwner:LambdaVolumeMount' :: Maybe Bool
addGroupOwner = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:permission:LambdaVolumeMount' :: Maybe LambdaFilesystemPermission
permission = Maybe LambdaFilesystemPermission
forall a. Maybe a
Prelude.Nothing,
$sel:sourcePath:LambdaVolumeMount' :: Text
sourcePath = Text
pSourcePath_,
$sel:destinationPath:LambdaVolumeMount' :: Text
destinationPath = Text
pDestinationPath_
}
lambdaVolumeMount_addGroupOwner :: Lens.Lens' LambdaVolumeMount (Prelude.Maybe Prelude.Bool)
lambdaVolumeMount_addGroupOwner :: (Maybe Bool -> f (Maybe Bool))
-> LambdaVolumeMount -> f LambdaVolumeMount
lambdaVolumeMount_addGroupOwner = (LambdaVolumeMount -> Maybe Bool)
-> (LambdaVolumeMount -> Maybe Bool -> LambdaVolumeMount)
-> Lens
LambdaVolumeMount LambdaVolumeMount (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaVolumeMount' {Maybe Bool
addGroupOwner :: Maybe Bool
$sel:addGroupOwner:LambdaVolumeMount' :: LambdaVolumeMount -> Maybe Bool
addGroupOwner} -> Maybe Bool
addGroupOwner) (\s :: LambdaVolumeMount
s@LambdaVolumeMount' {} Maybe Bool
a -> LambdaVolumeMount
s {$sel:addGroupOwner:LambdaVolumeMount' :: Maybe Bool
addGroupOwner = Maybe Bool
a} :: LambdaVolumeMount)
lambdaVolumeMount_permission :: Lens.Lens' LambdaVolumeMount (Prelude.Maybe LambdaFilesystemPermission)
lambdaVolumeMount_permission :: (Maybe LambdaFilesystemPermission
-> f (Maybe LambdaFilesystemPermission))
-> LambdaVolumeMount -> f LambdaVolumeMount
lambdaVolumeMount_permission = (LambdaVolumeMount -> Maybe LambdaFilesystemPermission)
-> (LambdaVolumeMount
-> Maybe LambdaFilesystemPermission -> LambdaVolumeMount)
-> Lens
LambdaVolumeMount
LambdaVolumeMount
(Maybe LambdaFilesystemPermission)
(Maybe LambdaFilesystemPermission)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaVolumeMount' {Maybe LambdaFilesystemPermission
permission :: Maybe LambdaFilesystemPermission
$sel:permission:LambdaVolumeMount' :: LambdaVolumeMount -> Maybe LambdaFilesystemPermission
permission} -> Maybe LambdaFilesystemPermission
permission) (\s :: LambdaVolumeMount
s@LambdaVolumeMount' {} Maybe LambdaFilesystemPermission
a -> LambdaVolumeMount
s {$sel:permission:LambdaVolumeMount' :: Maybe LambdaFilesystemPermission
permission = Maybe LambdaFilesystemPermission
a} :: LambdaVolumeMount)
lambdaVolumeMount_sourcePath :: Lens.Lens' LambdaVolumeMount Prelude.Text
lambdaVolumeMount_sourcePath :: (Text -> f Text) -> LambdaVolumeMount -> f LambdaVolumeMount
lambdaVolumeMount_sourcePath = (LambdaVolumeMount -> Text)
-> (LambdaVolumeMount -> Text -> LambdaVolumeMount)
-> Lens LambdaVolumeMount LambdaVolumeMount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaVolumeMount' {Text
sourcePath :: Text
$sel:sourcePath:LambdaVolumeMount' :: LambdaVolumeMount -> Text
sourcePath} -> Text
sourcePath) (\s :: LambdaVolumeMount
s@LambdaVolumeMount' {} Text
a -> LambdaVolumeMount
s {$sel:sourcePath:LambdaVolumeMount' :: Text
sourcePath = Text
a} :: LambdaVolumeMount)
lambdaVolumeMount_destinationPath :: Lens.Lens' LambdaVolumeMount Prelude.Text
lambdaVolumeMount_destinationPath :: (Text -> f Text) -> LambdaVolumeMount -> f LambdaVolumeMount
lambdaVolumeMount_destinationPath = (LambdaVolumeMount -> Text)
-> (LambdaVolumeMount -> Text -> LambdaVolumeMount)
-> Lens LambdaVolumeMount LambdaVolumeMount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaVolumeMount' {Text
destinationPath :: Text
$sel:destinationPath:LambdaVolumeMount' :: LambdaVolumeMount -> Text
destinationPath} -> Text
destinationPath) (\s :: LambdaVolumeMount
s@LambdaVolumeMount' {} Text
a -> LambdaVolumeMount
s {$sel:destinationPath:LambdaVolumeMount' :: Text
destinationPath = Text
a} :: LambdaVolumeMount)
instance Prelude.Hashable LambdaVolumeMount
instance Prelude.NFData LambdaVolumeMount
instance Core.ToJSON LambdaVolumeMount where
toJSON :: LambdaVolumeMount -> Value
toJSON LambdaVolumeMount' {Maybe Bool
Maybe LambdaFilesystemPermission
Text
destinationPath :: Text
sourcePath :: Text
permission :: Maybe LambdaFilesystemPermission
addGroupOwner :: Maybe Bool
$sel:destinationPath:LambdaVolumeMount' :: LambdaVolumeMount -> Text
$sel:sourcePath:LambdaVolumeMount' :: LambdaVolumeMount -> Text
$sel:permission:LambdaVolumeMount' :: LambdaVolumeMount -> Maybe LambdaFilesystemPermission
$sel:addGroupOwner:LambdaVolumeMount' :: LambdaVolumeMount -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"addGroupOwner" 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
addGroupOwner,
(Text
"permission" Text -> LambdaFilesystemPermission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaFilesystemPermission -> Pair)
-> Maybe LambdaFilesystemPermission -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaFilesystemPermission
permission,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"sourcePath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourcePath),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"destinationPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationPath)
]
)