Skip to content

get_comments_for_compared_commit

get_comments_for_compared_commit(
    repository_name: RepositoryName,
    after_commit_id: CommitId,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    before_commit_id: Optional[CommitId] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> GetCommentsForComparedCommitOutput

Returns information about comments made on the comparison between two commits.

Reaction counts might include numbers from user identities who were deleted after the reaction was made. For a count of reactions from active identities, use GetCommentReactions.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository where you want to compare commits.

  • before_commit_id (Optional[CommitId], default: None ) –

    To establish the directionality of the comparison, the full commit ID of the before commit.

  • after_commit_id (CommitId) –

    To establish the directionality of the comparison, the full commit ID of the after commit.

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

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

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

    A non-zero, non-negative integer used to limit the number of returned results. The default is 100 comments, but you can configure up to 500.

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def get_comments_for_compared_commit(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    after_commit_id: "capo_codecommit.types.commit_id.CommitId",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    before_commit_id: Optional["capo_codecommit.types.commit_id.CommitId"] = None,
    next_token: Optional["capo_codecommit.types.next_token.NextToken"] = None,
    max_results: Optional["capo_codecommit.types.max_results.MaxResults"] = None,
) -> "capo_codecommit.types.get_comments_for_compared_commit_output.GetCommentsForComparedCommitOutput":
    """<p>Returns information about comments made on the comparison between two commits.</p> <note> <p>Reaction counts might include numbers from user identities who were deleted after the reaction was made. For a count of reactions from active identities, use GetCommentReactions.</p> </note>

    Args:
        repository_name: <p>The name of the repository where you want to compare commits.</p>
        before_commit_id: <p>To establish the directionality of the comparison, the full commit ID of the before commit.</p>
        after_commit_id: <p>To establish the directionality of the comparison, the full commit ID of the after commit.</p>
        next_token: <p>An enumeration token that when provided in a request, returns the next batch of the results. </p>
        max_results: <p>A non-zero, non-negative integer used to limit the number of returned results. The default is 100 comments, but you can configure up to 500.</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_id_required_exception.CommitIdRequiredException: <p>A commit ID 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_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_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.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.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.get_comments_for_compared_commit_input.GetCommentsForComparedCommitInput]",
    ) -> OperationResponse[
        "capo_codecommit.types.get_comments_for_compared_commit_output.GetCommentsForComparedCommitOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_comments_for_compared_commit

        output, http_response = (
            capo_codecommit._operations.code_commit_20150413.get_comments_for_compared_commit.get_comments_for_compared_commit(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCommentsForComparedCommit")
    )
    input_: capo_codecommit.types.get_comments_for_compared_commit_input.GetCommentsForComparedCommitInput = {
        "repository_name": repository_name,
        "after_commit_id": after_commit_id,
    }
    if before_commit_id is not None:
        input_["before_commit_id"] = before_commit_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output