startMediaAnalysisJob method
Initiates a new media analysis job. Accepts a manifest file in an Amazon S3 bucket. The output is a manifest file and a summary of the manifest stored in the Amazon S3 bucket.
May throw AccessDeniedException.
May throw IdempotentParameterMismatchException.
May throw InternalServerError.
May throw InvalidManifestException.
May throw InvalidParameterException.
May throw InvalidS3ObjectException.
May throw LimitExceededException.
May throw ProvisionedThroughputExceededException.
May throw ResourceNotFoundException.
May throw ResourceNotReadyException.
May throw ThrottlingException.
Parameter input :
Input data to be analyzed by the job.
Parameter operationsConfig :
Configuration options for the media analysis job to be created.
Parameter outputConfig :
The Amazon S3 bucket location to store the results.
Parameter clientRequestToken :
Idempotency token used to prevent the accidental creation of duplicate
versions. If you use the same token with multiple
StartMediaAnalysisJobRequest requests, the same response is
returned. Use ClientRequestToken to prevent the same request
from being processed more than once.
Parameter jobName :
The name of the job. Does not have to be unique.
Parameter kmsKeyId :
The identifier of customer managed AWS KMS key (name or ARN). The key is
used to encrypt images copied into the service. The key is also used to
encrypt results and manifest files written to the output Amazon S3 bucket.
Implementation
Future<StartMediaAnalysisJobResponse> startMediaAnalysisJob({
required MediaAnalysisInput input,
required MediaAnalysisOperationsConfig operationsConfig,
required MediaAnalysisOutputConfig outputConfig,
String? clientRequestToken,
String? jobName,
String? kmsKeyId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RekognitionService.StartMediaAnalysisJob'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Input': input,
'OperationsConfig': operationsConfig,
'OutputConfig': outputConfig,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
if (jobName != null) 'JobName': jobName,
if (kmsKeyId != null) 'KmsKeyId': kmsKeyId,
},
);
return StartMediaAnalysisJobResponse.fromJson(jsonResponse.body);
}