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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .posted_webhook_event_type import PostedWebhookEventType
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class PostedWebhookSpec(UniversalBaseModel):
    """
    URL and settings for a specific webhook to be posted to the server
    """

    url: str = pydantic.Field()
    """
    URL to send the webhook to
    """

    events: typing.List[PostedWebhookEventType] = pydantic.Field()
    """
    Events this URL is subscribed to
    """

    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
