{-# 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.ListInputRoutings
(
ListInputRoutings (..),
newListInputRoutings,
listInputRoutings_maxResults,
listInputRoutings_nextToken,
listInputRoutings_inputIdentifier,
ListInputRoutingsResponse (..),
newListInputRoutingsResponse,
listInputRoutingsResponse_nextToken,
listInputRoutingsResponse_routedResources,
listInputRoutingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEvents.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListInputRoutings = ListInputRoutings'
{
ListInputRoutings -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListInputRoutings -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListInputRoutings -> InputIdentifier
inputIdentifier :: InputIdentifier
}
deriving (ListInputRoutings -> ListInputRoutings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInputRoutings -> ListInputRoutings -> Bool
$c/= :: ListInputRoutings -> ListInputRoutings -> Bool
== :: ListInputRoutings -> ListInputRoutings -> Bool
$c== :: ListInputRoutings -> ListInputRoutings -> Bool
Prelude.Eq, ReadPrec [ListInputRoutings]
ReadPrec ListInputRoutings
Int -> ReadS ListInputRoutings
ReadS [ListInputRoutings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInputRoutings]
$creadListPrec :: ReadPrec [ListInputRoutings]
readPrec :: ReadPrec ListInputRoutings
$creadPrec :: ReadPrec ListInputRoutings
readList :: ReadS [ListInputRoutings]
$creadList :: ReadS [ListInputRoutings]
readsPrec :: Int -> ReadS ListInputRoutings
$creadsPrec :: Int -> ReadS ListInputRoutings
Prelude.Read, Int -> ListInputRoutings -> ShowS
[ListInputRoutings] -> ShowS
ListInputRoutings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInputRoutings] -> ShowS
$cshowList :: [ListInputRoutings] -> ShowS
show :: ListInputRoutings -> String
$cshow :: ListInputRoutings -> String
showsPrec :: Int -> ListInputRoutings -> ShowS
$cshowsPrec :: Int -> ListInputRoutings -> ShowS
Prelude.Show, forall x. Rep ListInputRoutings x -> ListInputRoutings
forall x. ListInputRoutings -> Rep ListInputRoutings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInputRoutings x -> ListInputRoutings
$cfrom :: forall x. ListInputRoutings -> Rep ListInputRoutings x
Prelude.Generic)
newListInputRoutings ::
InputIdentifier ->
ListInputRoutings
newListInputRoutings :: InputIdentifier -> ListInputRoutings
newListInputRoutings InputIdentifier
pInputIdentifier_ =
ListInputRoutings'
{ $sel:maxResults:ListInputRoutings' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListInputRoutings' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:inputIdentifier:ListInputRoutings' :: InputIdentifier
inputIdentifier = InputIdentifier
pInputIdentifier_
}
listInputRoutings_maxResults :: Lens.Lens' ListInputRoutings (Prelude.Maybe Prelude.Natural)
listInputRoutings_maxResults :: Lens' ListInputRoutings (Maybe Natural)
listInputRoutings_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutings' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInputRoutings' :: ListInputRoutings -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInputRoutings
s@ListInputRoutings' {} Maybe Natural
a -> ListInputRoutings
s {$sel:maxResults:ListInputRoutings' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInputRoutings)
listInputRoutings_nextToken :: Lens.Lens' ListInputRoutings (Prelude.Maybe Prelude.Text)
listInputRoutings_nextToken :: Lens' ListInputRoutings (Maybe Text)
listInputRoutings_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutings' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInputRoutings' :: ListInputRoutings -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInputRoutings
s@ListInputRoutings' {} Maybe Text
a -> ListInputRoutings
s {$sel:nextToken:ListInputRoutings' :: Maybe Text
nextToken = Maybe Text
a} :: ListInputRoutings)
listInputRoutings_inputIdentifier :: Lens.Lens' ListInputRoutings InputIdentifier
listInputRoutings_inputIdentifier :: Lens' ListInputRoutings InputIdentifier
listInputRoutings_inputIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutings' {InputIdentifier
inputIdentifier :: InputIdentifier
$sel:inputIdentifier:ListInputRoutings' :: ListInputRoutings -> InputIdentifier
inputIdentifier} -> InputIdentifier
inputIdentifier) (\s :: ListInputRoutings
s@ListInputRoutings' {} InputIdentifier
a -> ListInputRoutings
s {$sel:inputIdentifier:ListInputRoutings' :: InputIdentifier
inputIdentifier = InputIdentifier
a} :: ListInputRoutings)
instance Core.AWSRequest ListInputRoutings where
type
AWSResponse ListInputRoutings =
ListInputRoutingsResponse
request :: (Service -> Service)
-> ListInputRoutings -> Request ListInputRoutings
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListInputRoutings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListInputRoutings)))
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 Text
-> Maybe [RoutedResource] -> Int -> ListInputRoutingsResponse
ListInputRoutingsResponse'
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
"nextToken")
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
"routedResources"
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListInputRoutings where
hashWithSalt :: Int -> ListInputRoutings -> Int
hashWithSalt Int
_salt ListInputRoutings' {Maybe Natural
Maybe Text
InputIdentifier
inputIdentifier :: InputIdentifier
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:inputIdentifier:ListInputRoutings' :: ListInputRoutings -> InputIdentifier
$sel:nextToken:ListInputRoutings' :: ListInputRoutings -> Maybe Text
$sel:maxResults:ListInputRoutings' :: ListInputRoutings -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InputIdentifier
inputIdentifier
instance Prelude.NFData ListInputRoutings where
rnf :: ListInputRoutings -> ()
rnf ListInputRoutings' {Maybe Natural
Maybe Text
InputIdentifier
inputIdentifier :: InputIdentifier
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:inputIdentifier:ListInputRoutings' :: ListInputRoutings -> InputIdentifier
$sel:nextToken:ListInputRoutings' :: ListInputRoutings -> Maybe Text
$sel:maxResults:ListInputRoutings' :: ListInputRoutings -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InputIdentifier
inputIdentifier
instance Data.ToHeaders ListInputRoutings where
toHeaders :: ListInputRoutings -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON ListInputRoutings where
toJSON :: ListInputRoutings -> Value
toJSON ListInputRoutings' {Maybe Natural
Maybe Text
InputIdentifier
inputIdentifier :: InputIdentifier
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:inputIdentifier:ListInputRoutings' :: ListInputRoutings -> InputIdentifier
$sel:nextToken:ListInputRoutings' :: ListInputRoutings -> Maybe Text
$sel:maxResults:ListInputRoutings' :: ListInputRoutings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just
(Key
"inputIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InputIdentifier
inputIdentifier)
]
)
instance Data.ToPath ListInputRoutings where
toPath :: ListInputRoutings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/input-routings"
instance Data.ToQuery ListInputRoutings where
toQuery :: ListInputRoutings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListInputRoutingsResponse = ListInputRoutingsResponse'
{
ListInputRoutingsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListInputRoutingsResponse -> Maybe [RoutedResource]
routedResources :: Prelude.Maybe [RoutedResource],
ListInputRoutingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListInputRoutingsResponse -> ListInputRoutingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInputRoutingsResponse -> ListInputRoutingsResponse -> Bool
$c/= :: ListInputRoutingsResponse -> ListInputRoutingsResponse -> Bool
== :: ListInputRoutingsResponse -> ListInputRoutingsResponse -> Bool
$c== :: ListInputRoutingsResponse -> ListInputRoutingsResponse -> Bool
Prelude.Eq, ReadPrec [ListInputRoutingsResponse]
ReadPrec ListInputRoutingsResponse
Int -> ReadS ListInputRoutingsResponse
ReadS [ListInputRoutingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInputRoutingsResponse]
$creadListPrec :: ReadPrec [ListInputRoutingsResponse]
readPrec :: ReadPrec ListInputRoutingsResponse
$creadPrec :: ReadPrec ListInputRoutingsResponse
readList :: ReadS [ListInputRoutingsResponse]
$creadList :: ReadS [ListInputRoutingsResponse]
readsPrec :: Int -> ReadS ListInputRoutingsResponse
$creadsPrec :: Int -> ReadS ListInputRoutingsResponse
Prelude.Read, Int -> ListInputRoutingsResponse -> ShowS
[ListInputRoutingsResponse] -> ShowS
ListInputRoutingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInputRoutingsResponse] -> ShowS
$cshowList :: [ListInputRoutingsResponse] -> ShowS
show :: ListInputRoutingsResponse -> String
$cshow :: ListInputRoutingsResponse -> String
showsPrec :: Int -> ListInputRoutingsResponse -> ShowS
$cshowsPrec :: Int -> ListInputRoutingsResponse -> ShowS
Prelude.Show, forall x.
Rep ListInputRoutingsResponse x -> ListInputRoutingsResponse
forall x.
ListInputRoutingsResponse -> Rep ListInputRoutingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInputRoutingsResponse x -> ListInputRoutingsResponse
$cfrom :: forall x.
ListInputRoutingsResponse -> Rep ListInputRoutingsResponse x
Prelude.Generic)
newListInputRoutingsResponse ::
Prelude.Int ->
ListInputRoutingsResponse
newListInputRoutingsResponse :: Int -> ListInputRoutingsResponse
newListInputRoutingsResponse Int
pHttpStatus_ =
ListInputRoutingsResponse'
{ $sel:nextToken:ListInputRoutingsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:routedResources:ListInputRoutingsResponse' :: Maybe [RoutedResource]
routedResources = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListInputRoutingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listInputRoutingsResponse_nextToken :: Lens.Lens' ListInputRoutingsResponse (Prelude.Maybe Prelude.Text)
listInputRoutingsResponse_nextToken :: Lens' ListInputRoutingsResponse (Maybe Text)
listInputRoutingsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutingsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInputRoutingsResponse
s@ListInputRoutingsResponse' {} Maybe Text
a -> ListInputRoutingsResponse
s {$sel:nextToken:ListInputRoutingsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInputRoutingsResponse)
listInputRoutingsResponse_routedResources :: Lens.Lens' ListInputRoutingsResponse (Prelude.Maybe [RoutedResource])
listInputRoutingsResponse_routedResources :: Lens' ListInputRoutingsResponse (Maybe [RoutedResource])
listInputRoutingsResponse_routedResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutingsResponse' {Maybe [RoutedResource]
routedResources :: Maybe [RoutedResource]
$sel:routedResources:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Maybe [RoutedResource]
routedResources} -> Maybe [RoutedResource]
routedResources) (\s :: ListInputRoutingsResponse
s@ListInputRoutingsResponse' {} Maybe [RoutedResource]
a -> ListInputRoutingsResponse
s {$sel:routedResources:ListInputRoutingsResponse' :: Maybe [RoutedResource]
routedResources = Maybe [RoutedResource]
a} :: ListInputRoutingsResponse) 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
listInputRoutingsResponse_httpStatus :: Lens.Lens' ListInputRoutingsResponse Prelude.Int
listInputRoutingsResponse_httpStatus :: Lens' ListInputRoutingsResponse Int
listInputRoutingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputRoutingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListInputRoutingsResponse
s@ListInputRoutingsResponse' {} Int
a -> ListInputRoutingsResponse
s {$sel:httpStatus:ListInputRoutingsResponse' :: Int
httpStatus = Int
a} :: ListInputRoutingsResponse)
instance Prelude.NFData ListInputRoutingsResponse where
rnf :: ListInputRoutingsResponse -> ()
rnf ListInputRoutingsResponse' {Int
Maybe [RoutedResource]
Maybe Text
httpStatus :: Int
routedResources :: Maybe [RoutedResource]
nextToken :: Maybe Text
$sel:httpStatus:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Int
$sel:routedResources:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Maybe [RoutedResource]
$sel:nextToken:ListInputRoutingsResponse' :: ListInputRoutingsResponse -> Maybe Text
..} =
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 Maybe [RoutedResource]
routedResources
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus