# 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 .webhook_event_object_event_type import WebhookEventObjectEventType


class WebhookEventObject(UniversalBaseModel):
    id: str
    event_type: WebhookEventObjectEventType
    alert_id: str
    workspace_id: str
    user_name: str
    payload: typing.Dict[str, typing.Optional[typing.Any]]
    created_at: dt.datetime
    max_retries: typing.Optional[int] = None
    url: str
    secret: typing.Optional[str] = None
    headers: typing.Optional[typing.Dict[str, str]] = None

    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
