{-# 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.ListAlarmModels
(
ListAlarmModels (..),
newListAlarmModels,
listAlarmModels_nextToken,
listAlarmModels_maxResults,
ListAlarmModelsResponse (..),
newListAlarmModelsResponse,
listAlarmModelsResponse_nextToken,
listAlarmModelsResponse_alarmModelSummaries,
listAlarmModelsResponse_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 ListAlarmModels = ListAlarmModels'
{
ListAlarmModels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAlarmModels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListAlarmModels -> ListAlarmModels -> Bool
(ListAlarmModels -> ListAlarmModels -> Bool)
-> (ListAlarmModels -> ListAlarmModels -> Bool)
-> Eq ListAlarmModels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAlarmModels -> ListAlarmModels -> Bool
$c/= :: ListAlarmModels -> ListAlarmModels -> Bool
== :: ListAlarmModels -> ListAlarmModels -> Bool
$c== :: ListAlarmModels -> ListAlarmModels -> Bool
Prelude.Eq, ReadPrec [ListAlarmModels]
ReadPrec ListAlarmModels
Int -> ReadS ListAlarmModels
ReadS [ListAlarmModels]
(Int -> ReadS ListAlarmModels)
-> ReadS [ListAlarmModels]
-> ReadPrec ListAlarmModels
-> ReadPrec [ListAlarmModels]
-> Read ListAlarmModels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAlarmModels]
$creadListPrec :: ReadPrec [ListAlarmModels]
readPrec :: ReadPrec ListAlarmModels
$creadPrec :: ReadPrec ListAlarmModels
readList :: ReadS [ListAlarmModels]
$creadList :: ReadS [ListAlarmModels]
readsPrec :: Int -> ReadS ListAlarmModels
$creadsPrec :: Int -> ReadS ListAlarmModels
Prelude.Read, Int -> ListAlarmModels -> ShowS
[ListAlarmModels] -> ShowS
ListAlarmModels -> String
(Int -> ListAlarmModels -> ShowS)
-> (ListAlarmModels -> String)
-> ([ListAlarmModels] -> ShowS)
-> Show ListAlarmModels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAlarmModels] -> ShowS
$cshowList :: [ListAlarmModels] -> ShowS
show :: ListAlarmModels -> String
$cshow :: ListAlarmModels -> String
showsPrec :: Int -> ListAlarmModels -> ShowS
$cshowsPrec :: Int -> ListAlarmModels -> ShowS
Prelude.Show, (forall x. ListAlarmModels -> Rep ListAlarmModels x)
-> (forall x. Rep ListAlarmModels x -> ListAlarmModels)
-> Generic ListAlarmModels
forall x. Rep ListAlarmModels x -> ListAlarmModels
forall x. ListAlarmModels -> Rep ListAlarmModels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAlarmModels x -> ListAlarmModels
$cfrom :: forall x. ListAlarmModels -> Rep ListAlarmModels x
Prelude.Generic)
newListAlarmModels ::
ListAlarmModels
newListAlarmModels :: ListAlarmModels
newListAlarmModels =
ListAlarmModels' :: Maybe Text -> Maybe Natural -> ListAlarmModels
ListAlarmModels'
{ $sel:nextToken:ListAlarmModels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListAlarmModels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listAlarmModels_nextToken :: Lens.Lens' ListAlarmModels (Prelude.Maybe Prelude.Text)
listAlarmModels_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAlarmModels -> f ListAlarmModels
listAlarmModels_nextToken = (ListAlarmModels -> Maybe Text)
-> (ListAlarmModels -> Maybe Text -> ListAlarmModels)
-> Lens ListAlarmModels ListAlarmModels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAlarmModels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAlarmModels' :: ListAlarmModels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAlarmModels
s@ListAlarmModels' {} Maybe Text
a -> ListAlarmModels
s {$sel:nextToken:ListAlarmModels' :: Maybe Text
nextToken = Maybe Text
a} :: ListAlarmModels)
listAlarmModels_maxResults :: Lens.Lens' ListAlarmModels (Prelude.Maybe Prelude.Natural)
listAlarmModels_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAlarmModels -> f ListAlarmModels
listAlarmModels_maxResults = (ListAlarmModels -> Maybe Natural)
-> (ListAlarmModels -> Maybe Natural -> ListAlarmModels)
-> Lens
ListAlarmModels ListAlarmModels (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAlarmModels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAlarmModels' :: ListAlarmModels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAlarmModels
s@ListAlarmModels' {} Maybe Natural
a -> ListAlarmModels
s {$sel:maxResults:ListAlarmModels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAlarmModels)
instance Core.AWSRequest ListAlarmModels where
type
AWSResponse ListAlarmModels =
ListAlarmModelsResponse
request :: ListAlarmModels -> Request ListAlarmModels
request = Service -> ListAlarmModels -> Request ListAlarmModels
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListAlarmModels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAlarmModels)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListAlarmModels))
-> Logger
-> Service
-> Proxy ListAlarmModels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAlarmModels)))
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 [AlarmModelSummary] -> Int -> ListAlarmModelsResponse
ListAlarmModelsResponse'
(Maybe Text
-> Maybe [AlarmModelSummary] -> Int -> ListAlarmModelsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [AlarmModelSummary] -> Int -> ListAlarmModelsResponse)
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 [AlarmModelSummary] -> Int -> ListAlarmModelsResponse)
-> Either String (Maybe [AlarmModelSummary])
-> Either String (Int -> ListAlarmModelsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [AlarmModelSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmModelSummaries"
Either String (Maybe (Maybe [AlarmModelSummary]))
-> Maybe [AlarmModelSummary]
-> Either String (Maybe [AlarmModelSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AlarmModelSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListAlarmModelsResponse)
-> Either String Int -> Either String ListAlarmModelsResponse
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 ListAlarmModels
instance Prelude.NFData ListAlarmModels
instance Core.ToHeaders ListAlarmModels where
toHeaders :: ListAlarmModels -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAlarmModels -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListAlarmModels where
toPath :: ListAlarmModels -> ByteString
toPath = ByteString -> ListAlarmModels -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/alarm-models"
instance Core.ToQuery ListAlarmModels where
toQuery :: ListAlarmModels -> QueryString
toQuery ListAlarmModels' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListAlarmModels' :: ListAlarmModels -> Maybe Natural
$sel:nextToken:ListAlarmModels' :: ListAlarmModels -> 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 ListAlarmModelsResponse = ListAlarmModelsResponse'
{
ListAlarmModelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAlarmModelsResponse -> Maybe [AlarmModelSummary]
alarmModelSummaries :: Prelude.Maybe [AlarmModelSummary],
ListAlarmModelsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool
(ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool)
-> (ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool)
-> Eq ListAlarmModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool
$c/= :: ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool
== :: ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool
$c== :: ListAlarmModelsResponse -> ListAlarmModelsResponse -> Bool
Prelude.Eq, ReadPrec [ListAlarmModelsResponse]
ReadPrec ListAlarmModelsResponse
Int -> ReadS ListAlarmModelsResponse
ReadS [ListAlarmModelsResponse]
(Int -> ReadS ListAlarmModelsResponse)
-> ReadS [ListAlarmModelsResponse]
-> ReadPrec ListAlarmModelsResponse
-> ReadPrec [ListAlarmModelsResponse]
-> Read ListAlarmModelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAlarmModelsResponse]
$creadListPrec :: ReadPrec [ListAlarmModelsResponse]
readPrec :: ReadPrec ListAlarmModelsResponse
$creadPrec :: ReadPrec ListAlarmModelsResponse
readList :: ReadS [ListAlarmModelsResponse]
$creadList :: ReadS [ListAlarmModelsResponse]
readsPrec :: Int -> ReadS ListAlarmModelsResponse
$creadsPrec :: Int -> ReadS ListAlarmModelsResponse
Prelude.Read, Int -> ListAlarmModelsResponse -> ShowS
[ListAlarmModelsResponse] -> ShowS
ListAlarmModelsResponse -> String
(Int -> ListAlarmModelsResponse -> ShowS)
-> (ListAlarmModelsResponse -> String)
-> ([ListAlarmModelsResponse] -> ShowS)
-> Show ListAlarmModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAlarmModelsResponse] -> ShowS
$cshowList :: [ListAlarmModelsResponse] -> ShowS
show :: ListAlarmModelsResponse -> String
$cshow :: ListAlarmModelsResponse -> String
showsPrec :: Int -> ListAlarmModelsResponse -> ShowS
$cshowsPrec :: Int -> ListAlarmModelsResponse -> ShowS
Prelude.Show, (forall x.
ListAlarmModelsResponse -> Rep ListAlarmModelsResponse x)
-> (forall x.
Rep ListAlarmModelsResponse x -> ListAlarmModelsResponse)
-> Generic ListAlarmModelsResponse
forall x. Rep ListAlarmModelsResponse x -> ListAlarmModelsResponse
forall x. ListAlarmModelsResponse -> Rep ListAlarmModelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAlarmModelsResponse x -> ListAlarmModelsResponse
$cfrom :: forall x. ListAlarmModelsResponse -> Rep ListAlarmModelsResponse x
Prelude.Generic)
newListAlarmModelsResponse ::
Prelude.Int ->
ListAlarmModelsResponse
newListAlarmModelsResponse :: Int -> ListAlarmModelsResponse
newListAlarmModelsResponse Int
pHttpStatus_ =
ListAlarmModelsResponse' :: Maybe Text
-> Maybe [AlarmModelSummary] -> Int -> ListAlarmModelsResponse
ListAlarmModelsResponse'
{ $sel:nextToken:ListAlarmModelsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelSummaries:ListAlarmModelsResponse' :: Maybe [AlarmModelSummary]
alarmModelSummaries = Maybe [AlarmModelSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAlarmModelsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAlarmModelsResponse_nextToken :: Lens.Lens' ListAlarmModelsResponse (Prelude.Maybe Prelude.Text)
listAlarmModelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAlarmModelsResponse -> f ListAlarmModelsResponse
listAlarmModelsResponse_nextToken = (ListAlarmModelsResponse -> Maybe Text)
-> (ListAlarmModelsResponse
-> Maybe Text -> ListAlarmModelsResponse)
-> Lens
ListAlarmModelsResponse
ListAlarmModelsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAlarmModelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAlarmModelsResponse' :: ListAlarmModelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAlarmModelsResponse
s@ListAlarmModelsResponse' {} Maybe Text
a -> ListAlarmModelsResponse
s {$sel:nextToken:ListAlarmModelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAlarmModelsResponse)
listAlarmModelsResponse_alarmModelSummaries :: Lens.Lens' ListAlarmModelsResponse (Prelude.Maybe [AlarmModelSummary])
listAlarmModelsResponse_alarmModelSummaries :: (Maybe [AlarmModelSummary] -> f (Maybe [AlarmModelSummary]))
-> ListAlarmModelsResponse -> f ListAlarmModelsResponse
listAlarmModelsResponse_alarmModelSummaries = (ListAlarmModelsResponse -> Maybe [AlarmModelSummary])
-> (ListAlarmModelsResponse
-> Maybe [AlarmModelSummary] -> ListAlarmModelsResponse)
-> Lens
ListAlarmModelsResponse
ListAlarmModelsResponse
(Maybe [AlarmModelSummary])
(Maybe [AlarmModelSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAlarmModelsResponse' {Maybe [AlarmModelSummary]
alarmModelSummaries :: Maybe [AlarmModelSummary]
$sel:alarmModelSummaries:ListAlarmModelsResponse' :: ListAlarmModelsResponse -> Maybe [AlarmModelSummary]
alarmModelSummaries} -> Maybe [AlarmModelSummary]
alarmModelSummaries) (\s :: ListAlarmModelsResponse
s@ListAlarmModelsResponse' {} Maybe [AlarmModelSummary]
a -> ListAlarmModelsResponse
s {$sel:alarmModelSummaries:ListAlarmModelsResponse' :: Maybe [AlarmModelSummary]
alarmModelSummaries = Maybe [AlarmModelSummary]
a} :: ListAlarmModelsResponse) ((Maybe [AlarmModelSummary] -> f (Maybe [AlarmModelSummary]))
-> ListAlarmModelsResponse -> f ListAlarmModelsResponse)
-> ((Maybe [AlarmModelSummary] -> f (Maybe [AlarmModelSummary]))
-> Maybe [AlarmModelSummary] -> f (Maybe [AlarmModelSummary]))
-> (Maybe [AlarmModelSummary] -> f (Maybe [AlarmModelSummary]))
-> ListAlarmModelsResponse
-> f ListAlarmModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AlarmModelSummary]
[AlarmModelSummary]
[AlarmModelSummary]
[AlarmModelSummary]
-> Iso
(Maybe [AlarmModelSummary])
(Maybe [AlarmModelSummary])
(Maybe [AlarmModelSummary])
(Maybe [AlarmModelSummary])
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
[AlarmModelSummary]
[AlarmModelSummary]
[AlarmModelSummary]
[AlarmModelSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAlarmModelsResponse_httpStatus :: Lens.Lens' ListAlarmModelsResponse Prelude.Int
listAlarmModelsResponse_httpStatus :: (Int -> f Int)
-> ListAlarmModelsResponse -> f ListAlarmModelsResponse
listAlarmModelsResponse_httpStatus = (ListAlarmModelsResponse -> Int)
-> (ListAlarmModelsResponse -> Int -> ListAlarmModelsResponse)
-> Lens ListAlarmModelsResponse ListAlarmModelsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAlarmModelsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAlarmModelsResponse' :: ListAlarmModelsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAlarmModelsResponse
s@ListAlarmModelsResponse' {} Int
a -> ListAlarmModelsResponse
s {$sel:httpStatus:ListAlarmModelsResponse' :: Int
httpStatus = Int
a} :: ListAlarmModelsResponse)
instance Prelude.NFData ListAlarmModelsResponse