startFraudsterRegistrationJob method

Future<StartFraudsterRegistrationJobResponse> startFraudsterRegistrationJob({
  1. required String dataAccessRoleArn,
  2. required String domainId,
  3. required InputDataConfig inputDataConfig,
  4. required OutputDataConfig outputDataConfig,
  5. String? clientToken,
  6. String? jobName,
  7. RegistrationConfig? registrationConfig,
})

Starts a new batch fraudster registration job using provided details.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dataAccessRoleArn : The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets to read the input manifest file and write the Job output file. Refer to the Create and edit a fraudster watchlist documentation for the permissions needed in this role.

Parameter domainId : The identifier of the domain that contains the fraudster registration job and in which the fraudsters are registered.

Parameter inputDataConfig : The input data config containing an S3 URI for the input manifest file that contains the list of fraudster registration requests.

Parameter outputDataConfig : The output data config containing the S3 location where Voice ID writes the job output file; you must also include a KMS key ID to encrypt the file.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter jobName : The name of the new fraudster registration job.

Parameter registrationConfig : The registration config containing details such as the action to take when a duplicate fraudster is detected, and the similarity threshold to use for detecting a duplicate fraudster.

Implementation

Future<StartFraudsterRegistrationJobResponse> startFraudsterRegistrationJob({
  required String dataAccessRoleArn,
  required String domainId,
  required InputDataConfig inputDataConfig,
  required OutputDataConfig outputDataConfig,
  String? clientToken,
  String? jobName,
  RegistrationConfig? registrationConfig,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'VoiceID.StartFraudsterRegistrationJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DataAccessRoleArn': dataAccessRoleArn,
      'DomainId': domainId,
      'InputDataConfig': inputDataConfig,
      'OutputDataConfig': outputDataConfig,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (jobName != null) 'JobName': jobName,
      if (registrationConfig != null)
        'RegistrationConfig': registrationConfig,
    },
  );

  return StartFraudsterRegistrationJobResponse.fromJson(jsonResponse.body);
}