listBuilds method

Future<ListBuildsOutput> listBuilds({
  1. int? limit,
  2. String? nextToken,
  3. BuildStatus? status,
})

Retrieves build resources for all builds associated with the AWS account in use. You can limit results to builds that are in a specific status by using the Status parameter. Use the pagination parameters to retrieve results in a set of sequential pages. Learn more

Upload a Custom Server Build

Related operations

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

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 status : Build status to filter results by. To retrieve all builds, leave this parameter empty.

Possible build statuses include the following:

  • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.
  • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.
  • FAILED -- The game build upload failed. You cannot create new fleets for this build.

Implementation

Future<ListBuildsOutput> listBuilds({
  int? limit,
  String? nextToken,
  BuildStatus? status,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.ListBuilds'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
      if (status != null) 'Status': status.toValue(),
    },
  );

  return ListBuildsOutput.fromJson(jsonResponse.body);
}