Copyright | (c) 2013-2018 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) |
Safe Haskell | None |
Language | Haskell2010 |
Retrieves all active game sessions that match a set of search criteria and sorts them in a specified order. You can search or sort by the following game session attributes:
- gameSessionId -- Unique identifier for the game session. You can use either a
GameSessionId
orGameSessionArn
value. - gameSessionName -- Name assigned to a game session. This value is set when requesting a new game session with
CreateGameSession
or updating withUpdateGameSession
. 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 withUpdateGameSession
. - 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.
To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. If successful, a collection of GameSession
objects matching the request is returned. Use the pagination parameters to retrieve results as a set of sequential pages.
You can search for game sessions one fleet at a time only. To find game sessions across multiple fleets, you must search each fleet separately and combine the results. This search feature finds only game sessions that are in ACTIVE
status. To locate games in statuses other than active, use DescribeGameSessionDetails
.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
- Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
Synopsis
- searchGameSessions :: SearchGameSessions
- data SearchGameSessions
- sgsFilterExpression :: Lens' SearchGameSessions (Maybe Text)
- sgsSortExpression :: Lens' SearchGameSessions (Maybe Text)
- sgsAliasId :: Lens' SearchGameSessions (Maybe Text)
- sgsNextToken :: Lens' SearchGameSessions (Maybe Text)
- sgsLimit :: Lens' SearchGameSessions (Maybe Natural)
- sgsFleetId :: Lens' SearchGameSessions (Maybe Text)
- searchGameSessionsResponse :: Int -> SearchGameSessionsResponse
- data SearchGameSessionsResponse
- sgsrsGameSessions :: Lens' SearchGameSessionsResponse [GameSession]
- sgsrsNextToken :: Lens' SearchGameSessionsResponse (Maybe Text)
- sgsrsResponseStatus :: Lens' SearchGameSessionsResponse Int
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:
sgsFilterExpression
- 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 inACTIVE
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 aregameSessionName
,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 ongameSessionName
: "FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'"
. To chain multiple conditions in a single expression, use the logical keywordsAND
,OR
, andNOT
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: *=
,<>
,<
,>
,<=
,>=
* Parentheses * NOT * AND * 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"
.sgsSortExpression
- 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 aregameSessionName
,gameSessionId
,gameSessionProperties
,maximumSessions
,creationTimeMillis
,playerSessionCount
,hasAvailablePlayerSessions
. * Order -- Valid sort orders areASC
(ascending) andDESC
(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
- Unique identifier for an alias associated with the fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.sgsNextToken
- Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.sgsLimit
- Maximum number of results to return. Use this parameter withNextToken
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
- Unique identifier for a fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.
data SearchGameSessions Source #
Represents the input for a request action.
See: searchGameSessions
smart constructor.
Instances
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
, 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: * =
, <>
, <
, >
, <=
, >=
* Parentheses * NOT * AND * 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"
.
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
, 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.
sgsAliasId :: Lens' SearchGameSessions (Maybe Text) Source #
Unique identifier for an alias associated with the fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.
sgsNextToken :: Lens' SearchGameSessions (Maybe Text) Source #
Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning 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 to search for active game sessions. 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:
sgsrsGameSessions
- Collection of objects containing game session properties for each session matching the request.sgsrsNextToken
- Token that indicates 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.sgsrsResponseStatus
- -- | The response status code.
data SearchGameSessionsResponse Source #
Represents the returned data in response to a request action.
See: searchGameSessionsResponse
smart constructor.
Instances
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 that indicates 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.
sgsrsResponseStatus :: Lens' SearchGameSessionsResponse Int Source #
- - | The response status code.