requestUploadCredentials method

Future<RequestUploadCredentialsOutput> requestUploadCredentials({
  1. required String buildId,
})

Retrieves a fresh set of credentials for use when uploading a new set of game build files to Amazon GameLift's Amazon S3. This is done as part of the build creation process; see CreateBuild.

To request new credentials, specify the build ID as returned with an initial CreateBuild request. If successful, a new set of credentials are returned, along with the S3 storage location associated with the build ID.

Learn more

Create a Build with Files in S3

Related operations

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

Parameter buildId : A unique identifier for a build to get credentials for. You can use either the build ID or ARN value.

Implementation

Future<RequestUploadCredentialsOutput> requestUploadCredentials({
  required String buildId,
}) async {
  ArgumentError.checkNotNull(buildId, 'buildId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.RequestUploadCredentials'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BuildId': buildId,
    },
  );

  return RequestUploadCredentialsOutput.fromJson(jsonResponse.body);
}