{-# 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.RollbackStack
(
RollbackStack (..),
newRollbackStack,
rollbackStack_clientRequestToken,
rollbackStack_roleARN,
rollbackStack_stackName,
RollbackStackResponse (..),
newRollbackStackResponse,
rollbackStackResponse_stackId,
rollbackStackResponse_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 RollbackStack = RollbackStack'
{
RollbackStack -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
RollbackStack -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
RollbackStack -> Text
stackName :: Prelude.Text
}
deriving (RollbackStack -> RollbackStack -> Bool
(RollbackStack -> RollbackStack -> Bool)
-> (RollbackStack -> RollbackStack -> Bool) -> Eq RollbackStack
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RollbackStack -> RollbackStack -> Bool
$c/= :: RollbackStack -> RollbackStack -> Bool
== :: RollbackStack -> RollbackStack -> Bool
$c== :: RollbackStack -> RollbackStack -> Bool
Prelude.Eq, ReadPrec [RollbackStack]
ReadPrec RollbackStack
Int -> ReadS RollbackStack
ReadS [RollbackStack]
(Int -> ReadS RollbackStack)
-> ReadS [RollbackStack]
-> ReadPrec RollbackStack
-> ReadPrec [RollbackStack]
-> Read RollbackStack
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RollbackStack]
$creadListPrec :: ReadPrec [RollbackStack]
readPrec :: ReadPrec RollbackStack
$creadPrec :: ReadPrec RollbackStack
readList :: ReadS [RollbackStack]
$creadList :: ReadS [RollbackStack]
readsPrec :: Int -> ReadS RollbackStack
$creadsPrec :: Int -> ReadS RollbackStack
Prelude.Read, Int -> RollbackStack -> ShowS
[RollbackStack] -> ShowS
RollbackStack -> String
(Int -> RollbackStack -> ShowS)
-> (RollbackStack -> String)
-> ([RollbackStack] -> ShowS)
-> Show RollbackStack
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RollbackStack] -> ShowS
$cshowList :: [RollbackStack] -> ShowS
show :: RollbackStack -> String
$cshow :: RollbackStack -> String
showsPrec :: Int -> RollbackStack -> ShowS
$cshowsPrec :: Int -> RollbackStack -> ShowS
Prelude.Show, (forall x. RollbackStack -> Rep RollbackStack x)
-> (forall x. Rep RollbackStack x -> RollbackStack)
-> Generic RollbackStack
forall x. Rep RollbackStack x -> RollbackStack
forall x. RollbackStack -> Rep RollbackStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RollbackStack x -> RollbackStack
$cfrom :: forall x. RollbackStack -> Rep RollbackStack x
Prelude.Generic)
newRollbackStack ::
Prelude.Text ->
RollbackStack
newRollbackStack :: Text -> RollbackStack
newRollbackStack Text
pStackName_ =
RollbackStack' :: Maybe Text -> Maybe Text -> Text -> RollbackStack
RollbackStack'
{ $sel:clientRequestToken:RollbackStack' :: Maybe Text
clientRequestToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:RollbackStack' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:RollbackStack' :: Text
stackName = Text
pStackName_
}
rollbackStack_clientRequestToken :: Lens.Lens' RollbackStack (Prelude.Maybe Prelude.Text)
rollbackStack_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> RollbackStack -> f RollbackStack
rollbackStack_clientRequestToken = (RollbackStack -> Maybe Text)
-> (RollbackStack -> Maybe Text -> RollbackStack)
-> Lens RollbackStack RollbackStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackStack' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:RollbackStack' :: RollbackStack -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: RollbackStack
s@RollbackStack' {} Maybe Text
a -> RollbackStack
s {$sel:clientRequestToken:RollbackStack' :: Maybe Text
clientRequestToken = Maybe Text
a} :: RollbackStack)
rollbackStack_roleARN :: Lens.Lens' RollbackStack (Prelude.Maybe Prelude.Text)
rollbackStack_roleARN :: (Maybe Text -> f (Maybe Text)) -> RollbackStack -> f RollbackStack
rollbackStack_roleARN = (RollbackStack -> Maybe Text)
-> (RollbackStack -> Maybe Text -> RollbackStack)
-> Lens RollbackStack RollbackStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackStack' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:RollbackStack' :: RollbackStack -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: RollbackStack
s@RollbackStack' {} Maybe Text
a -> RollbackStack
s {$sel:roleARN:RollbackStack' :: Maybe Text
roleARN = Maybe Text
a} :: RollbackStack)
rollbackStack_stackName :: Lens.Lens' RollbackStack Prelude.Text
rollbackStack_stackName :: (Text -> f Text) -> RollbackStack -> f RollbackStack
rollbackStack_stackName = (RollbackStack -> Text)
-> (RollbackStack -> Text -> RollbackStack)
-> Lens RollbackStack RollbackStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackStack' {Text
stackName :: Text
$sel:stackName:RollbackStack' :: RollbackStack -> Text
stackName} -> Text
stackName) (\s :: RollbackStack
s@RollbackStack' {} Text
a -> RollbackStack
s {$sel:stackName:RollbackStack' :: Text
stackName = Text
a} :: RollbackStack)
instance Core.AWSRequest RollbackStack where
type
AWSResponse RollbackStack =
RollbackStackResponse
request :: RollbackStack -> Request RollbackStack
request = Service -> RollbackStack -> Request RollbackStack
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy RollbackStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RollbackStack)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse RollbackStack))
-> Logger
-> Service
-> Proxy RollbackStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RollbackStack)))
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
"RollbackStackResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> RollbackStackResponse
RollbackStackResponse'
(Maybe Text -> Int -> RollbackStackResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RollbackStackResponse)
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
"StackId")
Either String (Int -> RollbackStackResponse)
-> Either String Int -> Either String RollbackStackResponse
forall (f :: * -> *) a b. Applicative f => 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 RollbackStack
instance Prelude.NFData RollbackStack
instance Core.ToHeaders RollbackStack where
toHeaders :: RollbackStack -> ResponseHeaders
toHeaders = ResponseHeaders -> RollbackStack -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath RollbackStack where
toPath :: RollbackStack -> ByteString
toPath = ByteString -> RollbackStack -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RollbackStack where
toQuery :: RollbackStack -> QueryString
toQuery RollbackStack' {Maybe Text
Text
stackName :: Text
roleARN :: Maybe Text
clientRequestToken :: Maybe Text
$sel:stackName:RollbackStack' :: RollbackStack -> Text
$sel:roleARN:RollbackStack' :: RollbackStack -> Maybe Text
$sel:clientRequestToken:RollbackStack' :: RollbackStack -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"RollbackStack" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
ByteString
"RoleARN" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
roleARN,
ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
]
data RollbackStackResponse = RollbackStackResponse'
{
RollbackStackResponse -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
RollbackStackResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RollbackStackResponse -> RollbackStackResponse -> Bool
(RollbackStackResponse -> RollbackStackResponse -> Bool)
-> (RollbackStackResponse -> RollbackStackResponse -> Bool)
-> Eq RollbackStackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RollbackStackResponse -> RollbackStackResponse -> Bool
$c/= :: RollbackStackResponse -> RollbackStackResponse -> Bool
== :: RollbackStackResponse -> RollbackStackResponse -> Bool
$c== :: RollbackStackResponse -> RollbackStackResponse -> Bool
Prelude.Eq, ReadPrec [RollbackStackResponse]
ReadPrec RollbackStackResponse
Int -> ReadS RollbackStackResponse
ReadS [RollbackStackResponse]
(Int -> ReadS RollbackStackResponse)
-> ReadS [RollbackStackResponse]
-> ReadPrec RollbackStackResponse
-> ReadPrec [RollbackStackResponse]
-> Read RollbackStackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RollbackStackResponse]
$creadListPrec :: ReadPrec [RollbackStackResponse]
readPrec :: ReadPrec RollbackStackResponse
$creadPrec :: ReadPrec RollbackStackResponse
readList :: ReadS [RollbackStackResponse]
$creadList :: ReadS [RollbackStackResponse]
readsPrec :: Int -> ReadS RollbackStackResponse
$creadsPrec :: Int -> ReadS RollbackStackResponse
Prelude.Read, Int -> RollbackStackResponse -> ShowS
[RollbackStackResponse] -> ShowS
RollbackStackResponse -> String
(Int -> RollbackStackResponse -> ShowS)
-> (RollbackStackResponse -> String)
-> ([RollbackStackResponse] -> ShowS)
-> Show RollbackStackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RollbackStackResponse] -> ShowS
$cshowList :: [RollbackStackResponse] -> ShowS
show :: RollbackStackResponse -> String
$cshow :: RollbackStackResponse -> String
showsPrec :: Int -> RollbackStackResponse -> ShowS
$cshowsPrec :: Int -> RollbackStackResponse -> ShowS
Prelude.Show, (forall x. RollbackStackResponse -> Rep RollbackStackResponse x)
-> (forall x. Rep RollbackStackResponse x -> RollbackStackResponse)
-> Generic RollbackStackResponse
forall x. Rep RollbackStackResponse x -> RollbackStackResponse
forall x. RollbackStackResponse -> Rep RollbackStackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RollbackStackResponse x -> RollbackStackResponse
$cfrom :: forall x. RollbackStackResponse -> Rep RollbackStackResponse x
Prelude.Generic)
newRollbackStackResponse ::
Prelude.Int ->
RollbackStackResponse
newRollbackStackResponse :: Int -> RollbackStackResponse
newRollbackStackResponse Int
pHttpStatus_ =
RollbackStackResponse' :: Maybe Text -> Int -> RollbackStackResponse
RollbackStackResponse'
{ $sel:stackId:RollbackStackResponse' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RollbackStackResponse' :: Int
httpStatus = Int
pHttpStatus_
}
rollbackStackResponse_stackId :: Lens.Lens' RollbackStackResponse (Prelude.Maybe Prelude.Text)
rollbackStackResponse_stackId :: (Maybe Text -> f (Maybe Text))
-> RollbackStackResponse -> f RollbackStackResponse
rollbackStackResponse_stackId = (RollbackStackResponse -> Maybe Text)
-> (RollbackStackResponse -> Maybe Text -> RollbackStackResponse)
-> Lens
RollbackStackResponse
RollbackStackResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackStackResponse' {Maybe Text
stackId :: Maybe Text
$sel:stackId:RollbackStackResponse' :: RollbackStackResponse -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: RollbackStackResponse
s@RollbackStackResponse' {} Maybe Text
a -> RollbackStackResponse
s {$sel:stackId:RollbackStackResponse' :: Maybe Text
stackId = Maybe Text
a} :: RollbackStackResponse)
rollbackStackResponse_httpStatus :: Lens.Lens' RollbackStackResponse Prelude.Int
rollbackStackResponse_httpStatus :: (Int -> f Int) -> RollbackStackResponse -> f RollbackStackResponse
rollbackStackResponse_httpStatus = (RollbackStackResponse -> Int)
-> (RollbackStackResponse -> Int -> RollbackStackResponse)
-> Lens RollbackStackResponse RollbackStackResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackStackResponse' {Int
httpStatus :: Int
$sel:httpStatus:RollbackStackResponse' :: RollbackStackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RollbackStackResponse
s@RollbackStackResponse' {} Int
a -> RollbackStackResponse
s {$sel:httpStatus:RollbackStackResponse' :: Int
httpStatus = Int
a} :: RollbackStackResponse)
instance Prelude.NFData RollbackStackResponse