startVoiceToneAnalysisTask method

Future<StartVoiceToneAnalysisTaskResponse> startVoiceToneAnalysisTask({
  1. required String identifier,
  2. required VoiceAnalyticsLanguageCode languageCode,
  3. String? clientRequestToken,
  4. KinesisVideoStreamSourceTaskConfiguration? kinesisVideoStreamSourceTaskConfiguration,
})

Starts a voice tone analysis task. For more information about voice tone analysis, see Using Amazon Chime SDK voice analytics in the Amazon Chime SDK Developer Guide.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw NotFoundException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter identifier : The unique identifier of the resource to be updated. Valid values include the ID and ARN of the media insights pipeline.

Parameter languageCode : The language code.

Parameter clientRequestToken : The unique identifier for the client request. Use a different token for different voice tone analysis tasks.

Parameter kinesisVideoStreamSourceTaskConfiguration : The task configuration for the Kinesis video stream source of the media insights pipeline.

Implementation

Future<StartVoiceToneAnalysisTaskResponse> startVoiceToneAnalysisTask({
  required String identifier,
  required VoiceAnalyticsLanguageCode languageCode,
  String? clientRequestToken,
  KinesisVideoStreamSourceTaskConfiguration?
      kinesisVideoStreamSourceTaskConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'LanguageCode': languageCode.value,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (kinesisVideoStreamSourceTaskConfiguration != null)
      'KinesisVideoStreamSourceTaskConfiguration':
          kinesisVideoStreamSourceTaskConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/voice-tone-analysis-tasks?operation=start',
    exceptionFnMap: _exceptionFns,
  );
  return StartVoiceToneAnalysisTaskResponse.fromJson(response);
}