startSpeakerSearchTask method

Future<StartSpeakerSearchTaskResponse> startSpeakerSearchTask({
  1. required String transactionId,
  2. required String voiceConnectorId,
  3. required String voiceProfileDomainId,
  4. CallLegType? callLeg,
  5. String? clientRequestToken,
})

Starts a speaker search task.

May throw AccessDeniedException. May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw GoneException. May throw NotFoundException. May throw ResourceLimitExceededException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException. May throw UnprocessableEntityException.

Parameter transactionId : The transaction ID of the call being analyzed.

Parameter voiceConnectorId : The Voice Connector ID.

Parameter voiceProfileDomainId : The ID of the voice profile domain that will store the voice profile.

Parameter callLeg : Specifies which call leg to stream for speaker search.

Parameter clientRequestToken : The unique identifier for the client request. Use a different token for different speaker search tasks.

Implementation

Future<StartSpeakerSearchTaskResponse> startSpeakerSearchTask({
  required String transactionId,
  required String voiceConnectorId,
  required String voiceProfileDomainId,
  CallLegType? callLeg,
  String? clientRequestToken,
}) async {
  final $payload = <String, dynamic>{
    'TransactionId': transactionId,
    'VoiceProfileDomainId': voiceProfileDomainId,
    if (callLeg != null) 'CallLeg': callLeg.value,
    if (clientRequestToken != null) 'ClientRequestToken': clientRequestToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/voice-connectors/${Uri.encodeComponent(voiceConnectorId)}/speaker-search-tasks',
    exceptionFnMap: _exceptionFns,
  );
  return StartSpeakerSearchTaskResponse.fromJson(response);
}