{-# 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.MediaLive.ListInputs
(
ListInputs (..),
newListInputs,
listInputs_nextToken,
listInputs_maxResults,
ListInputsResponse (..),
newListInputsResponse,
listInputsResponse_inputs,
listInputsResponse_nextToken,
listInputsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types
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.AWSPager ListInputs where
page :: ListInputs -> AWSResponse ListInputs -> Maybe ListInputs
page ListInputs
rq AWSResponse ListInputs
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListInputs
ListInputsResponse
rs
ListInputsResponse
-> Getting (First Text) ListInputsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInputsResponse -> Const (First Text) ListInputsResponse
Lens' ListInputsResponse (Maybe Text)
listInputsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListInputsResponse -> Const (First Text) ListInputsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInputsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListInputs
forall a. Maybe a
Prelude.Nothing
| Maybe [Input] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListInputs
ListInputsResponse
rs
ListInputsResponse
-> Getting (First [Input]) ListInputsResponse [Input]
-> Maybe [Input]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Input] -> Const (First [Input]) (Maybe [Input]))
-> ListInputsResponse -> Const (First [Input]) ListInputsResponse
Lens' ListInputsResponse (Maybe [Input])
listInputsResponse_inputs ((Maybe [Input] -> Const (First [Input]) (Maybe [Input]))
-> ListInputsResponse -> Const (First [Input]) ListInputsResponse)
-> (([Input] -> Const (First [Input]) [Input])
-> Maybe [Input] -> Const (First [Input]) (Maybe [Input]))
-> Getting (First [Input]) ListInputsResponse [Input]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Input] -> Const (First [Input]) [Input])
-> Maybe [Input] -> Const (First [Input]) (Maybe [Input])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListInputs
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListInputs -> Maybe ListInputs
forall a. a -> Maybe a
Prelude.Just (ListInputs -> Maybe ListInputs) -> ListInputs -> Maybe ListInputs
forall a b. (a -> b) -> a -> b
Prelude.$
ListInputs
rq
ListInputs -> (ListInputs -> ListInputs) -> ListInputs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListInputs -> Identity ListInputs
Lens ListInputs ListInputs (Maybe Text) (Maybe Text)
listInputs_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListInputs -> Identity ListInputs)
-> Maybe Text -> ListInputs -> ListInputs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInputs
ListInputsResponse
rs
ListInputsResponse
-> Getting (First Text) ListInputsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInputsResponse -> Const (First Text) ListInputsResponse
Lens' ListInputsResponse (Maybe Text)
listInputsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListInputsResponse -> Const (First Text) ListInputsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInputsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
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 [Input] -> Maybe Text -> Int -> ListInputsResponse
ListInputsResponse'
(Maybe [Input] -> Maybe Text -> Int -> ListInputsResponse)
-> Either String (Maybe [Input])
-> 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 [Input]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"inputs" Either String (Maybe (Maybe [Input]))
-> Maybe [Input] -> Either String (Maybe [Input])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Input]
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] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath ListInputs where
toPath :: ListInputs -> ByteString
toPath = ByteString -> ListInputs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/prod/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 [Input]
inputs :: Prelude.Maybe [Input],
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 [Input] -> Maybe Text -> Int -> ListInputsResponse
ListInputsResponse'
{ $sel:inputs:ListInputsResponse' :: Maybe [Input]
inputs = Maybe [Input]
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_inputs :: Lens.Lens' ListInputsResponse (Prelude.Maybe [Input])
listInputsResponse_inputs :: (Maybe [Input] -> f (Maybe [Input]))
-> ListInputsResponse -> f ListInputsResponse
listInputsResponse_inputs = (ListInputsResponse -> Maybe [Input])
-> (ListInputsResponse -> Maybe [Input] -> ListInputsResponse)
-> Lens' ListInputsResponse (Maybe [Input])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInputsResponse' {Maybe [Input]
inputs :: Maybe [Input]
$sel:inputs:ListInputsResponse' :: ListInputsResponse -> Maybe [Input]
inputs} -> Maybe [Input]
inputs) (\s :: ListInputsResponse
s@ListInputsResponse' {} Maybe [Input]
a -> ListInputsResponse
s {$sel:inputs:ListInputsResponse' :: Maybe [Input]
inputs = Maybe [Input]
a} :: ListInputsResponse) ((Maybe [Input] -> f (Maybe [Input]))
-> ListInputsResponse -> f ListInputsResponse)
-> ((Maybe [Input] -> f (Maybe [Input]))
-> Maybe [Input] -> f (Maybe [Input]))
-> (Maybe [Input] -> f (Maybe [Input]))
-> ListInputsResponse
-> f ListInputsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Input] [Input] [Input] [Input]
-> Iso
(Maybe [Input]) (Maybe [Input]) (Maybe [Input]) (Maybe [Input])
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 [Input] [Input] [Input] [Input]
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 (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