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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .error import Error
from .subscription_test_result import SubscriptionTestResult


class TestWebhookSubscriptionResponse(UncheckedBaseModel):
    """
    Defines the fields that are included in the response body of a request to the TestWebhookSubscription endpoint.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Information on errors encountered during the request.
    """

    subscription_test_result: typing.Optional[SubscriptionTestResult] = pydantic.Field(default=None)
    """
    The [SubscriptionTestResult](entity:SubscriptionTestResult).
    """

    notification_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The URL that was used for the webhook notification test.
    """

    status_code: typing.Optional[int] = pydantic.Field(default=None)
    """
    The HTTP status code returned by the notification URL.
    """

    passes_filter: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the notification passed any configured filters.
    """

    payload: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    The payload that was sent in the test notification.
    """

    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
