{-# 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.Lambda.Types.FileSystemConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FileSystemConfig = FileSystemConfig'
{
FileSystemConfig -> Text
arn :: Prelude.Text,
FileSystemConfig -> Text
localMountPath :: Prelude.Text
}
deriving (FileSystemConfig -> FileSystemConfig -> Bool
(FileSystemConfig -> FileSystemConfig -> Bool)
-> (FileSystemConfig -> FileSystemConfig -> Bool)
-> Eq FileSystemConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileSystemConfig -> FileSystemConfig -> Bool
$c/= :: FileSystemConfig -> FileSystemConfig -> Bool
== :: FileSystemConfig -> FileSystemConfig -> Bool
$c== :: FileSystemConfig -> FileSystemConfig -> Bool
Prelude.Eq, ReadPrec [FileSystemConfig]
ReadPrec FileSystemConfig
Int -> ReadS FileSystemConfig
ReadS [FileSystemConfig]
(Int -> ReadS FileSystemConfig)
-> ReadS [FileSystemConfig]
-> ReadPrec FileSystemConfig
-> ReadPrec [FileSystemConfig]
-> Read FileSystemConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileSystemConfig]
$creadListPrec :: ReadPrec [FileSystemConfig]
readPrec :: ReadPrec FileSystemConfig
$creadPrec :: ReadPrec FileSystemConfig
readList :: ReadS [FileSystemConfig]
$creadList :: ReadS [FileSystemConfig]
readsPrec :: Int -> ReadS FileSystemConfig
$creadsPrec :: Int -> ReadS FileSystemConfig
Prelude.Read, Int -> FileSystemConfig -> ShowS
[FileSystemConfig] -> ShowS
FileSystemConfig -> String
(Int -> FileSystemConfig -> ShowS)
-> (FileSystemConfig -> String)
-> ([FileSystemConfig] -> ShowS)
-> Show FileSystemConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileSystemConfig] -> ShowS
$cshowList :: [FileSystemConfig] -> ShowS
show :: FileSystemConfig -> String
$cshow :: FileSystemConfig -> String
showsPrec :: Int -> FileSystemConfig -> ShowS
$cshowsPrec :: Int -> FileSystemConfig -> ShowS
Prelude.Show, (forall x. FileSystemConfig -> Rep FileSystemConfig x)
-> (forall x. Rep FileSystemConfig x -> FileSystemConfig)
-> Generic FileSystemConfig
forall x. Rep FileSystemConfig x -> FileSystemConfig
forall x. FileSystemConfig -> Rep FileSystemConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileSystemConfig x -> FileSystemConfig
$cfrom :: forall x. FileSystemConfig -> Rep FileSystemConfig x
Prelude.Generic)
newFileSystemConfig ::
Prelude.Text ->
Prelude.Text ->
FileSystemConfig
newFileSystemConfig :: Text -> Text -> FileSystemConfig
newFileSystemConfig Text
pArn_ Text
pLocalMountPath_ =
FileSystemConfig' :: Text -> Text -> FileSystemConfig
FileSystemConfig'
{ $sel:arn:FileSystemConfig' :: Text
arn = Text
pArn_,
$sel:localMountPath:FileSystemConfig' :: Text
localMountPath = Text
pLocalMountPath_
}
fileSystemConfig_arn :: Lens.Lens' FileSystemConfig Prelude.Text
fileSystemConfig_arn :: (Text -> f Text) -> FileSystemConfig -> f FileSystemConfig
fileSystemConfig_arn = (FileSystemConfig -> Text)
-> (FileSystemConfig -> Text -> FileSystemConfig)
-> Lens FileSystemConfig FileSystemConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemConfig' {Text
arn :: Text
$sel:arn:FileSystemConfig' :: FileSystemConfig -> Text
arn} -> Text
arn) (\s :: FileSystemConfig
s@FileSystemConfig' {} Text
a -> FileSystemConfig
s {$sel:arn:FileSystemConfig' :: Text
arn = Text
a} :: FileSystemConfig)
fileSystemConfig_localMountPath :: Lens.Lens' FileSystemConfig Prelude.Text
fileSystemConfig_localMountPath :: (Text -> f Text) -> FileSystemConfig -> f FileSystemConfig
fileSystemConfig_localMountPath = (FileSystemConfig -> Text)
-> (FileSystemConfig -> Text -> FileSystemConfig)
-> Lens FileSystemConfig FileSystemConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemConfig' {Text
localMountPath :: Text
$sel:localMountPath:FileSystemConfig' :: FileSystemConfig -> Text
localMountPath} -> Text
localMountPath) (\s :: FileSystemConfig
s@FileSystemConfig' {} Text
a -> FileSystemConfig
s {$sel:localMountPath:FileSystemConfig' :: Text
localMountPath = Text
a} :: FileSystemConfig)
instance Core.FromJSON FileSystemConfig where
parseJSON :: Value -> Parser FileSystemConfig
parseJSON =
String
-> (Object -> Parser FileSystemConfig)
-> Value
-> Parser FileSystemConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FileSystemConfig"
( \Object
x ->
Text -> Text -> FileSystemConfig
FileSystemConfig'
(Text -> Text -> FileSystemConfig)
-> Parser Text -> Parser (Text -> FileSystemConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (Text -> FileSystemConfig)
-> Parser Text -> Parser FileSystemConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LocalMountPath")
)
instance Prelude.Hashable FileSystemConfig
instance Prelude.NFData FileSystemConfig
instance Core.ToJSON FileSystemConfig where
toJSON :: FileSystemConfig -> Value
toJSON FileSystemConfig' {Text
localMountPath :: Text
arn :: Text
$sel:localMountPath:FileSystemConfig' :: FileSystemConfig -> Text
$sel:arn:FileSystemConfig' :: FileSystemConfig -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LocalMountPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
localMountPath)
]
)