{-# 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.Batch.Types.EFSVolumeConfiguration where
import Amazonka.Batch.Types.EFSAuthorizationConfig
import Amazonka.Batch.Types.EFSTransitEncryption
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EFSVolumeConfiguration = EFSVolumeConfiguration'
{
EFSVolumeConfiguration -> Maybe Text
rootDirectory :: Prelude.Maybe Prelude.Text,
EFSVolumeConfiguration -> Maybe EFSTransitEncryption
transitEncryption :: Prelude.Maybe EFSTransitEncryption,
EFSVolumeConfiguration -> Maybe EFSAuthorizationConfig
authorizationConfig :: Prelude.Maybe EFSAuthorizationConfig,
EFSVolumeConfiguration -> Maybe Int
transitEncryptionPort :: Prelude.Maybe Prelude.Int,
EFSVolumeConfiguration -> Text
fileSystemId :: Prelude.Text
}
deriving (EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool
(EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool)
-> (EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool)
-> Eq EFSVolumeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool
$c/= :: EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool
== :: EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool
$c== :: EFSVolumeConfiguration -> EFSVolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [EFSVolumeConfiguration]
ReadPrec EFSVolumeConfiguration
Int -> ReadS EFSVolumeConfiguration
ReadS [EFSVolumeConfiguration]
(Int -> ReadS EFSVolumeConfiguration)
-> ReadS [EFSVolumeConfiguration]
-> ReadPrec EFSVolumeConfiguration
-> ReadPrec [EFSVolumeConfiguration]
-> Read EFSVolumeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EFSVolumeConfiguration]
$creadListPrec :: ReadPrec [EFSVolumeConfiguration]
readPrec :: ReadPrec EFSVolumeConfiguration
$creadPrec :: ReadPrec EFSVolumeConfiguration
readList :: ReadS [EFSVolumeConfiguration]
$creadList :: ReadS [EFSVolumeConfiguration]
readsPrec :: Int -> ReadS EFSVolumeConfiguration
$creadsPrec :: Int -> ReadS EFSVolumeConfiguration
Prelude.Read, Int -> EFSVolumeConfiguration -> ShowS
[EFSVolumeConfiguration] -> ShowS
EFSVolumeConfiguration -> String
(Int -> EFSVolumeConfiguration -> ShowS)
-> (EFSVolumeConfiguration -> String)
-> ([EFSVolumeConfiguration] -> ShowS)
-> Show EFSVolumeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EFSVolumeConfiguration] -> ShowS
$cshowList :: [EFSVolumeConfiguration] -> ShowS
show :: EFSVolumeConfiguration -> String
$cshow :: EFSVolumeConfiguration -> String
showsPrec :: Int -> EFSVolumeConfiguration -> ShowS
$cshowsPrec :: Int -> EFSVolumeConfiguration -> ShowS
Prelude.Show, (forall x. EFSVolumeConfiguration -> Rep EFSVolumeConfiguration x)
-> (forall x.
Rep EFSVolumeConfiguration x -> EFSVolumeConfiguration)
-> Generic EFSVolumeConfiguration
forall x. Rep EFSVolumeConfiguration x -> EFSVolumeConfiguration
forall x. EFSVolumeConfiguration -> Rep EFSVolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EFSVolumeConfiguration x -> EFSVolumeConfiguration
$cfrom :: forall x. EFSVolumeConfiguration -> Rep EFSVolumeConfiguration x
Prelude.Generic)
newEFSVolumeConfiguration ::
Prelude.Text ->
EFSVolumeConfiguration
newEFSVolumeConfiguration :: Text -> EFSVolumeConfiguration
newEFSVolumeConfiguration Text
pFileSystemId_ =
EFSVolumeConfiguration' :: Maybe Text
-> Maybe EFSTransitEncryption
-> Maybe EFSAuthorizationConfig
-> Maybe Int
-> Text
-> EFSVolumeConfiguration
EFSVolumeConfiguration'
{ $sel:rootDirectory:EFSVolumeConfiguration' :: Maybe Text
rootDirectory =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:transitEncryption:EFSVolumeConfiguration' :: Maybe EFSTransitEncryption
transitEncryption = Maybe EFSTransitEncryption
forall a. Maybe a
Prelude.Nothing,
$sel:authorizationConfig:EFSVolumeConfiguration' :: Maybe EFSAuthorizationConfig
authorizationConfig = Maybe EFSAuthorizationConfig
forall a. Maybe a
Prelude.Nothing,
$sel:transitEncryptionPort:EFSVolumeConfiguration' :: Maybe Int
transitEncryptionPort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:fileSystemId:EFSVolumeConfiguration' :: Text
fileSystemId = Text
pFileSystemId_
}
eFSVolumeConfiguration_rootDirectory :: Lens.Lens' EFSVolumeConfiguration (Prelude.Maybe Prelude.Text)
eFSVolumeConfiguration_rootDirectory :: (Maybe Text -> f (Maybe Text))
-> EFSVolumeConfiguration -> f EFSVolumeConfiguration
eFSVolumeConfiguration_rootDirectory = (EFSVolumeConfiguration -> Maybe Text)
-> (EFSVolumeConfiguration -> Maybe Text -> EFSVolumeConfiguration)
-> Lens
EFSVolumeConfiguration
EFSVolumeConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EFSVolumeConfiguration' {Maybe Text
rootDirectory :: Maybe Text
$sel:rootDirectory:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe Text
rootDirectory} -> Maybe Text
rootDirectory) (\s :: EFSVolumeConfiguration
s@EFSVolumeConfiguration' {} Maybe Text
a -> EFSVolumeConfiguration
s {$sel:rootDirectory:EFSVolumeConfiguration' :: Maybe Text
rootDirectory = Maybe Text
a} :: EFSVolumeConfiguration)
eFSVolumeConfiguration_transitEncryption :: Lens.Lens' EFSVolumeConfiguration (Prelude.Maybe EFSTransitEncryption)
eFSVolumeConfiguration_transitEncryption :: (Maybe EFSTransitEncryption -> f (Maybe EFSTransitEncryption))
-> EFSVolumeConfiguration -> f EFSVolumeConfiguration
eFSVolumeConfiguration_transitEncryption = (EFSVolumeConfiguration -> Maybe EFSTransitEncryption)
-> (EFSVolumeConfiguration
-> Maybe EFSTransitEncryption -> EFSVolumeConfiguration)
-> Lens
EFSVolumeConfiguration
EFSVolumeConfiguration
(Maybe EFSTransitEncryption)
(Maybe EFSTransitEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EFSVolumeConfiguration' {Maybe EFSTransitEncryption
transitEncryption :: Maybe EFSTransitEncryption
$sel:transitEncryption:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe EFSTransitEncryption
transitEncryption} -> Maybe EFSTransitEncryption
transitEncryption) (\s :: EFSVolumeConfiguration
s@EFSVolumeConfiguration' {} Maybe EFSTransitEncryption
a -> EFSVolumeConfiguration
s {$sel:transitEncryption:EFSVolumeConfiguration' :: Maybe EFSTransitEncryption
transitEncryption = Maybe EFSTransitEncryption
a} :: EFSVolumeConfiguration)
eFSVolumeConfiguration_authorizationConfig :: Lens.Lens' EFSVolumeConfiguration (Prelude.Maybe EFSAuthorizationConfig)
eFSVolumeConfiguration_authorizationConfig :: (Maybe EFSAuthorizationConfig -> f (Maybe EFSAuthorizationConfig))
-> EFSVolumeConfiguration -> f EFSVolumeConfiguration
eFSVolumeConfiguration_authorizationConfig = (EFSVolumeConfiguration -> Maybe EFSAuthorizationConfig)
-> (EFSVolumeConfiguration
-> Maybe EFSAuthorizationConfig -> EFSVolumeConfiguration)
-> Lens
EFSVolumeConfiguration
EFSVolumeConfiguration
(Maybe EFSAuthorizationConfig)
(Maybe EFSAuthorizationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EFSVolumeConfiguration' {Maybe EFSAuthorizationConfig
authorizationConfig :: Maybe EFSAuthorizationConfig
$sel:authorizationConfig:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe EFSAuthorizationConfig
authorizationConfig} -> Maybe EFSAuthorizationConfig
authorizationConfig) (\s :: EFSVolumeConfiguration
s@EFSVolumeConfiguration' {} Maybe EFSAuthorizationConfig
a -> EFSVolumeConfiguration
s {$sel:authorizationConfig:EFSVolumeConfiguration' :: Maybe EFSAuthorizationConfig
authorizationConfig = Maybe EFSAuthorizationConfig
a} :: EFSVolumeConfiguration)
eFSVolumeConfiguration_transitEncryptionPort :: Lens.Lens' EFSVolumeConfiguration (Prelude.Maybe Prelude.Int)
eFSVolumeConfiguration_transitEncryptionPort :: (Maybe Int -> f (Maybe Int))
-> EFSVolumeConfiguration -> f EFSVolumeConfiguration
eFSVolumeConfiguration_transitEncryptionPort = (EFSVolumeConfiguration -> Maybe Int)
-> (EFSVolumeConfiguration -> Maybe Int -> EFSVolumeConfiguration)
-> Lens
EFSVolumeConfiguration
EFSVolumeConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EFSVolumeConfiguration' {Maybe Int
transitEncryptionPort :: Maybe Int
$sel:transitEncryptionPort:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe Int
transitEncryptionPort} -> Maybe Int
transitEncryptionPort) (\s :: EFSVolumeConfiguration
s@EFSVolumeConfiguration' {} Maybe Int
a -> EFSVolumeConfiguration
s {$sel:transitEncryptionPort:EFSVolumeConfiguration' :: Maybe Int
transitEncryptionPort = Maybe Int
a} :: EFSVolumeConfiguration)
eFSVolumeConfiguration_fileSystemId :: Lens.Lens' EFSVolumeConfiguration Prelude.Text
eFSVolumeConfiguration_fileSystemId :: (Text -> f Text)
-> EFSVolumeConfiguration -> f EFSVolumeConfiguration
eFSVolumeConfiguration_fileSystemId = (EFSVolumeConfiguration -> Text)
-> (EFSVolumeConfiguration -> Text -> EFSVolumeConfiguration)
-> Lens EFSVolumeConfiguration EFSVolumeConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EFSVolumeConfiguration' {Text
fileSystemId :: Text
$sel:fileSystemId:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Text
fileSystemId} -> Text
fileSystemId) (\s :: EFSVolumeConfiguration
s@EFSVolumeConfiguration' {} Text
a -> EFSVolumeConfiguration
s {$sel:fileSystemId:EFSVolumeConfiguration' :: Text
fileSystemId = Text
a} :: EFSVolumeConfiguration)
instance Core.FromJSON EFSVolumeConfiguration where
parseJSON :: Value -> Parser EFSVolumeConfiguration
parseJSON =
String
-> (Object -> Parser EFSVolumeConfiguration)
-> Value
-> Parser EFSVolumeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EFSVolumeConfiguration"
( \Object
x ->
Maybe Text
-> Maybe EFSTransitEncryption
-> Maybe EFSAuthorizationConfig
-> Maybe Int
-> Text
-> EFSVolumeConfiguration
EFSVolumeConfiguration'
(Maybe Text
-> Maybe EFSTransitEncryption
-> Maybe EFSAuthorizationConfig
-> Maybe Int
-> Text
-> EFSVolumeConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe EFSTransitEncryption
-> Maybe EFSAuthorizationConfig
-> Maybe Int
-> Text
-> EFSVolumeConfiguration)
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
"rootDirectory")
Parser
(Maybe EFSTransitEncryption
-> Maybe EFSAuthorizationConfig
-> Maybe Int
-> Text
-> EFSVolumeConfiguration)
-> Parser (Maybe EFSTransitEncryption)
-> Parser
(Maybe EFSAuthorizationConfig
-> Maybe Int -> Text -> EFSVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EFSTransitEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transitEncryption")
Parser
(Maybe EFSAuthorizationConfig
-> Maybe Int -> Text -> EFSVolumeConfiguration)
-> Parser (Maybe EFSAuthorizationConfig)
-> Parser (Maybe Int -> Text -> EFSVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EFSAuthorizationConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authorizationConfig")
Parser (Maybe Int -> Text -> EFSVolumeConfiguration)
-> Parser (Maybe Int) -> Parser (Text -> EFSVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transitEncryptionPort")
Parser (Text -> EFSVolumeConfiguration)
-> Parser Text -> Parser EFSVolumeConfiguration
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
"fileSystemId")
)
instance Prelude.Hashable EFSVolumeConfiguration
instance Prelude.NFData EFSVolumeConfiguration
instance Core.ToJSON EFSVolumeConfiguration where
toJSON :: EFSVolumeConfiguration -> Value
toJSON EFSVolumeConfiguration' {Maybe Int
Maybe Text
Maybe EFSAuthorizationConfig
Maybe EFSTransitEncryption
Text
fileSystemId :: Text
transitEncryptionPort :: Maybe Int
authorizationConfig :: Maybe EFSAuthorizationConfig
transitEncryption :: Maybe EFSTransitEncryption
rootDirectory :: Maybe Text
$sel:fileSystemId:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Text
$sel:transitEncryptionPort:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe Int
$sel:authorizationConfig:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe EFSAuthorizationConfig
$sel:transitEncryption:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe EFSTransitEncryption
$sel:rootDirectory:EFSVolumeConfiguration' :: EFSVolumeConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"rootDirectory" 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
rootDirectory,
(Text
"transitEncryption" Text -> EFSTransitEncryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EFSTransitEncryption -> Pair)
-> Maybe EFSTransitEncryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EFSTransitEncryption
transitEncryption,
(Text
"authorizationConfig" Text -> EFSAuthorizationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EFSAuthorizationConfig -> Pair)
-> Maybe EFSAuthorizationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EFSAuthorizationConfig
authorizationConfig,
(Text
"transitEncryptionPort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
transitEncryptionPort,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"fileSystemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fileSystemId)
]
)