Skip to content

post_comment_reply

post_comment_reply(
    in_reply_to: CommentId,
    content: Content,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
) -> PostCommentReplyOutput

Posts a comment in reply to an existing comment on a comparison between commits or a pull request.

Parameters:

  • in_reply_to (CommentId) –

    The system-generated ID of the comment to which you want to reply. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest.

  • 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.

  • content (Content) –

    The contents of your reply to a comment.

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def post_comment_reply(
    self,
    in_reply_to: "capo_codecommit.types.comment_id.CommentId",
    content: "capo_codecommit.types.content.Content",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    client_request_token: Optional[
        "capo_codecommit.types.client_request_token.ClientRequestToken"
    ] = None,
) -> "capo_codecommit.types.post_comment_reply_output.PostCommentReplyOutput":
    """<p>Posts a comment in reply to an existing comment on a comparison between commits or a pull request.</p>

    Args:
        in_reply_to: <p>The system-generated ID of the comment to which you want to reply. To get this ID, use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</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>
        content: <p>The contents of your reply to a comment.</p>

    Raises:
        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.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.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_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.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.post_comment_reply_input.PostCommentReplyInput]",
    ) -> OperationResponse[
        "capo_codecommit.types.post_comment_reply_output.PostCommentReplyOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.post_comment_reply

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PostCommentReply")
    )
    input_: capo_codecommit.types.post_comment_reply_input.PostCommentReplyInput = {
        "in_reply_to": in_reply_to,
        "content": content,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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