listSpeakerEnrollmentJobs method

Future<ListSpeakerEnrollmentJobsResponse> listSpeakerEnrollmentJobs({
  1. required String domainId,
  2. SpeakerEnrollmentJobStatus? jobStatus,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all the speaker enrollment jobs in the domain with the specified JobStatus. If JobStatus is not provided, this lists all jobs with all possible speaker enrollment job statuses.

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

Parameter domainId : The identifier of the domain that contains the speaker enrollment jobs.

Parameter jobStatus : Provides the status of your speaker enrollment Job.

Parameter maxResults : The maximum number of results that are returned per call. You can use NextToken to obtain more pages of results. The default is 100; the maximum allowed page size is also 100.

Parameter nextToken : If NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.

Implementation

Future<ListSpeakerEnrollmentJobsResponse> listSpeakerEnrollmentJobs({
  required String domainId,
  SpeakerEnrollmentJobStatus? jobStatus,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'VoiceID.ListSpeakerEnrollmentJobs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainId': domainId,
      if (jobStatus != null) 'JobStatus': jobStatus.value,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListSpeakerEnrollmentJobsResponse.fromJson(jsonResponse.body);
}