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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .error import Error
from .scheduled_shift import ScheduledShift


class SearchScheduledShiftsResponse(UncheckedBaseModel):
    """
    Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response.
    Either `scheduled_shifts` or `errors` is present in the response.
    """

    scheduled_shifts: typing.Optional[typing.List[ScheduledShift]] = pydantic.Field(default=None)
    """
    A paginated list of scheduled shifts that match the query conditions.
    """

    cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    The pagination cursor used to retrieve the next page of results. This field is present
    only if additional results are available.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Any 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
