{-# 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.TemplateParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TemplateParameter = TemplateParameter'
{
TemplateParameter -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
TemplateParameter -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
TemplateParameter -> Maybe Bool
noEcho :: Prelude.Maybe Prelude.Bool,
TemplateParameter -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (TemplateParameter -> TemplateParameter -> Bool
(TemplateParameter -> TemplateParameter -> Bool)
-> (TemplateParameter -> TemplateParameter -> Bool)
-> Eq TemplateParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateParameter -> TemplateParameter -> Bool
$c/= :: TemplateParameter -> TemplateParameter -> Bool
== :: TemplateParameter -> TemplateParameter -> Bool
$c== :: TemplateParameter -> TemplateParameter -> Bool
Prelude.Eq, ReadPrec [TemplateParameter]
ReadPrec TemplateParameter
Int -> ReadS TemplateParameter
ReadS [TemplateParameter]
(Int -> ReadS TemplateParameter)
-> ReadS [TemplateParameter]
-> ReadPrec TemplateParameter
-> ReadPrec [TemplateParameter]
-> Read TemplateParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateParameter]
$creadListPrec :: ReadPrec [TemplateParameter]
readPrec :: ReadPrec TemplateParameter
$creadPrec :: ReadPrec TemplateParameter
readList :: ReadS [TemplateParameter]
$creadList :: ReadS [TemplateParameter]
readsPrec :: Int -> ReadS TemplateParameter
$creadsPrec :: Int -> ReadS TemplateParameter
Prelude.Read, Int -> TemplateParameter -> ShowS
[TemplateParameter] -> ShowS
TemplateParameter -> String
(Int -> TemplateParameter -> ShowS)
-> (TemplateParameter -> String)
-> ([TemplateParameter] -> ShowS)
-> Show TemplateParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateParameter] -> ShowS
$cshowList :: [TemplateParameter] -> ShowS
show :: TemplateParameter -> String
$cshow :: TemplateParameter -> String
showsPrec :: Int -> TemplateParameter -> ShowS
$cshowsPrec :: Int -> TemplateParameter -> ShowS
Prelude.Show, (forall x. TemplateParameter -> Rep TemplateParameter x)
-> (forall x. Rep TemplateParameter x -> TemplateParameter)
-> Generic TemplateParameter
forall x. Rep TemplateParameter x -> TemplateParameter
forall x. TemplateParameter -> Rep TemplateParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateParameter x -> TemplateParameter
$cfrom :: forall x. TemplateParameter -> Rep TemplateParameter x
Prelude.Generic)
newTemplateParameter ::
TemplateParameter
newTemplateParameter :: TemplateParameter
newTemplateParameter =
TemplateParameter' :: Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> TemplateParameter
TemplateParameter'
{ $sel:parameterKey:TemplateParameter' :: Maybe Text
parameterKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:TemplateParameter' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:noEcho:TemplateParameter' :: Maybe Bool
noEcho = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:description:TemplateParameter' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
templateParameter_parameterKey :: Lens.Lens' TemplateParameter (Prelude.Maybe Prelude.Text)
templateParameter_parameterKey :: (Maybe Text -> f (Maybe Text))
-> TemplateParameter -> f TemplateParameter
templateParameter_parameterKey = (TemplateParameter -> Maybe Text)
-> (TemplateParameter -> Maybe Text -> TemplateParameter)
-> Lens
TemplateParameter TemplateParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateParameter' {Maybe Text
parameterKey :: Maybe Text
$sel:parameterKey:TemplateParameter' :: TemplateParameter -> Maybe Text
parameterKey} -> Maybe Text
parameterKey) (\s :: TemplateParameter
s@TemplateParameter' {} Maybe Text
a -> TemplateParameter
s {$sel:parameterKey:TemplateParameter' :: Maybe Text
parameterKey = Maybe Text
a} :: TemplateParameter)
templateParameter_defaultValue :: Lens.Lens' TemplateParameter (Prelude.Maybe Prelude.Text)
templateParameter_defaultValue :: (Maybe Text -> f (Maybe Text))
-> TemplateParameter -> f TemplateParameter
templateParameter_defaultValue = (TemplateParameter -> Maybe Text)
-> (TemplateParameter -> Maybe Text -> TemplateParameter)
-> Lens
TemplateParameter TemplateParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateParameter' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:TemplateParameter' :: TemplateParameter -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: TemplateParameter
s@TemplateParameter' {} Maybe Text
a -> TemplateParameter
s {$sel:defaultValue:TemplateParameter' :: Maybe Text
defaultValue = Maybe Text
a} :: TemplateParameter)
templateParameter_noEcho :: Lens.Lens' TemplateParameter (Prelude.Maybe Prelude.Bool)
templateParameter_noEcho :: (Maybe Bool -> f (Maybe Bool))
-> TemplateParameter -> f TemplateParameter
templateParameter_noEcho = (TemplateParameter -> Maybe Bool)
-> (TemplateParameter -> Maybe Bool -> TemplateParameter)
-> Lens
TemplateParameter TemplateParameter (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateParameter' {Maybe Bool
noEcho :: Maybe Bool
$sel:noEcho:TemplateParameter' :: TemplateParameter -> Maybe Bool
noEcho} -> Maybe Bool
noEcho) (\s :: TemplateParameter
s@TemplateParameter' {} Maybe Bool
a -> TemplateParameter
s {$sel:noEcho:TemplateParameter' :: Maybe Bool
noEcho = Maybe Bool
a} :: TemplateParameter)
templateParameter_description :: Lens.Lens' TemplateParameter (Prelude.Maybe Prelude.Text)
templateParameter_description :: (Maybe Text -> f (Maybe Text))
-> TemplateParameter -> f TemplateParameter
templateParameter_description = (TemplateParameter -> Maybe Text)
-> (TemplateParameter -> Maybe Text -> TemplateParameter)
-> Lens
TemplateParameter TemplateParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateParameter' {Maybe Text
description :: Maybe Text
$sel:description:TemplateParameter' :: TemplateParameter -> Maybe Text
description} -> Maybe Text
description) (\s :: TemplateParameter
s@TemplateParameter' {} Maybe Text
a -> TemplateParameter
s {$sel:description:TemplateParameter' :: Maybe Text
description = Maybe Text
a} :: TemplateParameter)
instance Core.FromXML TemplateParameter where
parseXML :: [Node] -> Either String TemplateParameter
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> TemplateParameter
TemplateParameter'
(Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> TemplateParameter)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Bool -> Maybe Text -> TemplateParameter)
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
"ParameterKey")
Either
String
(Maybe Text -> Maybe Bool -> Maybe Text -> TemplateParameter)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Maybe Text -> TemplateParameter)
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
"DefaultValue")
Either String (Maybe Bool -> Maybe Text -> TemplateParameter)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> TemplateParameter)
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
"NoEcho")
Either String (Maybe Text -> TemplateParameter)
-> Either String (Maybe Text) -> Either String TemplateParameter
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
"Description")
instance Prelude.Hashable TemplateParameter
instance Prelude.NFData TemplateParameter