describeGameSessionDetails method
Retrieves properties, including the protection policy in force, for one or
more game sessions. This operation can be used in several ways: (1)
provide a GameSessionId
or GameSessionArn
to
request details for a specific game session; (2) provide either a
FleetId
or an AliasId
to request properties for
all game sessions running on a fleet.
To get game session record(s), specify just one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSessionDetail object is returned for each session matching the request.
- CreateGameSession
- DescribeGameSessions
- DescribeGameSessionDetails
- SearchGameSessions
- UpdateGameSession
- GetGameSessionLogUrl
- Game session placements
May throw InternalServiceException. May throw NotFoundException. May throw InvalidRequestException. May throw UnauthorizedException. May throw TerminalRoutingStrategyException.
Parameter aliasId
:
A unique identifier for an alias associated with the fleet to retrieve all
game sessions for. You can use either the alias ID or ARN value.
Parameter fleetId
:
A unique identifier for a fleet to retrieve all game sessions active on
the fleet. You can use either the fleet ID or ARN value.
Parameter gameSessionId
:
A unique identifier for the game session to retrieve.
Parameter limit
:
The maximum number of results to return. Use this parameter with
NextToken
to get results as a set of sequential pages.
Parameter nextToken
:
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.
Parameter statusFilter
:
Game session status to filter results on. Possible game session statuses
include ACTIVE
, TERMINATED
,
ACTIVATING
and TERMINATING
(the last two are
transitory).
Implementation
Future<DescribeGameSessionDetailsOutput> describeGameSessionDetails({
String? aliasId,
String? fleetId,
String? gameSessionId,
int? limit,
String? nextToken,
String? statusFilter,
}) async {
_s.validateStringLength(
'gameSessionId',
gameSessionId,
1,
256,
);
_s.validateNumRange(
'limit',
limit,
1,
1152921504606846976,
);
_s.validateStringLength(
'nextToken',
nextToken,
1,
1024,
);
_s.validateStringLength(
'statusFilter',
statusFilter,
1,
1024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.DescribeGameSessionDetails'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (aliasId != null) 'AliasId': aliasId,
if (fleetId != null) 'FleetId': fleetId,
if (gameSessionId != null) 'GameSessionId': gameSessionId,
if (limit != null) 'Limit': limit,
if (nextToken != null) 'NextToken': nextToken,
if (statusFilter != null) 'StatusFilter': statusFilter,
},
);
return DescribeGameSessionDetailsOutput.fromJson(jsonResponse.body);
}