retryBuild method

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

Restarts a build.

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

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, AWS CodeBuild returns a parameter mismatch error.

Implementation

Future<RetryBuildOutput> retryBuild({
  String? id,
  String? idempotencyToken,
}) async {
  _s.validateStringLength(
    'id',
    id,
    1,
    1152921504606846976,
  );
  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);
}