{-# 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.AutoDeployment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoDeployment = AutoDeployment'
{
AutoDeployment -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
AutoDeployment -> Maybe Bool
retainStacksOnAccountRemoval :: Prelude.Maybe Prelude.Bool
}
deriving (AutoDeployment -> AutoDeployment -> Bool
(AutoDeployment -> AutoDeployment -> Bool)
-> (AutoDeployment -> AutoDeployment -> Bool) -> Eq AutoDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoDeployment -> AutoDeployment -> Bool
$c/= :: AutoDeployment -> AutoDeployment -> Bool
== :: AutoDeployment -> AutoDeployment -> Bool
$c== :: AutoDeployment -> AutoDeployment -> Bool
Prelude.Eq, ReadPrec [AutoDeployment]
ReadPrec AutoDeployment
Int -> ReadS AutoDeployment
ReadS [AutoDeployment]
(Int -> ReadS AutoDeployment)
-> ReadS [AutoDeployment]
-> ReadPrec AutoDeployment
-> ReadPrec [AutoDeployment]
-> Read AutoDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoDeployment]
$creadListPrec :: ReadPrec [AutoDeployment]
readPrec :: ReadPrec AutoDeployment
$creadPrec :: ReadPrec AutoDeployment
readList :: ReadS [AutoDeployment]
$creadList :: ReadS [AutoDeployment]
readsPrec :: Int -> ReadS AutoDeployment
$creadsPrec :: Int -> ReadS AutoDeployment
Prelude.Read, Int -> AutoDeployment -> ShowS
[AutoDeployment] -> ShowS
AutoDeployment -> String
(Int -> AutoDeployment -> ShowS)
-> (AutoDeployment -> String)
-> ([AutoDeployment] -> ShowS)
-> Show AutoDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoDeployment] -> ShowS
$cshowList :: [AutoDeployment] -> ShowS
show :: AutoDeployment -> String
$cshow :: AutoDeployment -> String
showsPrec :: Int -> AutoDeployment -> ShowS
$cshowsPrec :: Int -> AutoDeployment -> ShowS
Prelude.Show, (forall x. AutoDeployment -> Rep AutoDeployment x)
-> (forall x. Rep AutoDeployment x -> AutoDeployment)
-> Generic AutoDeployment
forall x. Rep AutoDeployment x -> AutoDeployment
forall x. AutoDeployment -> Rep AutoDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoDeployment x -> AutoDeployment
$cfrom :: forall x. AutoDeployment -> Rep AutoDeployment x
Prelude.Generic)
newAutoDeployment ::
AutoDeployment
newAutoDeployment :: AutoDeployment
newAutoDeployment =
AutoDeployment' :: Maybe Bool -> Maybe Bool -> AutoDeployment
AutoDeployment'
{ $sel:enabled:AutoDeployment' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:retainStacksOnAccountRemoval:AutoDeployment' :: Maybe Bool
retainStacksOnAccountRemoval = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
autoDeployment_enabled :: Lens.Lens' AutoDeployment (Prelude.Maybe Prelude.Bool)
autoDeployment_enabled :: (Maybe Bool -> f (Maybe Bool))
-> AutoDeployment -> f AutoDeployment
autoDeployment_enabled = (AutoDeployment -> Maybe Bool)
-> (AutoDeployment -> Maybe Bool -> AutoDeployment)
-> Lens AutoDeployment AutoDeployment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoDeployment' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:AutoDeployment' :: AutoDeployment -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: AutoDeployment
s@AutoDeployment' {} Maybe Bool
a -> AutoDeployment
s {$sel:enabled:AutoDeployment' :: Maybe Bool
enabled = Maybe Bool
a} :: AutoDeployment)
autoDeployment_retainStacksOnAccountRemoval :: Lens.Lens' AutoDeployment (Prelude.Maybe Prelude.Bool)
autoDeployment_retainStacksOnAccountRemoval :: (Maybe Bool -> f (Maybe Bool))
-> AutoDeployment -> f AutoDeployment
autoDeployment_retainStacksOnAccountRemoval = (AutoDeployment -> Maybe Bool)
-> (AutoDeployment -> Maybe Bool -> AutoDeployment)
-> Lens AutoDeployment AutoDeployment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoDeployment' {Maybe Bool
retainStacksOnAccountRemoval :: Maybe Bool
$sel:retainStacksOnAccountRemoval:AutoDeployment' :: AutoDeployment -> Maybe Bool
retainStacksOnAccountRemoval} -> Maybe Bool
retainStacksOnAccountRemoval) (\s :: AutoDeployment
s@AutoDeployment' {} Maybe Bool
a -> AutoDeployment
s {$sel:retainStacksOnAccountRemoval:AutoDeployment' :: Maybe Bool
retainStacksOnAccountRemoval = Maybe Bool
a} :: AutoDeployment)
instance Core.FromXML AutoDeployment where
parseXML :: [Node] -> Either String AutoDeployment
parseXML [Node]
x =
Maybe Bool -> Maybe Bool -> AutoDeployment
AutoDeployment'
(Maybe Bool -> Maybe Bool -> AutoDeployment)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> AutoDeployment)
forall (f :: * -> *) a b. Functor 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
"Enabled")
Either String (Maybe Bool -> AutoDeployment)
-> Either String (Maybe Bool) -> Either String AutoDeployment
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
"RetainStacksOnAccountRemoval")
instance Prelude.Hashable AutoDeployment
instance Prelude.NFData AutoDeployment
instance Core.ToQuery AutoDeployment where
toQuery :: AutoDeployment -> QueryString
toQuery AutoDeployment' {Maybe Bool
retainStacksOnAccountRemoval :: Maybe Bool
enabled :: Maybe Bool
$sel:retainStacksOnAccountRemoval:AutoDeployment' :: AutoDeployment -> Maybe Bool
$sel:enabled:AutoDeployment' :: AutoDeployment -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Enabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enabled,
ByteString
"RetainStacksOnAccountRemoval"
ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
retainStacksOnAccountRemoval
]