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

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


class Break(UncheckedBaseModel):
    """
    A record of a team member's break on a [timecard](entity:Timecard).
    """

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

    start_at: str = pydantic.Field()
    """
    RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to
    the minute is respected; seconds are truncated.
    """

    end_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to
    the minute is respected; seconds are truncated.
    """

    break_type_id: str = pydantic.Field()
    """
    The [BreakType](entity:BreakType) that this break was templated on.
    """

    name: str = pydantic.Field()
    """
    A human-readable name.
    """

    expected_duration: str = pydantic.Field()
    """
    Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of
    the break.
    
    Example for break expected duration of 15 minutes: PT15M
    """

    is_paid: bool = pydantic.Field()
    """
    Whether this break counts towards time worked for compensation
    purposes.
    """

    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
