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

from __future__ import annotations

import typing

from ...credentials.types.basic_credential import BasicCredential
from ...credentials.types.basic_credential_id import BasicCredentialId

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class OpenSearchCredential_Basic(BasicCredential):
    type: typing.Literal["basic"]

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


class OpenSearchCredential_BasicId(pydantic.BaseModel):
    type: typing.Literal["basic_id"]
    value: BasicCredentialId

    class Config:
        frozen = True
        smart_union = True


OpenSearchCredential = typing.Union[OpenSearchCredential_Basic, OpenSearchCredential_BasicId]
