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

from __future__ import annotations

import typing

from ...credentials.types.o_auth_client_credential import OAuthClientCredential
from ...credentials.types.o_auth_client_credential_id import OAuthClientCredentialId
from ...credentials.types.secret_credential import SecretCredential
from ...credentials.types.secret_credential_id import SecretCredentialId

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


class TeamsCredential_OAuthClient(OAuthClientCredential):
    type: typing.Literal["o_auth_client"]

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


class TeamsCredential_OAuthClientId(pydantic.BaseModel):
    type: typing.Literal["o_auth_client_id"]
    value: OAuthClientCredentialId

    class Config:
        frozen = True
        smart_union = True


class TeamsCredential_WebhookUrl(SecretCredential):
    type: typing.Literal["webhook_url"]

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


class TeamsCredential_WebhookUrlId(pydantic.BaseModel):
    type: typing.Literal["webhook_url_id"]
    value: SecretCredentialId

    class Config:
        frozen = True
        smart_union = True


TeamsCredential = typing.Union[
    TeamsCredential_OAuthClient, TeamsCredential_OAuthClientId, TeamsCredential_WebhookUrl, TeamsCredential_WebhookUrlId
]
