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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.serialization import FieldMetadata
from ...core.unchecked_base_model import UncheckedBaseModel
from .webhook_agent import WebhookAgent
from .webhook_subscription_populated_event_type import WebhookSubscriptionPopulatedEventType


class WebhookSubscriptionPopulated(UncheckedBaseModel):
    id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="_id"),
        pydantic.Field(alias="_id", description="The unique identifier for the subscription"),
    ] = None
    webhook_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="webhookId"),
        pydantic.Field(alias="webhookId", description="The ID of the webhook"),
    ] = None
    agent_id: typing_extensions.Annotated[
        typing.Optional[WebhookAgent],
        FieldMetadata(alias="agentId"),
        pydantic.Field(alias="agentId", description="The populated agent details, or null if not assigned"),
    ] = None
    event_type: typing_extensions.Annotated[
        typing.Optional[WebhookSubscriptionPopulatedEventType],
        FieldMetadata(alias="eventType"),
        pydantic.Field(alias="eventType", description="The type of event subscribed to"),
    ] = None
    created_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="createdAt"),
        pydantic.Field(alias="createdAt", description="The date and time when the subscription was created"),
    ] = None
    updated_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="updatedAt"),
        pydantic.Field(alias="updatedAt", description="The date and time when the subscription was last updated"),
    ] = 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
