getMergeCommit method

Future<GetMergeCommitOutput> getMergeCommit({
  1. required String destinationCommitSpecifier,
  2. required String repositoryName,
  3. required String sourceCommitSpecifier,
  4. ConflictDetailLevelTypeEnum? conflictDetailLevel,
  5. ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
})

Returns information about a specified merge commit.

May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw CommitRequiredException. May throw InvalidCommitException. May throw CommitDoesNotExistException. May throw InvalidConflictDetailLevelException. May throw InvalidConflictResolutionStrategyException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter destinationCommitSpecifier : The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

Parameter repositoryName : The name of the repository that contains the merge commit about which you want to get information.

Parameter sourceCommitSpecifier : The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

Parameter conflictDetailLevel : The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

Parameter conflictResolutionStrategy : Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

Implementation

Future<GetMergeCommitOutput> getMergeCommit({
  required String destinationCommitSpecifier,
  required String repositoryName,
  required String sourceCommitSpecifier,
  ConflictDetailLevelTypeEnum? conflictDetailLevel,
  ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
}) async {
  ArgumentError.checkNotNull(
      destinationCommitSpecifier, 'destinationCommitSpecifier');
  ArgumentError.checkNotNull(repositoryName, 'repositoryName');
  _s.validateStringLength(
    'repositoryName',
    repositoryName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sourceCommitSpecifier, 'sourceCommitSpecifier');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.GetMergeCommit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'destinationCommitSpecifier': destinationCommitSpecifier,
      'repositoryName': repositoryName,
      'sourceCommitSpecifier': sourceCommitSpecifier,
      if (conflictDetailLevel != null)
        'conflictDetailLevel': conflictDetailLevel.toValue(),
      if (conflictResolutionStrategy != null)
        'conflictResolutionStrategy': conflictResolutionStrategy.toValue(),
    },
  );

  return GetMergeCommitOutput.fromJson(jsonResponse.body);
}