Skip to content

list_findings_metrics async

list_findings_metrics(
    start_date: datetime,
    end_date: datetime,
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListFindingsMetricsResponse

Returns metrics about all findings in an account within a specified time range.

Parameters:

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

    A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

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

    The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the nextToken element is returned in the response. Use nextToken in a subsequent request to retrieve additional results. If not specified, returns 1000 results.

  • start_date (datetime) –

    The start date of the interval which you want to retrieve metrics from. Rounds to the nearest day.

  • end_date (datetime) –

    The end date of the interval which you want to retrieve metrics from. Round to the nearest day.

Raises:

Source code in docs_src/capo_codeguru_security/_services/async_code_guru_security.py
async def list_findings_metrics(
    self,
    start_date: datetime.datetime,
    end_date: datetime.datetime,
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
    next_token: Optional[
        "capo_codeguru_security.types.next_token.NextToken"
    ] = None,
    max_results: Optional[int] = None,
) -> "capo_codeguru_security.types.list_findings_metrics_response.ListFindingsMetricsResponse":
    """<p>Returns metrics about all findings in an account within a specified time range.</p>

    Args:
        next_token: <p>A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the <code>nextToken</code> value returned from the previous request to continue listing results after the first page.</p>
        max_results: <p>The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the <code>nextToken</code> element is returned in the response. Use <code>nextToken</code> in a subsequent request to retrieve additional results. If not specified, returns 1000 results.</p>
        start_date: <p>The start date of the interval which you want to retrieve metrics from. Rounds to the nearest day.</p>
        end_date: <p>The end date of the interval which you want to retrieve metrics from. Round to the nearest day.</p>

    Raises:
        capo_codeguru_security.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_codeguru_security.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_codeguru_security.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codeguru_security.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_codeguru_security.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguru_security.types.list_findings_metrics_request.ListFindingsMetricsRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_security.types.list_findings_metrics_response.ListFindingsMetricsResponse"
    ]:
        import capo_codeguru_security._operations.aws_code_guru_security.list_findings_metrics

        (
            output,
            http_response,
        ) = await capo_codeguru_security._operations.aws_code_guru_security.list_findings_metrics.async_list_findings_metrics(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFindingsMetrics")
    )
    input_: capo_codeguru_security.types.list_findings_metrics_request.ListFindingsMetricsRequest = {
        "start_date": start_date,
        "end_date": end_date,
    }
    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