startPHIDetectionJob method
Starts an asynchronous job to detect protected health information (PHI).
Use the DescribePHIDetectionJob operation to track the status
of a job.
May throw InternalServerException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
Parameter dataAccessRoleArn :
The Amazon Resource Name (ARN) of the AWS Identity and Access Management
(IAM) role that grants Amazon Comprehend Medical read access to your input
data. For more information, see
Role-Based Permissions Required for Asynchronous Operations.
Parameter inputDataConfig :
Specifies the format and location of the input data for the job.
Parameter languageCode :
The language of the input documents. All documents must be in the same
language.
Parameter outputDataConfig :
Specifies where to send the output files.
Parameter clientRequestToken :
A unique identifier for the request. If you don't set the client request
token, Amazon Comprehend Medical generates one.
Parameter jobName :
The identifier of the job.
Parameter kMSKey :
An AWS Key Management Service key to encrypt your output files. If you do
not specify a key, the files are written in plain text.
Implementation
Future<StartPHIDetectionJobResponse> startPHIDetectionJob({
required String dataAccessRoleArn,
required InputDataConfig inputDataConfig,
required LanguageCode languageCode,
required OutputDataConfig outputDataConfig,
String? clientRequestToken,
String? jobName,
String? kMSKey,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ComprehendMedical_20181030.StartPHIDetectionJob'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DataAccessRoleArn': dataAccessRoleArn,
'InputDataConfig': inputDataConfig,
'LanguageCode': languageCode.value,
'OutputDataConfig': outputDataConfig,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
if (jobName != null) 'JobName': jobName,
if (kMSKey != null) 'KMSKey': kMSKey,
},
);
return StartPHIDetectionJobResponse.fromJson(jsonResponse.body);
}