createSampleFindings method

Future<void> createSampleFindings({
  1. required String detectorId,
  2. List<String>? findingTypes,
})

Generates sample findings of types specified by the list of finding types. If 'NULL' is specified for findingTypes, the API generates sample findings of all supported finding types.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The ID of the detector for which you need to create sample findings.

To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

Parameter findingTypes : The types of sample findings to generate.

Implementation

Future<void> createSampleFindings({
  required String detectorId,
  List<String>? findingTypes,
}) async {
  final $payload = <String, dynamic>{
    if (findingTypes != null) 'findingTypes': findingTypes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/detector/${Uri.encodeComponent(detectorId)}/findings/create',
    exceptionFnMap: _exceptionFns,
  );
}