{-# 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.LambdaDeviceMount 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 LambdaDeviceMount = LambdaDeviceMount'
{
LambdaDeviceMount -> Maybe Bool
addGroupOwner :: Prelude.Maybe Prelude.Bool,
LambdaDeviceMount -> Maybe LambdaFilesystemPermission
permission :: Prelude.Maybe LambdaFilesystemPermission,
LambdaDeviceMount -> Text
path :: Prelude.Text
}
deriving (LambdaDeviceMount -> LambdaDeviceMount -> Bool
(LambdaDeviceMount -> LambdaDeviceMount -> Bool)
-> (LambdaDeviceMount -> LambdaDeviceMount -> Bool)
-> Eq LambdaDeviceMount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaDeviceMount -> LambdaDeviceMount -> Bool
$c/= :: LambdaDeviceMount -> LambdaDeviceMount -> Bool
== :: LambdaDeviceMount -> LambdaDeviceMount -> Bool
$c== :: LambdaDeviceMount -> LambdaDeviceMount -> Bool
Prelude.Eq, ReadPrec [LambdaDeviceMount]
ReadPrec LambdaDeviceMount
Int -> ReadS LambdaDeviceMount
ReadS [LambdaDeviceMount]
(Int -> ReadS LambdaDeviceMount)
-> ReadS [LambdaDeviceMount]
-> ReadPrec LambdaDeviceMount
-> ReadPrec [LambdaDeviceMount]
-> Read LambdaDeviceMount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaDeviceMount]
$creadListPrec :: ReadPrec [LambdaDeviceMount]
readPrec :: ReadPrec LambdaDeviceMount
$creadPrec :: ReadPrec LambdaDeviceMount
readList :: ReadS [LambdaDeviceMount]
$creadList :: ReadS [LambdaDeviceMount]
readsPrec :: Int -> ReadS LambdaDeviceMount
$creadsPrec :: Int -> ReadS LambdaDeviceMount
Prelude.Read, Int -> LambdaDeviceMount -> ShowS
[LambdaDeviceMount] -> ShowS
LambdaDeviceMount -> String
(Int -> LambdaDeviceMount -> ShowS)
-> (LambdaDeviceMount -> String)
-> ([LambdaDeviceMount] -> ShowS)
-> Show LambdaDeviceMount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaDeviceMount] -> ShowS
$cshowList :: [LambdaDeviceMount] -> ShowS
show :: LambdaDeviceMount -> String
$cshow :: LambdaDeviceMount -> String
showsPrec :: Int -> LambdaDeviceMount -> ShowS
$cshowsPrec :: Int -> LambdaDeviceMount -> ShowS
Prelude.Show, (forall x. LambdaDeviceMount -> Rep LambdaDeviceMount x)
-> (forall x. Rep LambdaDeviceMount x -> LambdaDeviceMount)
-> Generic LambdaDeviceMount
forall x. Rep LambdaDeviceMount x -> LambdaDeviceMount
forall x. LambdaDeviceMount -> Rep LambdaDeviceMount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaDeviceMount x -> LambdaDeviceMount
$cfrom :: forall x. LambdaDeviceMount -> Rep LambdaDeviceMount x
Prelude.Generic)
newLambdaDeviceMount ::
Prelude.Text ->
LambdaDeviceMount
newLambdaDeviceMount :: Text -> LambdaDeviceMount
newLambdaDeviceMount Text
pPath_ =
LambdaDeviceMount' :: Maybe Bool
-> Maybe LambdaFilesystemPermission -> Text -> LambdaDeviceMount
LambdaDeviceMount'
{ $sel:addGroupOwner:LambdaDeviceMount' :: Maybe Bool
addGroupOwner = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:permission:LambdaDeviceMount' :: Maybe LambdaFilesystemPermission
permission = Maybe LambdaFilesystemPermission
forall a. Maybe a
Prelude.Nothing,
$sel:path:LambdaDeviceMount' :: Text
path = Text
pPath_
}
lambdaDeviceMount_addGroupOwner :: Lens.Lens' LambdaDeviceMount (Prelude.Maybe Prelude.Bool)
lambdaDeviceMount_addGroupOwner :: (Maybe Bool -> f (Maybe Bool))
-> LambdaDeviceMount -> f LambdaDeviceMount
lambdaDeviceMount_addGroupOwner = (LambdaDeviceMount -> Maybe Bool)
-> (LambdaDeviceMount -> Maybe Bool -> LambdaDeviceMount)
-> Lens
LambdaDeviceMount LambdaDeviceMount (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaDeviceMount' {Maybe Bool
addGroupOwner :: Maybe Bool
$sel:addGroupOwner:LambdaDeviceMount' :: LambdaDeviceMount -> Maybe Bool
addGroupOwner} -> Maybe Bool
addGroupOwner) (\s :: LambdaDeviceMount
s@LambdaDeviceMount' {} Maybe Bool
a -> LambdaDeviceMount
s {$sel:addGroupOwner:LambdaDeviceMount' :: Maybe Bool
addGroupOwner = Maybe Bool
a} :: LambdaDeviceMount)
lambdaDeviceMount_permission :: Lens.Lens' LambdaDeviceMount (Prelude.Maybe LambdaFilesystemPermission)
lambdaDeviceMount_permission :: (Maybe LambdaFilesystemPermission
-> f (Maybe LambdaFilesystemPermission))
-> LambdaDeviceMount -> f LambdaDeviceMount
lambdaDeviceMount_permission = (LambdaDeviceMount -> Maybe LambdaFilesystemPermission)
-> (LambdaDeviceMount
-> Maybe LambdaFilesystemPermission -> LambdaDeviceMount)
-> Lens
LambdaDeviceMount
LambdaDeviceMount
(Maybe LambdaFilesystemPermission)
(Maybe LambdaFilesystemPermission)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaDeviceMount' {Maybe LambdaFilesystemPermission
permission :: Maybe LambdaFilesystemPermission
$sel:permission:LambdaDeviceMount' :: LambdaDeviceMount -> Maybe LambdaFilesystemPermission
permission} -> Maybe LambdaFilesystemPermission
permission) (\s :: LambdaDeviceMount
s@LambdaDeviceMount' {} Maybe LambdaFilesystemPermission
a -> LambdaDeviceMount
s {$sel:permission:LambdaDeviceMount' :: Maybe LambdaFilesystemPermission
permission = Maybe LambdaFilesystemPermission
a} :: LambdaDeviceMount)
lambdaDeviceMount_path :: Lens.Lens' LambdaDeviceMount Prelude.Text
lambdaDeviceMount_path :: (Text -> f Text) -> LambdaDeviceMount -> f LambdaDeviceMount
lambdaDeviceMount_path = (LambdaDeviceMount -> Text)
-> (LambdaDeviceMount -> Text -> LambdaDeviceMount)
-> Lens LambdaDeviceMount LambdaDeviceMount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaDeviceMount' {Text
path :: Text
$sel:path:LambdaDeviceMount' :: LambdaDeviceMount -> Text
path} -> Text
path) (\s :: LambdaDeviceMount
s@LambdaDeviceMount' {} Text
a -> LambdaDeviceMount
s {$sel:path:LambdaDeviceMount' :: Text
path = Text
a} :: LambdaDeviceMount)
instance Prelude.Hashable LambdaDeviceMount
instance Prelude.NFData LambdaDeviceMount
instance Core.ToJSON LambdaDeviceMount where
toJSON :: LambdaDeviceMount -> Value
toJSON LambdaDeviceMount' {Maybe Bool
Maybe LambdaFilesystemPermission
Text
path :: Text
permission :: Maybe LambdaFilesystemPermission
addGroupOwner :: Maybe Bool
$sel:path:LambdaDeviceMount' :: LambdaDeviceMount -> Text
$sel:permission:LambdaDeviceMount' :: LambdaDeviceMount -> Maybe LambdaFilesystemPermission
$sel:addGroupOwner:LambdaDeviceMount' :: LambdaDeviceMount -> 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
"path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
path)
]
)