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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .timecard_sort_field import TimecardSortField
import pydantic
from .sort_order import SortOrder
from ..core.pydantic_utilities import IS_PYDANTIC_V2


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

    field: typing.Optional[TimecardSortField] = pydantic.Field(default=None)
    """
    The field to sort on.
    See [TimecardSortField](#type-timecardsortfield) 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
