Skip to content

get_differences async

get_differences(
    repository_name: RepositoryName,
    after_commit_specifier: CommitName,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    before_commit_specifier: Optional[CommitName] = None,
    before_path: Optional[Path] = None,
    after_path: Optional[Path] = None,
    max_results: Optional[Limit] = None,
    next_token: Optional[NextToken] = None,
) -> GetDifferencesOutput

Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference). Results can be limited to a specified path.

For line-level diff details, pass the beforeBlob.blobId and afterBlob.blobId values from a Difference object to GetBlobDifferences.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository where you want to get differences.

  • before_commit_specifier (Optional[CommitName], default: None ) –

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, the full commit ID). Optional. If not specified, all changes before the afterCommitSpecifier value are shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults.

  • after_commit_specifier (CommitName) –

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

  • before_path (Optional[Path], default: None ) –

    The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences are shown for all paths.

  • after_path (Optional[Path], default: None ) –

    The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences are shown for all paths.

  • max_results (Optional[Limit], default: None ) –

    A non-zero, non-negative integer used to limit the number of returned results.

  • next_token (Optional[NextToken], default: None ) –

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

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def get_differences(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    after_commit_specifier: "capo_codecommit.types.commit_name.CommitName",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    before_commit_specifier: Optional[
        "capo_codecommit.types.commit_name.CommitName"
    ] = None,
    before_path: Optional["capo_codecommit.types.path.Path"] = None,
    after_path: Optional["capo_codecommit.types.path.Path"] = None,
    max_results: Optional["capo_codecommit.types.limit.Limit"] = None,
    next_token: Optional["capo_codecommit.types.next_token.NextToken"] = None,
) -> "capo_codecommit.types.get_differences_output.GetDifferencesOutput":
    """<p>Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference). Results can be limited to a specified path.</p> <p>For line-level diff details, pass the <code>beforeBlob.blobId</code> and <code>afterBlob.blobId</code> values from a <code>Difference</code> object to <a>GetBlobDifferences</a>.</p>

    Args:
        repository_name: <p>The name of the repository where you want to get differences.</p>
        before_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, the full commit ID). Optional. If not specified, all changes before the <code>afterCommitSpecifier</code> value are shown. If you do not use <code>beforeCommitSpecifier</code> in your request, consider limiting the results with <code>maxResults</code>.</p>
        after_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit.</p>
        before_path: <p>The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If <code>beforePath</code> and <code>afterPath</code> are not specified, differences are shown for all paths.</p>
        after_path: <p>The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences are shown for all paths.</p>
        max_results: <p>A non-zero, non-negative integer used to limit the number of returned results.</p>
        next_token: <p>An enumeration token that, when provided in a request, returns the next batch of the results.</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_commit_id_exception.InvalidCommitIdException: <p>The specified commit ID is not valid.</p>
        capo_codecommit.errors.invalid_continuation_token_exception.InvalidContinuationTokenException: <p>The specified continuation token is not valid.</p>
        capo_codecommit.errors.invalid_max_results_exception.InvalidMaxResultsException: <p>The specified number of maximum results is not valid.</p>
        capo_codecommit.errors.invalid_path_exception.InvalidPathException: <p>The specified path 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.path_does_not_exist_exception.PathDoesNotExistException: <p>The specified path does not exist.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codecommit.types.get_differences_input.GetDifferencesInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.get_differences_output.GetDifferencesOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_differences

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDifferences")
    )
    input_: capo_codecommit.types.get_differences_input.GetDifferencesInput = {
        "repository_name": repository_name,
        "after_commit_specifier": after_commit_specifier,
    }
    if before_commit_specifier is not None:
        input_["before_commit_specifier"] = before_commit_specifier
    if before_path is not None:
        input_["before_path"] = before_path
    if after_path is not None:
        input_["after_path"] = after_path
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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