Skip to content

Chat Model

teams_lib_pzsp2_z1.model.chat

Classes

Chat dataclass

Represents a chat in Microsoft Teams.

Attributes:

Name Type Description
id str

The unique identifier of the chat.

chat_type ChatType

The type of the conversation (One-on-One or Group).

is_hidden bool

Indicates whether the chat is hidden for the user.

topic Optional[str]

The subject or topic of the chat. This is typically None for one-on-one chats.

Source code in teams_lib_pzsp2_z1/model/chat.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@dataclass
class Chat:
    """Represents a chat in Microsoft Teams.

    Attributes:
        id (str): The unique identifier of the chat.
        chat_type (ChatType): The type of the conversation (One-on-One or Group).
        is_hidden (bool): Indicates whether the chat is hidden for the user.
        topic (Optional[str]): The subject or topic of the chat.
            This is typically None for one-on-one chats.
    """

    id: str
    type: ChatType
    is_hidden: bool
    topic: str | None

ChatRef dataclass

Represents a polymorphic reference to a chat used for API lookups.

This class corresponds to GroupChatRef and OneOnOneChatRef in the Go library. The interpretation of the ref field depends on the chat_type.

Attributes:

Name Type Description
ref str

The identifier string. * If chat_type is GROUP: Can be a unique Chat ID or a Chat Topic. Note: Using a topic may lead to ambiguities if multiple group chats share the same name. * If chat_type is ONE_ON_ONE: Can be a unique Chat ID or the Recipient's reference (User ID or Email). Note: For resolution by User ID/Email to work, the chat must already exist between the logged-in user and the recipient.

chat_type ChatType

Determines how the ref string is interpreted.

Source code in teams_lib_pzsp2_z1/model/chat.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@dataclass
class ChatRef:
    """Represents a polymorphic reference to a chat used for API lookups.

    This class corresponds to `GroupChatRef` and `OneOnOneChatRef` in the Go library.
    The interpretation of the `ref` field depends on the `chat_type`.

    Attributes:
        ref (str): The identifier string.
            * If **chat_type is GROUP**: Can be a unique Chat ID or a Chat Topic.
              **Note**: Using a topic may lead to ambiguities if multiple group chats
              share the same name.
            * If **chat_type is ONE_ON_ONE**: Can be a unique Chat ID or the
              Recipient's reference (User ID or Email).
              **Note**: For resolution by User ID/Email to work, the chat must
              already exist between the logged-in user and the recipient.
        chat_type (ChatType): Determines how the `ref` string is interpreted.
    """
    ref: str
    type: ChatType

ChatType

Bases: Enum

Represents the type of chat in Microsoft Teams.

Attributes:

Name Type Description
ONE_ON_ONE

Represents a direct conversation between two users.

GROUP

Represents a conversation with multiple participants.

Source code in teams_lib_pzsp2_z1/model/chat.py
 5
 6
 7
 8
 9
10
11
12
13
14
class ChatType(Enum):
    """Represents the type of chat in Microsoft Teams.

    Attributes:
        ONE_ON_ONE: Represents a direct conversation between two users.
        GROUP: Represents a conversation with multiple participants.
    """

    ONE_ON_ONE = "one-on-one"
    GROUP = "group"