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

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import cancellation as shared_cancellation
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 PostScheduledEventsUUIDCancellationApplicationJSON:
    r"""Optional cancellation reason."""
    
    reason: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reason'), 'exclude': lambda f: f is None }})
    r"""Reason for cancellation"""  
    

@dataclasses.dataclass
class PostScheduledEventsUUIDCancellationRequest:
    
    uuid: str = dataclasses.field(metadata={'path_param': { 'field_name': 'uuid', 'style': 'simple', 'explode': False }})
    r"""The event's unique indentifier"""  
    request_body: Optional[PostScheduledEventsUUIDCancellationApplicationJSON] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }})
    r"""Optional cancellation reason."""  
    
class PostScheduledEventsUUIDCancellation403ApplicationJSONMessageEnum(str, Enum):
    YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_EVENT = 'You are not allowed to cancel this event'
    EVENT_IN_THE_PAST = 'Event in the past'
    EVENT_IS_ALREADY_CANCELED = 'Event is already canceled'

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


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PostScheduledEventsUUIDCancellation403ApplicationJSON:
    r"""Caller not authorized to perform this action"""
    
    message: Optional[PostScheduledEventsUUIDCancellation403ApplicationJSONMessageEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is None }})  
    title: Optional[PostScheduledEventsUUIDCancellation403ApplicationJSONTitleEnum] = 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 PostScheduledEventsUUIDCancellationErrorResponseDetails:
    
    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 PostScheduledEventsUUIDCancellationErrorResponse:
    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[PostScheduledEventsUUIDCancellationErrorResponseDetails]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PostScheduledEventsUUIDCancellation201ApplicationJSON:
    r"""Created"""
    
    resource: shared_cancellation.Cancellation = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('resource') }})
    r"""Provides data pertaining to the cancellation of the Event"""  
    

@dataclasses.dataclass
class PostScheduledEventsUUIDCancellationResponse:
    
    content_type: str = dataclasses.field()  
    status_code: int = dataclasses.field()  
    error_response: Optional[PostScheduledEventsUUIDCancellationErrorResponse] = dataclasses.field(default=None)
    r"""Request is not valid"""  
    post_scheduled_events_uuid_cancellation_201_application_json_object: Optional[PostScheduledEventsUUIDCancellation201ApplicationJSON] = dataclasses.field(default=None)
    r"""Created"""  
    post_scheduled_events_uuid_cancellation_403_application_json_object: Optional[PostScheduledEventsUUIDCancellation403ApplicationJSON] = dataclasses.field(default=None)
    r"""Caller not authorized to perform this action"""  
    raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)  
    