putLexicon method

Future<void> putLexicon({
  1. required String content,
  2. required String name,
})

Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.

For more information, see Managing Lexicons.

May throw InvalidLexiconException. May throw UnsupportedPlsAlphabetException. May throw UnsupportedPlsLanguageException. May throw LexiconSizeExceededException. May throw MaxLexemeLengthExceededException. May throw MaxLexiconsNumberExceededException. May throw ServiceFailureException.

Parameter content : Content of the PLS lexicon as string data.

Parameter name : Name of the lexicon. The name must follow the regular express format 0-9A-Za-z{1,20}. That is, the name is a case-sensitive alphanumeric string up to 20 characters long.

Implementation

Future<void> putLexicon({
  required String content,
  required String name,
}) async {
  ArgumentError.checkNotNull(content, 'content');
  ArgumentError.checkNotNull(name, 'name');
  final $payload = <String, dynamic>{
    'Content': content,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v1/lexicons/${Uri.encodeComponent(name)}',
    exceptionFnMap: _exceptionFns,
  );
}