{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data HostVolumeProperties = HostVolumeProperties'
{
HostVolumeProperties -> Maybe Text
sourcePath :: Prelude.Maybe Prelude.Text
}
deriving (HostVolumeProperties -> HostVolumeProperties -> Bool
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]
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
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. 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' {$sel:sourcePath:HostVolumeProperties' :: Maybe Text
sourcePath = forall a. Maybe a
Prelude.Nothing}
hostVolumeProperties_sourcePath :: Lens.Lens' HostVolumeProperties (Prelude.Maybe Prelude.Text)
hostVolumeProperties_sourcePath :: Lens' HostVolumeProperties (Maybe Text)
hostVolumeProperties_sourcePath = 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 Data.FromJSON HostVolumeProperties where
parseJSON :: Value -> Parser HostVolumeProperties
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HostVolumeProperties"
( \Object
x ->
Maybe Text -> HostVolumeProperties
HostVolumeProperties'
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
"sourcePath")
)
instance Prelude.Hashable HostVolumeProperties where
hashWithSalt :: Int -> HostVolumeProperties -> Int
hashWithSalt Int
_salt HostVolumeProperties' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:HostVolumeProperties' :: HostVolumeProperties -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourcePath
instance Prelude.NFData HostVolumeProperties where
rnf :: HostVolumeProperties -> ()
rnf HostVolumeProperties' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:HostVolumeProperties' :: HostVolumeProperties -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourcePath
instance Data.ToJSON HostVolumeProperties where
toJSON :: HostVolumeProperties -> Value
toJSON HostVolumeProperties' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:HostVolumeProperties' :: HostVolumeProperties -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"sourcePath" 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
sourcePath]
)