{-# 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.MediaConvert.ListQueues
(
ListQueues (..),
newListQueues,
listQueues_listBy,
listQueues_maxResults,
listQueues_nextToken,
listQueues_order,
ListQueuesResponse (..),
newListQueuesResponse,
listQueuesResponse_nextToken,
listQueuesResponse_queues,
listQueuesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListQueues = ListQueues'
{
ListQueues -> Maybe QueueListBy
listBy :: Prelude.Maybe QueueListBy,
ListQueues -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListQueues -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListQueues -> Maybe Order
order :: Prelude.Maybe Order
}
deriving (ListQueues -> ListQueues -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueues -> ListQueues -> Bool
$c/= :: ListQueues -> ListQueues -> Bool
== :: ListQueues -> ListQueues -> Bool
$c== :: ListQueues -> ListQueues -> Bool
Prelude.Eq, ReadPrec [ListQueues]
ReadPrec ListQueues
Int -> ReadS ListQueues
ReadS [ListQueues]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueues]
$creadListPrec :: ReadPrec [ListQueues]
readPrec :: ReadPrec ListQueues
$creadPrec :: ReadPrec ListQueues
readList :: ReadS [ListQueues]
$creadList :: ReadS [ListQueues]
readsPrec :: Int -> ReadS ListQueues
$creadsPrec :: Int -> ReadS ListQueues
Prelude.Read, Int -> ListQueues -> ShowS
[ListQueues] -> ShowS
ListQueues -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueues] -> ShowS
$cshowList :: [ListQueues] -> ShowS
show :: ListQueues -> String
$cshow :: ListQueues -> String
showsPrec :: Int -> ListQueues -> ShowS
$cshowsPrec :: Int -> ListQueues -> ShowS
Prelude.Show, forall x. Rep ListQueues x -> ListQueues
forall x. ListQueues -> Rep ListQueues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueues x -> ListQueues
$cfrom :: forall x. ListQueues -> Rep ListQueues x
Prelude.Generic)
newListQueues ::
ListQueues
newListQueues :: ListQueues
newListQueues =
ListQueues'
{ $sel:listBy:ListQueues' :: Maybe QueueListBy
listBy = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListQueues' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListQueues' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:order:ListQueues' :: Maybe Order
order = forall a. Maybe a
Prelude.Nothing
}
listQueues_listBy :: Lens.Lens' ListQueues (Prelude.Maybe QueueListBy)
listQueues_listBy :: Lens' ListQueues (Maybe QueueListBy)
listQueues_listBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueues' {Maybe QueueListBy
listBy :: Maybe QueueListBy
$sel:listBy:ListQueues' :: ListQueues -> Maybe QueueListBy
listBy} -> Maybe QueueListBy
listBy) (\s :: ListQueues
s@ListQueues' {} Maybe QueueListBy
a -> ListQueues
s {$sel:listBy:ListQueues' :: Maybe QueueListBy
listBy = Maybe QueueListBy
a} :: ListQueues)
listQueues_maxResults :: Lens.Lens' ListQueues (Prelude.Maybe Prelude.Natural)
listQueues_maxResults :: Lens' ListQueues (Maybe Natural)
listQueues_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueues' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListQueues' :: ListQueues -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListQueues
s@ListQueues' {} Maybe Natural
a -> ListQueues
s {$sel:maxResults:ListQueues' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListQueues)
listQueues_nextToken :: Lens.Lens' ListQueues (Prelude.Maybe Prelude.Text)
listQueues_nextToken :: Lens' ListQueues (Maybe Text)
listQueues_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueues' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueues' :: ListQueues -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueues
s@ListQueues' {} Maybe Text
a -> ListQueues
s {$sel:nextToken:ListQueues' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueues)
listQueues_order :: Lens.Lens' ListQueues (Prelude.Maybe Order)
listQueues_order :: Lens' ListQueues (Maybe Order)
listQueues_order = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueues' {Maybe Order
order :: Maybe Order
$sel:order:ListQueues' :: ListQueues -> Maybe Order
order} -> Maybe Order
order) (\s :: ListQueues
s@ListQueues' {} Maybe Order
a -> ListQueues
s {$sel:order:ListQueues' :: Maybe Order
order = Maybe Order
a} :: ListQueues)
instance Core.AWSPager ListQueues where
page :: ListQueues -> AWSResponse ListQueues -> Maybe ListQueues
page ListQueues
rq AWSResponse ListQueues
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListQueues
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListQueuesResponse (Maybe Text)
listQueuesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListQueues
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListQueuesResponse (Maybe [Queue])
listQueuesResponse_queues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListQueues
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListQueues (Maybe Text)
listQueues_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListQueues
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListQueuesResponse (Maybe Text)
listQueuesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListQueues where
type AWSResponse ListQueues = ListQueuesResponse
request :: (Service -> Service) -> ListQueues -> Request ListQueues
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListQueues
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListQueues)))
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 [Queue] -> Int -> ListQueuesResponse
ListQueuesResponse'
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
"queues" 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 ListQueues where
hashWithSalt :: Int -> ListQueues -> Int
hashWithSalt Int
_salt ListQueues' {Maybe Natural
Maybe Text
Maybe Order
Maybe QueueListBy
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe QueueListBy
$sel:order:ListQueues' :: ListQueues -> Maybe Order
$sel:nextToken:ListQueues' :: ListQueues -> Maybe Text
$sel:maxResults:ListQueues' :: ListQueues -> Maybe Natural
$sel:listBy:ListQueues' :: ListQueues -> Maybe QueueListBy
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QueueListBy
listBy
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` Maybe Order
order
instance Prelude.NFData ListQueues where
rnf :: ListQueues -> ()
rnf ListQueues' {Maybe Natural
Maybe Text
Maybe Order
Maybe QueueListBy
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe QueueListBy
$sel:order:ListQueues' :: ListQueues -> Maybe Order
$sel:nextToken:ListQueues' :: ListQueues -> Maybe Text
$sel:maxResults:ListQueues' :: ListQueues -> Maybe Natural
$sel:listBy:ListQueues' :: ListQueues -> Maybe QueueListBy
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe QueueListBy
listBy
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Order
order
instance Data.ToHeaders ListQueues where
toHeaders :: ListQueues -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListQueues where
toPath :: ListQueues -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2017-08-29/queues"
instance Data.ToQuery ListQueues where
toQuery :: ListQueues -> QueryString
toQuery ListQueues' {Maybe Natural
Maybe Text
Maybe Order
Maybe QueueListBy
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe QueueListBy
$sel:order:ListQueues' :: ListQueues -> Maybe Order
$sel:nextToken:ListQueues' :: ListQueues -> Maybe Text
$sel:maxResults:ListQueues' :: ListQueues -> Maybe Natural
$sel:listBy:ListQueues' :: ListQueues -> Maybe QueueListBy
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"listBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe QueueListBy
listBy,
ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"order" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Order
order
]
data ListQueuesResponse = ListQueuesResponse'
{
ListQueuesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListQueuesResponse -> Maybe [Queue]
queues :: Prelude.Maybe [Queue],
ListQueuesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListQueuesResponse -> ListQueuesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueuesResponse -> ListQueuesResponse -> Bool
$c/= :: ListQueuesResponse -> ListQueuesResponse -> Bool
== :: ListQueuesResponse -> ListQueuesResponse -> Bool
$c== :: ListQueuesResponse -> ListQueuesResponse -> Bool
Prelude.Eq, ReadPrec [ListQueuesResponse]
ReadPrec ListQueuesResponse
Int -> ReadS ListQueuesResponse
ReadS [ListQueuesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueuesResponse]
$creadListPrec :: ReadPrec [ListQueuesResponse]
readPrec :: ReadPrec ListQueuesResponse
$creadPrec :: ReadPrec ListQueuesResponse
readList :: ReadS [ListQueuesResponse]
$creadList :: ReadS [ListQueuesResponse]
readsPrec :: Int -> ReadS ListQueuesResponse
$creadsPrec :: Int -> ReadS ListQueuesResponse
Prelude.Read, Int -> ListQueuesResponse -> ShowS
[ListQueuesResponse] -> ShowS
ListQueuesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueuesResponse] -> ShowS
$cshowList :: [ListQueuesResponse] -> ShowS
show :: ListQueuesResponse -> String
$cshow :: ListQueuesResponse -> String
showsPrec :: Int -> ListQueuesResponse -> ShowS
$cshowsPrec :: Int -> ListQueuesResponse -> ShowS
Prelude.Show, forall x. Rep ListQueuesResponse x -> ListQueuesResponse
forall x. ListQueuesResponse -> Rep ListQueuesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueuesResponse x -> ListQueuesResponse
$cfrom :: forall x. ListQueuesResponse -> Rep ListQueuesResponse x
Prelude.Generic)
newListQueuesResponse ::
Prelude.Int ->
ListQueuesResponse
newListQueuesResponse :: Int -> ListQueuesResponse
newListQueuesResponse Int
pHttpStatus_ =
ListQueuesResponse'
{ $sel:nextToken:ListQueuesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:queues:ListQueuesResponse' :: Maybe [Queue]
queues = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListQueuesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listQueuesResponse_nextToken :: Lens.Lens' ListQueuesResponse (Prelude.Maybe Prelude.Text)
listQueuesResponse_nextToken :: Lens' ListQueuesResponse (Maybe Text)
listQueuesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueuesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueuesResponse' :: ListQueuesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueuesResponse
s@ListQueuesResponse' {} Maybe Text
a -> ListQueuesResponse
s {$sel:nextToken:ListQueuesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueuesResponse)
listQueuesResponse_queues :: Lens.Lens' ListQueuesResponse (Prelude.Maybe [Queue])
listQueuesResponse_queues :: Lens' ListQueuesResponse (Maybe [Queue])
listQueuesResponse_queues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueuesResponse' {Maybe [Queue]
queues :: Maybe [Queue]
$sel:queues:ListQueuesResponse' :: ListQueuesResponse -> Maybe [Queue]
queues} -> Maybe [Queue]
queues) (\s :: ListQueuesResponse
s@ListQueuesResponse' {} Maybe [Queue]
a -> ListQueuesResponse
s {$sel:queues:ListQueuesResponse' :: Maybe [Queue]
queues = Maybe [Queue]
a} :: ListQueuesResponse) 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
listQueuesResponse_httpStatus :: Lens.Lens' ListQueuesResponse Prelude.Int
listQueuesResponse_httpStatus :: Lens' ListQueuesResponse Int
listQueuesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueuesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListQueuesResponse' :: ListQueuesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListQueuesResponse
s@ListQueuesResponse' {} Int
a -> ListQueuesResponse
s {$sel:httpStatus:ListQueuesResponse' :: Int
httpStatus = Int
a} :: ListQueuesResponse)
instance Prelude.NFData ListQueuesResponse where
rnf :: ListQueuesResponse -> ()
rnf ListQueuesResponse' {Int
Maybe [Queue]
Maybe Text
httpStatus :: Int
queues :: Maybe [Queue]
nextToken :: Maybe Text
$sel:httpStatus:ListQueuesResponse' :: ListQueuesResponse -> Int
$sel:queues:ListQueuesResponse' :: ListQueuesResponse -> Maybe [Queue]
$sel:nextToken:ListQueuesResponse' :: ListQueuesResponse -> 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 [Queue]
queues
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus