# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import typing_extensions

from ...core.unchecked_base_model import UnionMetadata
from ...types.pronunciation_dictionary_alias_rule_request_model import PronunciationDictionaryAliasRuleRequestModel
from ...types.pronunciation_dictionary_phoneme_rule_request_model import PronunciationDictionaryPhonemeRuleRequestModel


class BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPostRulesItem_Alias(
    PronunciationDictionaryAliasRuleRequestModel
):
    type: typing.Literal["alias"] = "alias"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPostRulesItem_Phoneme(
    PronunciationDictionaryPhonemeRuleRequestModel
):
    type: typing.Literal["phoneme"] = "phoneme"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPostRulesItem = typing_extensions.Annotated[
    typing.Union[
        BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPostRulesItem_Alias,
        BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPostRulesItem_Phoneme,
    ],
    UnionMetadata(discriminant="type"),
]
