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