{-# 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.DescribeGameSessionDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves additional game session properties, including the game session
-- protection policy in force, a set of one or more game sessions in a
-- specific fleet location. You can optionally filter the results by
-- current game session status.
--
-- This operation can be used in the following ways:
--
-- -   To retrieve details for all game sessions that are currently running
--     on all locations in a fleet, provide a fleet or alias ID, with an
--     optional status filter. This approach returns details from the
--     fleet\'s home Region and all remote locations.
--
-- -   To retrieve details for all game sessions that are currently running
--     on a specific fleet location, provide a fleet or alias ID and a
--     location name, with optional status filter. The location can be the
--     fleet\'s home Region or any remote location.
--
-- -   To retrieve details for a specific game session, provide the game
--     session ID. This approach looks for the game session ID in all
--     fleets that reside in the Amazon Web Services Region defined in the
--     request.
--
-- Use the pagination parameters to retrieve results as a set of sequential
-- pages.
--
-- If successful, a @GameSessionDetail@ object is returned for each game
-- session that matches the request.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-find Find a game session>
--
-- <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.DescribeGameSessionDetails
  ( -- * Creating a Request
    DescribeGameSessionDetails (..),
    newDescribeGameSessionDetails,

    -- * Request Lenses
    describeGameSessionDetails_aliasId,
    describeGameSessionDetails_fleetId,
    describeGameSessionDetails_gameSessionId,
    describeGameSessionDetails_limit,
    describeGameSessionDetails_location,
    describeGameSessionDetails_nextToken,
    describeGameSessionDetails_statusFilter,

    -- * Destructuring the Response
    DescribeGameSessionDetailsResponse (..),
    newDescribeGameSessionDetailsResponse,

    -- * Response Lenses
    describeGameSessionDetailsResponse_gameSessionDetails,
    describeGameSessionDetailsResponse_nextToken,
    describeGameSessionDetailsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeGameSessionDetails' smart constructor.
data DescribeGameSessionDetails = DescribeGameSessionDetails'
  { -- | A unique identifier for the alias associated with the fleet to retrieve
    -- all game sessions for. You can use either the alias ID or ARN value.
    DescribeGameSessionDetails -> Maybe Text
aliasId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the fleet to retrieve all game sessions active
    -- on the fleet. You can use either the fleet ID or ARN value.
    DescribeGameSessionDetails -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the game session to retrieve.
    DescribeGameSessionDetails -> Maybe Text
gameSessionId :: 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.
    DescribeGameSessionDetails -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | A fleet location to get game session details for. You can specify a
    -- fleet\'s home Region or a remote location. Use the Amazon Web Services
    -- Region code format, such as @us-west-2@.
    DescribeGameSessionDetails -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | 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.
    DescribeGameSessionDetails -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Game session status to filter results on. Possible game session statuses
    -- include @ACTIVE@, @TERMINATED@, @ACTIVATING@ and @TERMINATING@ (the last
    -- two are transitory).
    DescribeGameSessionDetails -> Maybe Text
statusFilter :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeGameSessionDetails -> DescribeGameSessionDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessionDetails -> DescribeGameSessionDetails -> Bool
$c/= :: DescribeGameSessionDetails -> DescribeGameSessionDetails -> Bool
== :: DescribeGameSessionDetails -> DescribeGameSessionDetails -> Bool
$c== :: DescribeGameSessionDetails -> DescribeGameSessionDetails -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessionDetails]
ReadPrec DescribeGameSessionDetails
Int -> ReadS DescribeGameSessionDetails
ReadS [DescribeGameSessionDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessionDetails]
$creadListPrec :: ReadPrec [DescribeGameSessionDetails]
readPrec :: ReadPrec DescribeGameSessionDetails
$creadPrec :: ReadPrec DescribeGameSessionDetails
readList :: ReadS [DescribeGameSessionDetails]
$creadList :: ReadS [DescribeGameSessionDetails]
readsPrec :: Int -> ReadS DescribeGameSessionDetails
$creadsPrec :: Int -> ReadS DescribeGameSessionDetails
Prelude.Read, Int -> DescribeGameSessionDetails -> ShowS
[DescribeGameSessionDetails] -> ShowS
DescribeGameSessionDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessionDetails] -> ShowS
$cshowList :: [DescribeGameSessionDetails] -> ShowS
show :: DescribeGameSessionDetails -> String
$cshow :: DescribeGameSessionDetails -> String
showsPrec :: Int -> DescribeGameSessionDetails -> ShowS
$cshowsPrec :: Int -> DescribeGameSessionDetails -> ShowS
Prelude.Show, forall x.
Rep DescribeGameSessionDetails x -> DescribeGameSessionDetails
forall x.
DescribeGameSessionDetails -> Rep DescribeGameSessionDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameSessionDetails x -> DescribeGameSessionDetails
$cfrom :: forall x.
DescribeGameSessionDetails -> Rep DescribeGameSessionDetails x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGameSessionDetails' 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:
--
-- 'aliasId', 'describeGameSessionDetails_aliasId' - A unique identifier for the alias associated with the fleet to retrieve
-- all game sessions for. You can use either the alias ID or ARN value.
--
-- 'fleetId', 'describeGameSessionDetails_fleetId' - A unique identifier for the fleet to retrieve all game sessions active
-- on the fleet. You can use either the fleet ID or ARN value.
--
-- 'gameSessionId', 'describeGameSessionDetails_gameSessionId' - A unique identifier for the game session to retrieve.
--
-- 'limit', 'describeGameSessionDetails_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages.
--
-- 'location', 'describeGameSessionDetails_location' - A fleet location to get game session details for. You can specify a
-- fleet\'s home Region or a remote location. Use the Amazon Web Services
-- Region code format, such as @us-west-2@.
--
-- 'nextToken', 'describeGameSessionDetails_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.
--
-- 'statusFilter', 'describeGameSessionDetails_statusFilter' - Game session status to filter results on. Possible game session statuses
-- include @ACTIVE@, @TERMINATED@, @ACTIVATING@ and @TERMINATING@ (the last
-- two are transitory).
newDescribeGameSessionDetails ::
  DescribeGameSessionDetails
newDescribeGameSessionDetails :: DescribeGameSessionDetails
newDescribeGameSessionDetails =
  DescribeGameSessionDetails'
    { $sel:aliasId:DescribeGameSessionDetails' :: Maybe Text
aliasId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fleetId:DescribeGameSessionDetails' :: Maybe Text
fleetId = forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionId:DescribeGameSessionDetails' :: Maybe Text
gameSessionId = forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeGameSessionDetails' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:location:DescribeGameSessionDetails' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeGameSessionDetails' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:statusFilter:DescribeGameSessionDetails' :: Maybe Text
statusFilter = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the alias associated with the fleet to retrieve
-- all game sessions for. You can use either the alias ID or ARN value.
describeGameSessionDetails_aliasId :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_aliasId :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_aliasId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
aliasId :: Maybe Text
$sel:aliasId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
aliasId} -> Maybe Text
aliasId) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:aliasId:DescribeGameSessionDetails' :: Maybe Text
aliasId = Maybe Text
a} :: DescribeGameSessionDetails)

-- | A unique identifier for the fleet to retrieve all game sessions active
-- on the fleet. You can use either the fleet ID or ARN value.
describeGameSessionDetails_fleetId :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_fleetId :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_fleetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:fleetId:DescribeGameSessionDetails' :: Maybe Text
fleetId = Maybe Text
a} :: DescribeGameSessionDetails)

-- | A unique identifier for the game session to retrieve.
describeGameSessionDetails_gameSessionId :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_gameSessionId :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_gameSessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
gameSessionId :: Maybe Text
$sel:gameSessionId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
gameSessionId} -> Maybe Text
gameSessionId) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:gameSessionId:DescribeGameSessionDetails' :: Maybe Text
gameSessionId = Maybe Text
a} :: DescribeGameSessionDetails)

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

-- | A fleet location to get game session details for. You can specify a
-- fleet\'s home Region or a remote location. Use the Amazon Web Services
-- Region code format, such as @us-west-2@.
describeGameSessionDetails_location :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_location :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
location :: Maybe Text
$sel:location:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
location} -> Maybe Text
location) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:location:DescribeGameSessionDetails' :: Maybe Text
location = Maybe Text
a} :: DescribeGameSessionDetails)

-- | 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.
describeGameSessionDetails_nextToken :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_nextToken :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:nextToken:DescribeGameSessionDetails' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessionDetails)

-- | Game session status to filter results on. Possible game session statuses
-- include @ACTIVE@, @TERMINATED@, @ACTIVATING@ and @TERMINATING@ (the last
-- two are transitory).
describeGameSessionDetails_statusFilter :: Lens.Lens' DescribeGameSessionDetails (Prelude.Maybe Prelude.Text)
describeGameSessionDetails_statusFilter :: Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_statusFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetails' {Maybe Text
statusFilter :: Maybe Text
$sel:statusFilter:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
statusFilter} -> Maybe Text
statusFilter) (\s :: DescribeGameSessionDetails
s@DescribeGameSessionDetails' {} Maybe Text
a -> DescribeGameSessionDetails
s {$sel:statusFilter:DescribeGameSessionDetails' :: Maybe Text
statusFilter = Maybe Text
a} :: DescribeGameSessionDetails)

instance Core.AWSPager DescribeGameSessionDetails where
  page :: DescribeGameSessionDetails
-> AWSResponse DescribeGameSessionDetails
-> Maybe DescribeGameSessionDetails
page DescribeGameSessionDetails
rq AWSResponse DescribeGameSessionDetails
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeGameSessionDetails
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeGameSessionDetailsResponse (Maybe Text)
describeGameSessionDetailsResponse_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 DescribeGameSessionDetails
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeGameSessionDetailsResponse (Maybe [GameSessionDetail])
describeGameSessionDetailsResponse_gameSessionDetails
            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.$ DescribeGameSessionDetails
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeGameSessionDetails (Maybe Text)
describeGameSessionDetails_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeGameSessionDetails
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeGameSessionDetailsResponse (Maybe Text)
describeGameSessionDetailsResponse_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 DescribeGameSessionDetails where
  type
    AWSResponse DescribeGameSessionDetails =
      DescribeGameSessionDetailsResponse
  request :: (Service -> Service)
-> DescribeGameSessionDetails -> Request DescribeGameSessionDetails
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 DescribeGameSessionDetails
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeGameSessionDetails)))
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 [GameSessionDetail]
-> Maybe Text -> Int -> DescribeGameSessionDetailsResponse
DescribeGameSessionDetailsResponse'
            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
"GameSessionDetails"
                            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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeGameSessionDetails where
  hashWithSalt :: Int -> DescribeGameSessionDetails -> Int
hashWithSalt Int
_salt DescribeGameSessionDetails' {Maybe Natural
Maybe Text
statusFilter :: Maybe Text
nextToken :: Maybe Text
location :: Maybe Text
limit :: Maybe Natural
gameSessionId :: Maybe Text
fleetId :: Maybe Text
aliasId :: Maybe Text
$sel:statusFilter:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:nextToken:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:location:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:limit:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Natural
$sel:gameSessionId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:fleetId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:aliasId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aliasId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fleetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameSessionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusFilter

instance Prelude.NFData DescribeGameSessionDetails where
  rnf :: DescribeGameSessionDetails -> ()
rnf DescribeGameSessionDetails' {Maybe Natural
Maybe Text
statusFilter :: Maybe Text
nextToken :: Maybe Text
location :: Maybe Text
limit :: Maybe Natural
gameSessionId :: Maybe Text
fleetId :: Maybe Text
aliasId :: Maybe Text
$sel:statusFilter:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:nextToken:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:location:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:limit:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Natural
$sel:gameSessionId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:fleetId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:aliasId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aliasId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fleetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameSessionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
      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 Text
statusFilter

instance Data.ToHeaders DescribeGameSessionDetails where
  toHeaders :: DescribeGameSessionDetails -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"GameLift.DescribeGameSessionDetails" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeGameSessionDetails where
  toJSON :: DescribeGameSessionDetails -> Value
toJSON DescribeGameSessionDetails' {Maybe Natural
Maybe Text
statusFilter :: Maybe Text
nextToken :: Maybe Text
location :: Maybe Text
limit :: Maybe Natural
gameSessionId :: Maybe Text
fleetId :: Maybe Text
aliasId :: Maybe Text
$sel:statusFilter:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:nextToken:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:location:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:limit:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Natural
$sel:gameSessionId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:fleetId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
$sel:aliasId:DescribeGameSessionDetails' :: DescribeGameSessionDetails -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AliasId" 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
aliasId,
            (Key
"FleetId" 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
fleetId,
            (Key
"GameSessionId" 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
gameSessionId,
            (Key
"Limit" 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
limit,
            (Key
"Location" 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
location,
            (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,
            (Key
"StatusFilter" 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
statusFilter
          ]
      )

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

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

-- | /See:/ 'newDescribeGameSessionDetailsResponse' smart constructor.
data DescribeGameSessionDetailsResponse = DescribeGameSessionDetailsResponse'
  { -- | A collection of properties for each game session that matches the
    -- request.
    DescribeGameSessionDetailsResponse -> Maybe [GameSessionDetail]
gameSessionDetails :: Prelude.Maybe [GameSessionDetail],
    -- | 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.
    DescribeGameSessionDetailsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeGameSessionDetailsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeGameSessionDetailsResponse
-> DescribeGameSessionDetailsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameSessionDetailsResponse
-> DescribeGameSessionDetailsResponse -> Bool
$c/= :: DescribeGameSessionDetailsResponse
-> DescribeGameSessionDetailsResponse -> Bool
== :: DescribeGameSessionDetailsResponse
-> DescribeGameSessionDetailsResponse -> Bool
$c== :: DescribeGameSessionDetailsResponse
-> DescribeGameSessionDetailsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGameSessionDetailsResponse]
ReadPrec DescribeGameSessionDetailsResponse
Int -> ReadS DescribeGameSessionDetailsResponse
ReadS [DescribeGameSessionDetailsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameSessionDetailsResponse]
$creadListPrec :: ReadPrec [DescribeGameSessionDetailsResponse]
readPrec :: ReadPrec DescribeGameSessionDetailsResponse
$creadPrec :: ReadPrec DescribeGameSessionDetailsResponse
readList :: ReadS [DescribeGameSessionDetailsResponse]
$creadList :: ReadS [DescribeGameSessionDetailsResponse]
readsPrec :: Int -> ReadS DescribeGameSessionDetailsResponse
$creadsPrec :: Int -> ReadS DescribeGameSessionDetailsResponse
Prelude.Read, Int -> DescribeGameSessionDetailsResponse -> ShowS
[DescribeGameSessionDetailsResponse] -> ShowS
DescribeGameSessionDetailsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameSessionDetailsResponse] -> ShowS
$cshowList :: [DescribeGameSessionDetailsResponse] -> ShowS
show :: DescribeGameSessionDetailsResponse -> String
$cshow :: DescribeGameSessionDetailsResponse -> String
showsPrec :: Int -> DescribeGameSessionDetailsResponse -> ShowS
$cshowsPrec :: Int -> DescribeGameSessionDetailsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeGameSessionDetailsResponse x
-> DescribeGameSessionDetailsResponse
forall x.
DescribeGameSessionDetailsResponse
-> Rep DescribeGameSessionDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameSessionDetailsResponse x
-> DescribeGameSessionDetailsResponse
$cfrom :: forall x.
DescribeGameSessionDetailsResponse
-> Rep DescribeGameSessionDetailsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGameSessionDetailsResponse' 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:
--
-- 'gameSessionDetails', 'describeGameSessionDetailsResponse_gameSessionDetails' - A collection of properties for each game session that matches the
-- request.
--
-- 'nextToken', 'describeGameSessionDetailsResponse_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.
--
-- 'httpStatus', 'describeGameSessionDetailsResponse_httpStatus' - The response's http status code.
newDescribeGameSessionDetailsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeGameSessionDetailsResponse
newDescribeGameSessionDetailsResponse :: Int -> DescribeGameSessionDetailsResponse
newDescribeGameSessionDetailsResponse Int
pHttpStatus_ =
  DescribeGameSessionDetailsResponse'
    { $sel:gameSessionDetails:DescribeGameSessionDetailsResponse' :: Maybe [GameSessionDetail]
gameSessionDetails =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeGameSessionDetailsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeGameSessionDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of properties for each game session that matches the
-- request.
describeGameSessionDetailsResponse_gameSessionDetails :: Lens.Lens' DescribeGameSessionDetailsResponse (Prelude.Maybe [GameSessionDetail])
describeGameSessionDetailsResponse_gameSessionDetails :: Lens'
  DescribeGameSessionDetailsResponse (Maybe [GameSessionDetail])
describeGameSessionDetailsResponse_gameSessionDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetailsResponse' {Maybe [GameSessionDetail]
gameSessionDetails :: Maybe [GameSessionDetail]
$sel:gameSessionDetails:DescribeGameSessionDetailsResponse' :: DescribeGameSessionDetailsResponse -> Maybe [GameSessionDetail]
gameSessionDetails} -> Maybe [GameSessionDetail]
gameSessionDetails) (\s :: DescribeGameSessionDetailsResponse
s@DescribeGameSessionDetailsResponse' {} Maybe [GameSessionDetail]
a -> DescribeGameSessionDetailsResponse
s {$sel:gameSessionDetails:DescribeGameSessionDetailsResponse' :: Maybe [GameSessionDetail]
gameSessionDetails = Maybe [GameSessionDetail]
a} :: DescribeGameSessionDetailsResponse) 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

-- | 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.
describeGameSessionDetailsResponse_nextToken :: Lens.Lens' DescribeGameSessionDetailsResponse (Prelude.Maybe Prelude.Text)
describeGameSessionDetailsResponse_nextToken :: Lens' DescribeGameSessionDetailsResponse (Maybe Text)
describeGameSessionDetailsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameSessionDetailsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeGameSessionDetailsResponse' :: DescribeGameSessionDetailsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeGameSessionDetailsResponse
s@DescribeGameSessionDetailsResponse' {} Maybe Text
a -> DescribeGameSessionDetailsResponse
s {$sel:nextToken:DescribeGameSessionDetailsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeGameSessionDetailsResponse)

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

instance
  Prelude.NFData
    DescribeGameSessionDetailsResponse
  where
  rnf :: DescribeGameSessionDetailsResponse -> ()
rnf DescribeGameSessionDetailsResponse' {Int
Maybe [GameSessionDetail]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
gameSessionDetails :: Maybe [GameSessionDetail]
$sel:httpStatus:DescribeGameSessionDetailsResponse' :: DescribeGameSessionDetailsResponse -> Int
$sel:nextToken:DescribeGameSessionDetailsResponse' :: DescribeGameSessionDetailsResponse -> Maybe Text
$sel:gameSessionDetails:DescribeGameSessionDetailsResponse' :: DescribeGameSessionDetailsResponse -> Maybe [GameSessionDetail]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [GameSessionDetail]
gameSessionDetails
      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 Int
httpStatus