Skip to content

put_comment_reaction

put_comment_reaction(
    comment_id: CommentId,
    reaction_value: ReactionValue,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> None

Adds or updates a reaction to a specified comment for the user whose identity is used to make the request. You can only add or update a reaction for yourself. You cannot add, modify, or delete a reaction for another user.

Parameters:

  • comment_id (CommentId) –

    The ID of the comment to which you want to add or update a reaction.

  • reaction_value (ReactionValue) –

    The emoji reaction you want to add or update. To remove a reaction, provide a value of blank or null. You can also provide the value of none. For information about emoji reaction values supported in CodeCommit, see the CodeCommit User Guide.

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def put_comment_reaction(
    self,
    comment_id: "capo_codecommit.types.comment_id.CommentId",
    reaction_value: "capo_codecommit.types.reaction_value.ReactionValue",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> None:
    """<p>Adds or updates a reaction to a specified comment for the user whose identity is used to make the request. You can only add or update a reaction for yourself. You cannot add, modify, or delete a reaction for another user.</p>

    Args:
        comment_id: <p>The ID of the comment to which you want to add or update a reaction.</p>
        reaction_value: <p>The emoji reaction you want to add or update. To remove a reaction, provide a value of blank or null. You can also provide the value of none. For information about emoji reaction values supported in CodeCommit, see the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-commit-comment.html#emoji-reaction-table">CodeCommit User Guide</a>.</p>

    Raises:
        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.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.invalid_reaction_value_exception.InvalidReactionValueException: <p>The value of the reaction is not valid. For more information, see the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">CodeCommit User Guide</a>.</p>
        capo_codecommit.errors.reaction_limit_exceeded_exception.ReactionLimitExceededException: <p>The number of reactions has been exceeded. Reactions are limited to one reaction per user for each individual comment ID.</p>
        capo_codecommit.errors.reaction_value_required_exception.ReactionValueRequiredException: <p>A reaction value is required. </p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.put_comment_reaction_input.PutCommentReactionInput]",
    ) -> OperationResponse[None]:
        import capo_codecommit._operations.code_commit_20150413.put_comment_reaction

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutCommentReaction")
    )
    input_: capo_codecommit.types.put_comment_reaction_input.PutCommentReactionInput = {
        "comment_id": comment_id,
        "reaction_value": reaction_value,
    }

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