Skip to content

list_scans async

list_scans(
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListScansResponse

Returns a list of all scans in an account. Does not return EXPRESS scans.

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 100 results.

Raises:

Source code in docs_src/capo_codeguru_security/_services/async_code_guru_security.py
async def list_scans(
    self,
    *,
    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_scans_response.ListScansResponse":
    """<p>Returns a list of all scans in an account. Does not return <code>EXPRESS</code> scans.</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 100 results.</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_scans_request.ListScansRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_security.types.list_scans_response.ListScansResponse"
    ]:
        import capo_codeguru_security._operations.aws_code_guru_security.list_scans

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListScans")
    )
    input_: capo_codeguru_security.types.list_scans_request.ListScansRequest = {}
    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