{-# 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.ParameterDeclaration where
import Amazonka.CloudFormation.Types.ParameterConstraints
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ParameterDeclaration = ParameterDeclaration'
{
ParameterDeclaration -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
ParameterDeclaration -> Maybe Text
parameterType :: Prelude.Maybe Prelude.Text,
ParameterDeclaration -> Maybe ParameterConstraints
parameterConstraints :: Prelude.Maybe ParameterConstraints,
ParameterDeclaration -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
ParameterDeclaration -> Maybe Bool
noEcho :: Prelude.Maybe Prelude.Bool,
ParameterDeclaration -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ParameterDeclaration -> ParameterDeclaration -> Bool
(ParameterDeclaration -> ParameterDeclaration -> Bool)
-> (ParameterDeclaration -> ParameterDeclaration -> Bool)
-> Eq ParameterDeclaration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterDeclaration -> ParameterDeclaration -> Bool
$c/= :: ParameterDeclaration -> ParameterDeclaration -> Bool
== :: ParameterDeclaration -> ParameterDeclaration -> Bool
$c== :: ParameterDeclaration -> ParameterDeclaration -> Bool
Prelude.Eq, ReadPrec [ParameterDeclaration]
ReadPrec ParameterDeclaration
Int -> ReadS ParameterDeclaration
ReadS [ParameterDeclaration]
(Int -> ReadS ParameterDeclaration)
-> ReadS [ParameterDeclaration]
-> ReadPrec ParameterDeclaration
-> ReadPrec [ParameterDeclaration]
-> Read ParameterDeclaration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterDeclaration]
$creadListPrec :: ReadPrec [ParameterDeclaration]
readPrec :: ReadPrec ParameterDeclaration
$creadPrec :: ReadPrec ParameterDeclaration
readList :: ReadS [ParameterDeclaration]
$creadList :: ReadS [ParameterDeclaration]
readsPrec :: Int -> ReadS ParameterDeclaration
$creadsPrec :: Int -> ReadS ParameterDeclaration
Prelude.Read, Int -> ParameterDeclaration -> ShowS
[ParameterDeclaration] -> ShowS
ParameterDeclaration -> String
(Int -> ParameterDeclaration -> ShowS)
-> (ParameterDeclaration -> String)
-> ([ParameterDeclaration] -> ShowS)
-> Show ParameterDeclaration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterDeclaration] -> ShowS
$cshowList :: [ParameterDeclaration] -> ShowS
show :: ParameterDeclaration -> String
$cshow :: ParameterDeclaration -> String
showsPrec :: Int -> ParameterDeclaration -> ShowS
$cshowsPrec :: Int -> ParameterDeclaration -> ShowS
Prelude.Show, (forall x. ParameterDeclaration -> Rep ParameterDeclaration x)
-> (forall x. Rep ParameterDeclaration x -> ParameterDeclaration)
-> Generic ParameterDeclaration
forall x. Rep ParameterDeclaration x -> ParameterDeclaration
forall x. ParameterDeclaration -> Rep ParameterDeclaration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterDeclaration x -> ParameterDeclaration
$cfrom :: forall x. ParameterDeclaration -> Rep ParameterDeclaration x
Prelude.Generic)
newParameterDeclaration ::
ParameterDeclaration
newParameterDeclaration :: ParameterDeclaration
newParameterDeclaration =
ParameterDeclaration' :: Maybe Text
-> Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ParameterDeclaration
ParameterDeclaration'
{ $sel:parameterKey:ParameterDeclaration' :: Maybe Text
parameterKey =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameterType:ParameterDeclaration' :: Maybe Text
parameterType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameterConstraints:ParameterDeclaration' :: Maybe ParameterConstraints
parameterConstraints = Maybe ParameterConstraints
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:ParameterDeclaration' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:noEcho:ParameterDeclaration' :: Maybe Bool
noEcho = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:description:ParameterDeclaration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
parameterDeclaration_parameterKey :: Lens.Lens' ParameterDeclaration (Prelude.Maybe Prelude.Text)
parameterDeclaration_parameterKey :: (Maybe Text -> f (Maybe Text))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_parameterKey = (ParameterDeclaration -> Maybe Text)
-> (ParameterDeclaration -> Maybe Text -> ParameterDeclaration)
-> Lens
ParameterDeclaration ParameterDeclaration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe Text
parameterKey :: Maybe Text
$sel:parameterKey:ParameterDeclaration' :: ParameterDeclaration -> Maybe Text
parameterKey} -> Maybe Text
parameterKey) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe Text
a -> ParameterDeclaration
s {$sel:parameterKey:ParameterDeclaration' :: Maybe Text
parameterKey = Maybe Text
a} :: ParameterDeclaration)
parameterDeclaration_parameterType :: Lens.Lens' ParameterDeclaration (Prelude.Maybe Prelude.Text)
parameterDeclaration_parameterType :: (Maybe Text -> f (Maybe Text))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_parameterType = (ParameterDeclaration -> Maybe Text)
-> (ParameterDeclaration -> Maybe Text -> ParameterDeclaration)
-> Lens
ParameterDeclaration ParameterDeclaration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe Text
parameterType :: Maybe Text
$sel:parameterType:ParameterDeclaration' :: ParameterDeclaration -> Maybe Text
parameterType} -> Maybe Text
parameterType) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe Text
a -> ParameterDeclaration
s {$sel:parameterType:ParameterDeclaration' :: Maybe Text
parameterType = Maybe Text
a} :: ParameterDeclaration)
parameterDeclaration_parameterConstraints :: Lens.Lens' ParameterDeclaration (Prelude.Maybe ParameterConstraints)
parameterDeclaration_parameterConstraints :: (Maybe ParameterConstraints -> f (Maybe ParameterConstraints))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_parameterConstraints = (ParameterDeclaration -> Maybe ParameterConstraints)
-> (ParameterDeclaration
-> Maybe ParameterConstraints -> ParameterDeclaration)
-> Lens
ParameterDeclaration
ParameterDeclaration
(Maybe ParameterConstraints)
(Maybe ParameterConstraints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe ParameterConstraints
parameterConstraints :: Maybe ParameterConstraints
$sel:parameterConstraints:ParameterDeclaration' :: ParameterDeclaration -> Maybe ParameterConstraints
parameterConstraints} -> Maybe ParameterConstraints
parameterConstraints) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe ParameterConstraints
a -> ParameterDeclaration
s {$sel:parameterConstraints:ParameterDeclaration' :: Maybe ParameterConstraints
parameterConstraints = Maybe ParameterConstraints
a} :: ParameterDeclaration)
parameterDeclaration_defaultValue :: Lens.Lens' ParameterDeclaration (Prelude.Maybe Prelude.Text)
parameterDeclaration_defaultValue :: (Maybe Text -> f (Maybe Text))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_defaultValue = (ParameterDeclaration -> Maybe Text)
-> (ParameterDeclaration -> Maybe Text -> ParameterDeclaration)
-> Lens
ParameterDeclaration ParameterDeclaration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:ParameterDeclaration' :: ParameterDeclaration -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe Text
a -> ParameterDeclaration
s {$sel:defaultValue:ParameterDeclaration' :: Maybe Text
defaultValue = Maybe Text
a} :: ParameterDeclaration)
parameterDeclaration_noEcho :: Lens.Lens' ParameterDeclaration (Prelude.Maybe Prelude.Bool)
parameterDeclaration_noEcho :: (Maybe Bool -> f (Maybe Bool))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_noEcho = (ParameterDeclaration -> Maybe Bool)
-> (ParameterDeclaration -> Maybe Bool -> ParameterDeclaration)
-> Lens
ParameterDeclaration ParameterDeclaration (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe Bool
noEcho :: Maybe Bool
$sel:noEcho:ParameterDeclaration' :: ParameterDeclaration -> Maybe Bool
noEcho} -> Maybe Bool
noEcho) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe Bool
a -> ParameterDeclaration
s {$sel:noEcho:ParameterDeclaration' :: Maybe Bool
noEcho = Maybe Bool
a} :: ParameterDeclaration)
parameterDeclaration_description :: Lens.Lens' ParameterDeclaration (Prelude.Maybe Prelude.Text)
parameterDeclaration_description :: (Maybe Text -> f (Maybe Text))
-> ParameterDeclaration -> f ParameterDeclaration
parameterDeclaration_description = (ParameterDeclaration -> Maybe Text)
-> (ParameterDeclaration -> Maybe Text -> ParameterDeclaration)
-> Lens
ParameterDeclaration ParameterDeclaration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDeclaration' {Maybe Text
description :: Maybe Text
$sel:description:ParameterDeclaration' :: ParameterDeclaration -> Maybe Text
description} -> Maybe Text
description) (\s :: ParameterDeclaration
s@ParameterDeclaration' {} Maybe Text
a -> ParameterDeclaration
s {$sel:description:ParameterDeclaration' :: Maybe Text
description = Maybe Text
a} :: ParameterDeclaration)
instance Core.FromXML ParameterDeclaration where
parseXML :: [Node] -> Either String ParameterDeclaration
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ParameterDeclaration
ParameterDeclaration'
(Maybe Text
-> Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ParameterDeclaration)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ParameterDeclaration)
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 ParameterConstraints
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ParameterDeclaration)
-> Either String (Maybe Text)
-> Either
String
(Maybe ParameterConstraints
-> Maybe Text -> Maybe Bool -> Maybe Text -> ParameterDeclaration)
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
"ParameterType")
Either
String
(Maybe ParameterConstraints
-> Maybe Text -> Maybe Bool -> Maybe Text -> ParameterDeclaration)
-> Either String (Maybe ParameterConstraints)
-> Either
String
(Maybe Text -> Maybe Bool -> Maybe Text -> ParameterDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ParameterConstraints)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ParameterConstraints")
Either
String
(Maybe Text -> Maybe Bool -> Maybe Text -> ParameterDeclaration)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Maybe Text -> ParameterDeclaration)
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 -> ParameterDeclaration)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> ParameterDeclaration)
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 -> ParameterDeclaration)
-> Either String (Maybe Text) -> Either String ParameterDeclaration
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 ParameterDeclaration
instance Prelude.NFData ParameterDeclaration