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

from __future__ import annotations
from ...core.unchecked_base_model import UncheckedBaseModel
import typing
from .incident_response_team_union import IncidentResponseTeamUnion
from ...common.types.id import Id
from ...engine.types.object import Object
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from .incident_response_user_union import IncidentResponseUserUnion
import typing_extensions
from ...core.unchecked_base_model import UnionMetadata


class IncidentResponseEscalationTargetUnion_IncidentResponseUser(UncheckedBaseModel):
    type: typing.Literal["incident_response_user"] = "incident_response_user"
    email_addr: typing.Optional[str] = None
    teams: typing.Optional[typing.List[IncidentResponseTeamUnion]] = None
    name: typing.Optional[str] = None
    uid: Id
    timezone: typing.Optional[str] = None
    job_title: typing.Optional[str] = None
    src_url: typing.Optional[str] = None
    unmapped: typing.Optional[Object] = None

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

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


class IncidentResponseEscalationTargetUnion_IncidentResponseTeam(UncheckedBaseModel):
    type: typing.Literal["incident_response_team"] = "incident_response_team"
    desc: typing.Optional[str] = None
    name: typing.Optional[str] = None
    src_url: typing.Optional[str] = None
    uid: Id
    unmapped: typing.Optional[Object] = None

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

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


class IncidentResponseEscalationTargetUnion_IncidentResponseSchedule(
    UncheckedBaseModel
):
    type: typing.Literal["incident_response_schedule"] = "incident_response_schedule"
    desc: typing.Optional[str] = None
    name: typing.Optional[str] = None
    src_url: typing.Optional[str] = None
    uid: Id
    teams: typing.Optional[typing.List[IncidentResponseTeamUnion]] = None
    users: typing.Optional[typing.List[IncidentResponseUserUnion]] = None
    unmapped: typing.Optional[Object] = None

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

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


class IncidentResponseEscalationTargetUnion_IncidentResponseUserReference(
    UncheckedBaseModel
):
    type: typing.Literal["incident_response_user_reference"] = (
        "incident_response_user_reference"
    )
    name: typing.Optional[str] = None
    desc: typing.Optional[str] = None
    uid: Id
    src_url: typing.Optional[str] = None

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

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


class IncidentResponseEscalationTargetUnion_IncidentResponseTeamReference(
    UncheckedBaseModel
):
    type: typing.Literal["incident_response_team_reference"] = (
        "incident_response_team_reference"
    )
    name: typing.Optional[str] = None
    desc: typing.Optional[str] = None
    uid: Id
    src_url: typing.Optional[str] = None

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

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


class IncidentResponseEscalationTargetUnion_IncidentResponseScheduleReference(
    UncheckedBaseModel
):
    type: typing.Literal["incident_response_schedule_reference"] = (
        "incident_response_schedule_reference"
    )
    name: typing.Optional[str] = None
    desc: typing.Optional[str] = None
    uid: Id
    src_url: typing.Optional[str] = None

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

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


IncidentResponseEscalationTargetUnion = typing_extensions.Annotated[
    typing.Union[
        IncidentResponseEscalationTargetUnion_IncidentResponseUser,
        IncidentResponseEscalationTargetUnion_IncidentResponseTeam,
        IncidentResponseEscalationTargetUnion_IncidentResponseSchedule,
        IncidentResponseEscalationTargetUnion_IncidentResponseUserReference,
        IncidentResponseEscalationTargetUnion_IncidentResponseTeamReference,
        IncidentResponseEscalationTargetUnion_IncidentResponseScheduleReference,
    ],
    UnionMetadata(discriminant="type"),
]
