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

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


class Availability(UncheckedBaseModel):
    """
    Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking.
    """

    start_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The RFC 3339 timestamp specifying the beginning time of the slot available for booking.
    """

    location_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the location available for booking.
    """

    appointment_segments: typing.Optional[typing.List[AppointmentSegment]] = pydantic.Field(default=None)
    """
    The list of appointment segments available for booking
    """

    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
