Azuregraph¶
flowtask.interfaces.AzureGraph
¶
AzureGraph
¶
Bases: ClientInterface
AzureGraph
Overview
Authentication and authorization Using Azure Identity and Microsoft Graph.
find_chat_by_name
async
¶
Finds a chat by its name (topic) and returns its chat_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chat_name
|
str
|
The name of the chat to find. |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional[str]: The chat_id if found, else None. |
find_one_on_one_chat
async
¶
Find the one-on-one chat between two users by their object IDs. Returns the chat_id or None if it doesn't exist.
get_channel_details
async
¶
Fetches details of a Teams channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team_id
|
str
|
The ID of the team. |
required |
channel_id
|
str
|
The ID of the channel. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Dict |
Dict
|
A dictionary containing channel details. |
get_channel_members
async
¶
Fetches the list of members in a Teams channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team_id
|
str
|
The ID of the team. |
required |
channel_id
|
str
|
The ID of the channel. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict]
|
List[Dict]: A list of member objects. |
get_chat_messages
async
¶
Get chat messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chat_id
|
str
|
Id of Chat |
required |
Returns:
| Type | Description |
|---|---|
Optional[List]
|
Optional[List]: All Chat Messages based on criteria. |
get_msteams_channel_messages
async
¶
get_msteams_channel_messages(team_id, channel_id, start_time=None, end_time=None, max_messages=None)
Fetches messages from a Teams channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team_id
|
str
|
The ID of the team. |
required |
channel_id
|
str
|
The ID of the channel. |
required |
start_time
|
str
|
ISO 8601 formatted start time to filter messages. |
None
|
end_time
|
str
|
ISO 8601 formatted end time to filter messages. |
None
|
max_messages
|
int
|
Maximum number of messages to retrieve. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict]
|
List[Dict]: A list of message objects. |
get_token
async
¶
Retrieves an access token for Microsoft Graph API using ClientSecretCredential.
get_user
async
¶
Fetches user information from Microsoft Graph API based on user ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
str
|
The Azure AD object ID of the user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Dict |
Dict
|
User information as a dictionary. |
get_user_info
async
¶
Fetches user information from Microsoft Graph API basado en el userPrincipalName o ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_principal_name
|
str
|
the UPN (email) or the objectId of the user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Información del usuario. |
list_chats
async
¶
Lists all chats accessible to the application or user.
Returns:
| Type | Description |
|---|---|
List[Dict]
|
List[Dict]: A list of chat objects. |
open
¶
Initializes the Microsoft Graph client using: - MSAL + StaticTokenCredential if user+password is provided (delegated flow). - ClientSecretCredential for app-only in other cases.
user_chat_messages
async
¶
user_chat_messages(user, chat_id, start_time=None, end_time=None, messages_per_page=50, max_messages=None, max_retries=3)
Get User chat messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chat_id
|
str
|
Id of Chat |
required |
Returns:
| Type | Description |
|---|---|
Optional[List]
|
Optional[List]: All Chat Messages based on criteria. |