stopGameSessionPlacement method

Future<StopGameSessionPlacementOutput> stopGameSessionPlacement({
  1. required String placementId,
})

Cancels a game session placement that is in PENDING status. To stop a placement, provide the placement ID values. If successful, the placement is moved to CANCELLED status.

May throw InternalServiceException. May throw InvalidRequestException. May throw NotFoundException. May throw UnauthorizedException.

Parameter placementId : A unique identifier for a game session placement to cancel.

Implementation

Future<StopGameSessionPlacementOutput> stopGameSessionPlacement({
  required String placementId,
}) async {
  ArgumentError.checkNotNull(placementId, 'placementId');
  _s.validateStringLength(
    'placementId',
    placementId,
    1,
    48,
    isRequired: true,
  );
  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);
}