describeMergeConflicts method

Future<DescribeMergeConflictsOutput> describeMergeConflicts({
  1. required String destinationCommitSpecifier,
  2. required String filePath,
  3. required MergeOptionTypeEnum mergeOption,
  4. required String repositoryName,
  5. required String sourceCommitSpecifier,
  6. ConflictDetailLevelTypeEnum? conflictDetailLevel,
  7. ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
  8. int? maxMergeHunks,
  9. String? nextToken,
})

Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy. If the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, an exception is thrown.

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 PathRequiredException. May throw InvalidPathException. May throw FileDoesNotExistException. May throw InvalidMaxMergeHunksException. May throw InvalidConflictDetailLevelException. 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 filePath : The path of the target files used to describe the conflicts.

Parameter mergeOption : The merge option or strategy you want to use to merge the code.

Parameter repositoryName : The name of the repository where you want to get information about a merge conflict.

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 maxMergeHunks : The maximum number of merge hunks 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<DescribeMergeConflictsOutput> describeMergeConflicts({
  required String destinationCommitSpecifier,
  required String filePath,
  required MergeOptionTypeEnum mergeOption,
  required String repositoryName,
  required String sourceCommitSpecifier,
  ConflictDetailLevelTypeEnum? conflictDetailLevel,
  ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
  int? maxMergeHunks,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(
      destinationCommitSpecifier, 'destinationCommitSpecifier');
  ArgumentError.checkNotNull(filePath, 'filePath');
  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.DescribeMergeConflicts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'destinationCommitSpecifier': destinationCommitSpecifier,
      'filePath': filePath,
      'mergeOption': mergeOption.toValue(),
      'repositoryName': repositoryName,
      'sourceCommitSpecifier': sourceCommitSpecifier,
      if (conflictDetailLevel != null)
        'conflictDetailLevel': conflictDetailLevel.toValue(),
      if (conflictResolutionStrategy != null)
        'conflictResolutionStrategy': conflictResolutionStrategy.toValue(),
      if (maxMergeHunks != null) 'maxMergeHunks': maxMergeHunks,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeMergeConflictsOutput.fromJson(jsonResponse.body);
}