{-# 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.ECS.Types.HostVolumeProperties where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HostVolumeProperties = HostVolumeProperties'
{
HostVolumeProperties -> Maybe Text
sourcePath :: Prelude.Maybe Prelude.Text
}
deriving (HostVolumeProperties -> HostVolumeProperties -> Bool
(HostVolumeProperties -> HostVolumeProperties -> Bool)
-> (HostVolumeProperties -> HostVolumeProperties -> Bool)
-> Eq HostVolumeProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostVolumeProperties -> HostVolumeProperties -> Bool
$c/= :: HostVolumeProperties -> HostVolumeProperties -> Bool
== :: HostVolumeProperties -> HostVolumeProperties -> Bool
$c== :: HostVolumeProperties -> HostVolumeProperties -> Bool
Prelude.Eq, ReadPrec [HostVolumeProperties]
ReadPrec HostVolumeProperties
Int -> ReadS HostVolumeProperties
ReadS [HostVolumeProperties]
(Int -> ReadS HostVolumeProperties)
-> ReadS [HostVolumeProperties]
-> ReadPrec HostVolumeProperties
-> ReadPrec [HostVolumeProperties]
-> Read HostVolumeProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostVolumeProperties]
$creadListPrec :: ReadPrec [HostVolumeProperties]
readPrec :: ReadPrec HostVolumeProperties
$creadPrec :: ReadPrec HostVolumeProperties
readList :: ReadS [HostVolumeProperties]
$creadList :: ReadS [HostVolumeProperties]
readsPrec :: Int -> ReadS HostVolumeProperties
$creadsPrec :: Int -> ReadS HostVolumeProperties
Prelude.Read, Int -> HostVolumeProperties -> ShowS
[HostVolumeProperties] -> ShowS
HostVolumeProperties -> String
(Int -> HostVolumeProperties -> ShowS)
-> (HostVolumeProperties -> String)
-> ([HostVolumeProperties] -> ShowS)
-> Show HostVolumeProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostVolumeProperties] -> ShowS
$cshowList :: [HostVolumeProperties] -> ShowS
show :: HostVolumeProperties -> String
$cshow :: HostVolumeProperties -> String
showsPrec :: Int -> HostVolumeProperties -> ShowS
$cshowsPrec :: Int -> HostVolumeProperties -> ShowS
Prelude.Show, (forall x. HostVolumeProperties -> Rep HostVolumeProperties x)
-> (forall x. Rep HostVolumeProperties x -> HostVolumeProperties)
-> Generic HostVolumeProperties
forall x. Rep HostVolumeProperties x -> HostVolumeProperties
forall x. HostVolumeProperties -> Rep HostVolumeProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostVolumeProperties x -> HostVolumeProperties
$cfrom :: forall x. HostVolumeProperties -> Rep HostVolumeProperties x
Prelude.Generic)
newHostVolumeProperties ::
HostVolumeProperties
newHostVolumeProperties :: HostVolumeProperties
newHostVolumeProperties =
HostVolumeProperties' :: Maybe Text -> HostVolumeProperties
HostVolumeProperties' {$sel:sourcePath:HostVolumeProperties' :: Maybe Text
sourcePath = Maybe Text
forall a. Maybe a
Prelude.Nothing}
hostVolumeProperties_sourcePath :: Lens.Lens' HostVolumeProperties (Prelude.Maybe Prelude.Text)
hostVolumeProperties_sourcePath :: (Maybe Text -> f (Maybe Text))
-> HostVolumeProperties -> f HostVolumeProperties
hostVolumeProperties_sourcePath = (HostVolumeProperties -> Maybe Text)
-> (HostVolumeProperties -> Maybe Text -> HostVolumeProperties)
-> Lens
HostVolumeProperties HostVolumeProperties (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostVolumeProperties' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:HostVolumeProperties' :: HostVolumeProperties -> Maybe Text
sourcePath} -> Maybe Text
sourcePath) (\s :: HostVolumeProperties
s@HostVolumeProperties' {} Maybe Text
a -> HostVolumeProperties
s {$sel:sourcePath:HostVolumeProperties' :: Maybe Text
sourcePath = Maybe Text
a} :: HostVolumeProperties)
instance Core.FromJSON HostVolumeProperties where
parseJSON :: Value -> Parser HostVolumeProperties
parseJSON =
String
-> (Object -> Parser HostVolumeProperties)
-> Value
-> Parser HostVolumeProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HostVolumeProperties"
( \Object
x ->
Maybe Text -> HostVolumeProperties
HostVolumeProperties'
(Maybe Text -> HostVolumeProperties)
-> Parser (Maybe Text) -> Parser HostVolumeProperties
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
"sourcePath")
)
instance Prelude.Hashable HostVolumeProperties
instance Prelude.NFData HostVolumeProperties
instance Core.ToJSON HostVolumeProperties where
toJSON :: HostVolumeProperties -> Value
toJSON HostVolumeProperties' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:HostVolumeProperties' :: HostVolumeProperties -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"sourcePath" 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
sourcePath]
)