Search messages model
teams_lib_pzsp2_z1.model.search
Classes
SearchConfig
dataclass
Configuration parameters for search operations.
Attributes:
| Name | Type | Description |
|---|---|---|
max_workers |
int
|
The maximum number of worker threads to use for concurrent search operations. Defaults to 8. |
Source code in teams_lib_pzsp2_z1/model/search.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Functions
__dict__()
Serializes the object keys to camelCase for the Go backend.
Source code in teams_lib_pzsp2_z1/model/search.py
18 19 20 | |
SearchMessagesOptions
dataclass
Configuration options for searching messages.
Attributes:
| Name | Type | Description |
|---|---|---|
query |
str | None
|
The search query string. |
search_page |
SearchPage | None
|
Pagination options. |
from_ |
list[str]
|
List of sender email addresses to include. |
not_from |
list[str]
|
List of sender email addresses to exclude. |
is_read |
bool | None
|
Filter by read status (True for read, False for unread). |
is_mentioned |
bool | None
|
Filter by mention status (True for mentioned, False for not mentioned). |
to |
list[str]
|
List of recipient email addresses to include. |
not_to |
list[str]
|
List of recipient email addresses to exclude. |
start_time |
datetime | None
|
Start time for the sent time range filter. |
end_time |
datetime | None
|
End time for the sent time range filter. |
interval |
TimeInterval | None
|
Predefined time interval for the sent time filter. |
not_from_me |
bool
|
Exclude messages sent by the current user. |
not_to_me |
bool
|
Exclude messages sent to the current user. |
from_me |
bool
|
Include only messages sent by the current user. |
to_me |
bool
|
Include only messages sent to the current user. |
Note: If interval is set, it takes precedence over start_time and end_time.
Note: Using to clauses works only in chats, not in team channels.
Note: Currently, queries for is_read may not function as expected due to API limitations.
Source code in teams_lib_pzsp2_z1/model/search.py
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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
Functions
__dict__()
Serializes the object keys to camelCase for the Go backend.
Source code in teams_lib_pzsp2_z1/model/search.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
SearchPage
dataclass
Represents pagination parameters for search results.
Attributes:
| Name | Type | Description |
|---|---|---|
from_ |
int
|
The starting index of the search results. |
size |
int
|
The number of search results to return. Defaults to 25. |
Source code in teams_lib_pzsp2_z1/model/search.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
Functions
__dict__()
Serializes the object keys to camelCase for the Go backend.
Source code in teams_lib_pzsp2_z1/model/search.py
36 37 38 | |
SearchResult
dataclass
SearchResult represents a single search result containing a message and its context.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
Message
|
The message that matched the search criteria. |
channel_id |
str | None
|
The ID of the channel where the message was found (if applicable). |
team_id |
str | None
|
The ID of the team where the message was found (if applicable). |
chat_id |
str | None
|
The ID of the chat where the message was found (if applicable). |
Source code in teams_lib_pzsp2_z1/model/search.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
SearchResults
dataclass
SearchResults represents the results of a message search.
Attributes:
| Name | Type | Description |
|---|---|---|
messages |
list[SearchResult]
|
A list of search results. |
next_from |
int | None
|
The index to use for the next page of results, or None if there are no more results. |
Source code in teams_lib_pzsp2_z1/model/search.py
157 158 159 160 161 162 163 164 165 166 167 168 169 | |
TimeInterval
Bases: Enum
Enumeration of time intervals for filtering search results.
Attributes:
| Name | Type | Description |
|---|---|---|
TODAY |
Represents the current day. |
|
YESTERDAY |
Represents the previous day. |
|
THIS_WEEK |
Represents the current week. |
|
THIS_MONTH |
Represents the current month. |
|
LAST_MONTH |
Represents the previous month. |
|
THIS_YEAR |
Represents the current year. |
|
LAST_YEAR |
Represents the previous year. |
Source code in teams_lib_pzsp2_z1/model/search.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |