{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MountPoint = MountPoint'
{
MountPoint -> Maybe Text
containerPath :: Prelude.Maybe Prelude.Text,
MountPoint -> Maybe Text
sourceVolume :: Prelude.Maybe Prelude.Text,
MountPoint -> Maybe Bool
readOnly :: Prelude.Maybe Prelude.Bool
}
deriving (MountPoint -> MountPoint -> Bool
(MountPoint -> MountPoint -> Bool)
-> (MountPoint -> MountPoint -> Bool) -> Eq MountPoint
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]
(Int -> ReadS MountPoint)
-> ReadS [MountPoint]
-> ReadPrec MountPoint
-> ReadPrec [MountPoint]
-> Read 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
(Int -> MountPoint -> ShowS)
-> (MountPoint -> String)
-> ([MountPoint] -> ShowS)
-> Show MountPoint
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. MountPoint -> Rep MountPoint x)
-> (forall x. Rep MountPoint x -> MountPoint) -> Generic MountPoint
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' :: Maybe Text -> Maybe Text -> Maybe Bool -> MountPoint
MountPoint'
{ $sel:containerPath:MountPoint' :: Maybe Text
containerPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceVolume:MountPoint' :: Maybe Text
sourceVolume = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:readOnly:MountPoint' :: Maybe Bool
readOnly = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
mountPoint_containerPath :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Text)
mountPoint_containerPath :: (Maybe Text -> f (Maybe Text)) -> MountPoint -> f MountPoint
mountPoint_containerPath = (MountPoint -> Maybe Text)
-> (MountPoint -> Maybe Text -> MountPoint)
-> Lens MountPoint MountPoint (Maybe Text) (Maybe Text)
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_sourceVolume :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Text)
mountPoint_sourceVolume :: (Maybe Text -> f (Maybe Text)) -> MountPoint -> f MountPoint
mountPoint_sourceVolume = (MountPoint -> Maybe Text)
-> (MountPoint -> Maybe Text -> MountPoint)
-> Lens MountPoint MountPoint (Maybe Text) (Maybe Text)
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)
mountPoint_readOnly :: Lens.Lens' MountPoint (Prelude.Maybe Prelude.Bool)
mountPoint_readOnly :: (Maybe Bool -> f (Maybe Bool)) -> MountPoint -> f MountPoint
mountPoint_readOnly = (MountPoint -> Maybe Bool)
-> (MountPoint -> Maybe Bool -> MountPoint)
-> Lens MountPoint MountPoint (Maybe Bool) (Maybe Bool)
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)
instance Core.FromJSON MountPoint where
parseJSON :: Value -> Parser MountPoint
parseJSON =
String
-> (Object -> Parser MountPoint) -> Value -> Parser MountPoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MountPoint"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Bool -> MountPoint
MountPoint'
(Maybe Text -> Maybe Text -> Maybe Bool -> MountPoint)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> MountPoint)
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
"containerPath")
Parser (Maybe Text -> Maybe Bool -> MountPoint)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> MountPoint)
forall (f :: * -> *) a b. Applicative f => 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
"sourceVolume")
Parser (Maybe Bool -> MountPoint)
-> Parser (Maybe Bool) -> Parser MountPoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"readOnly")
)
instance Prelude.Hashable MountPoint
instance Prelude.NFData MountPoint
instance Core.ToJSON MountPoint where
toJSON :: MountPoint -> Value
toJSON MountPoint' {Maybe Bool
Maybe Text
readOnly :: Maybe Bool
sourceVolume :: Maybe Text
containerPath :: Maybe Text
$sel:readOnly:MountPoint' :: MountPoint -> Maybe Bool
$sel:sourceVolume:MountPoint' :: MountPoint -> Maybe Text
$sel:containerPath:MountPoint' :: MountPoint -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"containerPath" 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
containerPath,
(Text
"sourceVolume" 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
sourceVolume,
(Text
"readOnly" 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
readOnly
]
)