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

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import scheduledeventsresponse as shared_scheduledeventsresponse
from calendly import utils
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from typing import Optional

class ListScheduledEventsStatusEnum(str, Enum):
    r"""Whether the scheduled event is `active` or `canceled`"""
    ACTIVE = 'active'
    CANCELED = 'canceled'


@dataclasses.dataclass
class ListScheduledEventsRequest:
    
    count: Optional[float] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'count', 'style': 'form', 'explode': True }})
    r"""The number of rows to return"""  
    invitee_email: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'invitee_email', 'style': 'form', 'explode': True }})
    r"""Return events that are scheduled with the invitee associated with this email address"""  
    max_start_time: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'max_start_time', 'style': 'form', 'explode': True }})
    r"""Include events with start times prior to this time (sample time format: \\"2020-01-02T03:04:05.678123Z\\"). This time should use the UTC timezone."""  
    min_start_time: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'min_start_time', 'style': 'form', 'explode': True }})
    r"""Include events with start times after this time (sample time format: \\"2020-01-02T03:04:05.678123Z\\"). This time should use the UTC timezone."""  
    organization: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'organization', 'style': 'form', 'explode': True }})
    r"""Return events that are scheduled with the organization associated with this URI"""  
    page_token: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page_token', 'style': 'form', 'explode': True }})
    r"""The token to pass to get the next or previous portion of the collection"""  
    sort: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'sort', 'style': 'form', 'explode': True }})
    r"""Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values.
    Supported fields are: start_time.
    Sort direction is specified as: asc, desc.
    """  
    status: Optional[ListScheduledEventsStatusEnum] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'status', 'style': 'form', 'explode': True }})
    r"""Whether the scheduled event is `active` or `canceled`"""  
    user: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'user', 'style': 'form', 'explode': True }})
    r"""Return events that are scheduled with the user associated with this URI"""  
    
class ListScheduledEvents403ApplicationJSONMessageEnum(str, Enum):
    YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THIS_RESOURCE_ = 'You do not have permission to access this resource.'
    PLEASE_ALSO_SPECIFY_ORGANIZATION_WHEN_REQUESTING_EVENTS_FOR_A_USER_WITHIN_YOUR_ORGANIZATION_ = 'Please also specify organization when requesting events for a user within your organization.'
    THIS_USER_IS_NOT_IN_YOUR_ORGANIZATION = 'This user is not in your organization'
    YOU_DO_NOT_HAVE_PERMISSION = 'You do not have permission'

class ListScheduledEvents403ApplicationJSONTitleEnum(str, Enum):
    PERMISSION_DENIED = 'Permission Denied'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class ListScheduledEvents403ApplicationJSON:
    r"""Permission Denied"""
    
    message: Optional[ListScheduledEvents403ApplicationJSONMessageEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is None }})  
    title: Optional[ListScheduledEvents403ApplicationJSONTitleEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('title'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class ListScheduledEventsErrorResponseDetails:
    
    message: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message') }})  
    parameter: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parameter'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class ListScheduledEventsErrorResponse:
    r"""Error Object"""
    
    message: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message') }})  
    title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('title') }})  
    details: Optional[list[ListScheduledEventsErrorResponseDetails]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details'), 'exclude': lambda f: f is None }})  
    

@dataclasses.dataclass
class ListScheduledEventsResponse:
    
    content_type: str = dataclasses.field()  
    status_code: int = dataclasses.field()  
    error_response: Optional[ListScheduledEventsErrorResponse] = dataclasses.field(default=None)
    r"""Request is not valid"""  
    list_scheduled_events_403_application_json_object: Optional[ListScheduledEvents403ApplicationJSON] = dataclasses.field(default=None)
    r"""Permission Denied"""  
    raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)  
    scheduled_events_response: Optional[shared_scheduledeventsresponse.ScheduledEventsResponse] = dataclasses.field(default=None)
    r"""OK"""  
    