{-# 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.DeleteChangeSet
(
DeleteChangeSet (..),
newDeleteChangeSet,
deleteChangeSet_stackName,
deleteChangeSet_changeSetName,
DeleteChangeSetResponse (..),
newDeleteChangeSetResponse,
deleteChangeSetResponse_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 DeleteChangeSet = DeleteChangeSet'
{
DeleteChangeSet -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text,
DeleteChangeSet -> Text
changeSetName :: Prelude.Text
}
deriving (DeleteChangeSet -> DeleteChangeSet -> Bool
(DeleteChangeSet -> DeleteChangeSet -> Bool)
-> (DeleteChangeSet -> DeleteChangeSet -> Bool)
-> Eq DeleteChangeSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChangeSet -> DeleteChangeSet -> Bool
$c/= :: DeleteChangeSet -> DeleteChangeSet -> Bool
== :: DeleteChangeSet -> DeleteChangeSet -> Bool
$c== :: DeleteChangeSet -> DeleteChangeSet -> Bool
Prelude.Eq, ReadPrec [DeleteChangeSet]
ReadPrec DeleteChangeSet
Int -> ReadS DeleteChangeSet
ReadS [DeleteChangeSet]
(Int -> ReadS DeleteChangeSet)
-> ReadS [DeleteChangeSet]
-> ReadPrec DeleteChangeSet
-> ReadPrec [DeleteChangeSet]
-> Read DeleteChangeSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChangeSet]
$creadListPrec :: ReadPrec [DeleteChangeSet]
readPrec :: ReadPrec DeleteChangeSet
$creadPrec :: ReadPrec DeleteChangeSet
readList :: ReadS [DeleteChangeSet]
$creadList :: ReadS [DeleteChangeSet]
readsPrec :: Int -> ReadS DeleteChangeSet
$creadsPrec :: Int -> ReadS DeleteChangeSet
Prelude.Read, Int -> DeleteChangeSet -> ShowS
[DeleteChangeSet] -> ShowS
DeleteChangeSet -> String
(Int -> DeleteChangeSet -> ShowS)
-> (DeleteChangeSet -> String)
-> ([DeleteChangeSet] -> ShowS)
-> Show DeleteChangeSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChangeSet] -> ShowS
$cshowList :: [DeleteChangeSet] -> ShowS
show :: DeleteChangeSet -> String
$cshow :: DeleteChangeSet -> String
showsPrec :: Int -> DeleteChangeSet -> ShowS
$cshowsPrec :: Int -> DeleteChangeSet -> ShowS
Prelude.Show, (forall x. DeleteChangeSet -> Rep DeleteChangeSet x)
-> (forall x. Rep DeleteChangeSet x -> DeleteChangeSet)
-> Generic DeleteChangeSet
forall x. Rep DeleteChangeSet x -> DeleteChangeSet
forall x. DeleteChangeSet -> Rep DeleteChangeSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteChangeSet x -> DeleteChangeSet
$cfrom :: forall x. DeleteChangeSet -> Rep DeleteChangeSet x
Prelude.Generic)
newDeleteChangeSet ::
Prelude.Text ->
DeleteChangeSet
newDeleteChangeSet :: Text -> DeleteChangeSet
newDeleteChangeSet Text
pChangeSetName_ =
DeleteChangeSet' :: Maybe Text -> Text -> DeleteChangeSet
DeleteChangeSet'
{ $sel:stackName:DeleteChangeSet' :: Maybe Text
stackName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:changeSetName:DeleteChangeSet' :: Text
changeSetName = Text
pChangeSetName_
}
deleteChangeSet_stackName :: Lens.Lens' DeleteChangeSet (Prelude.Maybe Prelude.Text)
deleteChangeSet_stackName :: (Maybe Text -> f (Maybe Text))
-> DeleteChangeSet -> f DeleteChangeSet
deleteChangeSet_stackName = (DeleteChangeSet -> Maybe Text)
-> (DeleteChangeSet -> Maybe Text -> DeleteChangeSet)
-> Lens DeleteChangeSet DeleteChangeSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChangeSet' {Maybe Text
stackName :: Maybe Text
$sel:stackName:DeleteChangeSet' :: DeleteChangeSet -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: DeleteChangeSet
s@DeleteChangeSet' {} Maybe Text
a -> DeleteChangeSet
s {$sel:stackName:DeleteChangeSet' :: Maybe Text
stackName = Maybe Text
a} :: DeleteChangeSet)
deleteChangeSet_changeSetName :: Lens.Lens' DeleteChangeSet Prelude.Text
deleteChangeSet_changeSetName :: (Text -> f Text) -> DeleteChangeSet -> f DeleteChangeSet
deleteChangeSet_changeSetName = (DeleteChangeSet -> Text)
-> (DeleteChangeSet -> Text -> DeleteChangeSet)
-> Lens DeleteChangeSet DeleteChangeSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChangeSet' {Text
changeSetName :: Text
$sel:changeSetName:DeleteChangeSet' :: DeleteChangeSet -> Text
changeSetName} -> Text
changeSetName) (\s :: DeleteChangeSet
s@DeleteChangeSet' {} Text
a -> DeleteChangeSet
s {$sel:changeSetName:DeleteChangeSet' :: Text
changeSetName = Text
a} :: DeleteChangeSet)
instance Core.AWSRequest DeleteChangeSet where
type
AWSResponse DeleteChangeSet =
DeleteChangeSetResponse
request :: DeleteChangeSet -> Request DeleteChangeSet
request = Service -> DeleteChangeSet -> Request DeleteChangeSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteChangeSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteChangeSet)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteChangeSet))
-> Logger
-> Service
-> Proxy DeleteChangeSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteChangeSet)))
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
"DeleteChangeSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DeleteChangeSetResponse
DeleteChangeSetResponse'
(Int -> DeleteChangeSetResponse)
-> Either String Int -> Either String DeleteChangeSetResponse
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 DeleteChangeSet
instance Prelude.NFData DeleteChangeSet
instance Core.ToHeaders DeleteChangeSet where
toHeaders :: DeleteChangeSet -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteChangeSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteChangeSet where
toPath :: DeleteChangeSet -> ByteString
toPath = ByteString -> DeleteChangeSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteChangeSet where
toQuery :: DeleteChangeSet -> QueryString
toQuery DeleteChangeSet' {Maybe Text
Text
changeSetName :: Text
stackName :: Maybe Text
$sel:changeSetName:DeleteChangeSet' :: DeleteChangeSet -> Text
$sel:stackName:DeleteChangeSet' :: DeleteChangeSet -> 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
"DeleteChangeSet" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
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 DeleteChangeSetResponse = DeleteChangeSetResponse'
{
DeleteChangeSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool
(DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool)
-> (DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool)
-> Eq DeleteChangeSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool
$c/= :: DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool
== :: DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool
$c== :: DeleteChangeSetResponse -> DeleteChangeSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteChangeSetResponse]
ReadPrec DeleteChangeSetResponse
Int -> ReadS DeleteChangeSetResponse
ReadS [DeleteChangeSetResponse]
(Int -> ReadS DeleteChangeSetResponse)
-> ReadS [DeleteChangeSetResponse]
-> ReadPrec DeleteChangeSetResponse
-> ReadPrec [DeleteChangeSetResponse]
-> Read DeleteChangeSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChangeSetResponse]
$creadListPrec :: ReadPrec [DeleteChangeSetResponse]
readPrec :: ReadPrec DeleteChangeSetResponse
$creadPrec :: ReadPrec DeleteChangeSetResponse
readList :: ReadS [DeleteChangeSetResponse]
$creadList :: ReadS [DeleteChangeSetResponse]
readsPrec :: Int -> ReadS DeleteChangeSetResponse
$creadsPrec :: Int -> ReadS DeleteChangeSetResponse
Prelude.Read, Int -> DeleteChangeSetResponse -> ShowS
[DeleteChangeSetResponse] -> ShowS
DeleteChangeSetResponse -> String
(Int -> DeleteChangeSetResponse -> ShowS)
-> (DeleteChangeSetResponse -> String)
-> ([DeleteChangeSetResponse] -> ShowS)
-> Show DeleteChangeSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChangeSetResponse] -> ShowS
$cshowList :: [DeleteChangeSetResponse] -> ShowS
show :: DeleteChangeSetResponse -> String
$cshow :: DeleteChangeSetResponse -> String
showsPrec :: Int -> DeleteChangeSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteChangeSetResponse -> ShowS
Prelude.Show, (forall x.
DeleteChangeSetResponse -> Rep DeleteChangeSetResponse x)
-> (forall x.
Rep DeleteChangeSetResponse x -> DeleteChangeSetResponse)
-> Generic DeleteChangeSetResponse
forall x. Rep DeleteChangeSetResponse x -> DeleteChangeSetResponse
forall x. DeleteChangeSetResponse -> Rep DeleteChangeSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteChangeSetResponse x -> DeleteChangeSetResponse
$cfrom :: forall x. DeleteChangeSetResponse -> Rep DeleteChangeSetResponse x
Prelude.Generic)
newDeleteChangeSetResponse ::
Prelude.Int ->
DeleteChangeSetResponse
newDeleteChangeSetResponse :: Int -> DeleteChangeSetResponse
newDeleteChangeSetResponse Int
pHttpStatus_ =
DeleteChangeSetResponse' :: Int -> DeleteChangeSetResponse
DeleteChangeSetResponse' {$sel:httpStatus:DeleteChangeSetResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteChangeSetResponse_httpStatus :: Lens.Lens' DeleteChangeSetResponse Prelude.Int
deleteChangeSetResponse_httpStatus :: (Int -> f Int)
-> DeleteChangeSetResponse -> f DeleteChangeSetResponse
deleteChangeSetResponse_httpStatus = (DeleteChangeSetResponse -> Int)
-> (DeleteChangeSetResponse -> Int -> DeleteChangeSetResponse)
-> Lens DeleteChangeSetResponse DeleteChangeSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChangeSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteChangeSetResponse' :: DeleteChangeSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteChangeSetResponse
s@DeleteChangeSetResponse' {} Int
a -> DeleteChangeSetResponse
s {$sel:httpStatus:DeleteChangeSetResponse' :: Int
httpStatus = Int
a} :: DeleteChangeSetResponse)
instance Prelude.NFData DeleteChangeSetResponse