{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Parameter = Parameter'
{
Parameter -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Text
resolvedValue :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
Parameter -> Maybe Bool
usePreviousValue :: Prelude.Maybe Prelude.Bool
}
deriving (Parameter -> Parameter -> Bool
(Parameter -> Parameter -> Bool)
-> (Parameter -> Parameter -> Bool) -> Eq Parameter
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]
(Int -> ReadS Parameter)
-> ReadS [Parameter]
-> ReadPrec Parameter
-> ReadPrec [Parameter]
-> Read 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
(Int -> Parameter -> ShowS)
-> (Parameter -> String)
-> ([Parameter] -> ShowS)
-> Show Parameter
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. Parameter -> Rep Parameter x)
-> (forall x. Rep Parameter x -> Parameter) -> Generic Parameter
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' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Parameter
Parameter'
{ $sel:parameterValue:Parameter' :: Maybe Text
parameterValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resolvedValue:Parameter' :: Maybe Text
resolvedValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameterKey:Parameter' :: Maybe Text
parameterKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:usePreviousValue:Parameter' :: Maybe Bool
usePreviousValue = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
parameter_parameterValue :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Text)
parameter_parameterValue :: (Maybe Text -> f (Maybe Text)) -> Parameter -> f Parameter
parameter_parameterValue = (Parameter -> Maybe Text)
-> (Parameter -> Maybe Text -> Parameter)
-> Lens Parameter Parameter (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Parameter -> f Parameter
parameter_resolvedValue = (Parameter -> Maybe Text)
-> (Parameter -> Maybe Text -> Parameter)
-> Lens Parameter Parameter (Maybe Text) (Maybe Text)
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_parameterKey :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Text)
parameter_parameterKey :: (Maybe Text -> f (Maybe Text)) -> Parameter -> f Parameter
parameter_parameterKey = (Parameter -> Maybe Text)
-> (Parameter -> Maybe Text -> Parameter)
-> Lens Parameter Parameter (Maybe Text) (Maybe Text)
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_usePreviousValue :: Lens.Lens' Parameter (Prelude.Maybe Prelude.Bool)
parameter_usePreviousValue :: (Maybe Bool -> f (Maybe Bool)) -> Parameter -> f Parameter
parameter_usePreviousValue = (Parameter -> Maybe Bool)
-> (Parameter -> Maybe Bool -> Parameter)
-> Lens Parameter Parameter (Maybe Bool) (Maybe Bool)
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 Core.FromXML Parameter where
parseXML :: [Node] -> Either String Parameter
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Parameter
Parameter'
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Parameter)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Bool -> Parameter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ParameterValue")
Either String (Maybe Text -> Maybe Text -> Maybe Bool -> Parameter)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Bool -> Parameter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResolvedValue")
Either String (Maybe Text -> Maybe Bool -> Parameter)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Parameter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ParameterKey")
Either String (Maybe Bool -> Parameter)
-> Either String (Maybe Bool) -> Either String Parameter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UsePreviousValue")
instance Prelude.Hashable Parameter
instance Prelude.NFData Parameter
instance Core.ToQuery Parameter where
toQuery :: Parameter -> QueryString
toQuery Parameter' {Maybe Bool
Maybe Text
usePreviousValue :: Maybe Bool
parameterKey :: Maybe Text
resolvedValue :: Maybe Text
parameterValue :: Maybe Text
$sel:usePreviousValue:Parameter' :: Parameter -> Maybe Bool
$sel:parameterKey:Parameter' :: Parameter -> Maybe Text
$sel:resolvedValue:Parameter' :: Parameter -> Maybe Text
$sel:parameterValue:Parameter' :: Parameter -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ParameterValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
parameterValue,
ByteString
"ResolvedValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resolvedValue,
ByteString
"ParameterKey" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
parameterKey,
ByteString
"UsePreviousValue" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
usePreviousValue
]