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

from __future__ import annotations

import typing

from ...credentials.types.bridge_secret_credential import BridgeSecretCredential
from ...credentials.types.bridge_secret_credential_id import BridgeSecretCredentialId

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


class ElasticsearchBridgeSharedSecret_BridgeSecret(BridgeSecretCredential):
    type: typing.Literal["bridge_secret"]

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


class ElasticsearchBridgeSharedSecret_BridgeSecretId(pydantic.BaseModel):
    type: typing.Literal["bridge_secret_id"]
    value: BridgeSecretCredentialId

    class Config:
        frozen = True
        smart_union = True


ElasticsearchBridgeSharedSecret = typing.Union[
    ElasticsearchBridgeSharedSecret_BridgeSecret, ElasticsearchBridgeSharedSecret_BridgeSecretId
]
