{-# 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.UpdateTopicRuleDestination
(
UpdateTopicRuleDestination (..),
newUpdateTopicRuleDestination,
updateTopicRuleDestination_arn,
updateTopicRuleDestination_status,
UpdateTopicRuleDestinationResponse (..),
newUpdateTopicRuleDestinationResponse,
updateTopicRuleDestinationResponse_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 UpdateTopicRuleDestination = UpdateTopicRuleDestination'
{
UpdateTopicRuleDestination -> Text
arn :: Prelude.Text,
UpdateTopicRuleDestination -> TopicRuleDestinationStatus
status :: TopicRuleDestinationStatus
}
deriving (UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool
(UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool)
-> (UpdateTopicRuleDestination
-> UpdateTopicRuleDestination -> Bool)
-> Eq UpdateTopicRuleDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool
$c/= :: UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool
== :: UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool
$c== :: UpdateTopicRuleDestination -> UpdateTopicRuleDestination -> Bool
Prelude.Eq, ReadPrec [UpdateTopicRuleDestination]
ReadPrec UpdateTopicRuleDestination
Int -> ReadS UpdateTopicRuleDestination
ReadS [UpdateTopicRuleDestination]
(Int -> ReadS UpdateTopicRuleDestination)
-> ReadS [UpdateTopicRuleDestination]
-> ReadPrec UpdateTopicRuleDestination
-> ReadPrec [UpdateTopicRuleDestination]
-> Read UpdateTopicRuleDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTopicRuleDestination]
$creadListPrec :: ReadPrec [UpdateTopicRuleDestination]
readPrec :: ReadPrec UpdateTopicRuleDestination
$creadPrec :: ReadPrec UpdateTopicRuleDestination
readList :: ReadS [UpdateTopicRuleDestination]
$creadList :: ReadS [UpdateTopicRuleDestination]
readsPrec :: Int -> ReadS UpdateTopicRuleDestination
$creadsPrec :: Int -> ReadS UpdateTopicRuleDestination
Prelude.Read, Int -> UpdateTopicRuleDestination -> ShowS
[UpdateTopicRuleDestination] -> ShowS
UpdateTopicRuleDestination -> String
(Int -> UpdateTopicRuleDestination -> ShowS)
-> (UpdateTopicRuleDestination -> String)
-> ([UpdateTopicRuleDestination] -> ShowS)
-> Show UpdateTopicRuleDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTopicRuleDestination] -> ShowS
$cshowList :: [UpdateTopicRuleDestination] -> ShowS
show :: UpdateTopicRuleDestination -> String
$cshow :: UpdateTopicRuleDestination -> String
showsPrec :: Int -> UpdateTopicRuleDestination -> ShowS
$cshowsPrec :: Int -> UpdateTopicRuleDestination -> ShowS
Prelude.Show, (forall x.
UpdateTopicRuleDestination -> Rep UpdateTopicRuleDestination x)
-> (forall x.
Rep UpdateTopicRuleDestination x -> UpdateTopicRuleDestination)
-> Generic UpdateTopicRuleDestination
forall x.
Rep UpdateTopicRuleDestination x -> UpdateTopicRuleDestination
forall x.
UpdateTopicRuleDestination -> Rep UpdateTopicRuleDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTopicRuleDestination x -> UpdateTopicRuleDestination
$cfrom :: forall x.
UpdateTopicRuleDestination -> Rep UpdateTopicRuleDestination x
Prelude.Generic)
newUpdateTopicRuleDestination ::
Prelude.Text ->
TopicRuleDestinationStatus ->
UpdateTopicRuleDestination
newUpdateTopicRuleDestination :: Text -> TopicRuleDestinationStatus -> UpdateTopicRuleDestination
newUpdateTopicRuleDestination Text
pArn_ TopicRuleDestinationStatus
pStatus_ =
UpdateTopicRuleDestination' :: Text -> TopicRuleDestinationStatus -> UpdateTopicRuleDestination
UpdateTopicRuleDestination'
{ $sel:arn:UpdateTopicRuleDestination' :: Text
arn = Text
pArn_,
$sel:status:UpdateTopicRuleDestination' :: TopicRuleDestinationStatus
status = TopicRuleDestinationStatus
pStatus_
}
updateTopicRuleDestination_arn :: Lens.Lens' UpdateTopicRuleDestination Prelude.Text
updateTopicRuleDestination_arn :: (Text -> f Text)
-> UpdateTopicRuleDestination -> f UpdateTopicRuleDestination
updateTopicRuleDestination_arn = (UpdateTopicRuleDestination -> Text)
-> (UpdateTopicRuleDestination
-> Text -> UpdateTopicRuleDestination)
-> Lens
UpdateTopicRuleDestination UpdateTopicRuleDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTopicRuleDestination' {Text
arn :: Text
$sel:arn:UpdateTopicRuleDestination' :: UpdateTopicRuleDestination -> Text
arn} -> Text
arn) (\s :: UpdateTopicRuleDestination
s@UpdateTopicRuleDestination' {} Text
a -> UpdateTopicRuleDestination
s {$sel:arn:UpdateTopicRuleDestination' :: Text
arn = Text
a} :: UpdateTopicRuleDestination)
updateTopicRuleDestination_status :: Lens.Lens' UpdateTopicRuleDestination TopicRuleDestinationStatus
updateTopicRuleDestination_status :: (TopicRuleDestinationStatus -> f TopicRuleDestinationStatus)
-> UpdateTopicRuleDestination -> f UpdateTopicRuleDestination
updateTopicRuleDestination_status = (UpdateTopicRuleDestination -> TopicRuleDestinationStatus)
-> (UpdateTopicRuleDestination
-> TopicRuleDestinationStatus -> UpdateTopicRuleDestination)
-> Lens
UpdateTopicRuleDestination
UpdateTopicRuleDestination
TopicRuleDestinationStatus
TopicRuleDestinationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTopicRuleDestination' {TopicRuleDestinationStatus
status :: TopicRuleDestinationStatus
$sel:status:UpdateTopicRuleDestination' :: UpdateTopicRuleDestination -> TopicRuleDestinationStatus
status} -> TopicRuleDestinationStatus
status) (\s :: UpdateTopicRuleDestination
s@UpdateTopicRuleDestination' {} TopicRuleDestinationStatus
a -> UpdateTopicRuleDestination
s {$sel:status:UpdateTopicRuleDestination' :: TopicRuleDestinationStatus
status = TopicRuleDestinationStatus
a} :: UpdateTopicRuleDestination)
instance Core.AWSRequest UpdateTopicRuleDestination where
type
AWSResponse UpdateTopicRuleDestination =
UpdateTopicRuleDestinationResponse
request :: UpdateTopicRuleDestination -> Request UpdateTopicRuleDestination
request = Service
-> UpdateTopicRuleDestination -> Request UpdateTopicRuleDestination
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateTopicRuleDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTopicRuleDestination)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateTopicRuleDestination))
-> Logger
-> Service
-> Proxy UpdateTopicRuleDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTopicRuleDestination)))
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 -> UpdateTopicRuleDestinationResponse
UpdateTopicRuleDestinationResponse'
(Int -> UpdateTopicRuleDestinationResponse)
-> Either String Int
-> Either String UpdateTopicRuleDestinationResponse
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 UpdateTopicRuleDestination
instance Prelude.NFData UpdateTopicRuleDestination
instance Core.ToHeaders UpdateTopicRuleDestination where
toHeaders :: UpdateTopicRuleDestination -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateTopicRuleDestination -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateTopicRuleDestination where
toJSON :: UpdateTopicRuleDestination -> Value
toJSON UpdateTopicRuleDestination' {Text
TopicRuleDestinationStatus
status :: TopicRuleDestinationStatus
arn :: Text
$sel:status:UpdateTopicRuleDestination' :: UpdateTopicRuleDestination -> TopicRuleDestinationStatus
$sel:arn:UpdateTopicRuleDestination' :: UpdateTopicRuleDestination -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> TopicRuleDestinationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TopicRuleDestinationStatus
status)
]
)
instance Core.ToPath UpdateTopicRuleDestination where
toPath :: UpdateTopicRuleDestination -> ByteString
toPath = ByteString -> UpdateTopicRuleDestination -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/destinations"
instance Core.ToQuery UpdateTopicRuleDestination where
toQuery :: UpdateTopicRuleDestination -> QueryString
toQuery = QueryString -> UpdateTopicRuleDestination -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateTopicRuleDestinationResponse = UpdateTopicRuleDestinationResponse'
{
UpdateTopicRuleDestinationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool
(UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool)
-> (UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool)
-> Eq UpdateTopicRuleDestinationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool
$c/= :: UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool
== :: UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool
$c== :: UpdateTopicRuleDestinationResponse
-> UpdateTopicRuleDestinationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTopicRuleDestinationResponse]
ReadPrec UpdateTopicRuleDestinationResponse
Int -> ReadS UpdateTopicRuleDestinationResponse
ReadS [UpdateTopicRuleDestinationResponse]
(Int -> ReadS UpdateTopicRuleDestinationResponse)
-> ReadS [UpdateTopicRuleDestinationResponse]
-> ReadPrec UpdateTopicRuleDestinationResponse
-> ReadPrec [UpdateTopicRuleDestinationResponse]
-> Read UpdateTopicRuleDestinationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTopicRuleDestinationResponse]
$creadListPrec :: ReadPrec [UpdateTopicRuleDestinationResponse]
readPrec :: ReadPrec UpdateTopicRuleDestinationResponse
$creadPrec :: ReadPrec UpdateTopicRuleDestinationResponse
readList :: ReadS [UpdateTopicRuleDestinationResponse]
$creadList :: ReadS [UpdateTopicRuleDestinationResponse]
readsPrec :: Int -> ReadS UpdateTopicRuleDestinationResponse
$creadsPrec :: Int -> ReadS UpdateTopicRuleDestinationResponse
Prelude.Read, Int -> UpdateTopicRuleDestinationResponse -> ShowS
[UpdateTopicRuleDestinationResponse] -> ShowS
UpdateTopicRuleDestinationResponse -> String
(Int -> UpdateTopicRuleDestinationResponse -> ShowS)
-> (UpdateTopicRuleDestinationResponse -> String)
-> ([UpdateTopicRuleDestinationResponse] -> ShowS)
-> Show UpdateTopicRuleDestinationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTopicRuleDestinationResponse] -> ShowS
$cshowList :: [UpdateTopicRuleDestinationResponse] -> ShowS
show :: UpdateTopicRuleDestinationResponse -> String
$cshow :: UpdateTopicRuleDestinationResponse -> String
showsPrec :: Int -> UpdateTopicRuleDestinationResponse -> ShowS
$cshowsPrec :: Int -> UpdateTopicRuleDestinationResponse -> ShowS
Prelude.Show, (forall x.
UpdateTopicRuleDestinationResponse
-> Rep UpdateTopicRuleDestinationResponse x)
-> (forall x.
Rep UpdateTopicRuleDestinationResponse x
-> UpdateTopicRuleDestinationResponse)
-> Generic UpdateTopicRuleDestinationResponse
forall x.
Rep UpdateTopicRuleDestinationResponse x
-> UpdateTopicRuleDestinationResponse
forall x.
UpdateTopicRuleDestinationResponse
-> Rep UpdateTopicRuleDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTopicRuleDestinationResponse x
-> UpdateTopicRuleDestinationResponse
$cfrom :: forall x.
UpdateTopicRuleDestinationResponse
-> Rep UpdateTopicRuleDestinationResponse x
Prelude.Generic)
newUpdateTopicRuleDestinationResponse ::
Prelude.Int ->
UpdateTopicRuleDestinationResponse
newUpdateTopicRuleDestinationResponse :: Int -> UpdateTopicRuleDestinationResponse
newUpdateTopicRuleDestinationResponse Int
pHttpStatus_ =
UpdateTopicRuleDestinationResponse' :: Int -> UpdateTopicRuleDestinationResponse
UpdateTopicRuleDestinationResponse'
{ $sel:httpStatus:UpdateTopicRuleDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateTopicRuleDestinationResponse_httpStatus :: Lens.Lens' UpdateTopicRuleDestinationResponse Prelude.Int
updateTopicRuleDestinationResponse_httpStatus :: (Int -> f Int)
-> UpdateTopicRuleDestinationResponse
-> f UpdateTopicRuleDestinationResponse
updateTopicRuleDestinationResponse_httpStatus = (UpdateTopicRuleDestinationResponse -> Int)
-> (UpdateTopicRuleDestinationResponse
-> Int -> UpdateTopicRuleDestinationResponse)
-> Lens
UpdateTopicRuleDestinationResponse
UpdateTopicRuleDestinationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTopicRuleDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTopicRuleDestinationResponse' :: UpdateTopicRuleDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateTopicRuleDestinationResponse
s@UpdateTopicRuleDestinationResponse' {} Int
a -> UpdateTopicRuleDestinationResponse
s {$sel:httpStatus:UpdateTopicRuleDestinationResponse' :: Int
httpStatus = Int
a} :: UpdateTopicRuleDestinationResponse)
instance
Prelude.NFData
UpdateTopicRuleDestinationResponse