Skip to content

get_findings async

get_findings(
    scan_name: ScanName,
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
    status: Optional[Status] = None,
) -> GetFindingsResponse

Returns a list of all findings generated by a particular scan.

Parameters:

  • scan_name (ScanName) –

    The name of the scan you want to retrieve findings from.

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

  • status (Optional[Status], default: None ) –

    The status of the findings you want to get. Pass either Open, Closed, or All.

Raises:

Source code in docs_src/capo_codeguru_security/_services/async_code_guru_security.py
async def get_findings(
    self,
    scan_name: "capo_codeguru_security.types.scan_name.ScanName",
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
    next_token: Optional[
        "capo_codeguru_security.types.next_token.NextToken"
    ] = None,
    max_results: Optional[int] = None,
    status: Optional["capo_codeguru_security.types.status.Status"] = None,
) -> "capo_codeguru_security.types.get_findings_response.GetFindingsResponse":
    """<p>Returns a list of all findings generated by a particular scan.</p>

    Args:
        scan_name: <p>The name of the scan you want to retrieve findings from.</p>
        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>
        status: <p>The status of the findings you want to get. Pass either <code>Open</code>, <code>Closed</code>, or <code>All</code>.</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.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.</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.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request was not found.</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.get_findings_request.GetFindingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_security.types.get_findings_response.GetFindingsResponse"
    ]:
        import capo_codeguru_security._operations.aws_code_guru_security.get_findings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFindings")
    )
    input_: capo_codeguru_security.types.get_findings_request.GetFindingsRequest = {
        "scan_name": scan_name
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if status is not None:
        input_["status"] = status

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