stopKeyPhrasesDetectionJob method
Stops a key phrases detection job in progress.
If the job state is IN_PROGRESS
the job is 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 stopped and put into
the STOPPED
state.
If the job is in the COMPLETED
or FAILED
state
when you call the StopDominantLanguageDetectionJob
operation,
the operation returns a 400 Internal Request Exception.
When a job is stopped, any documents already processed are written to the output location.
May throw InvalidRequestException. May throw JobNotFoundException. May throw InternalServerException.
Parameter jobId
:
The identifier of the key phrases detection job to stop.
Implementation
Future<StopKeyPhrasesDetectionJobResponse> stopKeyPhrasesDetectionJob({
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': 'Comprehend_20171127.StopKeyPhrasesDetectionJob'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobId': jobId,
},
);
return StopKeyPhrasesDetectionJobResponse.fromJson(jsonResponse.body);
}