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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from .language_info import LanguageInfo
from .language_pair_info import LanguagePairInfo


class LanguagesResponse_Pair(UncheckedBaseModel):
    kind: typing.Literal["pair"] = "pair"
    language_pairs: typing.List[LanguagePairInfo]

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


class LanguagesResponse_Single(UncheckedBaseModel):
    kind: typing.Literal["single"] = "single"
    languages: typing.List[LanguageInfo]

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


LanguagesResponse = typing_extensions.Annotated[
    typing.Union[LanguagesResponse_Pair, LanguagesResponse_Single], UnionMetadata(discriminant="kind")
]
