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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class SubscriptionTestResult(UncheckedBaseModel):
    """
    Represents the details of a webhook subscription, including notification URL,
    event types, and signature key.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A Square-generated unique ID for the subscription test result.
    """

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

    payload: typing.Optional[str] = pydantic.Field(default=None)
    """
    An object containing the payload of the test event. For example, a `payment.created` event.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp of when the subscription was created, in RFC 3339 format. 
    For example, "2016-09-04T23:59:33.123Z".
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp of when the subscription was updated, in RFC 3339 format. For example, "2016-09-04T23:59:33.123Z".
    Because a subscription test result is unique, this field is the same as the `created_at` field.
    """

    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
