# 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 Snippet(UncheckedBaseModel):
    """
    Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Square-assigned ID for the snippet.
    """

    site_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the site that contains the snippet.
    """

    content: str = pydantic.Field()
    """
    The snippet code, which can contain valid HTML, JavaScript, or both.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp of when the snippet was initially added to the site, in RFC 3339 format.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp of when the snippet was last updated on the site, in RFC 3339 format.
    """

    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
