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

from __future__ import annotations
import dataclasses
import dateutil.parser
from ..shared import cancellation as shared_cancellation
from ..shared import inviteequestionandanswer as shared_inviteequestionandanswer
from ..shared import inviteetracking as shared_inviteetracking
from calendly import utils
from dataclasses_json import Undefined, dataclass_json
from datetime import datetime
from enum import Enum
from marshmallow import fields
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class InviteeNoShow1:
    r"""Provides data pertaining to the associated no show for the Invitee"""
    
    created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""The moment when the no show was created"""  
    uri: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('uri') }})
    r"""Canonical reference (unique identifier) for the no show"""  
    
class InviteePaymentCurrencyEnum(str, Enum):
    r"""The currency format that the payment is in."""
    AUD = 'AUD'
    CAD = 'CAD'
    EUR = 'EUR'
    GBP = 'GBP'
    USD = 'USD'

class InviteePaymentProviderEnum(str, Enum):
    r"""Payment provider"""
    STRIPE = 'stripe'
    PAYPAL = 'paypal'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class InviteePayment:
    r"""Invitee payment"""
    
    amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }})
    r"""The amount of the payment"""  
    currency: InviteePaymentCurrencyEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency') }})
    r"""The currency format that the payment is in."""  
    external_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_id') }})
    r"""Unique identifier for the payment"""  
    provider: InviteePaymentProviderEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('provider') }})
    r"""Payment provider"""  
    successful: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('successful') }})
    r"""Indicates whether the payment was successfully processed"""  
    terms: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('terms') }})
    r"""Terms of the payment"""  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class InviteeReconfirmation:
    r"""Assuming reconfirmation is enabled for the event type, when reconfirmation is requested this object is present with a `created_at` that reflects when the reconfirmation notification was sent. Once the invitee has reconfirmed the `confirmed_at` attribute will change from `null` to a timestamp that reflects when they took action."""
    
    confirmed_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('confirmed_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""When the Invitee confirmed their attendance."""  
    created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""When the reconfirmation was created."""  
    
class InviteeStatusEnum(str, Enum):
    r"""Indicates if the invitee is \\"active\\" or \\"canceled\\" """
    ACTIVE = 'active'
    CANCELED = 'canceled'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class Invitee:
    r"""An individual who has been invited to meet with a Calendly member"""
    
    cancel_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cancel_url') }})
    r"""Link to cancelling the event for the invitee"""  
    created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""The moment when the event was created (e.g. \\"2020-01-02T03:04:05.678123Z\\")"""  
    email: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('email') }})
    r"""The invitee’s email address"""  
    event: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('event') }})
    r"""A reference to the event"""  
    first_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('first_name') }})
    r"""The first name of the invitee who booked the event when the event type is configured to use separate fields for first name and last name. Null when event type is configured to use a single field for name."""  
    last_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('last_name') }})
    r"""The last name of the invitee who booked the event when the event type is configured to use separate fields for first name and last name. Null when event type is configured to use a single field for name."""  
    name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }})
    r"""The invitee’s name (in human-readable format)"""  
    new_invitee: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('new_invitee') }})
    r"""Link to new invitee, after reschedule"""  
    no_show: InviteeNoShow1 = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('no_show') }})
    r"""Provides data pertaining to the associated no show for the Invitee"""  
    old_invitee: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('old_invitee') }})
    r"""Reference to old Invitee instance that got rescheduled"""  
    payment: InviteePayment = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payment') }})
    r"""Invitee payment"""  
    questions_and_answers: list[shared_inviteequestionandanswer.InviteeQuestionAndAnswer] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('questions_and_answers') }})
    r"""A collection of the invitee's responses to questions on the event booking confirmation form"""  
    reconfirmation: InviteeReconfirmation = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reconfirmation') }})
    r"""Assuming reconfirmation is enabled for the event type, when reconfirmation is requested this object is present with a `created_at` that reflects when the reconfirmation notification was sent. Once the invitee has reconfirmed the `confirmed_at` attribute will change from `null` to a timestamp that reflects when they took action."""  
    reschedule_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reschedule_url') }})
    r"""Link to rescheduling the event for the invitee"""  
    rescheduled: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rescheduled') }})
    r"""Indicates if this invitee has rescheduled. If `true`, a reference to the new Invitee instance is provided in the `new_invitee` field."""  
    routing_form_submission: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('routing_form_submission') }})
    r"""Reference to a routing form submission that redirected the invitee to a booking page."""  
    status: InviteeStatusEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }})
    r"""Indicates if the invitee is \\"active\\" or \\"canceled\\" """  
    text_reminder_number: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text_reminder_number') }})
    r"""The phone number to use when sending text (SMS) reminders"""  
    timezone: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timezone') }})
    r"""Time zone to use when displaying time to the invitee"""  
    tracking: shared_inviteetracking.InviteeTracking = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tracking') }})
    r"""The UTM and Salesforce tracking parameters associated with an Invitee"""  
    updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""The moment when the event was last updated (e.g. \\"2020-01-02T03:04:05.678123Z\\")"""  
    uri: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('uri') }})
    r"""Canonical reference (unique identifier) for the invitee"""  
    cancellation: Optional[shared_cancellation.Cancellation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cancellation'), 'exclude': lambda f: f is None }})
    r"""Provides data pertaining to the cancellation of the Event"""  
    