Skip to content

get_comments_for_pull_request async

get_comments_for_pull_request(
    pull_request_id: PullRequestId,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    repository_name: Optional[RepositoryName] = None,
    before_commit_id: Optional[CommitId] = None,
    after_commit_id: Optional[CommitId] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> GetCommentsForPullRequestOutput

Returns comments made on a pull request.

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:

  • pull_request_id (PullRequestId) –

    The system-generated ID of the pull request. To get this ID, use ListPullRequests.

  • repository_name (Optional[RepositoryName], default: None ) –

    The name of the repository that contains the pull request. Requirement is conditional: repositoryName must be specified when beforeCommitId and afterCommitId are included.

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

    The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created. Requirement is conditional: beforeCommitId must be specified when repositoryName is included.

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

    The full commit ID of the commit in the source branch that was the tip of the branch at the time the comment was made. Requirement is conditional: afterCommitId must be specified when repositoryName is included.

  • 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. You can return up to 500 comments with a single request.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def get_comments_for_pull_request(
    self,
    pull_request_id: "capo_codecommit.types.pull_request_id.PullRequestId",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    repository_name: Optional[
        "capo_codecommit.types.repository_name.RepositoryName"
    ] = None,
    before_commit_id: Optional["capo_codecommit.types.commit_id.CommitId"] = None,
    after_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_pull_request_output.GetCommentsForPullRequestOutput":
    """<p>Returns comments made on a pull request.</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:
        pull_request_id: <p>The system-generated ID of the pull request. To get this ID, use <a>ListPullRequests</a>.</p>
        repository_name: <p>The name of the repository that contains the pull request. Requirement is conditional: <code>repositoryName</code> must be specified when <code>beforeCommitId</code> and <code>afterCommitId</code> are included.</p>
        before_commit_id: <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created. Requirement is conditional: <code>beforeCommitId</code> must be specified when <code>repositoryName</code> is included.</p>
        after_commit_id: <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the comment was made. Requirement is conditional: <code>afterCommitId</code> must be specified when <code>repositoryName</code> is included.</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. You can return up to 500 comments with a single request.</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_pull_request_id_exception.InvalidPullRequestIdException: <p>The pull request ID is not valid. Make sure that you have provided the full ID and that the pull request is in the specified repository, and then try again.</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.pull_request_does_not_exist_exception.PullRequestDoesNotExistException: <p>The pull request ID could not be found. Make sure that you have specified the correct repository name and pull request ID, and then try again.</p>
        capo_codecommit.errors.pull_request_id_required_exception.PullRequestIdRequiredException: <p>A pull request ID is required, but none was provided.</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.repository_not_associated_with_pull_request_exception.RepositoryNotAssociatedWithPullRequestException: <p>The repository does not contain any pull requests with that pull request ID. Use GetPullRequest to verify the correct repository name for the pull request ID.</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_comments_for_pull_request_input.GetCommentsForPullRequestInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.get_comments_for_pull_request_output.GetCommentsForPullRequestOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_comments_for_pull_request

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCommentsForPullRequest")
    )
    input_: capo_codecommit.types.get_comments_for_pull_request_input.GetCommentsForPullRequestInput = {
        "pull_request_id": pull_request_id
    }
    if repository_name is not None:
        input_["repository_name"] = repository_name
    if before_commit_id is not None:
        input_["before_commit_id"] = before_commit_id
    if after_commit_id is not None:
        input_["after_commit_id"] = after_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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output