{-# 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.ElasticTranscoder.ListPipelines
(
ListPipelines (..),
newListPipelines,
listPipelines_ascending,
listPipelines_pageToken,
ListPipelinesResponse (..),
newListPipelinesResponse,
listPipelinesResponse_nextPageToken,
listPipelinesResponse_pipelines,
listPipelinesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.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 ListPipelines = ListPipelines'
{
ListPipelines -> Maybe Text
ascending :: Prelude.Maybe Prelude.Text,
ListPipelines -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
}
deriving (ListPipelines -> ListPipelines -> Bool
(ListPipelines -> ListPipelines -> Bool)
-> (ListPipelines -> ListPipelines -> Bool) -> Eq ListPipelines
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPipelines -> ListPipelines -> Bool
$c/= :: ListPipelines -> ListPipelines -> Bool
== :: ListPipelines -> ListPipelines -> Bool
$c== :: ListPipelines -> ListPipelines -> Bool
Prelude.Eq, ReadPrec [ListPipelines]
ReadPrec ListPipelines
Int -> ReadS ListPipelines
ReadS [ListPipelines]
(Int -> ReadS ListPipelines)
-> ReadS [ListPipelines]
-> ReadPrec ListPipelines
-> ReadPrec [ListPipelines]
-> Read ListPipelines
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPipelines]
$creadListPrec :: ReadPrec [ListPipelines]
readPrec :: ReadPrec ListPipelines
$creadPrec :: ReadPrec ListPipelines
readList :: ReadS [ListPipelines]
$creadList :: ReadS [ListPipelines]
readsPrec :: Int -> ReadS ListPipelines
$creadsPrec :: Int -> ReadS ListPipelines
Prelude.Read, Int -> ListPipelines -> ShowS
[ListPipelines] -> ShowS
ListPipelines -> String
(Int -> ListPipelines -> ShowS)
-> (ListPipelines -> String)
-> ([ListPipelines] -> ShowS)
-> Show ListPipelines
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPipelines] -> ShowS
$cshowList :: [ListPipelines] -> ShowS
show :: ListPipelines -> String
$cshow :: ListPipelines -> String
showsPrec :: Int -> ListPipelines -> ShowS
$cshowsPrec :: Int -> ListPipelines -> ShowS
Prelude.Show, (forall x. ListPipelines -> Rep ListPipelines x)
-> (forall x. Rep ListPipelines x -> ListPipelines)
-> Generic ListPipelines
forall x. Rep ListPipelines x -> ListPipelines
forall x. ListPipelines -> Rep ListPipelines x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPipelines x -> ListPipelines
$cfrom :: forall x. ListPipelines -> Rep ListPipelines x
Prelude.Generic)
newListPipelines ::
ListPipelines
newListPipelines :: ListPipelines
newListPipelines =
ListPipelines' :: Maybe Text -> Maybe Text -> ListPipelines
ListPipelines'
{ $sel:ascending:ListPipelines' :: Maybe Text
ascending = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageToken:ListPipelines' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
listPipelines_ascending :: Lens.Lens' ListPipelines (Prelude.Maybe Prelude.Text)
listPipelines_ascending :: (Maybe Text -> f (Maybe Text)) -> ListPipelines -> f ListPipelines
listPipelines_ascending = (ListPipelines -> Maybe Text)
-> (ListPipelines -> Maybe Text -> ListPipelines)
-> Lens ListPipelines ListPipelines (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelines' {Maybe Text
ascending :: Maybe Text
$sel:ascending:ListPipelines' :: ListPipelines -> Maybe Text
ascending} -> Maybe Text
ascending) (\s :: ListPipelines
s@ListPipelines' {} Maybe Text
a -> ListPipelines
s {$sel:ascending:ListPipelines' :: Maybe Text
ascending = Maybe Text
a} :: ListPipelines)
listPipelines_pageToken :: Lens.Lens' ListPipelines (Prelude.Maybe Prelude.Text)
listPipelines_pageToken :: (Maybe Text -> f (Maybe Text)) -> ListPipelines -> f ListPipelines
listPipelines_pageToken = (ListPipelines -> Maybe Text)
-> (ListPipelines -> Maybe Text -> ListPipelines)
-> Lens ListPipelines ListPipelines (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelines' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListPipelines' :: ListPipelines -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListPipelines
s@ListPipelines' {} Maybe Text
a -> ListPipelines
s {$sel:pageToken:ListPipelines' :: Maybe Text
pageToken = Maybe Text
a} :: ListPipelines)
instance Core.AWSPager ListPipelines where
page :: ListPipelines -> AWSResponse ListPipelines -> Maybe ListPipelines
page ListPipelines
rq AWSResponse ListPipelines
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPipelines
ListPipelinesResponse
rs
ListPipelinesResponse
-> Getting (First Text) ListPipelinesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelinesResponse
-> Const (First Text) ListPipelinesResponse
Lens' ListPipelinesResponse (Maybe Text)
listPipelinesResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelinesResponse
-> Const (First Text) ListPipelinesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPipelinesResponse 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 ListPipelines
forall a. Maybe a
Prelude.Nothing
| Maybe [Pipeline] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPipelines
ListPipelinesResponse
rs
ListPipelinesResponse
-> Getting (First [Pipeline]) ListPipelinesResponse [Pipeline]
-> Maybe [Pipeline]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Pipeline] -> Const (First [Pipeline]) (Maybe [Pipeline]))
-> ListPipelinesResponse
-> Const (First [Pipeline]) ListPipelinesResponse
Lens' ListPipelinesResponse (Maybe [Pipeline])
listPipelinesResponse_pipelines ((Maybe [Pipeline] -> Const (First [Pipeline]) (Maybe [Pipeline]))
-> ListPipelinesResponse
-> Const (First [Pipeline]) ListPipelinesResponse)
-> (([Pipeline] -> Const (First [Pipeline]) [Pipeline])
-> Maybe [Pipeline] -> Const (First [Pipeline]) (Maybe [Pipeline]))
-> Getting (First [Pipeline]) ListPipelinesResponse [Pipeline]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Pipeline] -> Const (First [Pipeline]) [Pipeline])
-> Maybe [Pipeline] -> Const (First [Pipeline]) (Maybe [Pipeline])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListPipelines
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListPipelines -> Maybe ListPipelines
forall a. a -> Maybe a
Prelude.Just (ListPipelines -> Maybe ListPipelines)
-> ListPipelines -> Maybe ListPipelines
forall a b. (a -> b) -> a -> b
Prelude.$
ListPipelines
rq
ListPipelines -> (ListPipelines -> ListPipelines) -> ListPipelines
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPipelines -> Identity ListPipelines
Lens ListPipelines ListPipelines (Maybe Text) (Maybe Text)
listPipelines_pageToken
((Maybe Text -> Identity (Maybe Text))
-> ListPipelines -> Identity ListPipelines)
-> Maybe Text -> ListPipelines -> ListPipelines
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPipelines
ListPipelinesResponse
rs
ListPipelinesResponse
-> Getting (First Text) ListPipelinesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelinesResponse
-> Const (First Text) ListPipelinesResponse
Lens' ListPipelinesResponse (Maybe Text)
listPipelinesResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelinesResponse
-> Const (First Text) ListPipelinesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPipelinesResponse 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 ListPipelines where
type
AWSResponse ListPipelines =
ListPipelinesResponse
request :: ListPipelines -> Request ListPipelines
request = Service -> ListPipelines -> Request ListPipelines
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListPipelines
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPipelines)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListPipelines))
-> Logger
-> Service
-> Proxy ListPipelines
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPipelines)))
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 [Pipeline] -> Int -> ListPipelinesResponse
ListPipelinesResponse'
(Maybe Text -> Maybe [Pipeline] -> Int -> ListPipelinesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Pipeline] -> Int -> ListPipelinesResponse)
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
"NextPageToken")
Either String (Maybe [Pipeline] -> Int -> ListPipelinesResponse)
-> Either String (Maybe [Pipeline])
-> Either String (Int -> ListPipelinesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Pipeline]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Pipelines" Either String (Maybe (Maybe [Pipeline]))
-> Maybe [Pipeline] -> Either String (Maybe [Pipeline])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Pipeline]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListPipelinesResponse)
-> Either String Int -> Either String ListPipelinesResponse
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 ListPipelines
instance Prelude.NFData ListPipelines
instance Core.ToHeaders ListPipelines where
toHeaders :: ListPipelines -> ResponseHeaders
toHeaders = ResponseHeaders -> ListPipelines -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListPipelines where
toPath :: ListPipelines -> ByteString
toPath = ByteString -> ListPipelines -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2012-09-25/pipelines"
instance Core.ToQuery ListPipelines where
toQuery :: ListPipelines -> QueryString
toQuery ListPipelines' {Maybe Text
pageToken :: Maybe Text
ascending :: Maybe Text
$sel:pageToken:ListPipelines' :: ListPipelines -> Maybe Text
$sel:ascending:ListPipelines' :: ListPipelines -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Ascending" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
ascending,
ByteString
"PageToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
pageToken
]
data ListPipelinesResponse = ListPipelinesResponse'
{
ListPipelinesResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
ListPipelinesResponse -> Maybe [Pipeline]
pipelines :: Prelude.Maybe [Pipeline],
ListPipelinesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPipelinesResponse -> ListPipelinesResponse -> Bool
(ListPipelinesResponse -> ListPipelinesResponse -> Bool)
-> (ListPipelinesResponse -> ListPipelinesResponse -> Bool)
-> Eq ListPipelinesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPipelinesResponse -> ListPipelinesResponse -> Bool
$c/= :: ListPipelinesResponse -> ListPipelinesResponse -> Bool
== :: ListPipelinesResponse -> ListPipelinesResponse -> Bool
$c== :: ListPipelinesResponse -> ListPipelinesResponse -> Bool
Prelude.Eq, ReadPrec [ListPipelinesResponse]
ReadPrec ListPipelinesResponse
Int -> ReadS ListPipelinesResponse
ReadS [ListPipelinesResponse]
(Int -> ReadS ListPipelinesResponse)
-> ReadS [ListPipelinesResponse]
-> ReadPrec ListPipelinesResponse
-> ReadPrec [ListPipelinesResponse]
-> Read ListPipelinesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPipelinesResponse]
$creadListPrec :: ReadPrec [ListPipelinesResponse]
readPrec :: ReadPrec ListPipelinesResponse
$creadPrec :: ReadPrec ListPipelinesResponse
readList :: ReadS [ListPipelinesResponse]
$creadList :: ReadS [ListPipelinesResponse]
readsPrec :: Int -> ReadS ListPipelinesResponse
$creadsPrec :: Int -> ReadS ListPipelinesResponse
Prelude.Read, Int -> ListPipelinesResponse -> ShowS
[ListPipelinesResponse] -> ShowS
ListPipelinesResponse -> String
(Int -> ListPipelinesResponse -> ShowS)
-> (ListPipelinesResponse -> String)
-> ([ListPipelinesResponse] -> ShowS)
-> Show ListPipelinesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPipelinesResponse] -> ShowS
$cshowList :: [ListPipelinesResponse] -> ShowS
show :: ListPipelinesResponse -> String
$cshow :: ListPipelinesResponse -> String
showsPrec :: Int -> ListPipelinesResponse -> ShowS
$cshowsPrec :: Int -> ListPipelinesResponse -> ShowS
Prelude.Show, (forall x. ListPipelinesResponse -> Rep ListPipelinesResponse x)
-> (forall x. Rep ListPipelinesResponse x -> ListPipelinesResponse)
-> Generic ListPipelinesResponse
forall x. Rep ListPipelinesResponse x -> ListPipelinesResponse
forall x. ListPipelinesResponse -> Rep ListPipelinesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPipelinesResponse x -> ListPipelinesResponse
$cfrom :: forall x. ListPipelinesResponse -> Rep ListPipelinesResponse x
Prelude.Generic)
newListPipelinesResponse ::
Prelude.Int ->
ListPipelinesResponse
newListPipelinesResponse :: Int -> ListPipelinesResponse
newListPipelinesResponse Int
pHttpStatus_ =
ListPipelinesResponse' :: Maybe Text -> Maybe [Pipeline] -> Int -> ListPipelinesResponse
ListPipelinesResponse'
{ $sel:nextPageToken:ListPipelinesResponse' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pipelines:ListPipelinesResponse' :: Maybe [Pipeline]
pipelines = Maybe [Pipeline]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPipelinesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPipelinesResponse_nextPageToken :: Lens.Lens' ListPipelinesResponse (Prelude.Maybe Prelude.Text)
listPipelinesResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> ListPipelinesResponse -> f ListPipelinesResponse
listPipelinesResponse_nextPageToken = (ListPipelinesResponse -> Maybe Text)
-> (ListPipelinesResponse -> Maybe Text -> ListPipelinesResponse)
-> Lens' ListPipelinesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelinesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListPipelinesResponse' :: ListPipelinesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListPipelinesResponse
s@ListPipelinesResponse' {} Maybe Text
a -> ListPipelinesResponse
s {$sel:nextPageToken:ListPipelinesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListPipelinesResponse)
listPipelinesResponse_pipelines :: Lens.Lens' ListPipelinesResponse (Prelude.Maybe [Pipeline])
listPipelinesResponse_pipelines :: (Maybe [Pipeline] -> f (Maybe [Pipeline]))
-> ListPipelinesResponse -> f ListPipelinesResponse
listPipelinesResponse_pipelines = (ListPipelinesResponse -> Maybe [Pipeline])
-> (ListPipelinesResponse
-> Maybe [Pipeline] -> ListPipelinesResponse)
-> Lens' ListPipelinesResponse (Maybe [Pipeline])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelinesResponse' {Maybe [Pipeline]
pipelines :: Maybe [Pipeline]
$sel:pipelines:ListPipelinesResponse' :: ListPipelinesResponse -> Maybe [Pipeline]
pipelines} -> Maybe [Pipeline]
pipelines) (\s :: ListPipelinesResponse
s@ListPipelinesResponse' {} Maybe [Pipeline]
a -> ListPipelinesResponse
s {$sel:pipelines:ListPipelinesResponse' :: Maybe [Pipeline]
pipelines = Maybe [Pipeline]
a} :: ListPipelinesResponse) ((Maybe [Pipeline] -> f (Maybe [Pipeline]))
-> ListPipelinesResponse -> f ListPipelinesResponse)
-> ((Maybe [Pipeline] -> f (Maybe [Pipeline]))
-> Maybe [Pipeline] -> f (Maybe [Pipeline]))
-> (Maybe [Pipeline] -> f (Maybe [Pipeline]))
-> ListPipelinesResponse
-> f ListPipelinesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Pipeline] [Pipeline] [Pipeline] [Pipeline]
-> Iso
(Maybe [Pipeline])
(Maybe [Pipeline])
(Maybe [Pipeline])
(Maybe [Pipeline])
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 [Pipeline] [Pipeline] [Pipeline] [Pipeline]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listPipelinesResponse_httpStatus :: Lens.Lens' ListPipelinesResponse Prelude.Int
listPipelinesResponse_httpStatus :: (Int -> f Int) -> ListPipelinesResponse -> f ListPipelinesResponse
listPipelinesResponse_httpStatus = (ListPipelinesResponse -> Int)
-> (ListPipelinesResponse -> Int -> ListPipelinesResponse)
-> Lens ListPipelinesResponse ListPipelinesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelinesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPipelinesResponse' :: ListPipelinesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPipelinesResponse
s@ListPipelinesResponse' {} Int
a -> ListPipelinesResponse
s {$sel:httpStatus:ListPipelinesResponse' :: Int
httpStatus = Int
a} :: ListPipelinesResponse)
instance Prelude.NFData ListPipelinesResponse