Skip to content

get_merge_options async

get_merge_options(
    repository_name: RepositoryName,
    source_commit_specifier: CommitName,
    destination_commit_specifier: CommitName,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    conflict_detail_level: Optional[ConflictDetailLevelTypeEnum] = None,
    conflict_resolution_strategy: Optional[ConflictResolutionStrategyTypeEnum] = None,
) -> GetMergeOptionsOutput

Returns information about the merge options available for merging two specified branches. For details about why a merge option is not available, use GetMergeConflicts or DescribeMergeConflicts.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository that contains the commits about which you want to get merge options.

  • source_commit_specifier (CommitName) –

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

  • destination_commit_specifier (CommitName) –

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

  • conflict_detail_level (Optional[ConflictDetailLevelTypeEnum], default: None ) –

    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.

  • conflict_resolution_strategy (Optional[ConflictResolutionStrategyTypeEnum], default: None ) –

    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.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def get_merge_options(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    source_commit_specifier: "capo_codecommit.types.commit_name.CommitName",
    destination_commit_specifier: "capo_codecommit.types.commit_name.CommitName",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    conflict_detail_level: Optional[
        "capo_codecommit.types.conflict_detail_level_type_enum.ConflictDetailLevelTypeEnum"
    ] = None,
    conflict_resolution_strategy: Optional[
        "capo_codecommit.types.conflict_resolution_strategy_type_enum.ConflictResolutionStrategyTypeEnum"
    ] = None,
) -> "capo_codecommit.types.get_merge_options_output.GetMergeOptionsOutput":
    """<p>Returns information about the merge options available for merging two specified branches. For details about why a merge option is not available, use GetMergeConflicts or DescribeMergeConflicts.</p>

    Args:
        repository_name: <p>The name of the repository that contains the commits about which you want to get merge options.</p>
        source_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
        destination_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
        conflict_detail_level: <p>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.</p>
        conflict_resolution_strategy: <p>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.</p>

    Raises:
        capo_codecommit.errors.commit_does_not_exist_exception.CommitDoesNotExistException: <p>The specified commit does not exist or no commit was specified, and the specified repository has no default branch.</p>
        capo_codecommit.errors.commit_required_exception.CommitRequiredException: <p>A commit was not specified.</p>
        capo_codecommit.errors.encryption_integrity_checks_failed_exception.EncryptionIntegrityChecksFailedException: <p>An encryption integrity check failed.</p>
        capo_codecommit.errors.encryption_key_access_denied_exception.EncryptionKeyAccessDeniedException: <p>An encryption key could not be accessed.</p>
        capo_codecommit.errors.encryption_key_disabled_exception.EncryptionKeyDisabledException: <p>The encryption key is disabled.</p>
        capo_codecommit.errors.encryption_key_not_found_exception.EncryptionKeyNotFoundException: <p>No encryption key was found.</p>
        capo_codecommit.errors.encryption_key_unavailable_exception.EncryptionKeyUnavailableException: <p>The encryption key is not available.</p>
        capo_codecommit.errors.invalid_commit_exception.InvalidCommitException: <p>The specified commit is not valid.</p>
        capo_codecommit.errors.invalid_conflict_detail_level_exception.InvalidConflictDetailLevelException: <p>The specified conflict detail level is not valid.</p>
        capo_codecommit.errors.invalid_conflict_resolution_strategy_exception.InvalidConflictResolutionStrategyException: <p>The specified conflict resolution strategy is not valid.</p>
        capo_codecommit.errors.invalid_repository_name_exception.InvalidRepositoryNameException: <p>A specified repository name is not valid.</p> <note> <p>This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.</p> </note>
        capo_codecommit.errors.maximum_file_content_to_load_exceeded_exception.MaximumFileContentToLoadExceededException: <p>The number of files to load exceeds the allowed limit.</p>
        capo_codecommit.errors.maximum_items_to_compare_exceeded_exception.MaximumItemsToCompareExceededException: <p>The number of items to compare between the source or destination branches and the merge base has exceeded the maximum allowed.</p>
        capo_codecommit.errors.repository_does_not_exist_exception.RepositoryDoesNotExistException: <p>The specified repository does not exist.</p>
        capo_codecommit.errors.repository_name_required_exception.RepositoryNameRequiredException: <p>A repository name is required, but was not specified.</p>
        capo_codecommit.errors.tips_divergence_exceeded_exception.TipsDivergenceExceededException: <p>The divergence between the tips of the provided commit specifiers is too great to determine whether there might be any merge conflicts. Locally compare the specifiers using <code>git diff</code> or a diff tool.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codecommit.types.get_merge_options_input.GetMergeOptionsInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.get_merge_options_output.GetMergeOptionsOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_merge_options

        (
            output,
            http_response,
        ) = await capo_codecommit._operations.code_commit_20150413.get_merge_options.async_get_merge_options(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetMergeOptions")
    )
    input_: capo_codecommit.types.get_merge_options_input.GetMergeOptionsInput = {
        "repository_name": repository_name,
        "source_commit_specifier": source_commit_specifier,
        "destination_commit_specifier": destination_commit_specifier,
    }
    if conflict_detail_level is not None:
        input_["conflict_detail_level"] = conflict_detail_level
    if conflict_resolution_strategy is not None:
        input_["conflict_resolution_strategy"] = conflict_resolution_strategy

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output