Skip to content

put_lexicon

Operation

put_lexicon

put_lexicon(request: PutLexiconInput | PutLexiconInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[PutLexiconInputDict]) -> PutLexiconOutput

Stores a pronunciation lexicon in an Amazon Web Services 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.

Overwriting a lexicon keeps its existing tags. You can specify tags only when you create a lexicon. If you specify tags for a lexicon that already exists, the request fails with a ValidationException. To change the tags of an existing lexicon, use TagResource and UntagResource.

For more information, see Managing Lexicons.

Parameters:

Name Type Description Default
request PutLexiconInput | PutLexiconInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[PutLexiconInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
PutLexiconOutput

An instance of PutLexiconOutput.

put_lexicon async

put_lexicon(request: PutLexiconInput | PutLexiconInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[PutLexiconInputDict]) -> PutLexiconOutput

Stores a pronunciation lexicon in an Amazon Web Services 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.

Overwriting a lexicon keeps its existing tags. You can specify tags only when you create a lexicon. If you specify tags for a lexicon that already exists, the request fails with a ValidationException. To change the tags of an existing lexicon, use TagResource and UntagResource.

For more information, see Managing Lexicons.

Parameters:

Name Type Description Default
request PutLexiconInput | PutLexiconInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[PutLexiconInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
PutLexiconOutput

An instance of PutLexiconOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

PutLexiconInputDict

Bases: TypedDict

Dictionary form of PutLexiconInput.

Attributes

content instance-attribute
content: Required[str]

Content of the PLS lexicon as string data.

name instance-attribute
name: Required[str]

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

tags instance-attribute
tags: Mapping[str, str] | None

The metadata that you apply to the lexicon to help you categorize and organize it. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. You can't replace the tags of an existing lexicon by overwriting it with PutLexicon.

PutLexiconInput dataclass

Bases: _SerdeShape

Dataclass for PutLexiconInput structure.

Attributes

content class-attribute instance-attribute
content: str | None = ...

Content of the PLS lexicon as string data.

name class-attribute instance-attribute
name: str | None = ...

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

tags class-attribute instance-attribute
tags: dict[str, str] | None = ...

The metadata that you apply to the lexicon to help you categorize and organize it. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. You can't replace the tags of an existing lexicon by overwriting it with PutLexicon.

Output

PutLexiconOutput dataclass

Bases: _SerdeShape

Dataclass for PutLexiconOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.