{-# 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.MountPoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data MountPoint = MountPoint'
{
MountPoint -> Maybe Text
containerPath :: Prelude.Maybe Prelude.Text,
MountPoint -> Maybe Bool
readOnly :: Prelude.Maybe Prelude.Bool,
MountPoint -> Maybe Text
sourceVolume :: Prelude.Maybe Prelude.Text
}
deriving (MountPoint -> MountPoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MountPoint -> MountPoint -> Bool
$c/= :: MountPoint -> MountPoint -> Bool
== :: MountPoint -> MountPoint -> Bool
$c== :: MountPoint -> MountPoint -> Bool
Prelude.Eq, ReadPrec [MountPoint]
ReadPrec MountPoint
Int -> ReadS MountPoint
ReadS [MountPoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MountPoint]
$creadListPrec :: ReadPrec [MountPoint]
readPrec :: ReadPrec MountPoint
$creadPrec :: ReadPrec MountPoint
readList :: ReadS [MountPoint]
$creadList :: ReadS [MountPoint]
readsPrec :: Int -> ReadS MountPoint
$creadsPrec :: Int -> ReadS MountPoint
Prelude.Read, Int -> MountPoint -> ShowS
[MountPoint] -> ShowS
MountPoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MountPoint] -> ShowS
$cshowList :: [MountPoint] -> ShowS
show :: MountPoint -> String
$cshow :: MountPoint -> String
showsPrec :: Int -> MountPoint -> ShowS
$cshowsPrec :: Int -> MountPoint -> ShowS
Prelude.Show, forall x. Rep MountPoint x -> MountPoint
forall x. MountPoint -> Rep MountPoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MountPoint x -> MountPoint
$cfrom :: forall x. MountPoint -> Rep MountPoint x
Prelude.Generic)
newMountPoint ::
MountPoint
newMountPoint :: MountPoint
newMountPoint =
MountPoint'
{ $sel:containerPath:MountPoint' :: Maybe Text
containerPath = forall a. Maybe a
Prelude.Nothing,
$sel:readOnly:MountPoint' :: Maybe Bool
readOnly = forall a. Maybe a
Prelude.Nothing,
$sel:sourceVolume:MountPoint' :: Maybe Text
sourceVolume = forall a. Maybe a
Prelude.Nothing
}
mountPoint_containerPath :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Text)
mountPoint_containerPath :: Lens' MountPoint (Maybe Text)
mountPoint_containerPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MountPoint' {Maybe Text
containerPath :: Maybe Text
$sel:containerPath:MountPoint' :: MountPoint -> Maybe Text
containerPath} -> Maybe Text
containerPath) (\s :: MountPoint
s@MountPoint' {} Maybe Text
a -> MountPoint
s {$sel:containerPath:MountPoint' :: Maybe Text
containerPath = Maybe Text
a} :: MountPoint)
mountPoint_readOnly :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Bool)
mountPoint_readOnly :: Lens' MountPoint (Maybe Bool)
mountPoint_readOnly = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MountPoint' {Maybe Bool
readOnly :: Maybe Bool
$sel:readOnly:MountPoint' :: MountPoint -> Maybe Bool
readOnly} -> Maybe Bool
readOnly) (\s :: MountPoint
s@MountPoint' {} Maybe Bool
a -> MountPoint
s {$sel:readOnly:MountPoint' :: Maybe Bool
readOnly = Maybe Bool
a} :: MountPoint)
mountPoint_sourceVolume :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Text)
mountPoint_sourceVolume :: Lens' MountPoint (Maybe Text)
mountPoint_sourceVolume = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MountPoint' {Maybe Text
sourceVolume :: Maybe Text
$sel:sourceVolume:MountPoint' :: MountPoint -> Maybe Text
sourceVolume} -> Maybe Text
sourceVolume) (\s :: MountPoint
s@MountPoint' {} Maybe Text
a -> MountPoint
s {$sel:sourceVolume:MountPoint' :: Maybe Text
sourceVolume = Maybe Text
a} :: MountPoint)
instance Data.FromJSON MountPoint where
parseJSON :: Value -> Parser MountPoint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MountPoint"
( \Object
x ->
Maybe Text -> Maybe Bool -> Maybe Text -> MountPoint
MountPoint'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"containerPath")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"readOnly")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceVolume")
)
instance Prelude.Hashable MountPoint where
hashWithSalt :: Int -> MountPoint -> Int
hashWithSalt Int
_salt MountPoint' {Maybe Bool
Maybe Text
sourceVolume :: Maybe Text
readOnly :: Maybe Bool
containerPath :: Maybe Text
$sel:sourceVolume:MountPoint' :: MountPoint -> Maybe Text
$sel:readOnly:MountPoint' :: MountPoint -> Maybe Bool
$sel:containerPath:MountPoint' :: MountPoint -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
containerPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
readOnly
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceVolume
instance Prelude.NFData MountPoint where
rnf :: MountPoint -> ()
rnf MountPoint' {Maybe Bool
Maybe Text
sourceVolume :: Maybe Text
readOnly :: Maybe Bool
containerPath :: Maybe Text
$sel:sourceVolume:MountPoint' :: MountPoint -> Maybe Text
$sel:readOnly:MountPoint' :: MountPoint -> Maybe Bool
$sel:containerPath:MountPoint' :: MountPoint -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
containerPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
readOnly
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceVolume
instance Data.ToJSON MountPoint where
toJSON :: MountPoint -> Value
toJSON MountPoint' {Maybe Bool
Maybe Text
sourceVolume :: Maybe Text
readOnly :: Maybe Bool
containerPath :: Maybe Text
$sel:sourceVolume:MountPoint' :: MountPoint -> Maybe Text
$sel:readOnly:MountPoint' :: MountPoint -> Maybe Bool
$sel:containerPath:MountPoint' :: MountPoint -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"containerPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
containerPath,
(Key
"readOnly" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
readOnly,
(Key
"sourceVolume" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceVolume
]
)