{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
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
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]
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
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.
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'
{ $sel:confirmationToken:ConfirmTopicRuleDestination' :: Text
confirmationToken =
Text
pConfirmationToken_
}
confirmTopicRuleDestination_confirmationToken :: Lens.Lens' ConfirmTopicRuleDestination Prelude.Text
confirmTopicRuleDestination_confirmationToken :: Lens' ConfirmTopicRuleDestination Text
confirmTopicRuleDestination_confirmationToken = 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 :: (Service -> Service)
-> ConfirmTopicRuleDestination
-> Request ConfirmTopicRuleDestination
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ConfirmTopicRuleDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConfirmTopicRuleDestination)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> ConfirmTopicRuleDestinationResponse
ConfirmTopicRuleDestinationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ConfirmTopicRuleDestination where
hashWithSalt :: Int -> ConfirmTopicRuleDestination -> Int
hashWithSalt Int
_salt ConfirmTopicRuleDestination' {Text
confirmationToken :: Text
$sel:confirmationToken:ConfirmTopicRuleDestination' :: ConfirmTopicRuleDestination -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
confirmationToken
instance Prelude.NFData ConfirmTopicRuleDestination where
rnf :: ConfirmTopicRuleDestination -> ()
rnf ConfirmTopicRuleDestination' {Text
confirmationToken :: Text
$sel:confirmationToken:ConfirmTopicRuleDestination' :: ConfirmTopicRuleDestination -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
confirmationToken
instance Data.ToHeaders ConfirmTopicRuleDestination where
toHeaders :: ConfirmTopicRuleDestination -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ConfirmTopicRuleDestination where
toPath :: ConfirmTopicRuleDestination -> ByteString
toPath ConfirmTopicRuleDestination' {Text
confirmationToken :: Text
$sel:confirmationToken:ConfirmTopicRuleDestination' :: ConfirmTopicRuleDestination -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/confirmdestination/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
confirmationToken]
instance Data.ToQuery ConfirmTopicRuleDestination where
toQuery :: ConfirmTopicRuleDestination -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ConfirmTopicRuleDestinationResponse = ConfirmTopicRuleDestinationResponse'
{
ConfirmTopicRuleDestinationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ConfirmTopicRuleDestinationResponse
-> ConfirmTopicRuleDestinationResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:ConfirmTopicRuleDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
confirmTopicRuleDestinationResponse_httpStatus :: Lens.Lens' ConfirmTopicRuleDestinationResponse Prelude.Int
confirmTopicRuleDestinationResponse_httpStatus :: Lens' ConfirmTopicRuleDestinationResponse Int
confirmTopicRuleDestinationResponse_httpStatus = 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
where
rnf :: ConfirmTopicRuleDestinationResponse -> ()
rnf ConfirmTopicRuleDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConfirmTopicRuleDestinationResponse' :: ConfirmTopicRuleDestinationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus