{-# 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.ListTopicRuleDestinations
(
ListTopicRuleDestinations (..),
newListTopicRuleDestinations,
listTopicRuleDestinations_maxResults,
listTopicRuleDestinations_nextToken,
ListTopicRuleDestinationsResponse (..),
newListTopicRuleDestinationsResponse,
listTopicRuleDestinationsResponse_destinationSummaries,
listTopicRuleDestinationsResponse_nextToken,
listTopicRuleDestinationsResponse_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 ListTopicRuleDestinations = ListTopicRuleDestinations'
{
ListTopicRuleDestinations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListTopicRuleDestinations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListTopicRuleDestinations -> ListTopicRuleDestinations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTopicRuleDestinations -> ListTopicRuleDestinations -> Bool
$c/= :: ListTopicRuleDestinations -> ListTopicRuleDestinations -> Bool
== :: ListTopicRuleDestinations -> ListTopicRuleDestinations -> Bool
$c== :: ListTopicRuleDestinations -> ListTopicRuleDestinations -> Bool
Prelude.Eq, ReadPrec [ListTopicRuleDestinations]
ReadPrec ListTopicRuleDestinations
Int -> ReadS ListTopicRuleDestinations
ReadS [ListTopicRuleDestinations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTopicRuleDestinations]
$creadListPrec :: ReadPrec [ListTopicRuleDestinations]
readPrec :: ReadPrec ListTopicRuleDestinations
$creadPrec :: ReadPrec ListTopicRuleDestinations
readList :: ReadS [ListTopicRuleDestinations]
$creadList :: ReadS [ListTopicRuleDestinations]
readsPrec :: Int -> ReadS ListTopicRuleDestinations
$creadsPrec :: Int -> ReadS ListTopicRuleDestinations
Prelude.Read, Int -> ListTopicRuleDestinations -> ShowS
[ListTopicRuleDestinations] -> ShowS
ListTopicRuleDestinations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTopicRuleDestinations] -> ShowS
$cshowList :: [ListTopicRuleDestinations] -> ShowS
show :: ListTopicRuleDestinations -> String
$cshow :: ListTopicRuleDestinations -> String
showsPrec :: Int -> ListTopicRuleDestinations -> ShowS
$cshowsPrec :: Int -> ListTopicRuleDestinations -> ShowS
Prelude.Show, forall x.
Rep ListTopicRuleDestinations x -> ListTopicRuleDestinations
forall x.
ListTopicRuleDestinations -> Rep ListTopicRuleDestinations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTopicRuleDestinations x -> ListTopicRuleDestinations
$cfrom :: forall x.
ListTopicRuleDestinations -> Rep ListTopicRuleDestinations x
Prelude.Generic)
newListTopicRuleDestinations ::
ListTopicRuleDestinations
newListTopicRuleDestinations :: ListTopicRuleDestinations
newListTopicRuleDestinations =
ListTopicRuleDestinations'
{ $sel:maxResults:ListTopicRuleDestinations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTopicRuleDestinations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listTopicRuleDestinations_maxResults :: Lens.Lens' ListTopicRuleDestinations (Prelude.Maybe Prelude.Natural)
listTopicRuleDestinations_maxResults :: Lens' ListTopicRuleDestinations (Maybe Natural)
listTopicRuleDestinations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicRuleDestinations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTopicRuleDestinations
s@ListTopicRuleDestinations' {} Maybe Natural
a -> ListTopicRuleDestinations
s {$sel:maxResults:ListTopicRuleDestinations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTopicRuleDestinations)
listTopicRuleDestinations_nextToken :: Lens.Lens' ListTopicRuleDestinations (Prelude.Maybe Prelude.Text)
listTopicRuleDestinations_nextToken :: Lens' ListTopicRuleDestinations (Maybe Text)
listTopicRuleDestinations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicRuleDestinations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTopicRuleDestinations
s@ListTopicRuleDestinations' {} Maybe Text
a -> ListTopicRuleDestinations
s {$sel:nextToken:ListTopicRuleDestinations' :: Maybe Text
nextToken = Maybe Text
a} :: ListTopicRuleDestinations)
instance Core.AWSPager ListTopicRuleDestinations where
page :: ListTopicRuleDestinations
-> AWSResponse ListTopicRuleDestinations
-> Maybe ListTopicRuleDestinations
page ListTopicRuleDestinations
rq AWSResponse ListTopicRuleDestinations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListTopicRuleDestinations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTopicRuleDestinationsResponse (Maybe Text)
listTopicRuleDestinationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListTopicRuleDestinations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListTopicRuleDestinationsResponse
(Maybe [TopicRuleDestinationSummary])
listTopicRuleDestinationsResponse_destinationSummaries
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListTopicRuleDestinations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListTopicRuleDestinations (Maybe Text)
listTopicRuleDestinations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTopicRuleDestinations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTopicRuleDestinationsResponse (Maybe Text)
listTopicRuleDestinationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListTopicRuleDestinations where
type
AWSResponse ListTopicRuleDestinations =
ListTopicRuleDestinationsResponse
request :: (Service -> Service)
-> ListTopicRuleDestinations -> Request ListTopicRuleDestinations
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 ListTopicRuleDestinations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTopicRuleDestinations)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [TopicRuleDestinationSummary]
-> Maybe Text -> Int -> ListTopicRuleDestinationsResponse
ListTopicRuleDestinationsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"destinationSummaries"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => 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 ListTopicRuleDestinations where
hashWithSalt :: Int -> ListTopicRuleDestinations -> Int
hashWithSalt Int
_salt ListTopicRuleDestinations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Text
$sel:maxResults:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListTopicRuleDestinations where
rnf :: ListTopicRuleDestinations -> ()
rnf ListTopicRuleDestinations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Text
$sel:maxResults:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListTopicRuleDestinations where
toHeaders :: ListTopicRuleDestinations -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListTopicRuleDestinations where
toPath :: ListTopicRuleDestinations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/destinations"
instance Data.ToQuery ListTopicRuleDestinations where
toQuery :: ListTopicRuleDestinations -> QueryString
toQuery ListTopicRuleDestinations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Text
$sel:maxResults:ListTopicRuleDestinations' :: ListTopicRuleDestinations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListTopicRuleDestinationsResponse = ListTopicRuleDestinationsResponse'
{
ListTopicRuleDestinationsResponse
-> Maybe [TopicRuleDestinationSummary]
destinationSummaries :: Prelude.Maybe [TopicRuleDestinationSummary],
ListTopicRuleDestinationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTopicRuleDestinationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTopicRuleDestinationsResponse
-> ListTopicRuleDestinationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTopicRuleDestinationsResponse
-> ListTopicRuleDestinationsResponse -> Bool
$c/= :: ListTopicRuleDestinationsResponse
-> ListTopicRuleDestinationsResponse -> Bool
== :: ListTopicRuleDestinationsResponse
-> ListTopicRuleDestinationsResponse -> Bool
$c== :: ListTopicRuleDestinationsResponse
-> ListTopicRuleDestinationsResponse -> Bool
Prelude.Eq, ReadPrec [ListTopicRuleDestinationsResponse]
ReadPrec ListTopicRuleDestinationsResponse
Int -> ReadS ListTopicRuleDestinationsResponse
ReadS [ListTopicRuleDestinationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTopicRuleDestinationsResponse]
$creadListPrec :: ReadPrec [ListTopicRuleDestinationsResponse]
readPrec :: ReadPrec ListTopicRuleDestinationsResponse
$creadPrec :: ReadPrec ListTopicRuleDestinationsResponse
readList :: ReadS [ListTopicRuleDestinationsResponse]
$creadList :: ReadS [ListTopicRuleDestinationsResponse]
readsPrec :: Int -> ReadS ListTopicRuleDestinationsResponse
$creadsPrec :: Int -> ReadS ListTopicRuleDestinationsResponse
Prelude.Read, Int -> ListTopicRuleDestinationsResponse -> ShowS
[ListTopicRuleDestinationsResponse] -> ShowS
ListTopicRuleDestinationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTopicRuleDestinationsResponse] -> ShowS
$cshowList :: [ListTopicRuleDestinationsResponse] -> ShowS
show :: ListTopicRuleDestinationsResponse -> String
$cshow :: ListTopicRuleDestinationsResponse -> String
showsPrec :: Int -> ListTopicRuleDestinationsResponse -> ShowS
$cshowsPrec :: Int -> ListTopicRuleDestinationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTopicRuleDestinationsResponse x
-> ListTopicRuleDestinationsResponse
forall x.
ListTopicRuleDestinationsResponse
-> Rep ListTopicRuleDestinationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTopicRuleDestinationsResponse x
-> ListTopicRuleDestinationsResponse
$cfrom :: forall x.
ListTopicRuleDestinationsResponse
-> Rep ListTopicRuleDestinationsResponse x
Prelude.Generic)
newListTopicRuleDestinationsResponse ::
Prelude.Int ->
ListTopicRuleDestinationsResponse
newListTopicRuleDestinationsResponse :: Int -> ListTopicRuleDestinationsResponse
newListTopicRuleDestinationsResponse Int
pHttpStatus_ =
ListTopicRuleDestinationsResponse'
{ $sel:destinationSummaries:ListTopicRuleDestinationsResponse' :: Maybe [TopicRuleDestinationSummary]
destinationSummaries =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTopicRuleDestinationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTopicRuleDestinationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTopicRuleDestinationsResponse_destinationSummaries :: Lens.Lens' ListTopicRuleDestinationsResponse (Prelude.Maybe [TopicRuleDestinationSummary])
listTopicRuleDestinationsResponse_destinationSummaries :: Lens'
ListTopicRuleDestinationsResponse
(Maybe [TopicRuleDestinationSummary])
listTopicRuleDestinationsResponse_destinationSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicRuleDestinationsResponse' {Maybe [TopicRuleDestinationSummary]
destinationSummaries :: Maybe [TopicRuleDestinationSummary]
$sel:destinationSummaries:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse
-> Maybe [TopicRuleDestinationSummary]
destinationSummaries} -> Maybe [TopicRuleDestinationSummary]
destinationSummaries) (\s :: ListTopicRuleDestinationsResponse
s@ListTopicRuleDestinationsResponse' {} Maybe [TopicRuleDestinationSummary]
a -> ListTopicRuleDestinationsResponse
s {$sel:destinationSummaries:ListTopicRuleDestinationsResponse' :: Maybe [TopicRuleDestinationSummary]
destinationSummaries = Maybe [TopicRuleDestinationSummary]
a} :: ListTopicRuleDestinationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTopicRuleDestinationsResponse_nextToken :: Lens.Lens' ListTopicRuleDestinationsResponse (Prelude.Maybe Prelude.Text)
listTopicRuleDestinationsResponse_nextToken :: Lens' ListTopicRuleDestinationsResponse (Maybe Text)
listTopicRuleDestinationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicRuleDestinationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTopicRuleDestinationsResponse
s@ListTopicRuleDestinationsResponse' {} Maybe Text
a -> ListTopicRuleDestinationsResponse
s {$sel:nextToken:ListTopicRuleDestinationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTopicRuleDestinationsResponse)
listTopicRuleDestinationsResponse_httpStatus :: Lens.Lens' ListTopicRuleDestinationsResponse Prelude.Int
listTopicRuleDestinationsResponse_httpStatus :: Lens' ListTopicRuleDestinationsResponse Int
listTopicRuleDestinationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicRuleDestinationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTopicRuleDestinationsResponse
s@ListTopicRuleDestinationsResponse' {} Int
a -> ListTopicRuleDestinationsResponse
s {$sel:httpStatus:ListTopicRuleDestinationsResponse' :: Int
httpStatus = Int
a} :: ListTopicRuleDestinationsResponse)
instance
Prelude.NFData
ListTopicRuleDestinationsResponse
where
rnf :: ListTopicRuleDestinationsResponse -> ()
rnf ListTopicRuleDestinationsResponse' {Int
Maybe [TopicRuleDestinationSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
destinationSummaries :: Maybe [TopicRuleDestinationSummary]
$sel:httpStatus:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse -> Int
$sel:nextToken:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse -> Maybe Text
$sel:destinationSummaries:ListTopicRuleDestinationsResponse' :: ListTopicRuleDestinationsResponse
-> Maybe [TopicRuleDestinationSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [TopicRuleDestinationSummary]
destinationSummaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus