# 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 AppointmentSegment(UncheckedBaseModel):
    """
    Defines an appointment segment of a booking.
    """

    duration_minutes: typing.Optional[int] = pydantic.Field(default=None)
    """
    The time span in minutes of an appointment segment.
    """

    service_variation_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
    """

    team_member_id: str = pydantic.Field()
    """
    The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this segment.
    """

    service_variation_version: typing.Optional[int] = pydantic.Field(default=None)
    """
    The current version of the item variation representing the service booked in this segment.
    """

    intermission_minutes: typing.Optional[int] = pydantic.Field(default=None)
    """
    Time between the end of this segment and the beginning of the subsequent segment.
    """

    any_team_member: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the customer accepts any team member, instead of a specific one, to serve this segment.
    """

    resource_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The IDs of the seller-accessible resources used for this appointment segment.
    """

    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
