{-# 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.SSM.Types.MetadataValue 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 MetadataValue = MetadataValue'
{
MetadataValue -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (MetadataValue -> MetadataValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetadataValue -> MetadataValue -> Bool
$c/= :: MetadataValue -> MetadataValue -> Bool
== :: MetadataValue -> MetadataValue -> Bool
$c== :: MetadataValue -> MetadataValue -> Bool
Prelude.Eq, ReadPrec [MetadataValue]
ReadPrec MetadataValue
Int -> ReadS MetadataValue
ReadS [MetadataValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetadataValue]
$creadListPrec :: ReadPrec [MetadataValue]
readPrec :: ReadPrec MetadataValue
$creadPrec :: ReadPrec MetadataValue
readList :: ReadS [MetadataValue]
$creadList :: ReadS [MetadataValue]
readsPrec :: Int -> ReadS MetadataValue
$creadsPrec :: Int -> ReadS MetadataValue
Prelude.Read, Int -> MetadataValue -> ShowS
[MetadataValue] -> ShowS
MetadataValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetadataValue] -> ShowS
$cshowList :: [MetadataValue] -> ShowS
show :: MetadataValue -> String
$cshow :: MetadataValue -> String
showsPrec :: Int -> MetadataValue -> ShowS
$cshowsPrec :: Int -> MetadataValue -> ShowS
Prelude.Show, forall x. Rep MetadataValue x -> MetadataValue
forall x. MetadataValue -> Rep MetadataValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetadataValue x -> MetadataValue
$cfrom :: forall x. MetadataValue -> Rep MetadataValue x
Prelude.Generic)
newMetadataValue ::
MetadataValue
newMetadataValue :: MetadataValue
newMetadataValue =
MetadataValue' {$sel:value:MetadataValue' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing}
metadataValue_value :: Lens.Lens' MetadataValue (Prelude.Maybe Prelude.Text)
metadataValue_value :: Lens' MetadataValue (Maybe Text)
metadataValue_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataValue' {Maybe Text
value :: Maybe Text
$sel:value:MetadataValue' :: MetadataValue -> Maybe Text
value} -> Maybe Text
value) (\s :: MetadataValue
s@MetadataValue' {} Maybe Text
a -> MetadataValue
s {$sel:value:MetadataValue' :: Maybe Text
value = Maybe Text
a} :: MetadataValue)
instance Data.FromJSON MetadataValue where
parseJSON :: Value -> Parser MetadataValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MetadataValue"
( \Object
x ->
Maybe Text -> MetadataValue
MetadataValue' 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
"Value")
)
instance Prelude.Hashable MetadataValue where
hashWithSalt :: Int -> MetadataValue -> Int
hashWithSalt Int
_salt MetadataValue' {Maybe Text
value :: Maybe Text
$sel:value:MetadataValue' :: MetadataValue -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData MetadataValue where
rnf :: MetadataValue -> ()
rnf MetadataValue' {Maybe Text
value :: Maybe Text
$sel:value:MetadataValue' :: MetadataValue -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
instance Data.ToJSON MetadataValue where
toJSON :: MetadataValue -> Value
toJSON MetadataValue' {Maybe Text
value :: Maybe Text
$sel:value:MetadataValue' :: MetadataValue -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Value" 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
value]
)