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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .invoice_detail_object_history_item_user import InvoiceDetailObjectHistoryItemUser


class InvoiceDetailObjectHistoryItem(UniversalBaseModel):
    id: typing.Optional[int] = pydantic.Field(default=None)
    """
    History log entry ID
    """

    date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp of the history event
    """

    reason: typing.Optional[str] = pydantic.Field(default=None)
    """
    Type of action that occurred
    """

    message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Details about the action
    """

    user: typing.Optional[InvoiceDetailObjectHistoryItemUser] = pydantic.Field(default=None)
    """
    User who performed the action
    """

    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
