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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .shift_sort_field import ShiftSortField
import pydantic
from .sort_order import SortOrder
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ShiftSort(UncheckedBaseModel):
    """
    Sets the sort order of search results.

    Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).
    """

    field: typing.Optional[ShiftSortField] = pydantic.Field(default=None)
    """
    The field to sort on.
    See [ShiftSortField](#type-shiftsortfield) for possible values
    """

    order: typing.Optional[SortOrder] = pydantic.Field(default=None)
    """
    The order in which results are returned. Defaults to DESC.
    See [SortOrder](#type-sortorder) for possible values
    """

    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
