amazonka-gamelift-1.4.4: Amazon GameLift SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.GameLift.SearchGameSessions

Contents

Description

Retrieves a list of game sessions in a fleet that match a set of search criteria and sorts them in a specified order. Currently game session searches are limited to a single fleet. Search results include only game sessions that are in ACTIVE status.

You can search or sort by the following game session attributes:

  • gameSessionId -- ID value assigned to a game session. This unique value is returned in a GameSession object when a new game session is created.
  • 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.
  • 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.
  • 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.
  • hasAvailablePlayerSessions -- Boolean value indicating whether or not a game session has reached its maximum number of players. When searching with this attribute, the search value must be true or false. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.

To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a collection of GameSession objects matching the request is returned.

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.

Synopsis

Creating a Request

searchGameSessions :: SearchGameSessions Source #

Creates a value of SearchGameSessions with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data SearchGameSessions Source #

Represents the input for a request action.

See: searchGameSessions smart constructor.

Instances

Eq SearchGameSessions Source # 
Data SearchGameSessions Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SearchGameSessions -> c SearchGameSessions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SearchGameSessions #

toConstr :: SearchGameSessions -> Constr #

dataTypeOf :: SearchGameSessions -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c SearchGameSessions) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SearchGameSessions) #

gmapT :: (forall b. Data b => b -> b) -> SearchGameSessions -> SearchGameSessions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SearchGameSessions -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SearchGameSessions -> r #

gmapQ :: (forall d. Data d => d -> u) -> SearchGameSessions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SearchGameSessions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SearchGameSessions -> m SearchGameSessions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchGameSessions -> m SearchGameSessions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchGameSessions -> m SearchGameSessions #

Read SearchGameSessions Source # 
Show SearchGameSessions Source # 
Generic SearchGameSessions Source # 
Hashable SearchGameSessions Source # 
NFData SearchGameSessions Source # 

Methods

rnf :: SearchGameSessions -> () #

AWSRequest SearchGameSessions Source # 
ToPath SearchGameSessions Source # 
ToHeaders SearchGameSessions Source # 
ToQuery SearchGameSessions Source # 
ToJSON SearchGameSessions Source # 
type Rep SearchGameSessions Source # 
type Rep SearchGameSessions = D1 (MetaData "SearchGameSessions" "Network.AWS.GameLift.SearchGameSessions" "amazonka-gamelift-1.4.4-DPfJmtllByT7OdD35vBDe5" False) (C1 (MetaCons "SearchGameSessions'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_sgsFilterExpression") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_sgsSortExpression") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_sgsAliasId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))) ((:*:) (S1 (MetaSel (Just Symbol "_sgsNextToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_sgsLimit") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Nat))) (S1 (MetaSel (Just Symbol "_sgsFleetId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))))))
type Rs SearchGameSessions Source # 

Request Lenses

sgsFilterExpression :: Lens' SearchGameSessions (Maybe Text) Source #

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, creationTimeMillis, playerSessionCount, maximumSessions, hasAvailablePlayerSessions.
  • Comparator -- Valid comparators are: '=', '&lt;&gt;', '&lt;', '&gt;', '&lt;=', '&gt;='.
  • Value -- Value to be searched for. Values can be numbers, boolean values (true/false) or strings. String values are case sensitive, enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators '=' and '&lt;&gt;'. 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. '=', '&lt;&gt;', '&lt;', '&gt;', '&lt;=', '&gt;='
  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&gt;=10 AND hasAvailablePlayerSessions=true"'.

sgsSortExpression :: Lens' SearchGameSessions (Maybe Text) Source #

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, creationTimeMillis, playerSessionCount, maximumSessions, 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.

sgsAliasId :: Lens' SearchGameSessions (Maybe Text) Source #

Unique identifier for a fleet alias. Each request must reference either a fleet ID or alias ID, but not both.

sgsNextToken :: Lens' SearchGameSessions (Maybe Text) Source #

Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value.

sgsLimit :: Lens' SearchGameSessions (Maybe Natural) Source #

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.

sgsFleetId :: Lens' SearchGameSessions (Maybe Text) Source #

Unique identifier for a fleet. Each request must reference either a fleet ID or alias ID, but not both.

Destructuring the Response

searchGameSessionsResponse Source #

Creates a value of SearchGameSessionsResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data SearchGameSessionsResponse Source #

Represents the returned data in response to a request action.

See: searchGameSessionsResponse smart constructor.

Instances

Eq SearchGameSessionsResponse Source # 
Data SearchGameSessionsResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SearchGameSessionsResponse -> c SearchGameSessionsResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SearchGameSessionsResponse #

toConstr :: SearchGameSessionsResponse -> Constr #

dataTypeOf :: SearchGameSessionsResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c SearchGameSessionsResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SearchGameSessionsResponse) #

gmapT :: (forall b. Data b => b -> b) -> SearchGameSessionsResponse -> SearchGameSessionsResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SearchGameSessionsResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SearchGameSessionsResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> SearchGameSessionsResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SearchGameSessionsResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SearchGameSessionsResponse -> m SearchGameSessionsResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchGameSessionsResponse -> m SearchGameSessionsResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchGameSessionsResponse -> m SearchGameSessionsResponse #

Read SearchGameSessionsResponse Source # 
Show SearchGameSessionsResponse Source # 
Generic SearchGameSessionsResponse Source # 
NFData SearchGameSessionsResponse Source # 
type Rep SearchGameSessionsResponse Source # 
type Rep SearchGameSessionsResponse = D1 (MetaData "SearchGameSessionsResponse" "Network.AWS.GameLift.SearchGameSessions" "amazonka-gamelift-1.4.4-DPfJmtllByT7OdD35vBDe5" False) (C1 (MetaCons "SearchGameSessionsResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_sgsrsGameSessions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [GameSession]))) ((:*:) (S1 (MetaSel (Just Symbol "_sgsrsNextToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_sgsrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))))

Response Lenses

sgsrsGameSessions :: Lens' SearchGameSessionsResponse [GameSession] Source #

Collection of objects containing game session properties for each session matching the request.

sgsrsNextToken :: Lens' SearchGameSessionsResponse (Maybe Text) Source #

Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.

If a request has a limit that exactly matches the number of remaining results, a token is returned even though there are no more results to retrieve.