{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudFormation.ExecuteChangeSet
(
ExecuteChangeSet (..),
newExecuteChangeSet,
executeChangeSet_disableRollback,
executeChangeSet_clientRequestToken,
executeChangeSet_stackName,
executeChangeSet_changeSetName,
ExecuteChangeSetResponse (..),
newExecuteChangeSetResponse,
executeChangeSetResponse_httpStatus,
)
where
import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ExecuteChangeSet = ExecuteChangeSet'
{
ExecuteChangeSet -> Maybe Bool
disableRollback :: Prelude.Maybe Prelude.Bool,
ExecuteChangeSet -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
ExecuteChangeSet -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text,
ExecuteChangeSet -> Text
changeSetName :: Prelude.Text
}
deriving (ExecuteChangeSet -> ExecuteChangeSet -> Bool
(ExecuteChangeSet -> ExecuteChangeSet -> Bool)
-> (ExecuteChangeSet -> ExecuteChangeSet -> Bool)
-> Eq ExecuteChangeSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecuteChangeSet -> ExecuteChangeSet -> Bool
$c/= :: ExecuteChangeSet -> ExecuteChangeSet -> Bool
== :: ExecuteChangeSet -> ExecuteChangeSet -> Bool
$c== :: ExecuteChangeSet -> ExecuteChangeSet -> Bool
Prelude.Eq, ReadPrec [ExecuteChangeSet]
ReadPrec ExecuteChangeSet
Int -> ReadS ExecuteChangeSet
ReadS [ExecuteChangeSet]
(Int -> ReadS ExecuteChangeSet)
-> ReadS [ExecuteChangeSet]
-> ReadPrec ExecuteChangeSet
-> ReadPrec [ExecuteChangeSet]
-> Read ExecuteChangeSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecuteChangeSet]
$creadListPrec :: ReadPrec [ExecuteChangeSet]
readPrec :: ReadPrec ExecuteChangeSet
$creadPrec :: ReadPrec ExecuteChangeSet
readList :: ReadS [ExecuteChangeSet]
$creadList :: ReadS [ExecuteChangeSet]
readsPrec :: Int -> ReadS ExecuteChangeSet
$creadsPrec :: Int -> ReadS ExecuteChangeSet
Prelude.Read, Int -> ExecuteChangeSet -> ShowS
[ExecuteChangeSet] -> ShowS
ExecuteChangeSet -> String
(Int -> ExecuteChangeSet -> ShowS)
-> (ExecuteChangeSet -> String)
-> ([ExecuteChangeSet] -> ShowS)
-> Show ExecuteChangeSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecuteChangeSet] -> ShowS
$cshowList :: [ExecuteChangeSet] -> ShowS
show :: ExecuteChangeSet -> String
$cshow :: ExecuteChangeSet -> String
showsPrec :: Int -> ExecuteChangeSet -> ShowS
$cshowsPrec :: Int -> ExecuteChangeSet -> ShowS
Prelude.Show, (forall x. ExecuteChangeSet -> Rep ExecuteChangeSet x)
-> (forall x. Rep ExecuteChangeSet x -> ExecuteChangeSet)
-> Generic ExecuteChangeSet
forall x. Rep ExecuteChangeSet x -> ExecuteChangeSet
forall x. ExecuteChangeSet -> Rep ExecuteChangeSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExecuteChangeSet x -> ExecuteChangeSet
$cfrom :: forall x. ExecuteChangeSet -> Rep ExecuteChangeSet x
Prelude.Generic)
newExecuteChangeSet ::
Prelude.Text ->
ExecuteChangeSet
newExecuteChangeSet :: Text -> ExecuteChangeSet
newExecuteChangeSet Text
pChangeSetName_ =
ExecuteChangeSet' :: Maybe Bool -> Maybe Text -> Maybe Text -> Text -> ExecuteChangeSet
ExecuteChangeSet'
{ $sel:disableRollback:ExecuteChangeSet' :: Maybe Bool
disableRollback =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:ExecuteChangeSet' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:ExecuteChangeSet' :: Maybe Text
stackName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:changeSetName:ExecuteChangeSet' :: Text
changeSetName = Text
pChangeSetName_
}
executeChangeSet_disableRollback :: Lens.Lens' ExecuteChangeSet (Prelude.Maybe Prelude.Bool)
executeChangeSet_disableRollback :: (Maybe Bool -> f (Maybe Bool))
-> ExecuteChangeSet -> f ExecuteChangeSet
executeChangeSet_disableRollback = (ExecuteChangeSet -> Maybe Bool)
-> (ExecuteChangeSet -> Maybe Bool -> ExecuteChangeSet)
-> Lens ExecuteChangeSet ExecuteChangeSet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteChangeSet' {Maybe Bool
disableRollback :: Maybe Bool
$sel:disableRollback:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Bool
disableRollback} -> Maybe Bool
disableRollback) (\s :: ExecuteChangeSet
s@ExecuteChangeSet' {} Maybe Bool
a -> ExecuteChangeSet
s {$sel:disableRollback:ExecuteChangeSet' :: Maybe Bool
disableRollback = Maybe Bool
a} :: ExecuteChangeSet)
executeChangeSet_clientRequestToken :: Lens.Lens' ExecuteChangeSet (Prelude.Maybe Prelude.Text)
executeChangeSet_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> ExecuteChangeSet -> f ExecuteChangeSet
executeChangeSet_clientRequestToken = (ExecuteChangeSet -> Maybe Text)
-> (ExecuteChangeSet -> Maybe Text -> ExecuteChangeSet)
-> Lens ExecuteChangeSet ExecuteChangeSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteChangeSet' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: ExecuteChangeSet
s@ExecuteChangeSet' {} Maybe Text
a -> ExecuteChangeSet
s {$sel:clientRequestToken:ExecuteChangeSet' :: Maybe Text
clientRequestToken = Maybe Text
a} :: ExecuteChangeSet)
executeChangeSet_stackName :: Lens.Lens' ExecuteChangeSet (Prelude.Maybe Prelude.Text)
executeChangeSet_stackName :: (Maybe Text -> f (Maybe Text))
-> ExecuteChangeSet -> f ExecuteChangeSet
executeChangeSet_stackName = (ExecuteChangeSet -> Maybe Text)
-> (ExecuteChangeSet -> Maybe Text -> ExecuteChangeSet)
-> Lens ExecuteChangeSet ExecuteChangeSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteChangeSet' {Maybe Text
stackName :: Maybe Text
$sel:stackName:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: ExecuteChangeSet
s@ExecuteChangeSet' {} Maybe Text
a -> ExecuteChangeSet
s {$sel:stackName:ExecuteChangeSet' :: Maybe Text
stackName = Maybe Text
a} :: ExecuteChangeSet)
executeChangeSet_changeSetName :: Lens.Lens' ExecuteChangeSet Prelude.Text
executeChangeSet_changeSetName :: (Text -> f Text) -> ExecuteChangeSet -> f ExecuteChangeSet
executeChangeSet_changeSetName = (ExecuteChangeSet -> Text)
-> (ExecuteChangeSet -> Text -> ExecuteChangeSet)
-> Lens ExecuteChangeSet ExecuteChangeSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteChangeSet' {Text
changeSetName :: Text
$sel:changeSetName:ExecuteChangeSet' :: ExecuteChangeSet -> Text
changeSetName} -> Text
changeSetName) (\s :: ExecuteChangeSet
s@ExecuteChangeSet' {} Text
a -> ExecuteChangeSet
s {$sel:changeSetName:ExecuteChangeSet' :: Text
changeSetName = Text
a} :: ExecuteChangeSet)
instance Core.AWSRequest ExecuteChangeSet where
type
AWSResponse ExecuteChangeSet =
ExecuteChangeSetResponse
request :: ExecuteChangeSet -> Request ExecuteChangeSet
request = Service -> ExecuteChangeSet -> Request ExecuteChangeSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ExecuteChangeSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ExecuteChangeSet)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ExecuteChangeSet))
-> Logger
-> Service
-> Proxy ExecuteChangeSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ExecuteChangeSet)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ExecuteChangeSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> ExecuteChangeSetResponse
ExecuteChangeSetResponse'
(Int -> ExecuteChangeSetResponse)
-> Either String Int -> Either String ExecuteChangeSetResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ExecuteChangeSet
instance Prelude.NFData ExecuteChangeSet
instance Core.ToHeaders ExecuteChangeSet where
toHeaders :: ExecuteChangeSet -> ResponseHeaders
toHeaders = ResponseHeaders -> ExecuteChangeSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ExecuteChangeSet where
toPath :: ExecuteChangeSet -> ByteString
toPath = ByteString -> ExecuteChangeSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ExecuteChangeSet where
toQuery :: ExecuteChangeSet -> QueryString
toQuery ExecuteChangeSet' {Maybe Bool
Maybe Text
Text
changeSetName :: Text
stackName :: Maybe Text
clientRequestToken :: Maybe Text
disableRollback :: Maybe Bool
$sel:changeSetName:ExecuteChangeSet' :: ExecuteChangeSet -> Text
$sel:stackName:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Text
$sel:clientRequestToken:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Text
$sel:disableRollback:ExecuteChangeSet' :: ExecuteChangeSet -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ExecuteChangeSet" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"DisableRollback" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
disableRollback,
ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
ByteString
"StackName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackName,
ByteString
"ChangeSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
changeSetName
]
data ExecuteChangeSetResponse = ExecuteChangeSetResponse'
{
ExecuteChangeSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool
(ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool)
-> (ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool)
-> Eq ExecuteChangeSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool
$c/= :: ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool
== :: ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool
$c== :: ExecuteChangeSetResponse -> ExecuteChangeSetResponse -> Bool
Prelude.Eq, ReadPrec [ExecuteChangeSetResponse]
ReadPrec ExecuteChangeSetResponse
Int -> ReadS ExecuteChangeSetResponse
ReadS [ExecuteChangeSetResponse]
(Int -> ReadS ExecuteChangeSetResponse)
-> ReadS [ExecuteChangeSetResponse]
-> ReadPrec ExecuteChangeSetResponse
-> ReadPrec [ExecuteChangeSetResponse]
-> Read ExecuteChangeSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecuteChangeSetResponse]
$creadListPrec :: ReadPrec [ExecuteChangeSetResponse]
readPrec :: ReadPrec ExecuteChangeSetResponse
$creadPrec :: ReadPrec ExecuteChangeSetResponse
readList :: ReadS [ExecuteChangeSetResponse]
$creadList :: ReadS [ExecuteChangeSetResponse]
readsPrec :: Int -> ReadS ExecuteChangeSetResponse
$creadsPrec :: Int -> ReadS ExecuteChangeSetResponse
Prelude.Read, Int -> ExecuteChangeSetResponse -> ShowS
[ExecuteChangeSetResponse] -> ShowS
ExecuteChangeSetResponse -> String
(Int -> ExecuteChangeSetResponse -> ShowS)
-> (ExecuteChangeSetResponse -> String)
-> ([ExecuteChangeSetResponse] -> ShowS)
-> Show ExecuteChangeSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecuteChangeSetResponse] -> ShowS
$cshowList :: [ExecuteChangeSetResponse] -> ShowS
show :: ExecuteChangeSetResponse -> String
$cshow :: ExecuteChangeSetResponse -> String
showsPrec :: Int -> ExecuteChangeSetResponse -> ShowS
$cshowsPrec :: Int -> ExecuteChangeSetResponse -> ShowS
Prelude.Show, (forall x.
ExecuteChangeSetResponse -> Rep ExecuteChangeSetResponse x)
-> (forall x.
Rep ExecuteChangeSetResponse x -> ExecuteChangeSetResponse)
-> Generic ExecuteChangeSetResponse
forall x.
Rep ExecuteChangeSetResponse x -> ExecuteChangeSetResponse
forall x.
ExecuteChangeSetResponse -> Rep ExecuteChangeSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExecuteChangeSetResponse x -> ExecuteChangeSetResponse
$cfrom :: forall x.
ExecuteChangeSetResponse -> Rep ExecuteChangeSetResponse x
Prelude.Generic)
newExecuteChangeSetResponse ::
Prelude.Int ->
ExecuteChangeSetResponse
newExecuteChangeSetResponse :: Int -> ExecuteChangeSetResponse
newExecuteChangeSetResponse Int
pHttpStatus_ =
ExecuteChangeSetResponse' :: Int -> ExecuteChangeSetResponse
ExecuteChangeSetResponse'
{ $sel:httpStatus:ExecuteChangeSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
executeChangeSetResponse_httpStatus :: Lens.Lens' ExecuteChangeSetResponse Prelude.Int
executeChangeSetResponse_httpStatus :: (Int -> f Int)
-> ExecuteChangeSetResponse -> f ExecuteChangeSetResponse
executeChangeSetResponse_httpStatus = (ExecuteChangeSetResponse -> Int)
-> (ExecuteChangeSetResponse -> Int -> ExecuteChangeSetResponse)
-> Lens ExecuteChangeSetResponse ExecuteChangeSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteChangeSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExecuteChangeSetResponse' :: ExecuteChangeSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExecuteChangeSetResponse
s@ExecuteChangeSetResponse' {} Int
a -> ExecuteChangeSetResponse
s {$sel:httpStatus:ExecuteChangeSetResponse' :: Int
httpStatus = Int
a} :: ExecuteChangeSetResponse)
instance Prelude.NFData ExecuteChangeSetResponse