{-# 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.IoTEventsData.ListDetectors
(
ListDetectors (..),
newListDetectors,
listDetectors_nextToken,
listDetectors_stateName,
listDetectors_maxResults,
listDetectors_detectorModelName,
ListDetectorsResponse (..),
newListDetectorsResponse,
listDetectorsResponse_nextToken,
listDetectorsResponse_detectorSummaries,
listDetectorsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTEventsData.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 ListDetectors = ListDetectors'
{
ListDetectors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDetectors -> Maybe Text
stateName :: Prelude.Maybe Prelude.Text,
ListDetectors -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDetectors -> Text
detectorModelName :: Prelude.Text
}
deriving (ListDetectors -> ListDetectors -> Bool
(ListDetectors -> ListDetectors -> Bool)
-> (ListDetectors -> ListDetectors -> Bool) -> Eq ListDetectors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDetectors -> ListDetectors -> Bool
$c/= :: ListDetectors -> ListDetectors -> Bool
== :: ListDetectors -> ListDetectors -> Bool
$c== :: ListDetectors -> ListDetectors -> Bool
Prelude.Eq, ReadPrec [ListDetectors]
ReadPrec ListDetectors
Int -> ReadS ListDetectors
ReadS [ListDetectors]
(Int -> ReadS ListDetectors)
-> ReadS [ListDetectors]
-> ReadPrec ListDetectors
-> ReadPrec [ListDetectors]
-> Read ListDetectors
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDetectors]
$creadListPrec :: ReadPrec [ListDetectors]
readPrec :: ReadPrec ListDetectors
$creadPrec :: ReadPrec ListDetectors
readList :: ReadS [ListDetectors]
$creadList :: ReadS [ListDetectors]
readsPrec :: Int -> ReadS ListDetectors
$creadsPrec :: Int -> ReadS ListDetectors
Prelude.Read, Int -> ListDetectors -> ShowS
[ListDetectors] -> ShowS
ListDetectors -> String
(Int -> ListDetectors -> ShowS)
-> (ListDetectors -> String)
-> ([ListDetectors] -> ShowS)
-> Show ListDetectors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDetectors] -> ShowS
$cshowList :: [ListDetectors] -> ShowS
show :: ListDetectors -> String
$cshow :: ListDetectors -> String
showsPrec :: Int -> ListDetectors -> ShowS
$cshowsPrec :: Int -> ListDetectors -> ShowS
Prelude.Show, (forall x. ListDetectors -> Rep ListDetectors x)
-> (forall x. Rep ListDetectors x -> ListDetectors)
-> Generic ListDetectors
forall x. Rep ListDetectors x -> ListDetectors
forall x. ListDetectors -> Rep ListDetectors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDetectors x -> ListDetectors
$cfrom :: forall x. ListDetectors -> Rep ListDetectors x
Prelude.Generic)
newListDetectors ::
Prelude.Text ->
ListDetectors
newListDetectors :: Text -> ListDetectors
newListDetectors Text
pDetectorModelName_ =
ListDetectors' :: Maybe Text -> Maybe Text -> Maybe Natural -> Text -> ListDetectors
ListDetectors'
{ $sel:nextToken:ListDetectors' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stateName:ListDetectors' :: Maybe Text
stateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDetectors' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:detectorModelName:ListDetectors' :: Text
detectorModelName = Text
pDetectorModelName_
}
listDetectors_nextToken :: Lens.Lens' ListDetectors (Prelude.Maybe Prelude.Text)
listDetectors_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListDetectors -> f ListDetectors
listDetectors_nextToken = (ListDetectors -> Maybe Text)
-> (ListDetectors -> Maybe Text -> ListDetectors)
-> Lens ListDetectors ListDetectors (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDetectors' :: ListDetectors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDetectors
s@ListDetectors' {} Maybe Text
a -> ListDetectors
s {$sel:nextToken:ListDetectors' :: Maybe Text
nextToken = Maybe Text
a} :: ListDetectors)
listDetectors_stateName :: Lens.Lens' ListDetectors (Prelude.Maybe Prelude.Text)
listDetectors_stateName :: (Maybe Text -> f (Maybe Text)) -> ListDetectors -> f ListDetectors
listDetectors_stateName = (ListDetectors -> Maybe Text)
-> (ListDetectors -> Maybe Text -> ListDetectors)
-> Lens ListDetectors ListDetectors (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectors' {Maybe Text
stateName :: Maybe Text
$sel:stateName:ListDetectors' :: ListDetectors -> Maybe Text
stateName} -> Maybe Text
stateName) (\s :: ListDetectors
s@ListDetectors' {} Maybe Text
a -> ListDetectors
s {$sel:stateName:ListDetectors' :: Maybe Text
stateName = Maybe Text
a} :: ListDetectors)
listDetectors_maxResults :: Lens.Lens' ListDetectors (Prelude.Maybe Prelude.Natural)
listDetectors_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDetectors -> f ListDetectors
listDetectors_maxResults = (ListDetectors -> Maybe Natural)
-> (ListDetectors -> Maybe Natural -> ListDetectors)
-> Lens ListDetectors ListDetectors (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectors' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDetectors' :: ListDetectors -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDetectors
s@ListDetectors' {} Maybe Natural
a -> ListDetectors
s {$sel:maxResults:ListDetectors' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDetectors)
listDetectors_detectorModelName :: Lens.Lens' ListDetectors Prelude.Text
listDetectors_detectorModelName :: (Text -> f Text) -> ListDetectors -> f ListDetectors
listDetectors_detectorModelName = (ListDetectors -> Text)
-> (ListDetectors -> Text -> ListDetectors)
-> Lens ListDetectors ListDetectors Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectors' {Text
detectorModelName :: Text
$sel:detectorModelName:ListDetectors' :: ListDetectors -> Text
detectorModelName} -> Text
detectorModelName) (\s :: ListDetectors
s@ListDetectors' {} Text
a -> ListDetectors
s {$sel:detectorModelName:ListDetectors' :: Text
detectorModelName = Text
a} :: ListDetectors)
instance Core.AWSRequest ListDetectors where
type
AWSResponse ListDetectors =
ListDetectorsResponse
request :: ListDetectors -> Request ListDetectors
request = Service -> ListDetectors -> Request ListDetectors
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDetectors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDetectors)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDetectors))
-> Logger
-> Service
-> Proxy ListDetectors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDetectors)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [DetectorSummary] -> Int -> ListDetectorsResponse
ListDetectorsResponse'
(Maybe Text
-> Maybe [DetectorSummary] -> Int -> ListDetectorsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [DetectorSummary] -> Int -> ListDetectorsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
Either
String (Maybe [DetectorSummary] -> Int -> ListDetectorsResponse)
-> Either String (Maybe [DetectorSummary])
-> Either String (Int -> ListDetectorsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [DetectorSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"detectorSummaries"
Either String (Maybe (Maybe [DetectorSummary]))
-> Maybe [DetectorSummary]
-> Either String (Maybe [DetectorSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DetectorSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListDetectorsResponse)
-> Either String Int -> Either String ListDetectorsResponse
forall (f :: * -> *) a b. Applicative f => 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 ListDetectors
instance Prelude.NFData ListDetectors
instance Core.ToHeaders ListDetectors where
toHeaders :: ListDetectors -> ResponseHeaders
toHeaders = ResponseHeaders -> ListDetectors -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListDetectors where
toPath :: ListDetectors -> ByteString
toPath ListDetectors' {Maybe Natural
Maybe Text
Text
detectorModelName :: Text
maxResults :: Maybe Natural
stateName :: Maybe Text
nextToken :: Maybe Text
$sel:detectorModelName:ListDetectors' :: ListDetectors -> Text
$sel:maxResults:ListDetectors' :: ListDetectors -> Maybe Natural
$sel:stateName:ListDetectors' :: ListDetectors -> Maybe Text
$sel:nextToken:ListDetectors' :: ListDetectors -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/detectors/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorModelName]
instance Core.ToQuery ListDetectors where
toQuery :: ListDetectors -> QueryString
toQuery ListDetectors' {Maybe Natural
Maybe Text
Text
detectorModelName :: Text
maxResults :: Maybe Natural
stateName :: Maybe Text
nextToken :: Maybe Text
$sel:detectorModelName:ListDetectors' :: ListDetectors -> Text
$sel:maxResults:ListDetectors' :: ListDetectors -> Maybe Natural
$sel:stateName:ListDetectors' :: ListDetectors -> Maybe Text
$sel:nextToken:ListDetectors' :: ListDetectors -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"stateName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stateName,
ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListDetectorsResponse = ListDetectorsResponse'
{
ListDetectorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDetectorsResponse -> Maybe [DetectorSummary]
detectorSummaries :: Prelude.Maybe [DetectorSummary],
ListDetectorsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDetectorsResponse -> ListDetectorsResponse -> Bool
(ListDetectorsResponse -> ListDetectorsResponse -> Bool)
-> (ListDetectorsResponse -> ListDetectorsResponse -> Bool)
-> Eq ListDetectorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDetectorsResponse -> ListDetectorsResponse -> Bool
$c/= :: ListDetectorsResponse -> ListDetectorsResponse -> Bool
== :: ListDetectorsResponse -> ListDetectorsResponse -> Bool
$c== :: ListDetectorsResponse -> ListDetectorsResponse -> Bool
Prelude.Eq, ReadPrec [ListDetectorsResponse]
ReadPrec ListDetectorsResponse
Int -> ReadS ListDetectorsResponse
ReadS [ListDetectorsResponse]
(Int -> ReadS ListDetectorsResponse)
-> ReadS [ListDetectorsResponse]
-> ReadPrec ListDetectorsResponse
-> ReadPrec [ListDetectorsResponse]
-> Read ListDetectorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDetectorsResponse]
$creadListPrec :: ReadPrec [ListDetectorsResponse]
readPrec :: ReadPrec ListDetectorsResponse
$creadPrec :: ReadPrec ListDetectorsResponse
readList :: ReadS [ListDetectorsResponse]
$creadList :: ReadS [ListDetectorsResponse]
readsPrec :: Int -> ReadS ListDetectorsResponse
$creadsPrec :: Int -> ReadS ListDetectorsResponse
Prelude.Read, Int -> ListDetectorsResponse -> ShowS
[ListDetectorsResponse] -> ShowS
ListDetectorsResponse -> String
(Int -> ListDetectorsResponse -> ShowS)
-> (ListDetectorsResponse -> String)
-> ([ListDetectorsResponse] -> ShowS)
-> Show ListDetectorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDetectorsResponse] -> ShowS
$cshowList :: [ListDetectorsResponse] -> ShowS
show :: ListDetectorsResponse -> String
$cshow :: ListDetectorsResponse -> String
showsPrec :: Int -> ListDetectorsResponse -> ShowS
$cshowsPrec :: Int -> ListDetectorsResponse -> ShowS
Prelude.Show, (forall x. ListDetectorsResponse -> Rep ListDetectorsResponse x)
-> (forall x. Rep ListDetectorsResponse x -> ListDetectorsResponse)
-> Generic ListDetectorsResponse
forall x. Rep ListDetectorsResponse x -> ListDetectorsResponse
forall x. ListDetectorsResponse -> Rep ListDetectorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDetectorsResponse x -> ListDetectorsResponse
$cfrom :: forall x. ListDetectorsResponse -> Rep ListDetectorsResponse x
Prelude.Generic)
newListDetectorsResponse ::
Prelude.Int ->
ListDetectorsResponse
newListDetectorsResponse :: Int -> ListDetectorsResponse
newListDetectorsResponse Int
pHttpStatus_ =
ListDetectorsResponse' :: Maybe Text
-> Maybe [DetectorSummary] -> Int -> ListDetectorsResponse
ListDetectorsResponse'
{ $sel:nextToken:ListDetectorsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:detectorSummaries:ListDetectorsResponse' :: Maybe [DetectorSummary]
detectorSummaries = Maybe [DetectorSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDetectorsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDetectorsResponse_nextToken :: Lens.Lens' ListDetectorsResponse (Prelude.Maybe Prelude.Text)
listDetectorsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDetectorsResponse -> f ListDetectorsResponse
listDetectorsResponse_nextToken = (ListDetectorsResponse -> Maybe Text)
-> (ListDetectorsResponse -> Maybe Text -> ListDetectorsResponse)
-> Lens
ListDetectorsResponse
ListDetectorsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDetectorsResponse' :: ListDetectorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDetectorsResponse
s@ListDetectorsResponse' {} Maybe Text
a -> ListDetectorsResponse
s {$sel:nextToken:ListDetectorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDetectorsResponse)
listDetectorsResponse_detectorSummaries :: Lens.Lens' ListDetectorsResponse (Prelude.Maybe [DetectorSummary])
listDetectorsResponse_detectorSummaries :: (Maybe [DetectorSummary] -> f (Maybe [DetectorSummary]))
-> ListDetectorsResponse -> f ListDetectorsResponse
listDetectorsResponse_detectorSummaries = (ListDetectorsResponse -> Maybe [DetectorSummary])
-> (ListDetectorsResponse
-> Maybe [DetectorSummary] -> ListDetectorsResponse)
-> Lens
ListDetectorsResponse
ListDetectorsResponse
(Maybe [DetectorSummary])
(Maybe [DetectorSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorsResponse' {Maybe [DetectorSummary]
detectorSummaries :: Maybe [DetectorSummary]
$sel:detectorSummaries:ListDetectorsResponse' :: ListDetectorsResponse -> Maybe [DetectorSummary]
detectorSummaries} -> Maybe [DetectorSummary]
detectorSummaries) (\s :: ListDetectorsResponse
s@ListDetectorsResponse' {} Maybe [DetectorSummary]
a -> ListDetectorsResponse
s {$sel:detectorSummaries:ListDetectorsResponse' :: Maybe [DetectorSummary]
detectorSummaries = Maybe [DetectorSummary]
a} :: ListDetectorsResponse) ((Maybe [DetectorSummary] -> f (Maybe [DetectorSummary]))
-> ListDetectorsResponse -> f ListDetectorsResponse)
-> ((Maybe [DetectorSummary] -> f (Maybe [DetectorSummary]))
-> Maybe [DetectorSummary] -> f (Maybe [DetectorSummary]))
-> (Maybe [DetectorSummary] -> f (Maybe [DetectorSummary]))
-> ListDetectorsResponse
-> f ListDetectorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DetectorSummary]
[DetectorSummary]
[DetectorSummary]
[DetectorSummary]
-> Iso
(Maybe [DetectorSummary])
(Maybe [DetectorSummary])
(Maybe [DetectorSummary])
(Maybe [DetectorSummary])
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 AnIso
[DetectorSummary]
[DetectorSummary]
[DetectorSummary]
[DetectorSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDetectorsResponse_httpStatus :: Lens.Lens' ListDetectorsResponse Prelude.Int
listDetectorsResponse_httpStatus :: (Int -> f Int) -> ListDetectorsResponse -> f ListDetectorsResponse
listDetectorsResponse_httpStatus = (ListDetectorsResponse -> Int)
-> (ListDetectorsResponse -> Int -> ListDetectorsResponse)
-> Lens ListDetectorsResponse ListDetectorsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDetectorsResponse' :: ListDetectorsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDetectorsResponse
s@ListDetectorsResponse' {} Int
a -> ListDetectorsResponse
s {$sel:httpStatus:ListDetectorsResponse' :: Int
httpStatus = Int
a} :: ListDetectorsResponse)
instance Prelude.NFData ListDetectorsResponse