{-# 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.IoT.ConfirmTopicRuleDestination
(
ConfirmTopicRuleDestination (..),
newConfirmTopicRuleDestination,
confirmTopicRuleDestination_confirmationToken,
ConfirmTopicRuleDestinationResponse (..),
newConfirmTopicRuleDestinationResponse,
confirmTopicRuleDestinationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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 ConfirmTopicRuleDestination = ConfirmTopicRuleDestination'
{
ConfirmTopicRuleDestination -> Text
confirmationToken :: Prelude.Text
}
deriving (ConfirmTopicRuleDestination -> ConfirmTopicRuleDestination -> Bool
(ConfirmTopicRuleDestination
-> ConfirmTopicRuleDestination -> Bool)
-> (ConfirmTopicRuleDestination
-> ConfirmTopicRuleDestination -> Bool)
-> Eq ConfirmTopicRuleDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmTopicRuleDestination -> ConfirmTopicRuleDestination -> Bool
$c/= :: ConfirmTopicRuleDestination -> ConfirmTopicRuleDestination -> Bool
== :: ConfirmTopicRuleDestination -> ConfirmTopicRuleDestination -> Bool
$c== :: ConfirmTopicRuleDestination -> ConfirmTopicRuleDestination -> Bool
Prelude.Eq, ReadPrec [ConfirmTopicRuleDestination]
ReadPrec ConfirmTopicRuleDestination
Int -> ReadS ConfirmTopicRuleDestination
ReadS [ConfirmTopicRuleDestination]
(Int -> ReadS ConfirmTopicRuleDestination)
-> ReadS [ConfirmTopicRuleDestination]
-> ReadPrec ConfirmTopicRuleDestination
-> ReadPrec [ConfirmTopicRuleDestination]
-> Read ConfirmTopicRuleDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfirmTopicRuleDestination]
$creadListPrec :: ReadPrec [ConfirmTopicRuleDestination]
readPrec :: ReadPrec ConfirmTopicRuleDestination
$creadPrec :: ReadPrec ConfirmTopicRuleDestination
readList :: ReadS [ConfirmTopicRuleDestination]
$creadList :: ReadS [ConfirmTopicRuleDestination]
readsPrec :: Int -> ReadS ConfirmTopicRuleDestination
$creadsPrec :: Int -> ReadS ConfirmTopicRuleDestination
Prelude.Read, Int -> ConfirmTopicRuleDestination -> ShowS
[ConfirmTopicRuleDestination] -> ShowS
ConfirmTopicRuleDestination -> String
(Int -> ConfirmTopicRuleDestination -> ShowS)
-> (ConfirmTopicRuleDestination -> String)
-> ([ConfirmTopicRuleDestination] -> ShowS)
-> Show ConfirmTopicRuleDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmTopicRuleDestination] -> ShowS
$cshowList :: [ConfirmTopicRuleDestination] -> ShowS
show :: ConfirmTopicRuleDestination -> String
$cshow :: ConfirmTopicRuleDestination -> String
showsPrec :: Int -> ConfirmTopicRuleDestination -> ShowS
$cshowsPrec :: Int -> ConfirmTopicRuleDestination -> ShowS
Prelude.Show, (forall x.
ConfirmTopicRuleDestination -> Rep ConfirmTopicRuleDestination x)
-> (forall x.
Rep ConfirmTopicRuleDestination x -> ConfirmTopicRuleDestination)
-> Generic ConfirmTopicRuleDestination
forall x.
Rep ConfirmTopicRuleDestination x -> ConfirmTopicRuleDestination
forall x.
ConfirmTopicRuleDestination -> Rep ConfirmTopicRuleDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfirmTopicRuleDestination x -> ConfirmTopicRuleDestination
$cfrom :: forall x.
ConfirmTopicRuleDestination -> Rep ConfirmTopicRuleDestination x
Prelude.Generic)
newConfirmTopicRuleDestination ::
Prelude.Text ->
ConfirmTopicRuleDestination
newConfirmTopicRuleDestination :: Text -> ConfirmTopicRuleDestination
newConfirmTopicRuleDestination Text
pConfirmationToken_ =
ConfirmTopicRuleDestination' :: Text -> ConfirmTopicRuleDestination
ConfirmTopicRuleDestination'
{ $sel:confirmationToken:ConfirmTopicRuleDestination' :: Text
confirmationToken =
Text
pConfirmationToken_
}
confirmTopicRuleDestination_confirmationToken :: Lens.Lens' ConfirmTopicRuleDestination Prelude.Text
confirmTopicRuleDestination_confirmationToken :: (Text -> f Text)
-> ConfirmTopicRuleDestination -> f ConfirmTopicRuleDestination
confirmTopicRuleDestination_confirmationToken = (ConfirmTopicRuleDestination -> Text)
-> (ConfirmTopicRuleDestination
-> Text -> ConfirmTopicRuleDestination)
-> Lens
ConfirmTopicRuleDestination ConfirmTopicRuleDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTopicRuleDestination' {Text
confirmationToken :: Text
$sel:confirmationToken:ConfirmTopicRuleDestination' :: ConfirmTopicRuleDestination -> Text
confirmationToken} -> Text
confirmationToken) (\s :: ConfirmTopicRuleDestination
s@ConfirmTopicRuleDestination' {} Text
a -> ConfirmTopicRuleDestination
s {$sel:confirmationToken:ConfirmTopicRuleDestination' :: Text
confirmationToken = Text
a} :: ConfirmTopicRuleDestination)
instance Core.AWSRequest ConfirmTopicRuleDestination where
type
AWSResponse ConfirmTopicRuleDestination =
ConfirmTopicRuleDestinationResponse
request :: ConfirmTopicRuleDestination -> Request ConfirmTopicRuleDestination
request = Service
-> ConfirmTopicRuleDestination
-> Request ConfirmTopicRuleDestination
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ConfirmTopicRuleDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConfirmTopicRuleDestination)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ConfirmTopicRuleDestination))
-> Logger
-> Service
-> Proxy ConfirmTopicRuleDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConfirmTopicRuleDestination)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> ConfirmTopicRuleDestinationResponse
ConfirmTopicRuleDestinationResponse'
(Int -> ConfirmTopicRuleDestinationResponse)
-> Either String Int
-> Either String ConfirmTopicRuleDestinationResponse
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 ConfirmTopicRuleDestination
instance Prelude.NFData ConfirmTopicRuleDestination
instance Core.ToHeaders ConfirmTopicRuleDestination where
toHeaders :: ConfirmTopicRuleDestination -> ResponseHeaders
toHeaders = ResponseHeaders -> ConfirmTopicRuleDestination -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ConfirmTopicRuleDestination where
toPath :: ConfirmTopicRuleDestination -> ByteString
toPath ConfirmTopicRuleDestination' {Text
confirmationToken :: Text
$sel:confirmationToken:ConfirmTopicRuleDestination' :: ConfirmTopicRuleDestination -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/confirmdestination/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
confirmationToken]
instance Core.ToQuery ConfirmTopicRuleDestination where
toQuery :: ConfirmTopicRuleDestination -> QueryString
toQuery = QueryString -> ConfirmTopicRuleDestination -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ConfirmTopicRuleDestinationResponse = ConfirmTopicRuleDestinationResponse'
{
ConfirmTopicRuleDestinationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
(ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool)
-> (ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool)
-> Eq ConfirmTopicRuleDestinationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
$c/= :: ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
== :: ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
$c== :: ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
Prelude.Eq, ReadPrec [ConfirmTopicRuleDestinationResponse]
ReadPrec ConfirmTopicRuleDestinationResponse
Int -> ReadS ConfirmTopicRuleDestinationResponse
ReadS [ConfirmTopicRuleDestinationResponse]
(Int -> ReadS ConfirmTopicRuleDestinationResponse)
-> ReadS [ConfirmTopicRuleDestinationResponse]
-> ReadPrec ConfirmTopicRuleDestinationResponse
-> ReadPrec [ConfirmTopicRuleDestinationResponse]
-> Read ConfirmTopicRuleDestinationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfirmTopicRuleDestinationResponse]
$creadListPrec :: ReadPrec [ConfirmTopicRuleDestinationResponse]
readPrec :: ReadPrec ConfirmTopicRuleDestinationResponse
$creadPrec :: ReadPrec ConfirmTopicRuleDestinationResponse
readList :: ReadS [ConfirmTopicRuleDestinationResponse]
$creadList :: ReadS [ConfirmTopicRuleDestinationResponse]
readsPrec :: Int -> ReadS ConfirmTopicRuleDestinationResponse
$creadsPrec :: Int -> ReadS ConfirmTopicRuleDestinationResponse
Prelude.Read, Int -> ConfirmTopicRuleDestinationResponse -> ShowS
[ConfirmTopicRuleDestinationResponse] -> ShowS
ConfirmTopicRuleDestinationResponse -> String
(Int -> ConfirmTopicRuleDestinationResponse -> ShowS)
-> (ConfirmTopicRuleDestinationResponse -> String)
-> ([ConfirmTopicRuleDestinationResponse] -> ShowS)
-> Show ConfirmTopicRuleDestinationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmTopicRuleDestinationResponse] -> ShowS
$cshowList :: [ConfirmTopicRuleDestinationResponse] -> ShowS
show :: ConfirmTopicRuleDestinationResponse -> String
$cshow :: ConfirmTopicRuleDestinationResponse -> String
showsPrec :: Int -> ConfirmTopicRuleDestinationResponse -> ShowS
$cshowsPrec :: Int -> ConfirmTopicRuleDestinationResponse -> ShowS
Prelude.Show, (forall x.
ConfirmTopicRuleDestinationResponse
-> Rep ConfirmTopicRuleDestinationResponse x)
-> (forall x.
Rep ConfirmTopicRuleDestinationResponse x
-> ConfirmTopicRuleDestinationResponse)
-> Generic ConfirmTopicRuleDestinationResponse
forall x.
Rep ConfirmTopicRuleDestinationResponse x
-> ConfirmTopicRuleDestinationResponse
forall x.
ConfirmTopicRuleDestinationResponse
-> Rep ConfirmTopicRuleDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfirmTopicRuleDestinationResponse x
-> ConfirmTopicRuleDestinationResponse
$cfrom :: forall x.
ConfirmTopicRuleDestinationResponse
-> Rep ConfirmTopicRuleDestinationResponse x
Prelude.Generic)
newConfirmTopicRuleDestinationResponse ::
Prelude.Int ->
ConfirmTopicRuleDestinationResponse
newConfirmTopicRuleDestinationResponse :: Int -> ConfirmTopicRuleDestinationResponse
newConfirmTopicRuleDestinationResponse Int
pHttpStatus_ =
ConfirmTopicRuleDestinationResponse' :: Int -> ConfirmTopicRuleDestinationResponse
ConfirmTopicRuleDestinationResponse'
{ $sel:httpStatus:ConfirmTopicRuleDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
confirmTopicRuleDestinationResponse_httpStatus :: Lens.Lens' ConfirmTopicRuleDestinationResponse Prelude.Int
confirmTopicRuleDestinationResponse_httpStatus :: (Int -> f Int)
-> ConfirmTopicRuleDestinationResponse
-> f ConfirmTopicRuleDestinationResponse
confirmTopicRuleDestinationResponse_httpStatus = (ConfirmTopicRuleDestinationResponse -> Int)
-> (ConfirmTopicRuleDestinationResponse
-> Int -> ConfirmTopicRuleDestinationResponse)
-> Lens
ConfirmTopicRuleDestinationResponse
ConfirmTopicRuleDestinationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTopicRuleDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConfirmTopicRuleDestinationResponse' :: ConfirmTopicRuleDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ConfirmTopicRuleDestinationResponse
s@ConfirmTopicRuleDestinationResponse' {} Int
a -> ConfirmTopicRuleDestinationResponse
s {$sel:httpStatus:ConfirmTopicRuleDestinationResponse' :: Int
httpStatus = Int
a} :: ConfirmTopicRuleDestinationResponse)
instance
Prelude.NFData
ConfirmTopicRuleDestinationResponse