{-# 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.SNS.DeleteTopic
(
DeleteTopic (..),
newDeleteTopic,
deleteTopic_topicArn,
DeleteTopicResponse (..),
newDeleteTopicResponse,
)
where
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
import Amazonka.SNS.Types
data DeleteTopic = DeleteTopic'
{
DeleteTopic -> Text
topicArn :: Prelude.Text
}
deriving (DeleteTopic -> DeleteTopic -> Bool
(DeleteTopic -> DeleteTopic -> Bool)
-> (DeleteTopic -> DeleteTopic -> Bool) -> Eq DeleteTopic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTopic -> DeleteTopic -> Bool
$c/= :: DeleteTopic -> DeleteTopic -> Bool
== :: DeleteTopic -> DeleteTopic -> Bool
$c== :: DeleteTopic -> DeleteTopic -> Bool
Prelude.Eq, ReadPrec [DeleteTopic]
ReadPrec DeleteTopic
Int -> ReadS DeleteTopic
ReadS [DeleteTopic]
(Int -> ReadS DeleteTopic)
-> ReadS [DeleteTopic]
-> ReadPrec DeleteTopic
-> ReadPrec [DeleteTopic]
-> Read DeleteTopic
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTopic]
$creadListPrec :: ReadPrec [DeleteTopic]
readPrec :: ReadPrec DeleteTopic
$creadPrec :: ReadPrec DeleteTopic
readList :: ReadS [DeleteTopic]
$creadList :: ReadS [DeleteTopic]
readsPrec :: Int -> ReadS DeleteTopic
$creadsPrec :: Int -> ReadS DeleteTopic
Prelude.Read, Int -> DeleteTopic -> ShowS
[DeleteTopic] -> ShowS
DeleteTopic -> String
(Int -> DeleteTopic -> ShowS)
-> (DeleteTopic -> String)
-> ([DeleteTopic] -> ShowS)
-> Show DeleteTopic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTopic] -> ShowS
$cshowList :: [DeleteTopic] -> ShowS
show :: DeleteTopic -> String
$cshow :: DeleteTopic -> String
showsPrec :: Int -> DeleteTopic -> ShowS
$cshowsPrec :: Int -> DeleteTopic -> ShowS
Prelude.Show, (forall x. DeleteTopic -> Rep DeleteTopic x)
-> (forall x. Rep DeleteTopic x -> DeleteTopic)
-> Generic DeleteTopic
forall x. Rep DeleteTopic x -> DeleteTopic
forall x. DeleteTopic -> Rep DeleteTopic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTopic x -> DeleteTopic
$cfrom :: forall x. DeleteTopic -> Rep DeleteTopic x
Prelude.Generic)
newDeleteTopic ::
Prelude.Text ->
DeleteTopic
newDeleteTopic :: Text -> DeleteTopic
newDeleteTopic Text
pTopicArn_ =
DeleteTopic' :: Text -> DeleteTopic
DeleteTopic' {$sel:topicArn:DeleteTopic' :: Text
topicArn = Text
pTopicArn_}
deleteTopic_topicArn :: Lens.Lens' DeleteTopic Prelude.Text
deleteTopic_topicArn :: (Text -> f Text) -> DeleteTopic -> f DeleteTopic
deleteTopic_topicArn = (DeleteTopic -> Text)
-> (DeleteTopic -> Text -> DeleteTopic)
-> Lens DeleteTopic DeleteTopic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTopic' {Text
topicArn :: Text
$sel:topicArn:DeleteTopic' :: DeleteTopic -> Text
topicArn} -> Text
topicArn) (\s :: DeleteTopic
s@DeleteTopic' {} Text
a -> DeleteTopic
s {$sel:topicArn:DeleteTopic' :: Text
topicArn = Text
a} :: DeleteTopic)
instance Core.AWSRequest DeleteTopic where
type AWSResponse DeleteTopic = DeleteTopicResponse
request :: DeleteTopic -> Request DeleteTopic
request = Service -> DeleteTopic -> Request DeleteTopic
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTopic
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTopic)))
response = AWSResponse DeleteTopic
-> Logger
-> Service
-> Proxy DeleteTopic
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTopic)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteTopic
DeleteTopicResponse
DeleteTopicResponse'
instance Prelude.Hashable DeleteTopic
instance Prelude.NFData DeleteTopic
instance Core.ToHeaders DeleteTopic where
toHeaders :: DeleteTopic -> [Header]
toHeaders = [Header] -> DeleteTopic -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteTopic where
toPath :: DeleteTopic -> ByteString
toPath = ByteString -> DeleteTopic -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTopic where
toQuery :: DeleteTopic -> QueryString
toQuery DeleteTopic' {Text
topicArn :: Text
$sel:topicArn:DeleteTopic' :: DeleteTopic -> 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
"DeleteTopic" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"TopicArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
topicArn
]
data DeleteTopicResponse = DeleteTopicResponse'
{
}
deriving (DeleteTopicResponse -> DeleteTopicResponse -> Bool
(DeleteTopicResponse -> DeleteTopicResponse -> Bool)
-> (DeleteTopicResponse -> DeleteTopicResponse -> Bool)
-> Eq DeleteTopicResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTopicResponse -> DeleteTopicResponse -> Bool
$c/= :: DeleteTopicResponse -> DeleteTopicResponse -> Bool
== :: DeleteTopicResponse -> DeleteTopicResponse -> Bool
$c== :: DeleteTopicResponse -> DeleteTopicResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTopicResponse]
ReadPrec DeleteTopicResponse
Int -> ReadS DeleteTopicResponse
ReadS [DeleteTopicResponse]
(Int -> ReadS DeleteTopicResponse)
-> ReadS [DeleteTopicResponse]
-> ReadPrec DeleteTopicResponse
-> ReadPrec [DeleteTopicResponse]
-> Read DeleteTopicResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTopicResponse]
$creadListPrec :: ReadPrec [DeleteTopicResponse]
readPrec :: ReadPrec DeleteTopicResponse
$creadPrec :: ReadPrec DeleteTopicResponse
readList :: ReadS [DeleteTopicResponse]
$creadList :: ReadS [DeleteTopicResponse]
readsPrec :: Int -> ReadS DeleteTopicResponse
$creadsPrec :: Int -> ReadS DeleteTopicResponse
Prelude.Read, Int -> DeleteTopicResponse -> ShowS
[DeleteTopicResponse] -> ShowS
DeleteTopicResponse -> String
(Int -> DeleteTopicResponse -> ShowS)
-> (DeleteTopicResponse -> String)
-> ([DeleteTopicResponse] -> ShowS)
-> Show DeleteTopicResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTopicResponse] -> ShowS
$cshowList :: [DeleteTopicResponse] -> ShowS
show :: DeleteTopicResponse -> String
$cshow :: DeleteTopicResponse -> String
showsPrec :: Int -> DeleteTopicResponse -> ShowS
$cshowsPrec :: Int -> DeleteTopicResponse -> ShowS
Prelude.Show, (forall x. DeleteTopicResponse -> Rep DeleteTopicResponse x)
-> (forall x. Rep DeleteTopicResponse x -> DeleteTopicResponse)
-> Generic DeleteTopicResponse
forall x. Rep DeleteTopicResponse x -> DeleteTopicResponse
forall x. DeleteTopicResponse -> Rep DeleteTopicResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTopicResponse x -> DeleteTopicResponse
$cfrom :: forall x. DeleteTopicResponse -> Rep DeleteTopicResponse x
Prelude.Generic)
newDeleteTopicResponse ::
DeleteTopicResponse
newDeleteTopicResponse :: DeleteTopicResponse
newDeleteTopicResponse = DeleteTopicResponse
DeleteTopicResponse'
instance Prelude.NFData DeleteTopicResponse