createBatchPredictionJob method

Future<void> createBatchPredictionJob({
  1. required String detectorName,
  2. required String eventTypeName,
  3. required String iamRoleArn,
  4. required String inputPath,
  5. required String jobId,
  6. required String outputPath,
  7. String? detectorVersion,
  8. List<Tag>? tags,
})

Creates a batch prediction job.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter detectorName : The name of the detector.

Parameter eventTypeName : The name of the event type.

Parameter iamRoleArn : The ARN of the IAM role to use for this job request.

The IAM Role must have read permissions to your input S3 bucket and write permissions to your output S3 bucket. For more information about bucket permissions, see User policy examples in the Amazon S3 User Guide.

Parameter inputPath : The Amazon S3 location of your training file.

Parameter jobId : The ID of the batch prediction job.

Parameter outputPath : The Amazon S3 location of your output file.

Parameter detectorVersion : The detector version.

Parameter tags : A collection of key and value pairs.

Implementation

Future<void> createBatchPredictionJob({
  required String detectorName,
  required String eventTypeName,
  required String iamRoleArn,
  required String inputPath,
  required String jobId,
  required String outputPath,
  String? detectorVersion,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.CreateBatchPredictionJob'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'detectorName': detectorName,
      'eventTypeName': eventTypeName,
      'iamRoleArn': iamRoleArn,
      'inputPath': inputPath,
      'jobId': jobId,
      'outputPath': outputPath,
      if (detectorVersion != null) 'detectorVersion': detectorVersion,
      if (tags != null) 'tags': tags,
    },
  );
}