mergePullRequestByFastForward method
Attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the fast-forward merge strategy. If the merge is successful, it closes the pull request.
May throw ConcurrentReferenceUpdateException.
May throw EncryptionIntegrityChecksFailedException.
May throw EncryptionKeyAccessDeniedException.
May throw EncryptionKeyDisabledException.
May throw EncryptionKeyNotFoundException.
May throw EncryptionKeyUnavailableException.
May throw InvalidCommitIdException.
May throw InvalidPullRequestIdException.
May throw InvalidRepositoryNameException.
May throw ManualMergeRequiredException.
May throw PullRequestAlreadyClosedException.
May throw PullRequestApprovalRulesNotSatisfiedException.
May throw PullRequestDoesNotExistException.
May throw PullRequestIdRequiredException.
May throw ReferenceDoesNotExistException.
May throw RepositoryDoesNotExistException.
May throw RepositoryNameRequiredException.
May throw RepositoryNotAssociatedWithPullRequestException.
May throw TipOfSourceReferenceIsDifferentException.
Parameter pullRequestId :
The system-generated ID of the pull request. To get this ID, use
ListPullRequests.
Parameter repositoryName :
The name of the repository where the pull request was created.
Parameter sourceCommitId :
The full commit ID of the original or updated commit in the pull request
source branch. Pass this value if you want an exception thrown if the
current commit ID of the tip of the source branch does not match this
commit ID.
Implementation
Future<MergePullRequestByFastForwardOutput> mergePullRequestByFastForward({
required String pullRequestId,
required String repositoryName,
String? sourceCommitId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.MergePullRequestByFastForward'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'pullRequestId': pullRequestId,
'repositoryName': repositoryName,
if (sourceCommitId != null) 'sourceCommitId': sourceCommitId,
},
);
return MergePullRequestByFastForwardOutput.fromJson(jsonResponse.body);
}