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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import datetime as dt
import pydantic
from .user_simple import UserSimple
from .reason_enum import ReasonEnum
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Pause(UncheckedBaseModel):
    """
    A ModelSerializer that takes additional arguments for
    "fields", "omit" and "expand" in order to
    control which fields are displayed, and whether to replace simple
    values with complex, nested serializations
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when this pause record was created
    """

    deleted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when this pause record was soft-deleted
    """

    deleted_by: typing.Optional[int] = pydantic.Field(default=None)
    """
    User who soft-deleted this pause record
    """

    id: typing.Optional[int] = None
    paused_by: typing.Optional[UserSimple] = None
    project: typing.Optional[int] = pydantic.Field(default=None)
    """
    Related project for which the pause is set
    """

    reason: ReasonEnum = pydantic.Field()
    """
    Reason for pausing
    
    * `MANUAL` - Manual
    * `BEHAVIOR_BASED` - Behavior-based
    * `ANNOTATOR_EVALUATION` - Annotator evaluation
    * `ANNOTATION_LIMIT` - Annotation limit
    * `CUSTOM_SCRIPT` - Custom script
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when this pause record was last updated
    """

    user: typing.Optional[int] = pydantic.Field(default=None)
    """
    User who is paused
    """

    verbose_reason: typing.Optional[str] = pydantic.Field(default=None)
    """
    Detailed description of why the project is paused, will be readable by paused annotators
    """

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

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