Message Models
teams_lib_pzsp2_z1.model.message
Classes
ListMessagesOptions
dataclass
Contains options for listing messages (pagination and expansion).
Attributes:
| Name | Type | Description |
|---|---|---|
top |
Optional[int]
|
The maximum number of messages to return in one page. Defaults to None (server default). |
expand_replies |
bool
|
If True, the response will include replies nested within the messages. Defaults to False. |
Source code in teams_lib_pzsp2_z1/model/message.py
90 91 92 93 94 95 96 97 98 99 100 101 102 | |
Message
dataclass
Represents a Microsoft Teams chat message.
Used in both direct chats and channels.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The unique identifier of the message. |
content |
str
|
The actual body text or HTML of the message. |
content_type |
MessageContentType
|
The format of the content (Text or HTML). |
created_date_time |
datetime
|
The timestamp when the message was created. |
sender |
MessageFrom
|
The user who sent the message.
Note: Mapped from the |
reply_count |
int
|
The number of replies to this message. |
Source code in teams_lib_pzsp2_z1/model/message.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
MessageBody
dataclass
Represents the body of a message to be sent.
This class contains the payload structure required to send a new message or reply.
Attributes:
| Name | Type | Description |
|---|---|---|
content_type |
MessageContentType
|
The format of the content. |
content |
str
|
The text or HTML content. |
mentions |
List[Mention]
|
A list of mentions to include in the message. |
Source code in teams_lib_pzsp2_z1/model/message.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
Functions
__dict__()
Serializes the object keys to PascalCase for the Go backend.
Source code in teams_lib_pzsp2_z1/model/message.py
75 76 77 78 79 80 81 | |
__iter__()
Allows iteration over fields with PascalCase keys.
Source code in teams_lib_pzsp2_z1/model/message.py
83 84 85 86 87 | |
MessageCollection
dataclass
Represents a paginated collection of messages.
Attributes:
| Name | Type | Description |
|---|---|---|
messages |
List[Message]
|
The list of message objects in the current page. |
next_link |
Optional[str]
|
The URL to retrieve the next page of results. If None, there are no more messages. |
Source code in teams_lib_pzsp2_z1/model/message.py
105 106 107 108 109 110 111 112 113 114 115 116 | |
MessageContentType
Bases: Enum
Represents the type of content in a Microsoft Teams message.
Attributes:
| Name | Type | Description |
|---|---|---|
TEXT |
Plain text content. |
|
HTML |
HTML formatted content. |
Source code in teams_lib_pzsp2_z1/model/message.py
8 9 10 11 12 13 14 15 16 17 | |
MessageFrom
dataclass
Represents the sender of a message in Microsoft Teams.
Attributes:
| Name | Type | Description |
|---|---|---|
user_id |
str
|
The unique Azure Active Directory (AAD) identifier of the sender. |
display_name |
str
|
The visible name of the sender. |
Source code in teams_lib_pzsp2_z1/model/message.py
20 21 22 23 24 25 26 27 28 29 30 | |
teams_lib_pzsp2_z1.model.mention
Classes
Mention
dataclass
Represents a mention entity within a Microsoft Teams message.
This object maps a specific entity (User, Channel, etc.) to a placeholder in the message content. Can be obtained by get_mentions() method in the Chats and Channels service.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
MentionKind
|
The type of the mention. |
at_id |
int
|
The internal identifier used to link this mention to the
message content.
Example: If the message body contains |
text |
str
|
The text to display in the message (e.g., "@John Doe"). |
target_id |
str
|
The unique identifier (UUID) of the entity being mentioned (User ID, Channel ID, or Team ID). |
Source code in teams_lib_pzsp2_z1/model/mention.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
MentionKind
Bases: Enum
Represents the kind of mention in a Microsoft Teams message.
Attributes:
| Name | Type | Description |
|---|---|---|
USER |
Represents a mention of a specific user. |
|
CHANNEL |
Represents a mention of the current channel. |
|
TEAM |
Represents a mention of the entire team. |
|
EVERYONE |
Represents a mention of all participants. Note: This is applicable to Group Chats only. |
Source code in teams_lib_pzsp2_z1/model/mention.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |