{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.DescribeGameSessionQueues
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the properties for one or more game session queues. When
-- requesting multiple queues, use the pagination parameters to retrieve
-- results as a set of sequential pages. If successful, a GameSessionQueue
-- object is returned for each requested queue. When specifying a list of
-- queues, objects are returned only for queues that currently exist in the
-- Region.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-console.html View Your Queues>
--
-- __Related actions__
--
-- CreateGameSessionQueue | DescribeGameSessionQueues |
-- UpdateGameSessionQueue | DeleteGameSessionQueue |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
--
-- This operation returns paginated results.
module Amazonka.GameLift.DescribeGameSessionQueues
  ( -- * Creating a Request
    DescribeGameSessionQueues (..),
    newDescribeGameSessionQueues,

    -- * Request Lenses
    describeGameSessionQueues_nextToken,
    describeGameSessionQueues_names,
    describeGameSessionQueues_limit,

    -- * Destructuring the Response
    DescribeGameSessionQueuesResponse (..),
    newDescribeGameSessionQueuesResponse,

    -- * Response Lenses
    describeGameSessionQueuesResponse_nextToken,
    describeGameSessionQueuesResponse_gameSessionQueues,
    describeGameSessionQueuesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.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

-- | Represents the input for a request operation.
--
-- /See:/ 'newDescribeGameSessionQueues' smart constructor.
data DescribeGameSessionQueues = DescribeGameSessionQueues'
  { -- | A token that indicates the start of the next sequential page of results.
    -- Use the token that is returned with a previous call to this operation.
    -- To start at the beginning of the result set, do not specify a value.
    DescribeGameSessionQueues -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of queue names to retrieve information for. You can use either
    -- the queue ID or ARN value. To request settings for all queues, leave
    -- this parameter empty.
    DescribeGameSessionQueues -> Maybe [Text]
names :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return. Use this parameter with
    -- @NextToken@ to get results as a set of sequential pages. You can request
    -- up to 50 results.
    DescribeGameSessionQueues -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool
(DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool)
-> (DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool)
-> Eq DescribeGameSessionQueues
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool
$c/= :: DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool
== :: DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool
$c== :: DescribeGameSessionQueues -> DescribeGameSessionQueues -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessionQueues]
ReadPrec DescribeGameSessionQueues
Int -> ReadS DescribeGameSessionQueues
ReadS [DescribeGameSessionQueues]
(Int -> ReadS DescribeGameSessionQueues)
-> ReadS [DescribeGameSessionQueues]
-> ReadPrec DescribeGameSessionQueues
-> ReadPrec [DescribeGameSessionQueues]
-> Read DescribeGameSessionQueues
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessionQueues]
$creadListPrec :: ReadPrec [DescribeGameSessionQueues]
readPrec :: ReadPrec DescribeGameSessionQueues
$creadPrec :: ReadPrec DescribeGameSessionQueues
readList :: ReadS [DescribeGameSessionQueues]
$creadList :: ReadS [DescribeGameSessionQueues]
readsPrec :: Int -> ReadS DescribeGameSessionQueues
$creadsPrec :: Int -> ReadS DescribeGameSessionQueues
Prelude.Read, Int -> DescribeGameSessionQueues -> ShowS
[DescribeGameSessionQueues] -> ShowS
DescribeGameSessionQueues -> String
(Int -> DescribeGameSessionQueues -> ShowS)
-> (DescribeGameSessionQueues -> String)
-> ([DescribeGameSessionQueues] -> ShowS)
-> Show DescribeGameSessionQueues
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessionQueues] -> ShowS
$cshowList :: [DescribeGameSessionQueues] -> ShowS
show :: DescribeGameSessionQueues -> String
$cshow :: DescribeGameSessionQueues -> String
showsPrec :: Int -> DescribeGameSessionQueues -> ShowS
$cshowsPrec :: Int -> DescribeGameSessionQueues -> ShowS
Prelude.Show, (forall x.
 DescribeGameSessionQueues -> Rep DescribeGameSessionQueues x)
-> (forall x.
    Rep DescribeGameSessionQueues x -> DescribeGameSessionQueues)
-> Generic DescribeGameSessionQueues
forall x.
Rep DescribeGameSessionQueues x -> DescribeGameSessionQueues
forall x.
DescribeGameSessionQueues -> Rep DescribeGameSessionQueues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameSessionQueues x -> DescribeGameSessionQueues
$cfrom :: forall x.
DescribeGameSessionQueues -> Rep DescribeGameSessionQueues x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGameSessionQueues' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'describeGameSessionQueues_nextToken' - A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
--
-- 'names', 'describeGameSessionQueues_names' - A list of queue names to retrieve information for. You can use either
-- the queue ID or ARN value. To request settings for all queues, leave
-- this parameter empty.
--
-- 'limit', 'describeGameSessionQueues_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. You can request
-- up to 50 results.
newDescribeGameSessionQueues ::
  DescribeGameSessionQueues
newDescribeGameSessionQueues :: DescribeGameSessionQueues
newDescribeGameSessionQueues =
  DescribeGameSessionQueues' :: Maybe Text
-> Maybe [Text] -> Maybe Natural -> DescribeGameSessionQueues
DescribeGameSessionQueues'
    { $sel:nextToken:DescribeGameSessionQueues' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:names:DescribeGameSessionQueues' :: Maybe [Text]
names = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeGameSessionQueues' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
describeGameSessionQueues_nextToken :: Lens.Lens' DescribeGameSessionQueues (Prelude.Maybe Prelude.Text)
describeGameSessionQueues_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessionQueues -> f DescribeGameSessionQueues
describeGameSessionQueues_nextToken = (DescribeGameSessionQueues -> Maybe Text)
-> (DescribeGameSessionQueues
    -> Maybe Text -> DescribeGameSessionQueues)
-> Lens
     DescribeGameSessionQueues
     DescribeGameSessionQueues
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueues' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessionQueues
s@DescribeGameSessionQueues' {} Maybe Text
a -> DescribeGameSessionQueues
s {$sel:nextToken:DescribeGameSessionQueues' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessionQueues)

-- | A list of queue names to retrieve information for. You can use either
-- the queue ID or ARN value. To request settings for all queues, leave
-- this parameter empty.
describeGameSessionQueues_names :: Lens.Lens' DescribeGameSessionQueues (Prelude.Maybe [Prelude.Text])
describeGameSessionQueues_names :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeGameSessionQueues -> f DescribeGameSessionQueues
describeGameSessionQueues_names = (DescribeGameSessionQueues -> Maybe [Text])
-> (DescribeGameSessionQueues
    -> Maybe [Text] -> DescribeGameSessionQueues)
-> Lens
     DescribeGameSessionQueues
     DescribeGameSessionQueues
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueues' {Maybe [Text]
names :: Maybe [Text]
$sel:names:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe [Text]
names} -> Maybe [Text]
names) (\s :: DescribeGameSessionQueues
s@DescribeGameSessionQueues' {} Maybe [Text]
a -> DescribeGameSessionQueues
s {$sel:names:DescribeGameSessionQueues' :: Maybe [Text]
names = Maybe [Text]
a} :: DescribeGameSessionQueues) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeGameSessionQueues -> f DescribeGameSessionQueues)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeGameSessionQueues
-> f DescribeGameSessionQueues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. You can request
-- up to 50 results.
describeGameSessionQueues_limit :: Lens.Lens' DescribeGameSessionQueues (Prelude.Maybe Prelude.Natural)
describeGameSessionQueues_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeGameSessionQueues -> f DescribeGameSessionQueues
describeGameSessionQueues_limit = (DescribeGameSessionQueues -> Maybe Natural)
-> (DescribeGameSessionQueues
    -> Maybe Natural -> DescribeGameSessionQueues)
-> Lens
     DescribeGameSessionQueues
     DescribeGameSessionQueues
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueues' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeGameSessionQueues
s@DescribeGameSessionQueues' {} Maybe Natural
a -> DescribeGameSessionQueues
s {$sel:limit:DescribeGameSessionQueues' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeGameSessionQueues)

instance Core.AWSPager DescribeGameSessionQueues where
  page :: DescribeGameSessionQueues
-> AWSResponse DescribeGameSessionQueues
-> Maybe DescribeGameSessionQueues
page DescribeGameSessionQueues
rq AWSResponse DescribeGameSessionQueues
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeGameSessionQueues
DescribeGameSessionQueuesResponse
rs
            DescribeGameSessionQueuesResponse
-> Getting (First Text) DescribeGameSessionQueuesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionQueuesResponse
-> Const (First Text) DescribeGameSessionQueuesResponse
Lens' DescribeGameSessionQueuesResponse (Maybe Text)
describeGameSessionQueuesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeGameSessionQueuesResponse
 -> Const (First Text) DescribeGameSessionQueuesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeGameSessionQueuesResponse 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 DescribeGameSessionQueues
forall a. Maybe a
Prelude.Nothing
    | Maybe [GameSessionQueue] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeGameSessionQueues
DescribeGameSessionQueuesResponse
rs
            DescribeGameSessionQueuesResponse
-> Getting
     (First [GameSessionQueue])
     DescribeGameSessionQueuesResponse
     [GameSessionQueue]
-> Maybe [GameSessionQueue]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GameSessionQueue]
 -> Const (First [GameSessionQueue]) (Maybe [GameSessionQueue]))
-> DescribeGameSessionQueuesResponse
-> Const
     (First [GameSessionQueue]) DescribeGameSessionQueuesResponse
Lens' DescribeGameSessionQueuesResponse (Maybe [GameSessionQueue])
describeGameSessionQueuesResponse_gameSessionQueues
              ((Maybe [GameSessionQueue]
  -> Const (First [GameSessionQueue]) (Maybe [GameSessionQueue]))
 -> DescribeGameSessionQueuesResponse
 -> Const
      (First [GameSessionQueue]) DescribeGameSessionQueuesResponse)
-> (([GameSessionQueue]
     -> Const (First [GameSessionQueue]) [GameSessionQueue])
    -> Maybe [GameSessionQueue]
    -> Const (First [GameSessionQueue]) (Maybe [GameSessionQueue]))
-> Getting
     (First [GameSessionQueue])
     DescribeGameSessionQueuesResponse
     [GameSessionQueue]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GameSessionQueue]
 -> Const (First [GameSessionQueue]) [GameSessionQueue])
-> Maybe [GameSessionQueue]
-> Const (First [GameSessionQueue]) (Maybe [GameSessionQueue])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeGameSessionQueues
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeGameSessionQueues -> Maybe DescribeGameSessionQueues
forall a. a -> Maybe a
Prelude.Just (DescribeGameSessionQueues -> Maybe DescribeGameSessionQueues)
-> DescribeGameSessionQueues -> Maybe DescribeGameSessionQueues
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeGameSessionQueues
rq
          DescribeGameSessionQueues
-> (DescribeGameSessionQueues -> DescribeGameSessionQueues)
-> DescribeGameSessionQueues
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeGameSessionQueues -> Identity DescribeGameSessionQueues
Lens
  DescribeGameSessionQueues
  DescribeGameSessionQueues
  (Maybe Text)
  (Maybe Text)
describeGameSessionQueues_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeGameSessionQueues -> Identity DescribeGameSessionQueues)
-> Maybe Text
-> DescribeGameSessionQueues
-> DescribeGameSessionQueues
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeGameSessionQueues
DescribeGameSessionQueuesResponse
rs
          DescribeGameSessionQueuesResponse
-> Getting (First Text) DescribeGameSessionQueuesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeGameSessionQueuesResponse
-> Const (First Text) DescribeGameSessionQueuesResponse
Lens' DescribeGameSessionQueuesResponse (Maybe Text)
describeGameSessionQueuesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeGameSessionQueuesResponse
 -> Const (First Text) DescribeGameSessionQueuesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeGameSessionQueuesResponse 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 DescribeGameSessionQueues where
  type
    AWSResponse DescribeGameSessionQueues =
      DescribeGameSessionQueuesResponse
  request :: DescribeGameSessionQueues -> Request DescribeGameSessionQueues
request = Service
-> DescribeGameSessionQueues -> Request DescribeGameSessionQueues
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeGameSessionQueues
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeGameSessionQueues)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeGameSessionQueues))
-> Logger
-> Service
-> Proxy DescribeGameSessionQueues
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeGameSessionQueues)))
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 [GameSessionQueue]
-> Int
-> DescribeGameSessionQueuesResponse
DescribeGameSessionQueuesResponse'
            (Maybe Text
 -> Maybe [GameSessionQueue]
 -> Int
 -> DescribeGameSessionQueuesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [GameSessionQueue]
      -> Int -> DescribeGameSessionQueuesResponse)
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
"NextToken")
            Either
  String
  (Maybe [GameSessionQueue]
   -> Int -> DescribeGameSessionQueuesResponse)
-> Either String (Maybe [GameSessionQueue])
-> Either String (Int -> DescribeGameSessionQueuesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [GameSessionQueue]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameSessionQueues"
                            Either String (Maybe (Maybe [GameSessionQueue]))
-> Maybe [GameSessionQueue]
-> Either String (Maybe [GameSessionQueue])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GameSessionQueue]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeGameSessionQueuesResponse)
-> Either String Int
-> Either String DescribeGameSessionQueuesResponse
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 DescribeGameSessionQueues

instance Prelude.NFData DescribeGameSessionQueues

instance Core.ToHeaders DescribeGameSessionQueues where
  toHeaders :: DescribeGameSessionQueues -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeGameSessionQueues -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GameLift.DescribeGameSessionQueues" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DescribeGameSessionQueues where
  toJSON :: DescribeGameSessionQueues -> Value
toJSON DescribeGameSessionQueues' {Maybe Natural
Maybe [Text]
Maybe Text
limit :: Maybe Natural
names :: Maybe [Text]
nextToken :: Maybe Text
$sel:limit:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe Natural
$sel:names:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe [Text]
$sel:nextToken:DescribeGameSessionQueues' :: DescribeGameSessionQueues -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Names" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
names,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
          ]
      )

instance Core.ToPath DescribeGameSessionQueues where
  toPath :: DescribeGameSessionQueues -> ByteString
toPath = ByteString -> DescribeGameSessionQueues -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeGameSessionQueues where
  toQuery :: DescribeGameSessionQueues -> QueryString
toQuery = QueryString -> DescribeGameSessionQueues -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newDescribeGameSessionQueuesResponse' smart constructor.
data DescribeGameSessionQueuesResponse = DescribeGameSessionQueuesResponse'
  { -- | A token that indicates where to resume retrieving results on the next
    -- call to this operation. If no token is returned, these results represent
    -- the end of the list.
    DescribeGameSessionQueuesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A collection of objects that describe the requested game session queues.
    DescribeGameSessionQueuesResponse -> Maybe [GameSessionQueue]
gameSessionQueues :: Prelude.Maybe [GameSessionQueue],
    -- | The response's http status code.
    DescribeGameSessionQueuesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeGameSessionQueuesResponse
-> DescribeGameSessionQueuesResponse -> Bool
(DescribeGameSessionQueuesResponse
 -> DescribeGameSessionQueuesResponse -> Bool)
-> (DescribeGameSessionQueuesResponse
    -> DescribeGameSessionQueuesResponse -> Bool)
-> Eq DescribeGameSessionQueuesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessionQueuesResponse
-> DescribeGameSessionQueuesResponse -> Bool
$c/= :: DescribeGameSessionQueuesResponse
-> DescribeGameSessionQueuesResponse -> Bool
== :: DescribeGameSessionQueuesResponse
-> DescribeGameSessionQueuesResponse -> Bool
$c== :: DescribeGameSessionQueuesResponse
-> DescribeGameSessionQueuesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessionQueuesResponse]
ReadPrec DescribeGameSessionQueuesResponse
Int -> ReadS DescribeGameSessionQueuesResponse
ReadS [DescribeGameSessionQueuesResponse]
(Int -> ReadS DescribeGameSessionQueuesResponse)
-> ReadS [DescribeGameSessionQueuesResponse]
-> ReadPrec DescribeGameSessionQueuesResponse
-> ReadPrec [DescribeGameSessionQueuesResponse]
-> Read DescribeGameSessionQueuesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessionQueuesResponse]
$creadListPrec :: ReadPrec [DescribeGameSessionQueuesResponse]
readPrec :: ReadPrec DescribeGameSessionQueuesResponse
$creadPrec :: ReadPrec DescribeGameSessionQueuesResponse
readList :: ReadS [DescribeGameSessionQueuesResponse]
$creadList :: ReadS [DescribeGameSessionQueuesResponse]
readsPrec :: Int -> ReadS DescribeGameSessionQueuesResponse
$creadsPrec :: Int -> ReadS DescribeGameSessionQueuesResponse
Prelude.Read, Int -> DescribeGameSessionQueuesResponse -> ShowS
[DescribeGameSessionQueuesResponse] -> ShowS
DescribeGameSessionQueuesResponse -> String
(Int -> DescribeGameSessionQueuesResponse -> ShowS)
-> (DescribeGameSessionQueuesResponse -> String)
-> ([DescribeGameSessionQueuesResponse] -> ShowS)
-> Show DescribeGameSessionQueuesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessionQueuesResponse] -> ShowS
$cshowList :: [DescribeGameSessionQueuesResponse] -> ShowS
show :: DescribeGameSessionQueuesResponse -> String
$cshow :: DescribeGameSessionQueuesResponse -> String
showsPrec :: Int -> DescribeGameSessionQueuesResponse -> ShowS
$cshowsPrec :: Int -> DescribeGameSessionQueuesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeGameSessionQueuesResponse
 -> Rep DescribeGameSessionQueuesResponse x)
-> (forall x.
    Rep DescribeGameSessionQueuesResponse x
    -> DescribeGameSessionQueuesResponse)
-> Generic DescribeGameSessionQueuesResponse
forall x.
Rep DescribeGameSessionQueuesResponse x
-> DescribeGameSessionQueuesResponse
forall x.
DescribeGameSessionQueuesResponse
-> Rep DescribeGameSessionQueuesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameSessionQueuesResponse x
-> DescribeGameSessionQueuesResponse
$cfrom :: forall x.
DescribeGameSessionQueuesResponse
-> Rep DescribeGameSessionQueuesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGameSessionQueuesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'describeGameSessionQueuesResponse_nextToken' - A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
--
-- 'gameSessionQueues', 'describeGameSessionQueuesResponse_gameSessionQueues' - A collection of objects that describe the requested game session queues.
--
-- 'httpStatus', 'describeGameSessionQueuesResponse_httpStatus' - The response's http status code.
newDescribeGameSessionQueuesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeGameSessionQueuesResponse
newDescribeGameSessionQueuesResponse :: Int -> DescribeGameSessionQueuesResponse
newDescribeGameSessionQueuesResponse Int
pHttpStatus_ =
  DescribeGameSessionQueuesResponse' :: Maybe Text
-> Maybe [GameSessionQueue]
-> Int
-> DescribeGameSessionQueuesResponse
DescribeGameSessionQueuesResponse'
    { $sel:nextToken:DescribeGameSessionQueuesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionQueues:DescribeGameSessionQueuesResponse' :: Maybe [GameSessionQueue]
gameSessionQueues = Maybe [GameSessionQueue]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeGameSessionQueuesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
describeGameSessionQueuesResponse_nextToken :: Lens.Lens' DescribeGameSessionQueuesResponse (Prelude.Maybe Prelude.Text)
describeGameSessionQueuesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeGameSessionQueuesResponse
-> f DescribeGameSessionQueuesResponse
describeGameSessionQueuesResponse_nextToken = (DescribeGameSessionQueuesResponse -> Maybe Text)
-> (DescribeGameSessionQueuesResponse
    -> Maybe Text -> DescribeGameSessionQueuesResponse)
-> Lens' DescribeGameSessionQueuesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueuesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessionQueuesResponse' :: DescribeGameSessionQueuesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessionQueuesResponse
s@DescribeGameSessionQueuesResponse' {} Maybe Text
a -> DescribeGameSessionQueuesResponse
s {$sel:nextToken:DescribeGameSessionQueuesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessionQueuesResponse)

-- | A collection of objects that describe the requested game session queues.
describeGameSessionQueuesResponse_gameSessionQueues :: Lens.Lens' DescribeGameSessionQueuesResponse (Prelude.Maybe [GameSessionQueue])
describeGameSessionQueuesResponse_gameSessionQueues :: (Maybe [GameSessionQueue] -> f (Maybe [GameSessionQueue]))
-> DescribeGameSessionQueuesResponse
-> f DescribeGameSessionQueuesResponse
describeGameSessionQueuesResponse_gameSessionQueues = (DescribeGameSessionQueuesResponse -> Maybe [GameSessionQueue])
-> (DescribeGameSessionQueuesResponse
    -> Maybe [GameSessionQueue] -> DescribeGameSessionQueuesResponse)
-> Lens'
     DescribeGameSessionQueuesResponse (Maybe [GameSessionQueue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueuesResponse' {Maybe [GameSessionQueue]
gameSessionQueues :: Maybe [GameSessionQueue]
$sel:gameSessionQueues:DescribeGameSessionQueuesResponse' :: DescribeGameSessionQueuesResponse -> Maybe [GameSessionQueue]
gameSessionQueues} -> Maybe [GameSessionQueue]
gameSessionQueues) (\s :: DescribeGameSessionQueuesResponse
s@DescribeGameSessionQueuesResponse' {} Maybe [GameSessionQueue]
a -> DescribeGameSessionQueuesResponse
s {$sel:gameSessionQueues:DescribeGameSessionQueuesResponse' :: Maybe [GameSessionQueue]
gameSessionQueues = Maybe [GameSessionQueue]
a} :: DescribeGameSessionQueuesResponse) ((Maybe [GameSessionQueue] -> f (Maybe [GameSessionQueue]))
 -> DescribeGameSessionQueuesResponse
 -> f DescribeGameSessionQueuesResponse)
-> ((Maybe [GameSessionQueue] -> f (Maybe [GameSessionQueue]))
    -> Maybe [GameSessionQueue] -> f (Maybe [GameSessionQueue]))
-> (Maybe [GameSessionQueue] -> f (Maybe [GameSessionQueue]))
-> DescribeGameSessionQueuesResponse
-> f DescribeGameSessionQueuesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GameSessionQueue]
  [GameSessionQueue]
  [GameSessionQueue]
  [GameSessionQueue]
-> Iso
     (Maybe [GameSessionQueue])
     (Maybe [GameSessionQueue])
     (Maybe [GameSessionQueue])
     (Maybe [GameSessionQueue])
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
  [GameSessionQueue]
  [GameSessionQueue]
  [GameSessionQueue]
  [GameSessionQueue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeGameSessionQueuesResponse_httpStatus :: Lens.Lens' DescribeGameSessionQueuesResponse Prelude.Int
describeGameSessionQueuesResponse_httpStatus :: (Int -> f Int)
-> DescribeGameSessionQueuesResponse
-> f DescribeGameSessionQueuesResponse
describeGameSessionQueuesResponse_httpStatus = (DescribeGameSessionQueuesResponse -> Int)
-> (DescribeGameSessionQueuesResponse
    -> Int -> DescribeGameSessionQueuesResponse)
-> Lens
     DescribeGameSessionQueuesResponse
     DescribeGameSessionQueuesResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionQueuesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGameSessionQueuesResponse' :: DescribeGameSessionQueuesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGameSessionQueuesResponse
s@DescribeGameSessionQueuesResponse' {} Int
a -> DescribeGameSessionQueuesResponse
s {$sel:httpStatus:DescribeGameSessionQueuesResponse' :: Int
httpStatus = Int
a} :: DescribeGameSessionQueuesResponse)

instance
  Prelude.NFData
    DescribeGameSessionQueuesResponse