stopGameSessionPlacement method
This API works with the following fleet types: EC2, Anywhere, Container
Cancels a game session placement that's in PENDING status. To
stop a placement, provide the placement ID value.
Results
If successful, this operation removes the placement request from the queue
and moves the GameSessionPlacement to CANCELLED
status.
This operation results in an InvalidRequestExecption (400)
error if a game session has already been created for this placement. You
can clean up an unneeded game session by calling TerminateGameSession.
May throw InternalServiceException.
May throw InvalidRequestException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter placementId :
A unique identifier for a game session placement to stop.
Implementation
Future<StopGameSessionPlacementOutput> stopGameSessionPlacement({
required String placementId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.StopGameSessionPlacement'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PlacementId': placementId,
},
);
return StopGameSessionPlacementOutput.fromJson(jsonResponse.body);
}