startJob method
StartJob starts a new asynchronous bulk processing job. You
specify the input data location in Amazon S3, the action to perform, and
the output location where results are written.
For more information, see Job concepts in the Amazon Location Service Developer Guide.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter action :
The action to perform on the input data.
Parameter executionRoleArn :
The Amazon Resource Name (ARN) of the IAM role that Amazon Location
Service assumes during job processing. Amazon Location Service uses this
role to access the input and output locations specified for the job.
For more information about configuring IAM roles for Amazon Location jobs,
see Configure
IAM permissions in the Amazon Location Service Developer Guide.
Parameter inputOptions :
Configuration for input data location and format.
Parameter outputOptions :
Configuration for output data location and format.
Parameter actionOptions :
Additional parameters that can be requested for each result.
Parameter clientToken :
A unique identifier for this request to ensure idempotency.
Parameter name :
An optional name for the job resource.
Parameter tags :
Tags and corresponding values to be associated with the job.
Implementation
Future<StartJobResponse> startJob({
required JobAction action,
required String executionRoleArn,
required JobInputOptions inputOptions,
required JobOutputOptions outputOptions,
JobActionOptions? actionOptions,
String? clientToken,
String? name,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Action': action.value,
'ExecutionRoleArn': executionRoleArn,
'InputOptions': inputOptions,
'OutputOptions': outputOptions,
if (actionOptions != null) 'ActionOptions': actionOptions,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (name != null) 'Name': name,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/metadata/v0/jobs',
exceptionFnMap: _exceptionFns,
);
return StartJobResponse.fromJson(response);
}