Skip to content

create_case_comment

create_case_comment(
    case_id: CaseId,
    body: CommentBody,
    *,
    config_overrides: Optional[SecurityIRClientConfig] = None,
    client_token: Optional[str] = None,
) -> CreateCaseCommentResponse

Adds a comment to an existing case.

Parameters:

  • case_id (CaseId) –

    Required element used in combination with CreateCaseComment to specify a case ID.

  • client_token (Optional[str], default: None ) –

    The clientToken field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.

  • body (CommentBody) –

    Required element used in combination with CreateCaseComment to add content for the new comment.

Raises:

Examples:

Invoke CreateCaseComment

>>> client.create_case_comment(case_id='8403556009', body='Case comment body.')
Source code in docs_src/capo_security_ir/_services/security_ir.py
def create_case_comment(
    self,
    case_id: "capo_security_ir.types.case_id.CaseId",
    body: "capo_security_ir.types.comment_body.CommentBody",
    *,
    config_overrides: Optional[SecurityIRClientConfig] = None,
    client_token: Optional[str] = None,
) -> (
    "capo_security_ir.types.create_case_comment_response.CreateCaseCommentResponse"
):
    """<p>Adds a comment to an existing case.</p>

    Args:
        case_id: <p>Required element used in combination with CreateCaseComment to specify a case ID.</p>
        client_token: <note> <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided. </p> </note>
        body: <p>Required element used in combination with CreateCaseComment to add content for the new comment.</p>

    Raises:
        capo_security_ir.errors.access_denied_exception.AccessDeniedException: <p/>
        capo_security_ir.errors.conflict_exception.ConflictException: <p/>
        capo_security_ir.errors.internal_server_exception.InternalServerException: <p/>
        capo_security_ir.errors.invalid_token_exception.InvalidTokenException: <p/>
        capo_security_ir.errors.resource_not_found_exception.ResourceNotFoundException: <p/>
        capo_security_ir.errors.security_incident_response_not_active_exception.SecurityIncidentResponseNotActiveException: <p/>
        capo_security_ir.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p/>
        capo_security_ir.errors.throttling_exception.ThrottlingException: <p/>
        capo_security_ir.errors.validation_exception.ValidationException: <p/>
        capo_security_ir.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Invoke CreateCaseComment

        >>> client.create_case_comment(case_id='8403556009', body='Case comment body.')
    """

    def _handler(
        req: "OperationRequest[capo_security_ir.types.create_case_comment_request.CreateCaseCommentRequest]",
    ) -> OperationResponse[
        "capo_security_ir.types.create_case_comment_response.CreateCaseCommentResponse"
    ]:
        import capo_security_ir._operations.security_incident_response.create_case_comment

        output, http_response = (
            capo_security_ir._operations.security_incident_response.create_case_comment.create_case_comment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_security_ir.types.create_case_comment_request.CreateCaseCommentRequest",
    ) -> dict[str, Any]:
        import capo_security_ir.types.create_case_comment_request

        return capo_security_ir.types.create_case_comment_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateCaseComment", redact_input=_redact_input),
    )
    input_: capo_security_ir.types.create_case_comment_request.CreateCaseCommentRequest = {
        "case_id": case_id,
        "body": body,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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