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

from __future__ import annotations
import dataclasses
import dateutil.parser
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

class OrganizationInvitationStatusEnum(str, Enum):
    r"""The status of the invitation (\\"pending\\", \\"accepted\\", or \\"declined\\")"""
    PENDING = 'pending'
    ACCEPTED = 'accepted'
    DECLINED = 'declined'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class OrganizationInvitation:
    r"""Organization Invitation object"""
    
    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 the invitation 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 email address of the person who was invited to join the organization"""  
    last_sent_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('last_sent_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }})
    r"""The moment the invitation was last sent (e.g. \\"2020-01-02T03:04:05.678123Z\\")"""  
    organization: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('organization') }})
    r"""Canonical reference (unique identifier) for the organization"""  
    status: OrganizationInvitationStatusEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }})
    r"""The status of the invitation (\\"pending\\", \\"accepted\\", or \\"declined\\")"""  
    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 the invitation 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 organization invitation"""  
    user: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user'), 'exclude': lambda f: f is None }})
    r"""When the invitation is accepted, a reference to the user who accepted the invitation"""  
    