retryBuild method

Future<RetryBuildOutput> retryBuild({
  1. String? id,
  2. String? idempotencyToken,
})

Restarts a build.

May throw AccountLimitExceededException. May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter id : Specifies the identifier of the build to restart.

Parameter idempotencyToken : A unique, case sensitive identifier you provide to ensure the idempotency of the RetryBuild request. The token is included in the RetryBuild request and is valid for five minutes. If you repeat the RetryBuild request with the same token, but change a parameter, CodeBuild returns a parameter mismatch error.

Implementation

Future<RetryBuildOutput> retryBuild({
  String? id,
  String? idempotencyToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.RetryBuild'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (id != null) 'id': id,
      if (idempotencyToken != null) 'idempotencyToken': idempotencyToken,
    },
  );

  return RetryBuildOutput.fromJson(jsonResponse.body);
}