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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .goa_tag_tiny_response_response_body import GoaTagTinyResponseResponseBody
from .tiny_asset_object_response_body import TinyAssetObjectResponseBody
from .tiny_driver_object_response_body import TinyDriverObjectResponseBody
from .tiny_widget_object_response_body import TinyWidgetObjectResponseBody


class ScopeObjectResponseBody(UniversalBaseModel):
    """
    What the triggers are scoped to. These are the objects this alert applies to.
    """

    all_: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="all"),
        pydantic.Field(alias="all", description="Whether it applies to all applicable objects."),
    ]
    assets: typing.Optional[typing.List[TinyAssetObjectResponseBody]] = pydantic.Field(default=None)
    """
    The assets these triggers are scoped to.
    """

    drivers: typing.Optional[typing.List[TinyDriverObjectResponseBody]] = pydantic.Field(default=None)
    """
    The drivers these triggers are scoped to.
    """

    tags: typing.Optional[typing.List[GoaTagTinyResponseResponseBody]] = pydantic.Field(default=None)
    """
    The tags these triggers are scoped to.
    """

    widgets: typing.Optional[typing.List[TinyWidgetObjectResponseBody]] = pydantic.Field(default=None)
    """
    The widgets these triggers are scoped 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
