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

from ...core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
import datetime as dt
from .incident_response_escalation_rule import IncidentResponseEscalationRule
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


class IncidentResponseEscalationPolicy(UncheckedBaseModel):
    created_time: typing.Optional[int] = pydantic.Field(default=None)
    """
    A Unix timestamp in milliseconds representing the time the escalation policy was created.
    """

    created_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The human readable time the escalation policy was created.
    """

    desc: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the escalation policy.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the escalation policy.
    """

    escalation_rules: typing.Optional[typing.List[IncidentResponseEscalationRule]] = (
        pydantic.Field(default=None)
    )
    """
    The escalation rules for the escalation policy.
    """

    src_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    A deep-linked url to the escalation policy in a providers interface.
    """

    teams: typing.Optional[typing.List[IncidentResponseTeamUnion]] = pydantic.Field(
        default=None
    )
    """
    The teams that own the escalation policy.
    """

    uid: Id = pydantic.Field()
    """
    The unique identifier for the escalation policy.
    """

    updated_time: typing.Optional[int] = pydantic.Field(default=None)
    """
    A Unix timestamp in milliseconds representing the time the escalation policy was last updated.
    """

    updated_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The human readable time the escalation policy was last updated.
    """

    unmapped: typing.Optional[Object] = pydantic.Field(default=None)
    """
    The attributes that are not mapped to the incident response user schema. The names and values of those attributes are specific to each provider.
    """

    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
