createAuditSuppression method
Creates a Device Defender audit suppression.
Requires permission to access the CreateAuditSuppression action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ThrottlingException.
Parameter clientRequestToken :
Each audit supression must have a unique client request token. If you try
to create a new audit suppression with the same token as one that already
exists, an exception occurs. If you omit this value, Amazon Web Services
SDKs will automatically generate a unique client request.
Parameter description :
The description of the audit suppression.
Parameter expirationDate :
The epoch timestamp in seconds at which this suppression expires.
Parameter suppressIndefinitely :
Indicates whether a suppression should exist indefinitely or not.
Implementation
Future<void> createAuditSuppression({
required String checkName,
required ResourceIdentifier resourceIdentifier,
String? clientRequestToken,
String? description,
DateTime? expirationDate,
bool? suppressIndefinitely,
}) async {
final $payload = <String, dynamic>{
'checkName': checkName,
'resourceIdentifier': resourceIdentifier,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (expirationDate != null)
'expirationDate': unixTimestampToJson(expirationDate),
if (suppressIndefinitely != null)
'suppressIndefinitely': suppressIndefinitely,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/audit/suppressions/create',
exceptionFnMap: _exceptionFns,
);
}