{-# 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.CloudFormation.Types.Parameter 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 Parameter = Parameter'
{
Parameter -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Text
resolvedValue :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Bool
usePreviousValue :: Prelude.Maybe Prelude.Bool
}
deriving (Parameter -> Parameter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Parameter -> Parameter -> Bool
$c/= :: Parameter -> Parameter -> Bool
== :: Parameter -> Parameter -> Bool
$c== :: Parameter -> Parameter -> Bool
Prelude.Eq, ReadPrec [Parameter]
ReadPrec Parameter
Int -> ReadS Parameter
ReadS [Parameter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Parameter]
$creadListPrec :: ReadPrec [Parameter]
readPrec :: ReadPrec Parameter
$creadPrec :: ReadPrec Parameter
readList :: ReadS [Parameter]
$creadList :: ReadS [Parameter]
readsPrec :: Int -> ReadS Parameter
$creadsPrec :: Int -> ReadS Parameter
Prelude.Read, Int -> Parameter -> ShowS
[Parameter] -> ShowS
Parameter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Parameter] -> ShowS
$cshowList :: [Parameter] -> ShowS
show :: Parameter -> String
$cshow :: Parameter -> String
showsPrec :: Int -> Parameter -> ShowS
$cshowsPrec :: Int -> Parameter -> ShowS
Prelude.Show, forall x. Rep Parameter x -> Parameter
forall x. Parameter -> Rep Parameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Parameter x -> Parameter
$cfrom :: forall x. Parameter -> Rep Parameter x
Prelude.Generic)
newParameter ::
Parameter
newParameter :: Parameter
newParameter =
Parameter'
{ $sel:parameterKey:Parameter' :: Maybe Text
parameterKey = forall a. Maybe a
Prelude.Nothing,
$sel:parameterValue:Parameter' :: Maybe Text
parameterValue = forall a. Maybe a
Prelude.Nothing,
$sel:resolvedValue:Parameter' :: Maybe Text
resolvedValue = forall a. Maybe a
Prelude.Nothing,
$sel:usePreviousValue:Parameter' :: Maybe Bool
usePreviousValue = forall a. Maybe a
Prelude.Nothing
}
parameter_parameterKey :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Text)
parameter_parameterKey :: Lens' Parameter (Maybe Text)
parameter_parameterKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Parameter' {Maybe Text
parameterKey :: Maybe Text
$sel:parameterKey:Parameter' :: Parameter -> Maybe Text
parameterKey} -> Maybe Text
parameterKey) (\s :: Parameter
s@Parameter' {} Maybe Text
a -> Parameter
s {$sel:parameterKey:Parameter' :: Maybe Text
parameterKey = Maybe Text
a} :: Parameter)
parameter_parameterValue :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Text)
parameter_parameterValue :: Lens' Parameter (Maybe Text)
parameter_parameterValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Parameter' {Maybe Text
parameterValue :: Maybe Text
$sel:parameterValue:Parameter' :: Parameter -> Maybe Text
parameterValue} -> Maybe Text
parameterValue) (\s :: Parameter
s@Parameter' {} Maybe Text
a -> Parameter
s {$sel:parameterValue:Parameter' :: Maybe Text
parameterValue = Maybe Text
a} :: Parameter)
parameter_resolvedValue :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Text)
parameter_resolvedValue :: Lens' Parameter (Maybe Text)
parameter_resolvedValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Parameter' {Maybe Text
resolvedValue :: Maybe Text
$sel:resolvedValue:Parameter' :: Parameter -> Maybe Text
resolvedValue} -> Maybe Text
resolvedValue) (\s :: Parameter
s@Parameter' {} Maybe Text
a -> Parameter
s {$sel:resolvedValue:Parameter' :: Maybe Text
resolvedValue = Maybe Text
a} :: Parameter)
parameter_usePreviousValue :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Bool)
parameter_usePreviousValue :: Lens' Parameter (Maybe Bool)
parameter_usePreviousValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Parameter' {Maybe Bool
usePreviousValue :: Maybe Bool
$sel:usePreviousValue:Parameter' :: Parameter -> Maybe Bool
usePreviousValue} -> Maybe Bool
usePreviousValue) (\s :: Parameter
s@Parameter' {} Maybe Bool
a -> Parameter
s {$sel:usePreviousValue:Parameter' :: Maybe Bool
usePreviousValue = Maybe Bool
a} :: Parameter)
instance Data.FromXML Parameter where
parseXML :: [Node] -> Either String Parameter
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Parameter
Parameter'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ParameterKey")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ParameterValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ResolvedValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"UsePreviousValue")
instance Prelude.Hashable Parameter where
hashWithSalt :: Int -> Parameter -> Int
hashWithSalt Int
_salt Parameter' {Maybe Bool
Maybe Text
usePreviousValue :: Maybe Bool
resolvedValue :: Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:usePreviousValue:Parameter' :: Parameter -> Maybe Bool
$sel:resolvedValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterKey:Parameter' :: Parameter -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resolvedValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
usePreviousValue
instance Prelude.NFData Parameter where
rnf :: Parameter -> ()
rnf Parameter' {Maybe Bool
Maybe Text
usePreviousValue :: Maybe Bool
resolvedValue :: Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:usePreviousValue:Parameter' :: Parameter -> Maybe Bool
$sel:resolvedValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterKey:Parameter' :: Parameter -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resolvedValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
usePreviousValue
instance Data.ToQuery Parameter where
toQuery :: Parameter -> QueryString
toQuery Parameter' {Maybe Bool
Maybe Text
usePreviousValue :: Maybe Bool
resolvedValue :: Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:usePreviousValue:Parameter' :: Parameter -> Maybe Bool
$sel:resolvedValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterKey:Parameter' :: Parameter -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ParameterKey" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
parameterKey,
ByteString
"ParameterValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
parameterValue,
ByteString
"ResolvedValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
resolvedValue,
ByteString
"UsePreviousValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
usePreviousValue
]