createArchiveRule method
Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.
To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the IAM User Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter analyzerName :
The name of the created analyzer.
Parameter filter :
The criteria for the rule.
Parameter ruleName :
The name of the rule to create.
Parameter clientToken :
A client token.
Implementation
Future<void> createArchiveRule({
required String analyzerName,
required Map<String, Criterion> filter,
required String ruleName,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'filter': filter,
'ruleName': ruleName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/analyzer/${Uri.encodeComponent(analyzerName)}/archive-rule',
exceptionFnMap: _exceptionFns,
);
}