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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .shift_filter_status import ShiftFilterStatus
from .time_range import TimeRange
from .shift_workday import ShiftWorkday
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ShiftFilter(UncheckedBaseModel):
    """
    Defines a filter used in a search for `Shift` records. `AND` logic is
    used by Square's servers to apply each filter property specified.

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

    location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Fetch shifts for the specified location.
    """

    employee_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead.
    """

    status: typing.Optional[ShiftFilterStatus] = pydantic.Field(default=None)
    """
    Fetch a `Shift` instance by `Shift.status`.
    See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values
    """

    start: typing.Optional[TimeRange] = pydantic.Field(default=None)
    """
    Fetch `Shift` instances that start in the time range - Inclusive.
    """

    end: typing.Optional[TimeRange] = pydantic.Field(default=None)
    """
    Fetch the `Shift` instances that end in the time range - Inclusive.
    """

    workday: typing.Optional[ShiftWorkday] = pydantic.Field(default=None)
    """
    Fetch the `Shift` instances based on the workday date range.
    """

    team_member_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26".
    """

    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
