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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
from ..core.serialization import FieldMetadata
from .task import Task


class TaskQueryResults(UniversalBaseModel):
    tasks: typing.Optional[typing.List[Task]] = None
    next_page_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextPageToken")] = (
        pydantic.Field(default=None)
    )
    """
    Incomplete results can be detected by a non-empty nextPageToken field in the query results. In order to retrieve 
    the next page, perform the exact same request as previously and append a pageToken field with the value of 
    nextPageToken from the previous page. A new nextPageToken is provided on the following pages until all the 
    results are retrieved.
    """

    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


from .entity import Entity  # noqa: E402, F401, I001
from .override import Override  # noqa: E402, F401, I001
from .overrides import Overrides  # noqa: E402, F401, I001
from .principal import Principal  # noqa: E402, F401, I001

update_forward_refs(TaskQueryResults)
