stopTextTranslationJob method
Stops an asynchronous batch translation job that is in progress.
If the job's state is IN_PROGRESS
, the job will be marked for
termination and put into the STOP_REQUESTED
state. If the job
completes before it can be stopped, it is put into the
COMPLETED
state. Otherwise, the job is put into the
STOPPED
state.
Asynchronous batch translation jobs are started with the
StartTextTranslationJob operation. You can use the
DescribeTextTranslationJob or ListTextTranslationJobs
operations to get a batch translation job's JobId
.
May throw ResourceNotFoundException. May throw TooManyRequestsException. May throw InternalServerException.
Parameter jobId
:
The job ID of the job to be stopped.
Implementation
Future<StopTextTranslationJobResponse> stopTextTranslationJob({
required String jobId,
}) async {
ArgumentError.checkNotNull(jobId, 'jobId');
_s.validateStringLength(
'jobId',
jobId,
1,
32,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSShineFrontendService_20170701.StopTextTranslationJob'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobId': jobId,
},
);
return StopTextTranslationJobResponse.fromJson(jsonResponse.body);
}