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

import datetime as dt
import typing
import uuid

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata


class NotificationLog(UniversalBaseModel):
    id: uuid.UUID = pydantic.Field()
    """
    The unique identifier for the notification.
    """

    org_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="orgId")] = pydantic.Field(
        default=None
    )
    """
    The ID of the organization that the notification belongs to.
    """

    paypoint_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="paypointId")] = pydantic.Field(
        default=None
    )
    """
    The ID of the paypoint that the notification is related to.
    """

    notification_event: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="notificationEvent")] = (
        pydantic.Field(default=None)
    )
    """
    The event that triggered the notification.
    """

    target: typing.Optional[str] = pydantic.Field(default=None)
    """
    The target URL for the notification.
    """

    response_status: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="responseStatus")] = (
        pydantic.Field(default=None)
    )
    """
    The HTTP response status of the notification.
    """

    success: bool = pydantic.Field()
    """
    Indicates whether the notification was successful.
    """

    job_data: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="jobData")] = pydantic.Field(
        default=None
    )
    """
    Contains the body of the notification.
    """

    created_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdDate")] = pydantic.Field()
    """
    The date and time when the notification was created.
    """

    success_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="successDate")] = (
        pydantic.Field(default=None)
    )
    """
    The date and time when the notification was successfully delivered.
    """

    last_failed_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="lastFailedDate")
    ] = pydantic.Field(default=None)
    """
    The date and time when the notification last failed.
    """

    is_in_progress: typing_extensions.Annotated[bool, FieldMetadata(alias="isInProgress")] = pydantic.Field()
    """
    Indicates whether the notification is currently in progress.
    """

    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
