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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .job import Job
import pydantic
from .error import Error
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ListJobsResponse(UncheckedBaseModel):
    """
    Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors`
    is present in the response. If additional results are available, the `cursor` field is also present.
    """

    jobs: typing.Optional[typing.List[Job]] = pydantic.Field(default=None)
    """
    The retrieved jobs. A single paged response contains up to 100 jobs.
    """

    cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    An opaque cursor used to retrieve the next page of results. This field is present only
    if the request succeeded and additional results are available. For more information, see
    [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    The errors that occurred during the request.
    """

    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
