getMergeConflicts method

Future<GetMergeConflictsOutput> getMergeConflicts({
  1. required String destinationCommitSpecifier,
  2. required MergeOptionTypeEnum mergeOption,
  3. required String repositoryName,
  4. required String sourceCommitSpecifier,
  5. ConflictDetailLevelTypeEnum? conflictDetailLevel,
  6. ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
  7. int? maxConflictFiles,
  8. String? nextToken,
})

Returns information about merge conflicts between the before and after commit IDs for a pull request in a repository.

May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw MergeOptionRequiredException. May throw InvalidMergeOptionException. May throw InvalidContinuationTokenException. May throw CommitRequiredException. May throw CommitDoesNotExistException. May throw InvalidCommitException. May throw TipsDivergenceExceededException. May throw InvalidMaxConflictFilesException. May throw InvalidConflictDetailLevelException. May throw InvalidDestinationCommitSpecifierException. May throw InvalidSourceCommitSpecifierException. May throw InvalidConflictResolutionStrategyException. May throw MaximumFileContentToLoadExceededException. May throw MaximumItemsToCompareExceededException. 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 mergeOption : The merge option or strategy you want to use to merge the code.

Parameter repositoryName : The name of the repository where the pull request was created.

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.

Parameter maxConflictFiles : The maximum number of files to include in the output.

Parameter nextToken : An enumeration token that, when provided in a request, returns the next batch of the results.

Implementation

Future<GetMergeConflictsOutput> getMergeConflicts({
  required String destinationCommitSpecifier,
  required MergeOptionTypeEnum mergeOption,
  required String repositoryName,
  required String sourceCommitSpecifier,
  ConflictDetailLevelTypeEnum? conflictDetailLevel,
  ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
  int? maxConflictFiles,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(
      destinationCommitSpecifier, 'destinationCommitSpecifier');
  ArgumentError.checkNotNull(mergeOption, 'mergeOption');
  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.GetMergeConflicts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'destinationCommitSpecifier': destinationCommitSpecifier,
      'mergeOption': mergeOption.toValue(),
      'repositoryName': repositoryName,
      'sourceCommitSpecifier': sourceCommitSpecifier,
      if (conflictDetailLevel != null)
        'conflictDetailLevel': conflictDetailLevel.toValue(),
      if (conflictResolutionStrategy != null)
        'conflictResolutionStrategy': conflictResolutionStrategy.toValue(),
      if (maxConflictFiles != null) 'maxConflictFiles': maxConflictFiles,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetMergeConflictsOutput.fromJson(jsonResponse.body);
}