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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .date_range import DateRange
import pydantic
from .scheduled_shift_workday_matcher import ScheduledShiftWorkdayMatcher
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ScheduledShiftWorkday(UncheckedBaseModel):
    """
    A `ScheduledShift` search query filter parameter that sets a range of days that
    a `Shift` must start or end in before passing the filter condition.
    """

    date_range: typing.Optional[DateRange] = pydantic.Field(default=None)
    """
    Dates for fetching the scheduled shifts.
    """

    match_scheduled_shifts_by: typing.Optional[ScheduledShiftWorkdayMatcher] = pydantic.Field(default=None)
    """
    The strategy on which the dates are applied.
    See [ScheduledShiftWorkdayMatcher](#type-scheduledshiftworkdaymatcher) for possible values
    """

    default_timezone: typing.Optional[str] = pydantic.Field(default=None)
    """
    Location-specific timezones convert workdays to datetime filters.
    Every location included in the query must have a timezone or this field
    must be provided as a fallback. Format: the IANA timezone database
    identifier for the relevant timezone.
    """

    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
