Skip to content

list_comments async

list_comments(
    case_id: CaseId,
    *,
    config_overrides: Optional[AsyncSecurityIRClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> ListCommentsResponse

Returns comments for a designated case.

Parameters:

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

    An optional string that, if supplied, must be copied from the output of a previous call to ListComments. When provided in this manner, the API fetches the next page of results.

  • max_results (Optional[int], default: None ) –

    Optional element for ListComments to limit the number of responses.

  • case_id (CaseId) –

    Required element for ListComments to designate the case to query.

Raises:

Examples:

Invoke ListComments

>>> await client.list_comments(case_id='8403556009')
Source code in docs_src/capo_security_ir/_services/async_security_ir.py
async def list_comments(
    self,
    case_id: "capo_security_ir.types.case_id.CaseId",
    *,
    config_overrides: Optional[AsyncSecurityIRClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> "capo_security_ir.types.list_comments_response.ListCommentsResponse":
    """<p>Returns comments for a designated case.</p>

    Args:
        next_token: <p>An optional string that, if supplied, must be copied from the output of a previous call to ListComments. When provided in this manner, the API fetches the next page of results. </p>
        max_results: <p>Optional element for ListComments to limit the number of responses.</p>
        case_id: <p>Required element for ListComments to designate the case to query.</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 ListComments

        >>> await client.list_comments(case_id='8403556009')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_security_ir.types.list_comments_request.ListCommentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_security_ir.types.list_comments_response.ListCommentsResponse"
    ]:
        import capo_security_ir._operations.security_incident_response.list_comments

        (
            output,
            http_response,
        ) = await capo_security_ir._operations.security_incident_response.list_comments.async_list_comments(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_security_ir.types.list_comments_response.ListCommentsResponse",
    ) -> dict[str, Any]:
        import capo_security_ir.types.list_comments_response

        return capo_security_ir.types.list_comments_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListComments", redact_output=_redact_output),
    )
    input_: capo_security_ir.types.list_comments_request.ListCommentsRequest = {
        "case_id": case_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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