listScanJobSummaries method
This is a request for a summary of scan jobs created or running within the most recent 30 days.
May throw InvalidParameterValueException.
May throw ServiceUnavailableException.
Parameter accountId :
Returns the job count for the specified account.
If the request is sent from a member account or an account not part of Amazon Web Services Organizations, jobs within requestor's account will be returned.
Root, admin, and delegated administrator accounts can use the value
ANY to return job counts from every account in the
organization.
AGGREGATE_ALL aggregates job counts from all accounts within
the authenticated organization, then returns the sum.
Parameter aggregationPeriod :
The period for the returned results.
-
ONE_DAYThe daily job count for the prior 1 day. -
SEVEN_DAYSThe daily job count for the prior 7 days. -
FOURTEEN_DAYSThe daily job count for the prior 14 days.
Parameter malwareScanner :
Returns only the scan jobs for the specified malware scanner. Currently
the only MalwareScanner is GUARDDUTY. But the field also
supports ANY, and AGGREGATE_ALL.
Parameter maxResults :
The maximum number of items to be returned.
The value is an integer. Range of accepted values is from 1 to 500.
Parameter nextToken :
The next item following a partial list of returned items. For example, if
a request is made to return MaxResults number of items,
NextToken allows you to return more items in your list
starting at the location pointed to by the next token.
Parameter resourceType :
Returns the job count for the specified resource type. Use request
GetSupportedResourceTypes to obtain strings for supported
resource types.
The the value ANY returns count of all resource types.
AGGREGATE_ALL aggregates job counts for all resource types
and returns the sum.
Parameter scanResultStatus :
Returns only the scan jobs for the specified scan results.
Parameter state :
Returns only the scan jobs for the specified scanning job state.
Implementation
Future<ListScanJobSummariesOutput> listScanJobSummaries({
String? accountId,
AggregationPeriod? aggregationPeriod,
MalwareScanner? malwareScanner,
int? maxResults,
String? nextToken,
String? resourceType,
ScanResultStatus? scanResultStatus,
ScanJobStatus? state,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
if (accountId != null) 'AccountId': [accountId],
if (aggregationPeriod != null)
'AggregationPeriod': [aggregationPeriod.value],
if (malwareScanner != null) 'MalwareScanner': [malwareScanner.value],
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (resourceType != null) 'ResourceType': [resourceType],
if (scanResultStatus != null)
'ScanResultStatus': [scanResultStatus.value],
if (state != null) 'State': [state.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/audit/scan-job-summaries',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListScanJobSummariesOutput.fromJson(response);
}