updateDetector method
Future<void>
updateDetector({
- required String detectorId,
- DataSourceConfigurations? dataSources,
- bool? enable,
- FindingPublishingFrequency? findingPublishingFrequency,
Updates the Amazon GuardDuty detector specified by the detectorId.
May throw BadRequestException. May throw InternalServerErrorException.
Parameter detectorId
:
The unique ID of the detector to update.
Parameter dataSources
:
Describes which data sources will be updated.
Parameter enable
:
Specifies whether the detector is enabled or not enabled.
Parameter findingPublishingFrequency
:
An enum value that specifies how frequently findings are exported, such as
to CloudWatch Events.
Implementation
Future<void> updateDetector({
required String detectorId,
DataSourceConfigurations? dataSources,
bool? enable,
FindingPublishingFrequency? findingPublishingFrequency,
}) async {
ArgumentError.checkNotNull(detectorId, 'detectorId');
_s.validateStringLength(
'detectorId',
detectorId,
1,
300,
isRequired: true,
);
final $payload = <String, dynamic>{
if (dataSources != null) 'dataSources': dataSources,
if (enable != null) 'enable': enable,
if (findingPublishingFrequency != null)
'findingPublishingFrequency': findingPublishingFrequency.toValue(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/detector/${Uri.encodeComponent(detectorId)}',
exceptionFnMap: _exceptionFns,
);
}