createSampleFindings method

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

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

May throw BadRequestException. May throw InternalServerErrorException.

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

Parameter findingTypes : The types of sample findings to generate.

Implementation

Future<void> createSampleFindings({
  required String detectorId,
  List<String>? findingTypes,
}) async {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    300,
    isRequired: true,
  );
  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,
  );
}