# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..........core.datetime_utils import serialize_datetime
from ...base.types.timestamp import Timestamp
from .actor import Actor
from .device import Device

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class MeetingAttendee(pydantic.BaseModel):
    """
    The Meeting Attendee object encompasses information related to a meeting attendee.
    """

    actor: typing.Optional[Actor] = pydantic.Field(default=None)
    """
    The actor corresponding to the entity joining the meeting.
    """

    device: typing.Optional[Device] = pydantic.Field(default=None)
    """
    Information about the attendee's device.
    """

    invited_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    When the actor was invited to the meeting.
    """

    invited_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the actor was invited to the meeting.
    """

    inviter: typing.Optional[Actor] = pydantic.Field(default=None)
    """
    The actor who invited the attendee to the meeting.
    """

    join_times: typing.Optional[typing.List[Timestamp]] = pydantic.Field(default=None)
    """
    Time(s) at which the attendee joined the meeting.
    """

    join_times_dt: typing.Optional[typing.List[dt.datetime]] = pydantic.Field(default=None)
    """
    Time(s) at which the attendee joined the meeting.
    """

    leave_times: typing.Optional[typing.List[Timestamp]] = pydantic.Field(default=None)
    """
    Time(s) at which the attendee left the meeting.
    """

    leave_times_dt: typing.Optional[typing.List[dt.datetime]] = pydantic.Field(default=None)
    """
    Time(s) at which the attendee left the meeting.
    """

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        extra = pydantic.Extra.allow
        json_encoders = {dt.datetime: serialize_datetime}
