Skip to content

update_comment async

update_comment(
    comment_id: CommentId,
    content: Content,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> UpdateCommentOutput

Replaces the contents of a comment.

Parameters:

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def update_comment(
    self,
    comment_id: "capo_codecommit.types.comment_id.CommentId",
    content: "capo_codecommit.types.content.Content",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> "capo_codecommit.types.update_comment_output.UpdateCommentOutput":
    """<p>Replaces the contents of a comment.</p>

    Args:
        comment_id: <p>The system-generated ID of the comment you want to update. To get this ID, use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
        content: <p>The updated content to replace the existing content of the comment.</p>

    Raises:
        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.comment_deleted_exception.CommentDeletedException: <p>This comment has already been deleted. You cannot edit or delete a deleted comment.</p>
        capo_codecommit.errors.comment_does_not_exist_exception.CommentDoesNotExistException: <p>No comment exists with the provided ID. Verify that you have used the correct ID, and then try again.</p>
        capo_codecommit.errors.comment_id_required_exception.CommentIdRequiredException: <p>The comment ID is missing or null. A comment ID is required.</p>
        capo_codecommit.errors.comment_not_created_by_caller_exception.CommentNotCreatedByCallerException: <p>You cannot modify or delete this comment. Only comment authors can modify or delete their comments.</p>
        capo_codecommit.errors.invalid_comment_id_exception.InvalidCommentIdException: <p>The comment ID is not in a valid format. Make sure that you have provided the full comment 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.update_comment_input.UpdateCommentInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.update_comment_output.UpdateCommentOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.update_comment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateComment")
    )
    input_: capo_codecommit.types.update_comment_input.UpdateCommentInput = {
        "comment_id": comment_id,
        "content": content,
    }

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