Skip to content

list_malware_scans async

list_malware_scans(
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[String] = None,
    filter_criteria: Optional[ListMalwareScansFilterCriteria] = None,
    sort_criteria: Optional[SortCriteria] = None,
) -> ListMalwareScansResponse

Returns a list of malware scans. Each member account can view the malware scans for their own accounts. An administrator can view the malware scans for all of its members' accounts.

Parameters:

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

    You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 50. The maximum value is 50.

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

    You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing results.

  • filter_criteria (Optional[ListMalwareScansFilterCriteria], default: None ) –

    Represents the criteria used to filter the malware scan entries.

  • sort_criteria (Optional[SortCriteria], default: None ) –

    Represents the criteria used for sorting malware scan entries.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def list_malware_scans(
    self,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    max_results: Optional["capo_guardduty.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_guardduty.types.string.String"] = None,
    filter_criteria: Optional[
        "capo_guardduty.types.list_malware_scans_filter_criteria.ListMalwareScansFilterCriteria"
    ] = None,
    sort_criteria: Optional[
        "capo_guardduty.types.sort_criteria.SortCriteria"
    ] = None,
) -> "capo_guardduty.types.list_malware_scans_response.ListMalwareScansResponse":
    """<p>Returns a list of malware scans. Each member account can view the malware scans for their own accounts. An administrator can view the malware scans for all of its members' accounts.</p>

    Args:
        max_results: <p>You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 50. The maximum value is 50.</p>
        next_token: <p>You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing results.</p>
        filter_criteria: <p>Represents the criteria used to filter the malware scan entries.</p>
        sort_criteria: <p>Represents the criteria used for sorting malware scan entries.</p>

    Raises:
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_guardduty.types.list_malware_scans_request.ListMalwareScansRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.list_malware_scans_response.ListMalwareScansResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.list_malware_scans

        (
            output,
            http_response,
        ) = await capo_guardduty._operations.guard_duty_api_service.list_malware_scans.async_list_malware_scans(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMalwareScans")
    )
    input_: capo_guardduty.types.list_malware_scans_request.ListMalwareScansRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filter_criteria is not None:
        input_["filter_criteria"] = filter_criteria
    if sort_criteria is not None:
        input_["sort_criteria"] = sort_criteria

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