"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from calendly import utils
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class AvailabilityRuleIntervals:
    
    from_: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from'), 'exclude': lambda f: f is None }})
    r"""Format: `\\"hh:mm\\"`"""  
    to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }})
    r"""Format: `\\"hh:mm\\"`"""  
    
class AvailabilityRuleTypeEnum(str, Enum):
    r"""The type of this Availability Rule; can be \\"wday\\" or a specific \\"date\\"."""
    WDAY = 'wday'
    DATE = 'date'

class AvailabilityRuleWdayEnum(str, Enum):
    r"""The day of the week for which this Rule should be applied to."""
    SUNDAY = 'sunday'
    MONDAY = 'monday'
    TUESDAY = 'tuesday'
    WEDNESDAY = 'wednesday'
    THURSDAY = 'thursday'
    FRIDAY = 'friday'
    SATURDAY = 'saturday'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class AvailabilityRule:
    r"""The rules for an availability schedule."""
    
    intervals: list[AvailabilityRuleIntervals] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('intervals') }})
    r"""The intervals to be applied to this Rule. Each interval represents when booking a meeting is allowed. If the interval array is empty, then there is no booking availability for that day. Time is in 24h format (i.e. \\"17:30\\") and local to the timezone in the Availability Schedule."""  
    type: AvailabilityRuleTypeEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }})
    r"""The type of this Availability Rule; can be \\"wday\\" or a specific \\"date\\"."""  
    date_: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('date'), 'exclude': lambda f: f is None }})
    r"""A specific date in the future that this should be applied to (i.e. \\"2030-12-31\\")."""  
    wday: Optional[AvailabilityRuleWdayEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('wday'), 'exclude': lambda f: f is None }})
    r"""The day of the week for which this Rule should be applied to."""  
    