Skip to content

post_comment_for_compared_commit async

post_comment_for_compared_commit(
    repository_name: RepositoryName,
    after_commit_id: CommitId,
    content: Content,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    before_commit_id: Optional[CommitId] = None,
    location: Optional[Location] = None,
    client_request_token: Optional[ClientRequestToken] = None,
) -> PostCommentForComparedCommitOutput

Posts a comment on the comparison between two commits.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository where you want to post a comment on the comparison between commits.

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

    To establish the directionality of the comparison, the full commit ID of the before commit. Required for commenting on any commit unless that commit is the initial commit.

  • after_commit_id (CommitId) –

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

  • location (Optional[Location], default: None ) –

    The location of the comparison where you want to comment.

  • content (Content) –

    The content of the comment you want to make.

  • client_request_token (Optional[ClientRequestToken], default: None ) –

    A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def post_comment_for_compared_commit(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    after_commit_id: "capo_codecommit.types.commit_id.CommitId",
    content: "capo_codecommit.types.content.Content",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    before_commit_id: Optional["capo_codecommit.types.commit_id.CommitId"] = None,
    location: Optional["capo_codecommit.types.location.Location"] = None,
    client_request_token: Optional[
        "capo_codecommit.types.client_request_token.ClientRequestToken"
    ] = None,
) -> "capo_codecommit.types.post_comment_for_compared_commit_output.PostCommentForComparedCommitOutput":
    """<p>Posts a comment on the comparison between two commits.</p>

    Args:
        repository_name: <p>The name of the repository where you want to post a comment on the comparison between commits.</p>
        before_commit_id: <p>To establish the directionality of the comparison, the full commit ID of the before commit. Required for commenting on any commit unless that commit is the initial commit.</p>
        after_commit_id: <p>To establish the directionality of the comparison, the full commit ID of the after commit.</p>
        location: <p>The location of the comparison where you want to comment.</p>
        content: <p>The content of the comment you want to make.</p>
        client_request_token: <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>

    Raises:
        capo_codecommit.errors.before_commit_id_and_after_commit_id_are_same_exception.BeforeCommitIdAndAfterCommitIdAreSameException: <p>The before commit ID and the after commit ID are the same, which is not valid. The before commit ID and the after commit ID must be different commit IDs.</p>
        capo_codecommit.errors.client_request_token_required_exception.ClientRequestTokenRequiredException: <p>A client request token is required. A client request token is an unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
        capo_codecommit.errors.comment_content_required_exception.CommentContentRequiredException: <p>The comment is empty. You must provide some content for a comment. The content cannot be null.</p>
        capo_codecommit.errors.comment_content_size_limit_exceeded_exception.CommentContentSizeLimitExceededException: <p>The comment is too large. Comments are limited to 10,240 characters.</p>
        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.idempotency_parameter_mismatch_exception.IdempotencyParameterMismatchException: <p>The client request token is not valid. Either the token is not in a valid format, or the token has been used in a previous request and cannot be reused.</p>
        capo_codecommit.errors.invalid_client_request_token_exception.InvalidClientRequestTokenException: <p>The client request token 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_file_location_exception.InvalidFileLocationException: <p>The location of the file is not valid. Make sure that you include the file name and extension.</p>
        capo_codecommit.errors.invalid_file_position_exception.InvalidFilePositionException: <p>The position is not valid. Make sure that the line number exists in the version of the file you want to comment on.</p>
        capo_codecommit.errors.invalid_path_exception.InvalidPathException: <p>The specified path is not valid.</p>
        capo_codecommit.errors.invalid_relative_file_version_enum_exception.InvalidRelativeFileVersionEnumException: <p>Either the enum is not in a valid format, or the specified file version enum is not valid in respect to the current file version.</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.path_required_exception.PathRequiredException: <p>The folderPath for a location cannot be null.</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.post_comment_for_compared_commit_input.PostCommentForComparedCommitInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.post_comment_for_compared_commit_output.PostCommentForComparedCommitOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.post_comment_for_compared_commit

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PostCommentForComparedCommit")
    )
    input_: capo_codecommit.types.post_comment_for_compared_commit_input.PostCommentForComparedCommitInput = {
        "repository_name": repository_name,
        "after_commit_id": after_commit_id,
        "content": content,
    }
    if before_commit_id is not None:
        input_["before_commit_id"] = before_commit_id
    if location is not None:
        input_["location"] = location
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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