# 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 .actor import Actor

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


class Messaging(pydantic.BaseModel):
    """
    The Messaging object encompasses information related to instant messaging, such as sending messages, adding a user to a channel, etc.
    """

    channel_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the channel that the event pertains to.
    """

    channel_uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the channel that the event pertains to.
    """

    domains: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of domains participating in the chat session.
    """

    has_foreign_tenant_users: typing.Optional[bool] = pydantic.Field(default=None)
    """
    True if the event pertains to a channel or group which contains users from a foreign tenant.
    """

    has_guest_users: typing.Optional[bool] = pydantic.Field(default=None)
    """
    True if the event pertains to a channel or group which contains guest users.
    """

    has_unauthenticated_users: typing.Optional[bool] = pydantic.Field(default=None)
    """
    True if the event pertains to a channel or group which contains users that are not authenticated.
    """

    members: typing.Optional[typing.List[Actor]] = pydantic.Field(default=None)
    """
    Actors to whom the event pertains.
    """

    message_urls: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    URLs contained in the messages which are relevant to the chat session or event.
    """

    session_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the session that the event pertains to, e.g. a chat specific to a meeting, or a thread within a channel.
    """

    session_uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the session.
    """

    uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    UID of the event, e.g. unique message ID.
    """

    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}
