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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .weekday import Weekday
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class WorkweekConfig(UncheckedBaseModel):
    """
    Sets the day of the week and hour of the day that a business starts a
    workweek. This is used to calculate overtime pay.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The UUID for this object.
    """

    start_of_week: Weekday = pydantic.Field()
    """
    The day of the week on which a business week starts for
    compensation purposes.
    See [Weekday](#type-weekday) for possible values
    """

    start_of_day_local_time: str = pydantic.Field()
    """
    The local time at which a business week starts. Represented as a
    string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are
    truncated).
    """

    version: typing.Optional[int] = pydantic.Field(default=None)
    """
    Used for resolving concurrency issues. The request fails if the version
    provided does not match the server version at the time of the request. If not provided,
    Square executes a blind write; potentially overwriting data from another
    write.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    A read-only timestamp in RFC 3339 format; presented in UTC.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    A read-only timestamp in RFC 3339 format; presented in UTC.
    """

    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
