{-# 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.SearchGameSessions
-- 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 all active game sessions that match a set of search criteria
-- and sorts them into a specified order.
--
-- When searching for game sessions, you specify exactly where you want to
-- search and provide a search filter expression, a sort expression, or
-- both. A search request can search only one fleet, but it can search all
-- of a fleet\'s locations.
--
-- This operation can be used in the following ways:
--
-- -   To search all game sessions that are currently running on all
--     locations in a fleet, provide a fleet or alias ID. This approach
--     returns game sessions in the fleet\'s home Region and all remote
--     locations that fit the search criteria.
--
-- -   To search all game sessions that are currently running on a specific
--     fleet location, provide a fleet or alias ID and a location name. For
--     location, you can specify a fleet\'s home Region or any remote
--     location.
--
-- Use the pagination parameters to retrieve results as a set of sequential
-- pages.
--
-- If successful, a @GameSession@ object is returned for each game session
-- that matches the request. Search finds game sessions that are in
-- @ACTIVE@ status only. To retrieve information on game sessions in other
-- statuses, use DescribeGameSessions.
--
-- You can search or sort by the following game session attributes:
--
-- -   __gameSessionId__ -- A unique identifier for the game session. You
--     can use either a @GameSessionId@ or @GameSessionArn@ value.
--
-- -   __gameSessionName__ -- Name assigned to a game session. This value
--     is set when requesting a new game session with CreateGameSession or
--     updating with UpdateGameSession. Game session names do not need to
--     be unique to a game session.
--
-- -   __gameSessionProperties__ -- Custom data defined in a game
--     session\'s @GameProperty@ parameter. @GameProperty@ values are
--     stored as key:value pairs; the filter expression must indicate the
--     key and a string to search the data values for. For example, to
--     search for game sessions with custom data containing the key:value
--     pair \"gameMode:brawl\", specify the following:
--     @gameSessionProperties.gameMode = \"brawl\"@. All custom data values
--     are searched as strings.
--
-- -   __maximumSessions__ -- Maximum number of player sessions allowed for
--     a game session. This value is set when requesting a new game session
--     with CreateGameSession or updating with UpdateGameSession.
--
-- -   __creationTimeMillis__ -- Value indicating when a game session was
--     created. It is expressed in Unix time as milliseconds.
--
-- -   __playerSessionCount__ -- Number of players currently connected to a
--     game session. This value changes rapidly as players join the session
--     or drop out.
--
-- -   __hasAvailablePlayerSessions__ -- Boolean value indicating whether a
--     game session has reached its maximum number of players. It is highly
--     recommended that all search requests include this filter attribute
--     to optimize search performance and return only sessions that players
--     can join.
--
-- Returned values for @playerSessionCount@ and
-- @hasAvailablePlayerSessions@ change quickly as players join sessions and
-- others drop out. Results should be considered a snapshot in time. Be
-- sure to refresh search results often, and handle sessions that fill up
-- before a player can join.
--
-- __Related actions__
--
-- CreateGameSession | DescribeGameSessions | DescribeGameSessionDetails |
-- SearchGameSessions | UpdateGameSession | GetGameSessionLogUrl |
-- StartGameSessionPlacement | DescribeGameSessionPlacement |
-- StopGameSessionPlacement |
-- <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.SearchGameSessions
  ( -- * Creating a Request
    SearchGameSessions (..),
    newSearchGameSessions,

    -- * Request Lenses
    searchGameSessions_filterExpression,
    searchGameSessions_location,
    searchGameSessions_sortExpression,
    searchGameSessions_aliasId,
    searchGameSessions_nextToken,
    searchGameSessions_limit,
    searchGameSessions_fleetId,

    -- * Destructuring the Response
    SearchGameSessionsResponse (..),
    newSearchGameSessionsResponse,

    -- * Response Lenses
    searchGameSessionsResponse_gameSessions,
    searchGameSessionsResponse_nextToken,
    searchGameSessionsResponse_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:/ 'newSearchGameSessions' smart constructor.
data SearchGameSessions = SearchGameSessions'
  { -- | String containing the search criteria for the session search. If no
    -- filter expression is included, the request returns results for all game
    -- sessions in the fleet that are in @ACTIVE@ status.
    --
    -- A filter expression can contain one or multiple conditions. Each
    -- condition consists of the following:
    --
    -- -   __Operand__ -- Name of a game session attribute. Valid values are
    --     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
    --     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
    --     @hasAvailablePlayerSessions@.
    --
    -- -   __Comparator__ -- Valid comparators are: @=@, @\<>@, @\<@, @>@,
    --     @\<=@, @>=@.
    --
    -- -   __Value__ -- Value to be searched for. Values may be numbers,
    --     boolean values (true\/false) or strings depending on the operand.
    --     String values are case sensitive and must be enclosed in single
    --     quotes. Special characters must be escaped. Boolean and string
    --     values can only be used with the comparators @=@ and @\<>@. For
    --     example, the following filter expression searches on
    --     @gameSessionName@:
    --     \"@FilterExpression\": \"gameSessionName = \'Matt\\\\\'s Awesome Game 1\'\"@.
    --
    -- To chain multiple conditions in a single expression, use the logical
    -- keywords @AND@, @OR@, and @NOT@ and parentheses as needed. For example:
    -- @x AND y AND NOT z@, @NOT (x OR y)@.
    --
    -- Session search evaluates conditions from left to right using the
    -- following precedence rules:
    --
    -- 1.  @=@, @\<>@, @\<@, @>@, @\<=@, @>=@
    --
    -- 2.  Parentheses
    --
    -- 3.  NOT
    --
    -- 4.  AND
    --
    -- 5.  OR
    --
    -- For example, this filter expression retrieves game sessions hosting at
    -- least ten players that have an open player slot:
    -- @\"maximumSessions>=10 AND hasAvailablePlayerSessions=true\"@.
    SearchGameSessions -> Maybe Text
filterExpression :: Prelude.Maybe Prelude.Text,
    -- | A fleet location to search for game sessions. You can specify a fleet\'s
    -- home Region or a remote location. Use the AWS Region code format, such
    -- as @us-west-2@.
    SearchGameSessions -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | Instructions on how to sort the search results. If no sort expression is
    -- included, the request returns results in random order. A sort expression
    -- consists of the following elements:
    --
    -- -   __Operand__ -- Name of a game session attribute. Valid values are
    --     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
    --     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
    --     @hasAvailablePlayerSessions@.
    --
    -- -   __Order__ -- Valid sort orders are @ASC@ (ascending) and @DESC@
    --     (descending).
    --
    -- For example, this sort expression returns the oldest active sessions
    -- first: @\"SortExpression\": \"creationTimeMillis ASC\"@. Results with a
    -- null value for the sort operand are returned at the end of the list.
    SearchGameSessions -> Maybe Text
sortExpression :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the alias associated with the fleet to search
    -- for active game sessions. You can use either the alias ID or ARN value.
    -- Each request must reference either a fleet ID or alias ID, but not both.
    SearchGameSessions -> Maybe Text
aliasId :: 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.
    SearchGameSessions -> Maybe Text
nextToken :: 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. The maximum
    -- number of results returned is 20, even if this value is not set or is
    -- set higher than 20.
    SearchGameSessions -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | A unique identifier for the fleet to search for active game sessions.
    -- You can use either the fleet ID or ARN value. Each request must
    -- reference either a fleet ID or alias ID, but not both.
    SearchGameSessions -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text
  }
  deriving (SearchGameSessions -> SearchGameSessions -> Bool
(SearchGameSessions -> SearchGameSessions -> Bool)
-> (SearchGameSessions -> SearchGameSessions -> Bool)
-> Eq SearchGameSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchGameSessions -> SearchGameSessions -> Bool
$c/= :: SearchGameSessions -> SearchGameSessions -> Bool
== :: SearchGameSessions -> SearchGameSessions -> Bool
$c== :: SearchGameSessions -> SearchGameSessions -> Bool
Prelude.Eq, ReadPrec [SearchGameSessions]
ReadPrec SearchGameSessions
Int -> ReadS SearchGameSessions
ReadS [SearchGameSessions]
(Int -> ReadS SearchGameSessions)
-> ReadS [SearchGameSessions]
-> ReadPrec SearchGameSessions
-> ReadPrec [SearchGameSessions]
-> Read SearchGameSessions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchGameSessions]
$creadListPrec :: ReadPrec [SearchGameSessions]
readPrec :: ReadPrec SearchGameSessions
$creadPrec :: ReadPrec SearchGameSessions
readList :: ReadS [SearchGameSessions]
$creadList :: ReadS [SearchGameSessions]
readsPrec :: Int -> ReadS SearchGameSessions
$creadsPrec :: Int -> ReadS SearchGameSessions
Prelude.Read, Int -> SearchGameSessions -> ShowS
[SearchGameSessions] -> ShowS
SearchGameSessions -> String
(Int -> SearchGameSessions -> ShowS)
-> (SearchGameSessions -> String)
-> ([SearchGameSessions] -> ShowS)
-> Show SearchGameSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchGameSessions] -> ShowS
$cshowList :: [SearchGameSessions] -> ShowS
show :: SearchGameSessions -> String
$cshow :: SearchGameSessions -> String
showsPrec :: Int -> SearchGameSessions -> ShowS
$cshowsPrec :: Int -> SearchGameSessions -> ShowS
Prelude.Show, (forall x. SearchGameSessions -> Rep SearchGameSessions x)
-> (forall x. Rep SearchGameSessions x -> SearchGameSessions)
-> Generic SearchGameSessions
forall x. Rep SearchGameSessions x -> SearchGameSessions
forall x. SearchGameSessions -> Rep SearchGameSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchGameSessions x -> SearchGameSessions
$cfrom :: forall x. SearchGameSessions -> Rep SearchGameSessions x
Prelude.Generic)

-- |
-- Create a value of 'SearchGameSessions' 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:
--
-- 'filterExpression', 'searchGameSessions_filterExpression' - String containing the search criteria for the session search. If no
-- filter expression is included, the request returns results for all game
-- sessions in the fleet that are in @ACTIVE@ status.
--
-- A filter expression can contain one or multiple conditions. Each
-- condition consists of the following:
--
-- -   __Operand__ -- Name of a game session attribute. Valid values are
--     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
--     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
--     @hasAvailablePlayerSessions@.
--
-- -   __Comparator__ -- Valid comparators are: @=@, @\<>@, @\<@, @>@,
--     @\<=@, @>=@.
--
-- -   __Value__ -- Value to be searched for. Values may be numbers,
--     boolean values (true\/false) or strings depending on the operand.
--     String values are case sensitive and must be enclosed in single
--     quotes. Special characters must be escaped. Boolean and string
--     values can only be used with the comparators @=@ and @\<>@. For
--     example, the following filter expression searches on
--     @gameSessionName@:
--     \"@FilterExpression\": \"gameSessionName = \'Matt\\\\\'s Awesome Game 1\'\"@.
--
-- To chain multiple conditions in a single expression, use the logical
-- keywords @AND@, @OR@, and @NOT@ and parentheses as needed. For example:
-- @x AND y AND NOT z@, @NOT (x OR y)@.
--
-- Session search evaluates conditions from left to right using the
-- following precedence rules:
--
-- 1.  @=@, @\<>@, @\<@, @>@, @\<=@, @>=@
--
-- 2.  Parentheses
--
-- 3.  NOT
--
-- 4.  AND
--
-- 5.  OR
--
-- For example, this filter expression retrieves game sessions hosting at
-- least ten players that have an open player slot:
-- @\"maximumSessions>=10 AND hasAvailablePlayerSessions=true\"@.
--
-- 'location', 'searchGameSessions_location' - A fleet location to search for game sessions. You can specify a fleet\'s
-- home Region or a remote location. Use the AWS Region code format, such
-- as @us-west-2@.
--
-- 'sortExpression', 'searchGameSessions_sortExpression' - Instructions on how to sort the search results. If no sort expression is
-- included, the request returns results in random order. A sort expression
-- consists of the following elements:
--
-- -   __Operand__ -- Name of a game session attribute. Valid values are
--     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
--     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
--     @hasAvailablePlayerSessions@.
--
-- -   __Order__ -- Valid sort orders are @ASC@ (ascending) and @DESC@
--     (descending).
--
-- For example, this sort expression returns the oldest active sessions
-- first: @\"SortExpression\": \"creationTimeMillis ASC\"@. Results with a
-- null value for the sort operand are returned at the end of the list.
--
-- 'aliasId', 'searchGameSessions_aliasId' - A unique identifier for the alias associated with the fleet to search
-- for active game sessions. You can use either the alias ID or ARN value.
-- Each request must reference either a fleet ID or alias ID, but not both.
--
-- 'nextToken', 'searchGameSessions_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.
--
-- 'limit', 'searchGameSessions_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. The maximum
-- number of results returned is 20, even if this value is not set or is
-- set higher than 20.
--
-- 'fleetId', 'searchGameSessions_fleetId' - A unique identifier for the fleet to search for active game sessions.
-- You can use either the fleet ID or ARN value. Each request must
-- reference either a fleet ID or alias ID, but not both.
newSearchGameSessions ::
  SearchGameSessions
newSearchGameSessions :: SearchGameSessions
newSearchGameSessions =
  SearchGameSessions' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SearchGameSessions
SearchGameSessions'
    { $sel:filterExpression:SearchGameSessions' :: Maybe Text
filterExpression =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:SearchGameSessions' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortExpression:SearchGameSessions' :: Maybe Text
sortExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:aliasId:SearchGameSessions' :: Maybe Text
aliasId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchGameSessions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:SearchGameSessions' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetId:SearchGameSessions' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | String containing the search criteria for the session search. If no
-- filter expression is included, the request returns results for all game
-- sessions in the fleet that are in @ACTIVE@ status.
--
-- A filter expression can contain one or multiple conditions. Each
-- condition consists of the following:
--
-- -   __Operand__ -- Name of a game session attribute. Valid values are
--     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
--     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
--     @hasAvailablePlayerSessions@.
--
-- -   __Comparator__ -- Valid comparators are: @=@, @\<>@, @\<@, @>@,
--     @\<=@, @>=@.
--
-- -   __Value__ -- Value to be searched for. Values may be numbers,
--     boolean values (true\/false) or strings depending on the operand.
--     String values are case sensitive and must be enclosed in single
--     quotes. Special characters must be escaped. Boolean and string
--     values can only be used with the comparators @=@ and @\<>@. For
--     example, the following filter expression searches on
--     @gameSessionName@:
--     \"@FilterExpression\": \"gameSessionName = \'Matt\\\\\'s Awesome Game 1\'\"@.
--
-- To chain multiple conditions in a single expression, use the logical
-- keywords @AND@, @OR@, and @NOT@ and parentheses as needed. For example:
-- @x AND y AND NOT z@, @NOT (x OR y)@.
--
-- Session search evaluates conditions from left to right using the
-- following precedence rules:
--
-- 1.  @=@, @\<>@, @\<@, @>@, @\<=@, @>=@
--
-- 2.  Parentheses
--
-- 3.  NOT
--
-- 4.  AND
--
-- 5.  OR
--
-- For example, this filter expression retrieves game sessions hosting at
-- least ten players that have an open player slot:
-- @\"maximumSessions>=10 AND hasAvailablePlayerSessions=true\"@.
searchGameSessions_filterExpression :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_filterExpression :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_filterExpression = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
     SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
filterExpression :: Maybe Text
$sel:filterExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
filterExpression} -> Maybe Text
filterExpression) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:filterExpression:SearchGameSessions' :: Maybe Text
filterExpression = Maybe Text
a} :: SearchGameSessions)

-- | A fleet location to search for game sessions. You can specify a fleet\'s
-- home Region or a remote location. Use the AWS Region code format, such
-- as @us-west-2@.
searchGameSessions_location :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_location :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_location = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
     SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
location :: Maybe Text
$sel:location:SearchGameSessions' :: SearchGameSessions -> Maybe Text
location} -> Maybe Text
location) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:location:SearchGameSessions' :: Maybe Text
location = Maybe Text
a} :: SearchGameSessions)

-- | Instructions on how to sort the search results. If no sort expression is
-- included, the request returns results in random order. A sort expression
-- consists of the following elements:
--
-- -   __Operand__ -- Name of a game session attribute. Valid values are
--     @gameSessionName@, @gameSessionId@, @gameSessionProperties@,
--     @maximumSessions@, @creationTimeMillis@, @playerSessionCount@,
--     @hasAvailablePlayerSessions@.
--
-- -   __Order__ -- Valid sort orders are @ASC@ (ascending) and @DESC@
--     (descending).
--
-- For example, this sort expression returns the oldest active sessions
-- first: @\"SortExpression\": \"creationTimeMillis ASC\"@. Results with a
-- null value for the sort operand are returned at the end of the list.
searchGameSessions_sortExpression :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_sortExpression :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_sortExpression = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
     SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
sortExpression :: Maybe Text
$sel:sortExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
sortExpression} -> Maybe Text
sortExpression) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:sortExpression:SearchGameSessions' :: Maybe Text
sortExpression = Maybe Text
a} :: SearchGameSessions)

-- | A unique identifier for the alias associated with the fleet to search
-- for active game sessions. You can use either the alias ID or ARN value.
-- Each request must reference either a fleet ID or alias ID, but not both.
searchGameSessions_aliasId :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_aliasId :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_aliasId = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
     SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
aliasId :: Maybe Text
$sel:aliasId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
aliasId} -> Maybe Text
aliasId) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:aliasId:SearchGameSessions' :: Maybe Text
aliasId = Maybe Text
a} :: SearchGameSessions)

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

-- | The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. The maximum
-- number of results returned is 20, even if this value is not set or is
-- set higher than 20.
searchGameSessions_limit :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Natural)
searchGameSessions_limit :: (Maybe Natural -> f (Maybe Natural))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_limit = (SearchGameSessions -> Maybe Natural)
-> (SearchGameSessions -> Maybe Natural -> SearchGameSessions)
-> Lens
     SearchGameSessions
     SearchGameSessions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Natural
limit :: Maybe Natural
$sel:limit:SearchGameSessions' :: SearchGameSessions -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Natural
a -> SearchGameSessions
s {$sel:limit:SearchGameSessions' :: Maybe Natural
limit = Maybe Natural
a} :: SearchGameSessions)

-- | A unique identifier for the fleet to search for active game sessions.
-- You can use either the fleet ID or ARN value. Each request must
-- reference either a fleet ID or alias ID, but not both.
searchGameSessions_fleetId :: Lens.Lens' SearchGameSessions (Prelude.Maybe Prelude.Text)
searchGameSessions_fleetId :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessions -> f SearchGameSessions
searchGameSessions_fleetId = (SearchGameSessions -> Maybe Text)
-> (SearchGameSessions -> Maybe Text -> SearchGameSessions)
-> Lens
     SearchGameSessions SearchGameSessions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessions' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: SearchGameSessions
s@SearchGameSessions' {} Maybe Text
a -> SearchGameSessions
s {$sel:fleetId:SearchGameSessions' :: Maybe Text
fleetId = Maybe Text
a} :: SearchGameSessions)

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

instance Prelude.NFData SearchGameSessions

instance Core.ToHeaders SearchGameSessions where
  toHeaders :: SearchGameSessions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchGameSessions -> 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.SearchGameSessions" ::
                          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 SearchGameSessions where
  toJSON :: SearchGameSessions -> Value
toJSON SearchGameSessions' {Maybe Natural
Maybe Text
fleetId :: Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
aliasId :: Maybe Text
sortExpression :: Maybe Text
location :: Maybe Text
filterExpression :: Maybe Text
$sel:fleetId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:limit:SearchGameSessions' :: SearchGameSessions -> Maybe Natural
$sel:nextToken:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:aliasId:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:sortExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:location:SearchGameSessions' :: SearchGameSessions -> Maybe Text
$sel:filterExpression:SearchGameSessions' :: SearchGameSessions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FilterExpression" 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
filterExpression,
            (Text
"Location" 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
location,
            (Text
"SortExpression" 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
sortExpression,
            (Text
"AliasId" 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
aliasId,
            (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
"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,
            (Text
"FleetId" 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
fleetId
          ]
      )

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

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

-- |
-- Create a value of 'SearchGameSessionsResponse' 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:
--
-- 'gameSessions', 'searchGameSessionsResponse_gameSessions' - A collection of objects containing game session properties for each
-- session that matches the request.
--
-- 'nextToken', 'searchGameSessionsResponse_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', 'searchGameSessionsResponse_httpStatus' - The response's http status code.
newSearchGameSessionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchGameSessionsResponse
newSearchGameSessionsResponse :: Int -> SearchGameSessionsResponse
newSearchGameSessionsResponse Int
pHttpStatus_ =
  SearchGameSessionsResponse' :: Maybe [GameSession]
-> Maybe Text -> Int -> SearchGameSessionsResponse
SearchGameSessionsResponse'
    { $sel:gameSessions:SearchGameSessionsResponse' :: Maybe [GameSession]
gameSessions =
        Maybe [GameSession]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchGameSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of objects containing game session properties for each
-- session that matches the request.
searchGameSessionsResponse_gameSessions :: Lens.Lens' SearchGameSessionsResponse (Prelude.Maybe [GameSession])
searchGameSessionsResponse_gameSessions :: (Maybe [GameSession] -> f (Maybe [GameSession]))
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse
searchGameSessionsResponse_gameSessions = (SearchGameSessionsResponse -> Maybe [GameSession])
-> (SearchGameSessionsResponse
    -> Maybe [GameSession] -> SearchGameSessionsResponse)
-> Lens' SearchGameSessionsResponse (Maybe [GameSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessionsResponse' {Maybe [GameSession]
gameSessions :: Maybe [GameSession]
$sel:gameSessions:SearchGameSessionsResponse' :: SearchGameSessionsResponse -> Maybe [GameSession]
gameSessions} -> Maybe [GameSession]
gameSessions) (\s :: SearchGameSessionsResponse
s@SearchGameSessionsResponse' {} Maybe [GameSession]
a -> SearchGameSessionsResponse
s {$sel:gameSessions:SearchGameSessionsResponse' :: Maybe [GameSession]
gameSessions = Maybe [GameSession]
a} :: SearchGameSessionsResponse) ((Maybe [GameSession] -> f (Maybe [GameSession]))
 -> SearchGameSessionsResponse -> f SearchGameSessionsResponse)
-> ((Maybe [GameSession] -> f (Maybe [GameSession]))
    -> Maybe [GameSession] -> f (Maybe [GameSession]))
-> (Maybe [GameSession] -> f (Maybe [GameSession]))
-> SearchGameSessionsResponse
-> f SearchGameSessionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GameSession] [GameSession] [GameSession] [GameSession]
-> Iso
     (Maybe [GameSession])
     (Maybe [GameSession])
     (Maybe [GameSession])
     (Maybe [GameSession])
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 [GameSession] [GameSession] [GameSession] [GameSession]
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.
searchGameSessionsResponse_nextToken :: Lens.Lens' SearchGameSessionsResponse (Prelude.Maybe Prelude.Text)
searchGameSessionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchGameSessionsResponse -> f SearchGameSessionsResponse
searchGameSessionsResponse_nextToken = (SearchGameSessionsResponse -> Maybe Text)
-> (SearchGameSessionsResponse
    -> Maybe Text -> SearchGameSessionsResponse)
-> Lens' SearchGameSessionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchGameSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchGameSessionsResponse' :: SearchGameSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchGameSessionsResponse
s@SearchGameSessionsResponse' {} Maybe Text
a -> SearchGameSessionsResponse
s {$sel:nextToken:SearchGameSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchGameSessionsResponse)

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

instance Prelude.NFData SearchGameSessionsResponse