{-# 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.IoTEvents.ListDetectorModels
(
ListDetectorModels (..),
newListDetectorModels,
listDetectorModels_nextToken,
listDetectorModels_maxResults,
ListDetectorModelsResponse (..),
newListDetectorModelsResponse,
listDetectorModelsResponse_nextToken,
listDetectorModelsResponse_detectorModelSummaries,
listDetectorModelsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.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 ListDetectorModels = ListDetectorModels'
{
ListDetectorModels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDetectorModels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListDetectorModels -> ListDetectorModels -> Bool
(ListDetectorModels -> ListDetectorModels -> Bool)
-> (ListDetectorModels -> ListDetectorModels -> Bool)
-> Eq ListDetectorModels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDetectorModels -> ListDetectorModels -> Bool
$c/= :: ListDetectorModels -> ListDetectorModels -> Bool
== :: ListDetectorModels -> ListDetectorModels -> Bool
$c== :: ListDetectorModels -> ListDetectorModels -> Bool
Prelude.Eq, ReadPrec [ListDetectorModels]
ReadPrec ListDetectorModels
Int -> ReadS ListDetectorModels
ReadS [ListDetectorModels]
(Int -> ReadS ListDetectorModels)
-> ReadS [ListDetectorModels]
-> ReadPrec ListDetectorModels
-> ReadPrec [ListDetectorModels]
-> Read ListDetectorModels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDetectorModels]
$creadListPrec :: ReadPrec [ListDetectorModels]
readPrec :: ReadPrec ListDetectorModels
$creadPrec :: ReadPrec ListDetectorModels
readList :: ReadS [ListDetectorModels]
$creadList :: ReadS [ListDetectorModels]
readsPrec :: Int -> ReadS ListDetectorModels
$creadsPrec :: Int -> ReadS ListDetectorModels
Prelude.Read, Int -> ListDetectorModels -> ShowS
[ListDetectorModels] -> ShowS
ListDetectorModels -> String
(Int -> ListDetectorModels -> ShowS)
-> (ListDetectorModels -> String)
-> ([ListDetectorModels] -> ShowS)
-> Show ListDetectorModels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDetectorModels] -> ShowS
$cshowList :: [ListDetectorModels] -> ShowS
show :: ListDetectorModels -> String
$cshow :: ListDetectorModels -> String
showsPrec :: Int -> ListDetectorModels -> ShowS
$cshowsPrec :: Int -> ListDetectorModels -> ShowS
Prelude.Show, (forall x. ListDetectorModels -> Rep ListDetectorModels x)
-> (forall x. Rep ListDetectorModels x -> ListDetectorModels)
-> Generic ListDetectorModels
forall x. Rep ListDetectorModels x -> ListDetectorModels
forall x. ListDetectorModels -> Rep ListDetectorModels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDetectorModels x -> ListDetectorModels
$cfrom :: forall x. ListDetectorModels -> Rep ListDetectorModels x
Prelude.Generic)
newListDetectorModels ::
ListDetectorModels
newListDetectorModels :: ListDetectorModels
newListDetectorModels =
ListDetectorModels' :: Maybe Text -> Maybe Natural -> ListDetectorModels
ListDetectorModels'
{ $sel:nextToken:ListDetectorModels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDetectorModels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listDetectorModels_nextToken :: Lens.Lens' ListDetectorModels (Prelude.Maybe Prelude.Text)
listDetectorModels_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDetectorModels -> f ListDetectorModels
listDetectorModels_nextToken = (ListDetectorModels -> Maybe Text)
-> (ListDetectorModels -> Maybe Text -> ListDetectorModels)
-> Lens
ListDetectorModels ListDetectorModels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorModels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDetectorModels' :: ListDetectorModels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDetectorModels
s@ListDetectorModels' {} Maybe Text
a -> ListDetectorModels
s {$sel:nextToken:ListDetectorModels' :: Maybe Text
nextToken = Maybe Text
a} :: ListDetectorModels)
listDetectorModels_maxResults :: Lens.Lens' ListDetectorModels (Prelude.Maybe Prelude.Natural)
listDetectorModels_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDetectorModels -> f ListDetectorModels
listDetectorModels_maxResults = (ListDetectorModels -> Maybe Natural)
-> (ListDetectorModels -> Maybe Natural -> ListDetectorModels)
-> Lens
ListDetectorModels
ListDetectorModels
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorModels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDetectorModels' :: ListDetectorModels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDetectorModels
s@ListDetectorModels' {} Maybe Natural
a -> ListDetectorModels
s {$sel:maxResults:ListDetectorModels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDetectorModels)
instance Core.AWSRequest ListDetectorModels where
type
AWSResponse ListDetectorModels =
ListDetectorModelsResponse
request :: ListDetectorModels -> Request ListDetectorModels
request = Service -> ListDetectorModels -> Request ListDetectorModels
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDetectorModels
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDetectorModels)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDetectorModels))
-> Logger
-> Service
-> Proxy ListDetectorModels
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDetectorModels)))
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 [DetectorModelSummary]
-> Int
-> ListDetectorModelsResponse
ListDetectorModelsResponse'
(Maybe Text
-> Maybe [DetectorModelSummary]
-> Int
-> ListDetectorModelsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [DetectorModelSummary] -> Int -> ListDetectorModelsResponse)
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 [DetectorModelSummary] -> Int -> ListDetectorModelsResponse)
-> Either String (Maybe [DetectorModelSummary])
-> Either String (Int -> ListDetectorModelsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [DetectorModelSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"detectorModelSummaries"
Either String (Maybe (Maybe [DetectorModelSummary]))
-> Maybe [DetectorModelSummary]
-> Either String (Maybe [DetectorModelSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DetectorModelSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListDetectorModelsResponse)
-> Either String Int -> Either String ListDetectorModelsResponse
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 ListDetectorModels
instance Prelude.NFData ListDetectorModels
instance Core.ToHeaders ListDetectorModels where
toHeaders :: ListDetectorModels -> ResponseHeaders
toHeaders = ResponseHeaders -> ListDetectorModels -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListDetectorModels where
toPath :: ListDetectorModels -> ByteString
toPath = ByteString -> ListDetectorModels -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/detector-models"
instance Core.ToQuery ListDetectorModels where
toQuery :: ListDetectorModels -> QueryString
toQuery ListDetectorModels' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListDetectorModels' :: ListDetectorModels -> Maybe Natural
$sel:nextToken:ListDetectorModels' :: ListDetectorModels -> 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
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListDetectorModelsResponse = ListDetectorModelsResponse'
{
ListDetectorModelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDetectorModelsResponse -> Maybe [DetectorModelSummary]
detectorModelSummaries :: Prelude.Maybe [DetectorModelSummary],
ListDetectorModelsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool
(ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool)
-> (ListDetectorModelsResponse
-> ListDetectorModelsResponse -> Bool)
-> Eq ListDetectorModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool
$c/= :: ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool
== :: ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool
$c== :: ListDetectorModelsResponse -> ListDetectorModelsResponse -> Bool
Prelude.Eq, ReadPrec [ListDetectorModelsResponse]
ReadPrec ListDetectorModelsResponse
Int -> ReadS ListDetectorModelsResponse
ReadS [ListDetectorModelsResponse]
(Int -> ReadS ListDetectorModelsResponse)
-> ReadS [ListDetectorModelsResponse]
-> ReadPrec ListDetectorModelsResponse
-> ReadPrec [ListDetectorModelsResponse]
-> Read ListDetectorModelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDetectorModelsResponse]
$creadListPrec :: ReadPrec [ListDetectorModelsResponse]
readPrec :: ReadPrec ListDetectorModelsResponse
$creadPrec :: ReadPrec ListDetectorModelsResponse
readList :: ReadS [ListDetectorModelsResponse]
$creadList :: ReadS [ListDetectorModelsResponse]
readsPrec :: Int -> ReadS ListDetectorModelsResponse
$creadsPrec :: Int -> ReadS ListDetectorModelsResponse
Prelude.Read, Int -> ListDetectorModelsResponse -> ShowS
[ListDetectorModelsResponse] -> ShowS
ListDetectorModelsResponse -> String
(Int -> ListDetectorModelsResponse -> ShowS)
-> (ListDetectorModelsResponse -> String)
-> ([ListDetectorModelsResponse] -> ShowS)
-> Show ListDetectorModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDetectorModelsResponse] -> ShowS
$cshowList :: [ListDetectorModelsResponse] -> ShowS
show :: ListDetectorModelsResponse -> String
$cshow :: ListDetectorModelsResponse -> String
showsPrec :: Int -> ListDetectorModelsResponse -> ShowS
$cshowsPrec :: Int -> ListDetectorModelsResponse -> ShowS
Prelude.Show, (forall x.
ListDetectorModelsResponse -> Rep ListDetectorModelsResponse x)
-> (forall x.
Rep ListDetectorModelsResponse x -> ListDetectorModelsResponse)
-> Generic ListDetectorModelsResponse
forall x.
Rep ListDetectorModelsResponse x -> ListDetectorModelsResponse
forall x.
ListDetectorModelsResponse -> Rep ListDetectorModelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDetectorModelsResponse x -> ListDetectorModelsResponse
$cfrom :: forall x.
ListDetectorModelsResponse -> Rep ListDetectorModelsResponse x
Prelude.Generic)
newListDetectorModelsResponse ::
Prelude.Int ->
ListDetectorModelsResponse
newListDetectorModelsResponse :: Int -> ListDetectorModelsResponse
newListDetectorModelsResponse Int
pHttpStatus_ =
ListDetectorModelsResponse' :: Maybe Text
-> Maybe [DetectorModelSummary]
-> Int
-> ListDetectorModelsResponse
ListDetectorModelsResponse'
{ $sel:nextToken:ListDetectorModelsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:detectorModelSummaries:ListDetectorModelsResponse' :: Maybe [DetectorModelSummary]
detectorModelSummaries = Maybe [DetectorModelSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDetectorModelsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDetectorModelsResponse_nextToken :: Lens.Lens' ListDetectorModelsResponse (Prelude.Maybe Prelude.Text)
listDetectorModelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDetectorModelsResponse -> f ListDetectorModelsResponse
listDetectorModelsResponse_nextToken = (ListDetectorModelsResponse -> Maybe Text)
-> (ListDetectorModelsResponse
-> Maybe Text -> ListDetectorModelsResponse)
-> Lens
ListDetectorModelsResponse
ListDetectorModelsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorModelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDetectorModelsResponse' :: ListDetectorModelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDetectorModelsResponse
s@ListDetectorModelsResponse' {} Maybe Text
a -> ListDetectorModelsResponse
s {$sel:nextToken:ListDetectorModelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDetectorModelsResponse)
listDetectorModelsResponse_detectorModelSummaries :: Lens.Lens' ListDetectorModelsResponse (Prelude.Maybe [DetectorModelSummary])
listDetectorModelsResponse_detectorModelSummaries :: (Maybe [DetectorModelSummary] -> f (Maybe [DetectorModelSummary]))
-> ListDetectorModelsResponse -> f ListDetectorModelsResponse
listDetectorModelsResponse_detectorModelSummaries = (ListDetectorModelsResponse -> Maybe [DetectorModelSummary])
-> (ListDetectorModelsResponse
-> Maybe [DetectorModelSummary] -> ListDetectorModelsResponse)
-> Lens
ListDetectorModelsResponse
ListDetectorModelsResponse
(Maybe [DetectorModelSummary])
(Maybe [DetectorModelSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorModelsResponse' {Maybe [DetectorModelSummary]
detectorModelSummaries :: Maybe [DetectorModelSummary]
$sel:detectorModelSummaries:ListDetectorModelsResponse' :: ListDetectorModelsResponse -> Maybe [DetectorModelSummary]
detectorModelSummaries} -> Maybe [DetectorModelSummary]
detectorModelSummaries) (\s :: ListDetectorModelsResponse
s@ListDetectorModelsResponse' {} Maybe [DetectorModelSummary]
a -> ListDetectorModelsResponse
s {$sel:detectorModelSummaries:ListDetectorModelsResponse' :: Maybe [DetectorModelSummary]
detectorModelSummaries = Maybe [DetectorModelSummary]
a} :: ListDetectorModelsResponse) ((Maybe [DetectorModelSummary] -> f (Maybe [DetectorModelSummary]))
-> ListDetectorModelsResponse -> f ListDetectorModelsResponse)
-> ((Maybe [DetectorModelSummary]
-> f (Maybe [DetectorModelSummary]))
-> Maybe [DetectorModelSummary]
-> f (Maybe [DetectorModelSummary]))
-> (Maybe [DetectorModelSummary]
-> f (Maybe [DetectorModelSummary]))
-> ListDetectorModelsResponse
-> f ListDetectorModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DetectorModelSummary]
[DetectorModelSummary]
[DetectorModelSummary]
[DetectorModelSummary]
-> Iso
(Maybe [DetectorModelSummary])
(Maybe [DetectorModelSummary])
(Maybe [DetectorModelSummary])
(Maybe [DetectorModelSummary])
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
[DetectorModelSummary]
[DetectorModelSummary]
[DetectorModelSummary]
[DetectorModelSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDetectorModelsResponse_httpStatus :: Lens.Lens' ListDetectorModelsResponse Prelude.Int
listDetectorModelsResponse_httpStatus :: (Int -> f Int)
-> ListDetectorModelsResponse -> f ListDetectorModelsResponse
listDetectorModelsResponse_httpStatus = (ListDetectorModelsResponse -> Int)
-> (ListDetectorModelsResponse
-> Int -> ListDetectorModelsResponse)
-> Lens
ListDetectorModelsResponse ListDetectorModelsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDetectorModelsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDetectorModelsResponse' :: ListDetectorModelsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDetectorModelsResponse
s@ListDetectorModelsResponse' {} Int
a -> ListDetectorModelsResponse
s {$sel:httpStatus:ListDetectorModelsResponse' :: Int
httpStatus = Int
a} :: ListDetectorModelsResponse)
instance Prelude.NFData ListDetectorModelsResponse