universal-mcp-applications 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- universal_mcp/applications/ahrefs/README.md +51 -0
- universal_mcp/applications/ahrefs/__init__.py +1 -0
- universal_mcp/applications/ahrefs/app.py +2291 -0
- universal_mcp/applications/airtable/README.md +22 -0
- universal_mcp/applications/airtable/__init__.py +1 -0
- universal_mcp/applications/airtable/app.py +479 -0
- universal_mcp/applications/apollo/README.md +44 -0
- universal_mcp/applications/apollo/__init__.py +1 -0
- universal_mcp/applications/apollo/app.py +1847 -0
- universal_mcp/applications/asana/README.md +199 -0
- universal_mcp/applications/asana/__init__.py +1 -0
- universal_mcp/applications/asana/app.py +9509 -0
- universal_mcp/applications/aws-s3/README.md +0 -0
- universal_mcp/applications/aws-s3/__init__.py +1 -0
- universal_mcp/applications/aws-s3/app.py +552 -0
- universal_mcp/applications/bill/README.md +0 -0
- universal_mcp/applications/bill/__init__.py +1 -0
- universal_mcp/applications/bill/app.py +8705 -0
- universal_mcp/applications/box/README.md +307 -0
- universal_mcp/applications/box/__init__.py +1 -0
- universal_mcp/applications/box/app.py +15987 -0
- universal_mcp/applications/braze/README.md +106 -0
- universal_mcp/applications/braze/__init__.py +1 -0
- universal_mcp/applications/braze/app.py +4754 -0
- universal_mcp/applications/cal-com-v2/README.md +150 -0
- universal_mcp/applications/cal-com-v2/__init__.py +1 -0
- universal_mcp/applications/cal-com-v2/app.py +5541 -0
- universal_mcp/applications/calendly/README.md +53 -0
- universal_mcp/applications/calendly/__init__.py +1 -0
- universal_mcp/applications/calendly/app.py +1436 -0
- universal_mcp/applications/canva/README.md +43 -0
- universal_mcp/applications/canva/__init__.py +1 -0
- universal_mcp/applications/canva/app.py +941 -0
- universal_mcp/applications/clickup/README.md +135 -0
- universal_mcp/applications/clickup/__init__.py +1 -0
- universal_mcp/applications/clickup/app.py +5009 -0
- universal_mcp/applications/coda/README.md +108 -0
- universal_mcp/applications/coda/__init__.py +1 -0
- universal_mcp/applications/coda/app.py +3671 -0
- universal_mcp/applications/confluence/README.md +198 -0
- universal_mcp/applications/confluence/__init__.py +1 -0
- universal_mcp/applications/confluence/app.py +6273 -0
- universal_mcp/applications/contentful/README.md +17 -0
- universal_mcp/applications/contentful/__init__.py +1 -0
- universal_mcp/applications/contentful/app.py +364 -0
- universal_mcp/applications/crustdata/README.md +25 -0
- universal_mcp/applications/crustdata/__init__.py +1 -0
- universal_mcp/applications/crustdata/app.py +586 -0
- universal_mcp/applications/dialpad/README.md +202 -0
- universal_mcp/applications/dialpad/__init__.py +1 -0
- universal_mcp/applications/dialpad/app.py +5949 -0
- universal_mcp/applications/digitalocean/README.md +463 -0
- universal_mcp/applications/digitalocean/__init__.py +1 -0
- universal_mcp/applications/digitalocean/app.py +20835 -0
- universal_mcp/applications/domain-checker/README.md +13 -0
- universal_mcp/applications/domain-checker/__init__.py +1 -0
- universal_mcp/applications/domain-checker/app.py +265 -0
- universal_mcp/applications/e2b/README.md +12 -0
- universal_mcp/applications/e2b/__init__.py +1 -0
- universal_mcp/applications/e2b/app.py +187 -0
- universal_mcp/applications/elevenlabs/README.md +88 -0
- universal_mcp/applications/elevenlabs/__init__.py +1 -0
- universal_mcp/applications/elevenlabs/app.py +3235 -0
- universal_mcp/applications/exa/README.md +15 -0
- universal_mcp/applications/exa/__init__.py +1 -0
- universal_mcp/applications/exa/app.py +221 -0
- universal_mcp/applications/falai/README.md +17 -0
- universal_mcp/applications/falai/__init__.py +1 -0
- universal_mcp/applications/falai/app.py +331 -0
- universal_mcp/applications/figma/README.md +49 -0
- universal_mcp/applications/figma/__init__.py +1 -0
- universal_mcp/applications/figma/app.py +1090 -0
- universal_mcp/applications/firecrawl/README.md +20 -0
- universal_mcp/applications/firecrawl/__init__.py +1 -0
- universal_mcp/applications/firecrawl/app.py +514 -0
- universal_mcp/applications/fireflies/README.md +25 -0
- universal_mcp/applications/fireflies/__init__.py +1 -0
- universal_mcp/applications/fireflies/app.py +506 -0
- universal_mcp/applications/fpl/README.md +23 -0
- universal_mcp/applications/fpl/__init__.py +1 -0
- universal_mcp/applications/fpl/app.py +1327 -0
- universal_mcp/applications/fpl/utils/api.py +142 -0
- universal_mcp/applications/fpl/utils/fixtures.py +629 -0
- universal_mcp/applications/fpl/utils/helper.py +982 -0
- universal_mcp/applications/fpl/utils/league_utils.py +546 -0
- universal_mcp/applications/fpl/utils/position_utils.py +68 -0
- universal_mcp/applications/ghost-content/README.md +25 -0
- universal_mcp/applications/ghost-content/__init__.py +1 -0
- universal_mcp/applications/ghost-content/app.py +654 -0
- universal_mcp/applications/github/README.md +1049 -0
- universal_mcp/applications/github/__init__.py +1 -0
- universal_mcp/applications/github/app.py +50600 -0
- universal_mcp/applications/gong/README.md +63 -0
- universal_mcp/applications/gong/__init__.py +1 -0
- universal_mcp/applications/gong/app.py +2297 -0
- universal_mcp/applications/google-ads/README.md +0 -0
- universal_mcp/applications/google-ads/__init__.py +1 -0
- universal_mcp/applications/google-ads/app.py +23 -0
- universal_mcp/applications/google-calendar/README.md +21 -0
- universal_mcp/applications/google-calendar/__init__.py +1 -0
- universal_mcp/applications/google-calendar/app.py +574 -0
- universal_mcp/applications/google-docs/README.md +25 -0
- universal_mcp/applications/google-docs/__init__.py +1 -0
- universal_mcp/applications/google-docs/app.py +760 -0
- universal_mcp/applications/google-drive/README.md +68 -0
- universal_mcp/applications/google-drive/__init__.py +1 -0
- universal_mcp/applications/google-drive/app.py +4936 -0
- universal_mcp/applications/google-gemini/README.md +25 -0
- universal_mcp/applications/google-gemini/__init__.py +1 -0
- universal_mcp/applications/google-gemini/app.py +663 -0
- universal_mcp/applications/google-mail/README.md +31 -0
- universal_mcp/applications/google-mail/__init__.py +1 -0
- universal_mcp/applications/google-mail/app.py +1354 -0
- universal_mcp/applications/google-searchconsole/README.md +21 -0
- universal_mcp/applications/google-searchconsole/__init__.py +1 -0
- universal_mcp/applications/google-searchconsole/app.py +320 -0
- universal_mcp/applications/google-sheet/README.md +36 -0
- universal_mcp/applications/google-sheet/__init__.py +1 -0
- universal_mcp/applications/google-sheet/app.py +1941 -0
- universal_mcp/applications/hashnode/README.md +20 -0
- universal_mcp/applications/hashnode/__init__.py +1 -0
- universal_mcp/applications/hashnode/app.py +455 -0
- universal_mcp/applications/heygen/README.md +44 -0
- universal_mcp/applications/heygen/__init__.py +1 -0
- universal_mcp/applications/heygen/app.py +961 -0
- universal_mcp/applications/http-tools/README.md +16 -0
- universal_mcp/applications/http-tools/__init__.py +1 -0
- universal_mcp/applications/http-tools/app.py +153 -0
- universal_mcp/applications/hubspot/README.md +239 -0
- universal_mcp/applications/hubspot/__init__.py +1 -0
- universal_mcp/applications/hubspot/app.py +416 -0
- universal_mcp/applications/jira/README.md +600 -0
- universal_mcp/applications/jira/__init__.py +1 -0
- universal_mcp/applications/jira/app.py +28804 -0
- universal_mcp/applications/klaviyo/README.md +313 -0
- universal_mcp/applications/klaviyo/__init__.py +1 -0
- universal_mcp/applications/klaviyo/app.py +11236 -0
- universal_mcp/applications/linkedin/README.md +15 -0
- universal_mcp/applications/linkedin/__init__.py +1 -0
- universal_mcp/applications/linkedin/app.py +243 -0
- universal_mcp/applications/mailchimp/README.md +281 -0
- universal_mcp/applications/mailchimp/__init__.py +1 -0
- universal_mcp/applications/mailchimp/app.py +10937 -0
- universal_mcp/applications/markitdown/README.md +12 -0
- universal_mcp/applications/markitdown/__init__.py +1 -0
- universal_mcp/applications/markitdown/app.py +63 -0
- universal_mcp/applications/miro/README.md +151 -0
- universal_mcp/applications/miro/__init__.py +1 -0
- universal_mcp/applications/miro/app.py +5429 -0
- universal_mcp/applications/ms-teams/README.md +42 -0
- universal_mcp/applications/ms-teams/__init__.py +1 -0
- universal_mcp/applications/ms-teams/app.py +1823 -0
- universal_mcp/applications/neon/README.md +74 -0
- universal_mcp/applications/neon/__init__.py +1 -0
- universal_mcp/applications/neon/app.py +2018 -0
- universal_mcp/applications/notion/README.md +30 -0
- universal_mcp/applications/notion/__init__.py +1 -0
- universal_mcp/applications/notion/app.py +527 -0
- universal_mcp/applications/openai/README.md +22 -0
- universal_mcp/applications/openai/__init__.py +1 -0
- universal_mcp/applications/openai/app.py +759 -0
- universal_mcp/applications/outlook/README.md +20 -0
- universal_mcp/applications/outlook/__init__.py +1 -0
- universal_mcp/applications/outlook/app.py +444 -0
- universal_mcp/applications/perplexity/README.md +12 -0
- universal_mcp/applications/perplexity/__init__.py +1 -0
- universal_mcp/applications/perplexity/app.py +65 -0
- universal_mcp/applications/pipedrive/README.md +284 -0
- universal_mcp/applications/pipedrive/__init__.py +1 -0
- universal_mcp/applications/pipedrive/app.py +12924 -0
- universal_mcp/applications/posthog/README.md +132 -0
- universal_mcp/applications/posthog/__init__.py +1 -0
- universal_mcp/applications/posthog/app.py +7125 -0
- universal_mcp/applications/reddit/README.md +135 -0
- universal_mcp/applications/reddit/__init__.py +1 -0
- universal_mcp/applications/reddit/app.py +4652 -0
- universal_mcp/applications/replicate/README.md +18 -0
- universal_mcp/applications/replicate/__init__.py +1 -0
- universal_mcp/applications/replicate/app.py +495 -0
- universal_mcp/applications/resend/README.md +40 -0
- universal_mcp/applications/resend/__init__.py +1 -0
- universal_mcp/applications/resend/app.py +881 -0
- universal_mcp/applications/retell/README.md +21 -0
- universal_mcp/applications/retell/__init__.py +1 -0
- universal_mcp/applications/retell/app.py +333 -0
- universal_mcp/applications/rocketlane/README.md +70 -0
- universal_mcp/applications/rocketlane/__init__.py +1 -0
- universal_mcp/applications/rocketlane/app.py +4346 -0
- universal_mcp/applications/semanticscholar/README.md +25 -0
- universal_mcp/applications/semanticscholar/__init__.py +1 -0
- universal_mcp/applications/semanticscholar/app.py +482 -0
- universal_mcp/applications/semrush/README.md +44 -0
- universal_mcp/applications/semrush/__init__.py +1 -0
- universal_mcp/applications/semrush/app.py +2081 -0
- universal_mcp/applications/sendgrid/README.md +362 -0
- universal_mcp/applications/sendgrid/__init__.py +1 -0
- universal_mcp/applications/sendgrid/app.py +9752 -0
- universal_mcp/applications/sentry/README.md +186 -0
- universal_mcp/applications/sentry/__init__.py +1 -0
- universal_mcp/applications/sentry/app.py +7471 -0
- universal_mcp/applications/serpapi/README.md +14 -0
- universal_mcp/applications/serpapi/__init__.py +1 -0
- universal_mcp/applications/serpapi/app.py +293 -0
- universal_mcp/applications/sharepoint/README.md +0 -0
- universal_mcp/applications/sharepoint/__init__.py +1 -0
- universal_mcp/applications/sharepoint/app.py +215 -0
- universal_mcp/applications/shopify/README.md +321 -0
- universal_mcp/applications/shopify/__init__.py +1 -0
- universal_mcp/applications/shopify/app.py +15392 -0
- universal_mcp/applications/shortcut/README.md +128 -0
- universal_mcp/applications/shortcut/__init__.py +1 -0
- universal_mcp/applications/shortcut/app.py +4478 -0
- universal_mcp/applications/slack/README.md +0 -0
- universal_mcp/applications/slack/__init__.py +1 -0
- universal_mcp/applications/slack/app.py +570 -0
- universal_mcp/applications/spotify/README.md +91 -0
- universal_mcp/applications/spotify/__init__.py +1 -0
- universal_mcp/applications/spotify/app.py +2526 -0
- universal_mcp/applications/supabase/README.md +87 -0
- universal_mcp/applications/supabase/__init__.py +1 -0
- universal_mcp/applications/supabase/app.py +2970 -0
- universal_mcp/applications/tavily/README.md +12 -0
- universal_mcp/applications/tavily/__init__.py +1 -0
- universal_mcp/applications/tavily/app.py +51 -0
- universal_mcp/applications/trello/README.md +266 -0
- universal_mcp/applications/trello/__init__.py +1 -0
- universal_mcp/applications/trello/app.py +10875 -0
- universal_mcp/applications/twillo/README.md +0 -0
- universal_mcp/applications/twillo/__init__.py +1 -0
- universal_mcp/applications/twillo/app.py +269 -0
- universal_mcp/applications/twitter/README.md +100 -0
- universal_mcp/applications/twitter/__init__.py +1 -0
- universal_mcp/applications/twitter/api_segments/__init__.py +0 -0
- universal_mcp/applications/twitter/api_segments/api_segment_base.py +51 -0
- universal_mcp/applications/twitter/api_segments/compliance_api.py +122 -0
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +255 -0
- universal_mcp/applications/twitter/api_segments/dm_events_api.py +140 -0
- universal_mcp/applications/twitter/api_segments/likes_api.py +159 -0
- universal_mcp/applications/twitter/api_segments/lists_api.py +395 -0
- universal_mcp/applications/twitter/api_segments/openapi_json_api.py +34 -0
- universal_mcp/applications/twitter/api_segments/spaces_api.py +309 -0
- universal_mcp/applications/twitter/api_segments/trends_api.py +40 -0
- universal_mcp/applications/twitter/api_segments/tweets_api.py +1403 -0
- universal_mcp/applications/twitter/api_segments/usage_api.py +40 -0
- universal_mcp/applications/twitter/api_segments/users_api.py +1498 -0
- universal_mcp/applications/twitter/app.py +46 -0
- universal_mcp/applications/unipile/README.md +28 -0
- universal_mcp/applications/unipile/__init__.py +1 -0
- universal_mcp/applications/unipile/app.py +829 -0
- universal_mcp/applications/whatsapp/README.md +23 -0
- universal_mcp/applications/whatsapp/__init__.py +1 -0
- universal_mcp/applications/whatsapp/app.py +595 -0
- universal_mcp/applications/whatsapp-business/README.md +34 -0
- universal_mcp/applications/whatsapp-business/__init__.py +1 -0
- universal_mcp/applications/whatsapp-business/app.py +1065 -0
- universal_mcp/applications/wrike/README.md +46 -0
- universal_mcp/applications/wrike/__init__.py +1 -0
- universal_mcp/applications/wrike/app.py +1583 -0
- universal_mcp/applications/youtube/README.md +57 -0
- universal_mcp/applications/youtube/__init__.py +1 -0
- universal_mcp/applications/youtube/app.py +1696 -0
- universal_mcp/applications/zenquotes/README.md +12 -0
- universal_mcp/applications/zenquotes/__init__.py +1 -0
- universal_mcp/applications/zenquotes/app.py +31 -0
- universal_mcp_applications-0.1.1.dist-info/METADATA +172 -0
- universal_mcp_applications-0.1.1.dist-info/RECORD +268 -0
- universal_mcp_applications-0.1.1.dist-info/WHEEL +4 -0
- universal_mcp_applications-0.1.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1823 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from universal_mcp.applications.application import APIApplication
|
|
4
|
+
from universal_mcp.integrations import Integration
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MsTeamsApp(APIApplication):
|
|
8
|
+
def __init__(self, integration: Integration = None, **kwargs) -> None:
|
|
9
|
+
super().__init__(name="microsoft-teams", integration=integration, **kwargs)
|
|
10
|
+
self.base_url = "https://graph.microsoft.com/v1.0"
|
|
11
|
+
|
|
12
|
+
def list_chats(
|
|
13
|
+
self,
|
|
14
|
+
top: int | None = None,
|
|
15
|
+
skip: int | None = None,
|
|
16
|
+
search: str | None = None,
|
|
17
|
+
filter: str | None = None,
|
|
18
|
+
count: bool | None = None,
|
|
19
|
+
orderby: list[str] | None = None,
|
|
20
|
+
select: list[str] | None = None,
|
|
21
|
+
expand: list[str] | None = None,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
"""
|
|
24
|
+
List chats
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
top (integer): Show only the first n items Example: '50'.
|
|
28
|
+
skip (integer): Skip the first n items
|
|
29
|
+
search (string): Search items by search phrases
|
|
30
|
+
filter (string): Filter items by property values
|
|
31
|
+
count (boolean): Include count of items
|
|
32
|
+
orderby (array): Order items by property values
|
|
33
|
+
select (array): Select properties to be returned
|
|
34
|
+
expand (array): Expand related entities
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
dict[str, Any]: Retrieved collection
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
41
|
+
|
|
42
|
+
Tags:
|
|
43
|
+
chats.chat, important
|
|
44
|
+
"""
|
|
45
|
+
url = f"{self.base_url}/chats"
|
|
46
|
+
query_params = {
|
|
47
|
+
k: v
|
|
48
|
+
for k, v in [
|
|
49
|
+
("$top", top),
|
|
50
|
+
("$skip", skip),
|
|
51
|
+
("$search", search),
|
|
52
|
+
("$filter", filter),
|
|
53
|
+
("$count", count),
|
|
54
|
+
("$orderby", orderby),
|
|
55
|
+
("$select", select),
|
|
56
|
+
("$expand", expand),
|
|
57
|
+
]
|
|
58
|
+
if v is not None
|
|
59
|
+
}
|
|
60
|
+
response = self._get(url, params=query_params)
|
|
61
|
+
return self._handle_response(response)
|
|
62
|
+
|
|
63
|
+
def get_joined_teams(self) -> list[dict[str, Any]]:
|
|
64
|
+
"""
|
|
65
|
+
Fetches a list of the Microsoft Teams the user has joined.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
A list of dictionaries, where each dictionary represents a team.
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
httpx.HTTPStatusError: If the API request fails due to authentication or other issues.
|
|
72
|
+
|
|
73
|
+
Tags:
|
|
74
|
+
read, list, teams, microsoft-teams, api, important
|
|
75
|
+
"""
|
|
76
|
+
url = f"{self.base_url}/me/joinedTeams"
|
|
77
|
+
response = self._get(url)
|
|
78
|
+
data = self._handle_response(response)
|
|
79
|
+
# The API returns the list of teams under the "value" key.
|
|
80
|
+
return data.get("value", [])
|
|
81
|
+
|
|
82
|
+
def list_channels_for_team(
|
|
83
|
+
self,
|
|
84
|
+
team_id: str,
|
|
85
|
+
top: int | None = None,
|
|
86
|
+
skip: int | None = None,
|
|
87
|
+
search: str | None = None,
|
|
88
|
+
filter: str | None = None,
|
|
89
|
+
count: bool | None = None,
|
|
90
|
+
orderby: list[str] | None = None,
|
|
91
|
+
select: list[str] | None = None,
|
|
92
|
+
expand: list[str] | None = None,
|
|
93
|
+
) -> dict[str, Any]:
|
|
94
|
+
"""
|
|
95
|
+
List channels
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
team_id (string): team-id
|
|
99
|
+
top (integer): Show only the first n items Example: '50'.
|
|
100
|
+
skip (integer): Skip the first n items
|
|
101
|
+
search (string): Search items by search phrases
|
|
102
|
+
filter (string): Filter items by property values
|
|
103
|
+
count (boolean): Include count of items
|
|
104
|
+
orderby (array): Order items by property values
|
|
105
|
+
select (array): Select properties to be returned
|
|
106
|
+
expand (array): Expand related entities
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
dict[str, Any]: Retrieved collection
|
|
110
|
+
|
|
111
|
+
Raises:
|
|
112
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
113
|
+
|
|
114
|
+
Tags:
|
|
115
|
+
teams.channel, important
|
|
116
|
+
"""
|
|
117
|
+
if team_id is None:
|
|
118
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
119
|
+
url = f"{self.base_url}/teams/{team_id}/channels"
|
|
120
|
+
query_params = {
|
|
121
|
+
k: v
|
|
122
|
+
for k, v in [
|
|
123
|
+
("$top", top),
|
|
124
|
+
("$skip", skip),
|
|
125
|
+
("$search", search),
|
|
126
|
+
("$filter", filter),
|
|
127
|
+
("$count", count),
|
|
128
|
+
("$orderby", orderby),
|
|
129
|
+
("$select", select),
|
|
130
|
+
("$expand", expand),
|
|
131
|
+
]
|
|
132
|
+
if v is not None
|
|
133
|
+
}
|
|
134
|
+
response = self._get(url, params=query_params)
|
|
135
|
+
return self._handle_response(response)
|
|
136
|
+
|
|
137
|
+
def send_chat_message(self, chat_id: str, content: str) -> dict[str, Any]:
|
|
138
|
+
"""
|
|
139
|
+
Sends a message to a specific chat.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
chat_id: The unique identifier of the chat.
|
|
143
|
+
content: The message content to send (can be plain text or HTML).
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
A dictionary containing the API response for the sent message, including its ID.
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
httpx.HTTPStatusError: If the API request fails due to invalid ID, permissions, etc.
|
|
150
|
+
|
|
151
|
+
Tags:
|
|
152
|
+
create, send, message, chat, microsoft-teams, api, important
|
|
153
|
+
"""
|
|
154
|
+
url = f"{self.base_url}/chats/{chat_id}/messages"
|
|
155
|
+
payload = {"body": {"content": content}}
|
|
156
|
+
response = self._post(url, data=payload)
|
|
157
|
+
return self._handle_response(response)
|
|
158
|
+
|
|
159
|
+
def send_channel_message(
|
|
160
|
+
self, team_id: str, channel_id: str, content: str
|
|
161
|
+
) -> dict[str, Any]:
|
|
162
|
+
"""
|
|
163
|
+
Sends a message to a specific channel in a Microsoft Teams team.
|
|
164
|
+
|
|
165
|
+
Args:
|
|
166
|
+
team_id: The unique identifier of the team.
|
|
167
|
+
channel_id: The unique identifier of the channel within the team.
|
|
168
|
+
content: The message content to send (can be plain text or HTML).
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
A dictionary containing the API response for the sent message, including its ID.
|
|
172
|
+
|
|
173
|
+
Raises:
|
|
174
|
+
httpx.HTTPStatusError: If the API request fails due to invalid IDs, permissions, etc.
|
|
175
|
+
|
|
176
|
+
Tags:
|
|
177
|
+
create, send, message, channel, microsoft-teams, api, important
|
|
178
|
+
"""
|
|
179
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/messages"
|
|
180
|
+
payload = {"body": {"content": content}}
|
|
181
|
+
response = self._post(url, data=payload)
|
|
182
|
+
return self._handle_response(response)
|
|
183
|
+
|
|
184
|
+
def reply_to_channel_message(
|
|
185
|
+
self, team_id: str, channel_id: str, message_id: str, content: str
|
|
186
|
+
) -> dict[str, Any]:
|
|
187
|
+
"""
|
|
188
|
+
Sends a reply to a specific message in a channel.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
team_id: The unique identifier of the team.
|
|
192
|
+
channel_id: The unique identifier of the channel.
|
|
193
|
+
message_id: The unique identifier of the message to reply to.
|
|
194
|
+
content: The reply message content (can be plain text or HTML).
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
A dictionary containing the API response for the sent reply, including its ID.
|
|
198
|
+
|
|
199
|
+
Raises:
|
|
200
|
+
httpx.HTTPStatusError: If the API request fails due to invalid IDs, permissions, etc.
|
|
201
|
+
|
|
202
|
+
Tags:
|
|
203
|
+
create, send, reply, message, channel, microsoft-teams, api, important
|
|
204
|
+
"""
|
|
205
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/messages/{message_id}/replies"
|
|
206
|
+
payload = {"body": {"content": content}}
|
|
207
|
+
response = self._post(url, data=payload)
|
|
208
|
+
return self._handle_response(response)
|
|
209
|
+
|
|
210
|
+
def create_chat_operation(
|
|
211
|
+
self,
|
|
212
|
+
id: str | None = None,
|
|
213
|
+
chatType: str | None = None,
|
|
214
|
+
createdDateTime: str | None = None,
|
|
215
|
+
isHiddenForAllMembers: bool | None = None,
|
|
216
|
+
lastUpdatedDateTime: str | None = None,
|
|
217
|
+
onlineMeetingInfo: dict[str, dict[str, Any]] | None = None,
|
|
218
|
+
tenantId: str | None = None,
|
|
219
|
+
topic: str | None = None,
|
|
220
|
+
viewpoint: dict[str, dict[str, Any]] | None = None,
|
|
221
|
+
webUrl: str | None = None,
|
|
222
|
+
installedApps: list[Any] | None = None,
|
|
223
|
+
lastMessagePreview: Any | None = None,
|
|
224
|
+
members: list[Any] | None = None,
|
|
225
|
+
messages: list[Any] | None = None,
|
|
226
|
+
permissionGrants: list[Any] | None = None,
|
|
227
|
+
pinnedMessages: list[Any] | None = None,
|
|
228
|
+
tabs: list[Any] | None = None,
|
|
229
|
+
) -> Any:
|
|
230
|
+
"""
|
|
231
|
+
Create chat
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
235
|
+
chatType (string): chatType
|
|
236
|
+
createdDateTime (string): Date and time at which the chat was created. Read-only.
|
|
237
|
+
isHiddenForAllMembers (boolean): Indicates whether the chat is hidden for all its members. Read-only.
|
|
238
|
+
lastUpdatedDateTime (string): Date and time at which the chat was renamed or the list of members was last changed. Read-only.
|
|
239
|
+
onlineMeetingInfo (object): onlineMeetingInfo
|
|
240
|
+
tenantId (string): The identifier of the tenant in which the chat was created. Read-only.
|
|
241
|
+
topic (string): (Optional) Subject or topic for the chat. Only available for group chats.
|
|
242
|
+
viewpoint (object): viewpoint
|
|
243
|
+
webUrl (string): The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only.
|
|
244
|
+
installedApps (array): A collection of all the apps in the chat. Nullable.
|
|
245
|
+
lastMessagePreview (string): lastMessagePreview
|
|
246
|
+
members (array): A collection of all the members in the chat. Nullable.
|
|
247
|
+
messages (array): A collection of all the messages in the chat. Nullable.
|
|
248
|
+
permissionGrants (array): A collection of permissions granted to apps for the chat.
|
|
249
|
+
pinnedMessages (array): A collection of all the pinned messages in the chat. Nullable.
|
|
250
|
+
tabs (array): A collection of all the tabs in the chat. Nullable.
|
|
251
|
+
|
|
252
|
+
Returns:
|
|
253
|
+
Any: Created entity
|
|
254
|
+
|
|
255
|
+
Raises:
|
|
256
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
257
|
+
|
|
258
|
+
Tags:
|
|
259
|
+
chats.chat
|
|
260
|
+
"""
|
|
261
|
+
request_body_data = None
|
|
262
|
+
request_body_data = {
|
|
263
|
+
"id": id,
|
|
264
|
+
"chatType": chatType,
|
|
265
|
+
"createdDateTime": createdDateTime,
|
|
266
|
+
"isHiddenForAllMembers": isHiddenForAllMembers,
|
|
267
|
+
"lastUpdatedDateTime": lastUpdatedDateTime,
|
|
268
|
+
"onlineMeetingInfo": onlineMeetingInfo,
|
|
269
|
+
"tenantId": tenantId,
|
|
270
|
+
"topic": topic,
|
|
271
|
+
"viewpoint": viewpoint,
|
|
272
|
+
"webUrl": webUrl,
|
|
273
|
+
"installedApps": installedApps,
|
|
274
|
+
"lastMessagePreview": lastMessagePreview,
|
|
275
|
+
"members": members,
|
|
276
|
+
"messages": messages,
|
|
277
|
+
"permissionGrants": permissionGrants,
|
|
278
|
+
"pinnedMessages": pinnedMessages,
|
|
279
|
+
"tabs": tabs,
|
|
280
|
+
}
|
|
281
|
+
request_body_data = {
|
|
282
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
283
|
+
}
|
|
284
|
+
url = f"{self.base_url}/chats"
|
|
285
|
+
query_params = {}
|
|
286
|
+
response = self._post(
|
|
287
|
+
url,
|
|
288
|
+
data=request_body_data,
|
|
289
|
+
params=query_params,
|
|
290
|
+
content_type="application/json",
|
|
291
|
+
)
|
|
292
|
+
return self._handle_response(response)
|
|
293
|
+
|
|
294
|
+
def get_chat(
|
|
295
|
+
self,
|
|
296
|
+
chat_id: str,
|
|
297
|
+
select: list[str] | None = None,
|
|
298
|
+
expand: list[str] | None = None,
|
|
299
|
+
) -> Any:
|
|
300
|
+
"""
|
|
301
|
+
Get chat
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
chat_id (string): chat-id
|
|
305
|
+
select (array): Select properties to be returned
|
|
306
|
+
expand (array): Expand related entities
|
|
307
|
+
|
|
308
|
+
Returns:
|
|
309
|
+
Any: Retrieved entity
|
|
310
|
+
|
|
311
|
+
Raises:
|
|
312
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
313
|
+
|
|
314
|
+
Tags:
|
|
315
|
+
chats.chat
|
|
316
|
+
"""
|
|
317
|
+
if chat_id is None:
|
|
318
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
319
|
+
url = f"{self.base_url}/chats/{chat_id}"
|
|
320
|
+
query_params = {
|
|
321
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
322
|
+
}
|
|
323
|
+
response = self._get(url, params=query_params)
|
|
324
|
+
return self._handle_response(response)
|
|
325
|
+
|
|
326
|
+
def update_chat_details(
|
|
327
|
+
self,
|
|
328
|
+
chat_id: str,
|
|
329
|
+
id: str | None = None,
|
|
330
|
+
chatType: str | None = None,
|
|
331
|
+
createdDateTime: str | None = None,
|
|
332
|
+
isHiddenForAllMembers: bool | None = None,
|
|
333
|
+
lastUpdatedDateTime: str | None = None,
|
|
334
|
+
onlineMeetingInfo: dict[str, dict[str, Any]] | None = None,
|
|
335
|
+
tenantId: str | None = None,
|
|
336
|
+
topic: str | None = None,
|
|
337
|
+
viewpoint: dict[str, dict[str, Any]] | None = None,
|
|
338
|
+
webUrl: str | None = None,
|
|
339
|
+
installedApps: list[Any] | None = None,
|
|
340
|
+
lastMessagePreview: Any | None = None,
|
|
341
|
+
members: list[Any] | None = None,
|
|
342
|
+
messages: list[Any] | None = None,
|
|
343
|
+
permissionGrants: list[Any] | None = None,
|
|
344
|
+
pinnedMessages: list[Any] | None = None,
|
|
345
|
+
tabs: list[Any] | None = None,
|
|
346
|
+
) -> Any:
|
|
347
|
+
"""
|
|
348
|
+
Update chat
|
|
349
|
+
|
|
350
|
+
Args:
|
|
351
|
+
chat_id (string): chat-id
|
|
352
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
353
|
+
chatType (string): chatType
|
|
354
|
+
createdDateTime (string): Date and time at which the chat was created. Read-only.
|
|
355
|
+
isHiddenForAllMembers (boolean): Indicates whether the chat is hidden for all its members. Read-only.
|
|
356
|
+
lastUpdatedDateTime (string): Date and time at which the chat was renamed or the list of members was last changed. Read-only.
|
|
357
|
+
onlineMeetingInfo (object): onlineMeetingInfo
|
|
358
|
+
tenantId (string): The identifier of the tenant in which the chat was created. Read-only.
|
|
359
|
+
topic (string): (Optional) Subject or topic for the chat. Only available for group chats.
|
|
360
|
+
viewpoint (object): viewpoint
|
|
361
|
+
webUrl (string): The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only.
|
|
362
|
+
installedApps (array): A collection of all the apps in the chat. Nullable.
|
|
363
|
+
lastMessagePreview (string): lastMessagePreview
|
|
364
|
+
members (array): A collection of all the members in the chat. Nullable.
|
|
365
|
+
messages (array): A collection of all the messages in the chat. Nullable.
|
|
366
|
+
permissionGrants (array): A collection of permissions granted to apps for the chat.
|
|
367
|
+
pinnedMessages (array): A collection of all the pinned messages in the chat. Nullable.
|
|
368
|
+
tabs (array): A collection of all the tabs in the chat. Nullable.
|
|
369
|
+
|
|
370
|
+
Returns:
|
|
371
|
+
Any: Success
|
|
372
|
+
|
|
373
|
+
Raises:
|
|
374
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
375
|
+
|
|
376
|
+
Tags:
|
|
377
|
+
chats.chat
|
|
378
|
+
"""
|
|
379
|
+
if chat_id is None:
|
|
380
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
381
|
+
request_body_data = None
|
|
382
|
+
request_body_data = {
|
|
383
|
+
"id": id,
|
|
384
|
+
"chatType": chatType,
|
|
385
|
+
"createdDateTime": createdDateTime,
|
|
386
|
+
"isHiddenForAllMembers": isHiddenForAllMembers,
|
|
387
|
+
"lastUpdatedDateTime": lastUpdatedDateTime,
|
|
388
|
+
"onlineMeetingInfo": onlineMeetingInfo,
|
|
389
|
+
"tenantId": tenantId,
|
|
390
|
+
"topic": topic,
|
|
391
|
+
"viewpoint": viewpoint,
|
|
392
|
+
"webUrl": webUrl,
|
|
393
|
+
"installedApps": installedApps,
|
|
394
|
+
"lastMessagePreview": lastMessagePreview,
|
|
395
|
+
"members": members,
|
|
396
|
+
"messages": messages,
|
|
397
|
+
"permissionGrants": permissionGrants,
|
|
398
|
+
"pinnedMessages": pinnedMessages,
|
|
399
|
+
"tabs": tabs,
|
|
400
|
+
}
|
|
401
|
+
request_body_data = {
|
|
402
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
403
|
+
}
|
|
404
|
+
url = f"{self.base_url}/chats/{chat_id}"
|
|
405
|
+
query_params = {}
|
|
406
|
+
response = self._patch(url, data=request_body_data, params=query_params)
|
|
407
|
+
return self._handle_response(response)
|
|
408
|
+
|
|
409
|
+
def list_chat_apps(
|
|
410
|
+
self,
|
|
411
|
+
chat_id: str,
|
|
412
|
+
top: int | None = None,
|
|
413
|
+
skip: int | None = None,
|
|
414
|
+
search: str | None = None,
|
|
415
|
+
filter: str | None = None,
|
|
416
|
+
count: bool | None = None,
|
|
417
|
+
orderby: list[str] | None = None,
|
|
418
|
+
select: list[str] | None = None,
|
|
419
|
+
expand: list[str] | None = None,
|
|
420
|
+
) -> dict[str, Any]:
|
|
421
|
+
"""
|
|
422
|
+
List apps in chat
|
|
423
|
+
|
|
424
|
+
Args:
|
|
425
|
+
chat_id (string): chat-id
|
|
426
|
+
top (integer): Show only the first n items Example: '50'.
|
|
427
|
+
skip (integer): Skip the first n items
|
|
428
|
+
search (string): Search items by search phrases
|
|
429
|
+
filter (string): Filter items by property values
|
|
430
|
+
count (boolean): Include count of items
|
|
431
|
+
orderby (array): Order items by property values
|
|
432
|
+
select (array): Select properties to be returned
|
|
433
|
+
expand (array): Expand related entities
|
|
434
|
+
|
|
435
|
+
Returns:
|
|
436
|
+
dict[str, Any]: Retrieved collection
|
|
437
|
+
|
|
438
|
+
Raises:
|
|
439
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
440
|
+
|
|
441
|
+
Tags:
|
|
442
|
+
chats.teamsAppInstallation
|
|
443
|
+
"""
|
|
444
|
+
if chat_id is None:
|
|
445
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
446
|
+
url = f"{self.base_url}/chats/{chat_id}/installedApps"
|
|
447
|
+
query_params = {
|
|
448
|
+
k: v
|
|
449
|
+
for k, v in [
|
|
450
|
+
("$top", top),
|
|
451
|
+
("$skip", skip),
|
|
452
|
+
("$search", search),
|
|
453
|
+
("$filter", filter),
|
|
454
|
+
("$count", count),
|
|
455
|
+
("$orderby", orderby),
|
|
456
|
+
("$select", select),
|
|
457
|
+
("$expand", expand),
|
|
458
|
+
]
|
|
459
|
+
if v is not None
|
|
460
|
+
}
|
|
461
|
+
response = self._get(url, params=query_params)
|
|
462
|
+
return self._handle_response(response)
|
|
463
|
+
|
|
464
|
+
def list_chat_members(
|
|
465
|
+
self,
|
|
466
|
+
chat_id: str,
|
|
467
|
+
top: int | None = None,
|
|
468
|
+
skip: int | None = None,
|
|
469
|
+
search: str | None = None,
|
|
470
|
+
filter: str | None = None,
|
|
471
|
+
count: bool | None = None,
|
|
472
|
+
orderby: list[str] | None = None,
|
|
473
|
+
select: list[str] | None = None,
|
|
474
|
+
expand: list[str] | None = None,
|
|
475
|
+
) -> dict[str, Any]:
|
|
476
|
+
"""
|
|
477
|
+
List conversationMembers
|
|
478
|
+
|
|
479
|
+
Args:
|
|
480
|
+
chat_id (string): chat-id
|
|
481
|
+
top (integer): Show only the first n items Example: '50'.
|
|
482
|
+
skip (integer): Skip the first n items
|
|
483
|
+
search (string): Search items by search phrases
|
|
484
|
+
filter (string): Filter items by property values
|
|
485
|
+
count (boolean): Include count of items
|
|
486
|
+
orderby (array): Order items by property values
|
|
487
|
+
select (array): Select properties to be returned
|
|
488
|
+
expand (array): Expand related entities
|
|
489
|
+
|
|
490
|
+
Returns:
|
|
491
|
+
dict[str, Any]: Retrieved collection
|
|
492
|
+
|
|
493
|
+
Raises:
|
|
494
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
495
|
+
|
|
496
|
+
Tags:
|
|
497
|
+
chats.conversationMember
|
|
498
|
+
"""
|
|
499
|
+
if chat_id is None:
|
|
500
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
501
|
+
url = f"{self.base_url}/chats/{chat_id}/members"
|
|
502
|
+
query_params = {
|
|
503
|
+
k: v
|
|
504
|
+
for k, v in [
|
|
505
|
+
("$top", top),
|
|
506
|
+
("$skip", skip),
|
|
507
|
+
("$search", search),
|
|
508
|
+
("$filter", filter),
|
|
509
|
+
("$count", count),
|
|
510
|
+
("$orderby", orderby),
|
|
511
|
+
("$select", select),
|
|
512
|
+
("$expand", expand),
|
|
513
|
+
]
|
|
514
|
+
if v is not None
|
|
515
|
+
}
|
|
516
|
+
response = self._get(url, params=query_params)
|
|
517
|
+
return self._handle_response(response)
|
|
518
|
+
|
|
519
|
+
def add_member_to_chat(
|
|
520
|
+
self,
|
|
521
|
+
chat_id: str,
|
|
522
|
+
id: str | None = None,
|
|
523
|
+
displayName: str | None = None,
|
|
524
|
+
roles: list[str] | None = None,
|
|
525
|
+
visibleHistoryStartDateTime: str | None = None,
|
|
526
|
+
) -> Any:
|
|
527
|
+
"""
|
|
528
|
+
Add member to a chat
|
|
529
|
+
|
|
530
|
+
Args:
|
|
531
|
+
chat_id (string): chat-id
|
|
532
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
533
|
+
displayName (string): The display name of the user.
|
|
534
|
+
roles (array): The roles for that user. This property contains more qualifiers only when relevant - for example, if the member has owner privileges, the roles property contains owner as one of the values. Similarly, if the member is an in-tenant guest, the roles property contains guest as one of the values. A basic member shouldn't have any values specified in the roles property. An Out-of-tenant external member is assigned the owner role.
|
|
535
|
+
visibleHistoryStartDateTime (string): The timestamp denoting how far back a conversation's history is shared with the conversation member. This property is settable only for members of a chat.
|
|
536
|
+
|
|
537
|
+
Returns:
|
|
538
|
+
Any: Created navigation property.
|
|
539
|
+
|
|
540
|
+
Raises:
|
|
541
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
542
|
+
|
|
543
|
+
Tags:
|
|
544
|
+
chats.conversationMember
|
|
545
|
+
"""
|
|
546
|
+
if chat_id is None:
|
|
547
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
548
|
+
request_body_data = None
|
|
549
|
+
request_body_data = {
|
|
550
|
+
"id": id,
|
|
551
|
+
"displayName": displayName,
|
|
552
|
+
"roles": roles,
|
|
553
|
+
"visibleHistoryStartDateTime": visibleHistoryStartDateTime,
|
|
554
|
+
}
|
|
555
|
+
request_body_data = {
|
|
556
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
557
|
+
}
|
|
558
|
+
url = f"{self.base_url}/chats/{chat_id}/members"
|
|
559
|
+
query_params = {}
|
|
560
|
+
response = self._post(
|
|
561
|
+
url,
|
|
562
|
+
data=request_body_data,
|
|
563
|
+
params=query_params,
|
|
564
|
+
content_type="application/json",
|
|
565
|
+
)
|
|
566
|
+
return self._handle_response(response)
|
|
567
|
+
|
|
568
|
+
def get_chat_member_details(
|
|
569
|
+
self,
|
|
570
|
+
chat_id: str,
|
|
571
|
+
conversationMember_id: str,
|
|
572
|
+
select: list[str] | None = None,
|
|
573
|
+
expand: list[str] | None = None,
|
|
574
|
+
) -> Any:
|
|
575
|
+
"""
|
|
576
|
+
Get conversationMember
|
|
577
|
+
|
|
578
|
+
Args:
|
|
579
|
+
chat_id (string): chat-id
|
|
580
|
+
conversationMember_id (string): conversationMember-id
|
|
581
|
+
select (array): Select properties to be returned
|
|
582
|
+
expand (array): Expand related entities
|
|
583
|
+
|
|
584
|
+
Returns:
|
|
585
|
+
Any: Retrieved navigation property
|
|
586
|
+
|
|
587
|
+
Raises:
|
|
588
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
589
|
+
|
|
590
|
+
Tags:
|
|
591
|
+
chats.conversationMember
|
|
592
|
+
"""
|
|
593
|
+
if chat_id is None:
|
|
594
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
595
|
+
if conversationMember_id is None:
|
|
596
|
+
raise ValueError("Missing required parameter 'conversationMember-id'.")
|
|
597
|
+
url = f"{self.base_url}/chats/{chat_id}/members/{conversationMember_id}"
|
|
598
|
+
query_params = {
|
|
599
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
600
|
+
}
|
|
601
|
+
response = self._get(url, params=query_params)
|
|
602
|
+
return self._handle_response(response)
|
|
603
|
+
|
|
604
|
+
def delete_chat_member(self, chat_id: str, conversationMember_id: str) -> Any:
|
|
605
|
+
"""
|
|
606
|
+
Remove member from chat
|
|
607
|
+
|
|
608
|
+
Args:
|
|
609
|
+
chat_id (string): chat-id
|
|
610
|
+
conversationMember_id (string): conversationMember-id
|
|
611
|
+
|
|
612
|
+
Returns:
|
|
613
|
+
Any: Success
|
|
614
|
+
|
|
615
|
+
Raises:
|
|
616
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
617
|
+
|
|
618
|
+
Tags:
|
|
619
|
+
chats.conversationMember
|
|
620
|
+
"""
|
|
621
|
+
if chat_id is None:
|
|
622
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
623
|
+
if conversationMember_id is None:
|
|
624
|
+
raise ValueError("Missing required parameter 'conversationMember-id'.")
|
|
625
|
+
url = f"{self.base_url}/chats/{chat_id}/members/{conversationMember_id}"
|
|
626
|
+
query_params = {}
|
|
627
|
+
response = self._delete(url, params=query_params)
|
|
628
|
+
return self._handle_response(response)
|
|
629
|
+
|
|
630
|
+
def list_chat_messages(
|
|
631
|
+
self,
|
|
632
|
+
chat_id: str,
|
|
633
|
+
top: int | None = None,
|
|
634
|
+
skip: int | None = None,
|
|
635
|
+
search: str | None = None,
|
|
636
|
+
filter: str | None = None,
|
|
637
|
+
count: bool | None = None,
|
|
638
|
+
orderby: list[str] | None = None,
|
|
639
|
+
select: list[str] | None = None,
|
|
640
|
+
expand: list[str] | None = None,
|
|
641
|
+
) -> dict[str, Any]:
|
|
642
|
+
"""
|
|
643
|
+
List messages in a chat
|
|
644
|
+
|
|
645
|
+
Args:
|
|
646
|
+
chat_id (string): chat-id
|
|
647
|
+
top (integer): Show only the first n items Example: '50'.
|
|
648
|
+
skip (integer): Skip the first n items
|
|
649
|
+
search (string): Search items by search phrases
|
|
650
|
+
filter (string): Filter items by property values
|
|
651
|
+
count (boolean): Include count of items
|
|
652
|
+
orderby (array): Order items by property values
|
|
653
|
+
select (array): Select properties to be returned
|
|
654
|
+
expand (array): Expand related entities
|
|
655
|
+
|
|
656
|
+
Returns:
|
|
657
|
+
dict[str, Any]: Retrieved collection
|
|
658
|
+
|
|
659
|
+
Raises:
|
|
660
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
661
|
+
|
|
662
|
+
Tags:
|
|
663
|
+
chats.chatMessage
|
|
664
|
+
"""
|
|
665
|
+
if chat_id is None:
|
|
666
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
667
|
+
url = f"{self.base_url}/chats/{chat_id}/messages"
|
|
668
|
+
query_params = {
|
|
669
|
+
k: v
|
|
670
|
+
for k, v in [
|
|
671
|
+
("$top", top),
|
|
672
|
+
("$skip", skip),
|
|
673
|
+
("$search", search),
|
|
674
|
+
("$filter", filter),
|
|
675
|
+
("$count", count),
|
|
676
|
+
("$orderby", orderby),
|
|
677
|
+
("$select", select),
|
|
678
|
+
("$expand", expand),
|
|
679
|
+
]
|
|
680
|
+
if v is not None
|
|
681
|
+
}
|
|
682
|
+
response = self._get(url, params=query_params)
|
|
683
|
+
return self._handle_response(response)
|
|
684
|
+
|
|
685
|
+
def get_chat_message_detail(
|
|
686
|
+
self,
|
|
687
|
+
chat_id: str,
|
|
688
|
+
chatMessage_id: str,
|
|
689
|
+
select: list[str] | None = None,
|
|
690
|
+
expand: list[str] | None = None,
|
|
691
|
+
) -> Any:
|
|
692
|
+
"""
|
|
693
|
+
Get chatMessage in a channel or chat
|
|
694
|
+
|
|
695
|
+
Args:
|
|
696
|
+
chat_id (string): chat-id
|
|
697
|
+
chatMessage_id (string): chatMessage-id
|
|
698
|
+
select (array): Select properties to be returned
|
|
699
|
+
expand (array): Expand related entities
|
|
700
|
+
|
|
701
|
+
Returns:
|
|
702
|
+
Any: Retrieved navigation property
|
|
703
|
+
|
|
704
|
+
Raises:
|
|
705
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
706
|
+
|
|
707
|
+
Tags:
|
|
708
|
+
chats.chatMessage
|
|
709
|
+
"""
|
|
710
|
+
if chat_id is None:
|
|
711
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
712
|
+
if chatMessage_id is None:
|
|
713
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
714
|
+
url = f"{self.base_url}/chats/{chat_id}/messages/{chatMessage_id}"
|
|
715
|
+
query_params = {
|
|
716
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
717
|
+
}
|
|
718
|
+
response = self._get(url, params=query_params)
|
|
719
|
+
return self._handle_response(response)
|
|
720
|
+
|
|
721
|
+
def read_chat_replies(
|
|
722
|
+
self,
|
|
723
|
+
chat_id: str,
|
|
724
|
+
chatMessage_id: str,
|
|
725
|
+
top: int | None = None,
|
|
726
|
+
skip: int | None = None,
|
|
727
|
+
search: str | None = None,
|
|
728
|
+
filter: str | None = None,
|
|
729
|
+
count: bool | None = None,
|
|
730
|
+
orderby: list[str] | None = None,
|
|
731
|
+
select: list[str] | None = None,
|
|
732
|
+
expand: list[str] | None = None,
|
|
733
|
+
) -> dict[str, Any]:
|
|
734
|
+
"""
|
|
735
|
+
Get replies from chats
|
|
736
|
+
|
|
737
|
+
Args:
|
|
738
|
+
chat_id (string): chat-id
|
|
739
|
+
chatMessage_id (string): chatMessage-id
|
|
740
|
+
top (integer): Show only the first n items Example: '50'.
|
|
741
|
+
skip (integer): Skip the first n items
|
|
742
|
+
search (string): Search items by search phrases
|
|
743
|
+
filter (string): Filter items by property values
|
|
744
|
+
count (boolean): Include count of items
|
|
745
|
+
orderby (array): Order items by property values
|
|
746
|
+
select (array): Select properties to be returned
|
|
747
|
+
expand (array): Expand related entities
|
|
748
|
+
|
|
749
|
+
Returns:
|
|
750
|
+
dict[str, Any]: Retrieved collection
|
|
751
|
+
|
|
752
|
+
Raises:
|
|
753
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
754
|
+
|
|
755
|
+
Tags:
|
|
756
|
+
chats.chatMessage
|
|
757
|
+
"""
|
|
758
|
+
if chat_id is None:
|
|
759
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
760
|
+
if chatMessage_id is None:
|
|
761
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
762
|
+
url = f"{self.base_url}/chats/{chat_id}/messages/{chatMessage_id}/replies"
|
|
763
|
+
query_params = {
|
|
764
|
+
k: v
|
|
765
|
+
for k, v in [
|
|
766
|
+
("$top", top),
|
|
767
|
+
("$skip", skip),
|
|
768
|
+
("$search", search),
|
|
769
|
+
("$filter", filter),
|
|
770
|
+
("$count", count),
|
|
771
|
+
("$orderby", orderby),
|
|
772
|
+
("$select", select),
|
|
773
|
+
("$expand", expand),
|
|
774
|
+
]
|
|
775
|
+
if v is not None
|
|
776
|
+
}
|
|
777
|
+
response = self._get(url, params=query_params)
|
|
778
|
+
return self._handle_response(response)
|
|
779
|
+
|
|
780
|
+
def create_chat_reply(
|
|
781
|
+
self,
|
|
782
|
+
chat_id: str,
|
|
783
|
+
chatMessage_id: str,
|
|
784
|
+
id: str | None = None,
|
|
785
|
+
attachments: list[dict[str, dict[str, Any]]] | None = None,
|
|
786
|
+
body: dict[str, dict[str, Any]] | None = None,
|
|
787
|
+
channelIdentity: dict[str, dict[str, Any]] | None = None,
|
|
788
|
+
chatId: str | None = None,
|
|
789
|
+
createdDateTime: str | None = None,
|
|
790
|
+
deletedDateTime: str | None = None,
|
|
791
|
+
etag: str | None = None,
|
|
792
|
+
eventDetail: dict[str, dict[str, Any]] | None = None,
|
|
793
|
+
from_: Any | None = None,
|
|
794
|
+
importance: str | None = None,
|
|
795
|
+
lastEditedDateTime: str | None = None,
|
|
796
|
+
lastModifiedDateTime: str | None = None,
|
|
797
|
+
locale: str | None = None,
|
|
798
|
+
mentions: list[dict[str, dict[str, Any]]] | None = None,
|
|
799
|
+
messageHistory: list[dict[str, dict[str, Any]]] | None = None,
|
|
800
|
+
messageType: str | None = None,
|
|
801
|
+
policyViolation: dict[str, dict[str, Any]] | None = None,
|
|
802
|
+
reactions: list[dict[str, dict[str, Any]]] | None = None,
|
|
803
|
+
replyToId: str | None = None,
|
|
804
|
+
subject: str | None = None,
|
|
805
|
+
summary: str | None = None,
|
|
806
|
+
webUrl: str | None = None,
|
|
807
|
+
hostedContents: list[Any] | None = None,
|
|
808
|
+
replies: list[Any] | None = None,
|
|
809
|
+
) -> Any:
|
|
810
|
+
"""
|
|
811
|
+
Create new navigation property to replies for chats
|
|
812
|
+
|
|
813
|
+
Args:
|
|
814
|
+
chat_id (string): chat-id
|
|
815
|
+
chatMessage_id (string): chatMessage-id
|
|
816
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
817
|
+
attachments (array): References to attached objects like files, tabs, meetings etc.
|
|
818
|
+
body (object): body
|
|
819
|
+
channelIdentity (object): channelIdentity
|
|
820
|
+
chatId (string): If the message was sent in a chat, represents the identity of the chat.
|
|
821
|
+
createdDateTime (string): Timestamp of when the chat message was created.
|
|
822
|
+
deletedDateTime (string): Read only. Timestamp at which the chat message was deleted, or null if not deleted.
|
|
823
|
+
etag (string): Read-only. Version number of the chat message.
|
|
824
|
+
eventDetail (object): eventDetail
|
|
825
|
+
from_ (string): from
|
|
826
|
+
importance (string): importance
|
|
827
|
+
lastEditedDateTime (string): Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.
|
|
828
|
+
lastModifiedDateTime (string): Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
|
|
829
|
+
locale (string): Locale of the chat message set by the client. Always set to en-us.
|
|
830
|
+
mentions (array): List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag.
|
|
831
|
+
messageHistory (array): List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.
|
|
832
|
+
messageType (string): messageType
|
|
833
|
+
policyViolation (object): policyViolation
|
|
834
|
+
reactions (array): Reactions for this chat message (for example, Like).
|
|
835
|
+
replyToId (string): Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)
|
|
836
|
+
subject (string): The subject of the chat message, in plaintext.
|
|
837
|
+
summary (string): Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.
|
|
838
|
+
webUrl (string): Read-only. Link to the message in Microsoft Teams.
|
|
839
|
+
hostedContents (array): Content in a message hosted by Microsoft Teams - for example, images or code snippets.
|
|
840
|
+
replies (array): Replies for a specified message. Supports $expand for channel messages.
|
|
841
|
+
|
|
842
|
+
Returns:
|
|
843
|
+
Any: Created navigation property.
|
|
844
|
+
|
|
845
|
+
Raises:
|
|
846
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
847
|
+
|
|
848
|
+
Tags:
|
|
849
|
+
chats.chatMessage
|
|
850
|
+
"""
|
|
851
|
+
if chat_id is None:
|
|
852
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
853
|
+
if chatMessage_id is None:
|
|
854
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
855
|
+
request_body_data = None
|
|
856
|
+
request_body_data = {
|
|
857
|
+
"id": id,
|
|
858
|
+
"attachments": attachments,
|
|
859
|
+
"body": body,
|
|
860
|
+
"channelIdentity": channelIdentity,
|
|
861
|
+
"chatId": chatId,
|
|
862
|
+
"createdDateTime": createdDateTime,
|
|
863
|
+
"deletedDateTime": deletedDateTime,
|
|
864
|
+
"etag": etag,
|
|
865
|
+
"eventDetail": eventDetail,
|
|
866
|
+
"from": from_,
|
|
867
|
+
"importance": importance,
|
|
868
|
+
"lastEditedDateTime": lastEditedDateTime,
|
|
869
|
+
"lastModifiedDateTime": lastModifiedDateTime,
|
|
870
|
+
"locale": locale,
|
|
871
|
+
"mentions": mentions,
|
|
872
|
+
"messageHistory": messageHistory,
|
|
873
|
+
"messageType": messageType,
|
|
874
|
+
"policyViolation": policyViolation,
|
|
875
|
+
"reactions": reactions,
|
|
876
|
+
"replyToId": replyToId,
|
|
877
|
+
"subject": subject,
|
|
878
|
+
"summary": summary,
|
|
879
|
+
"webUrl": webUrl,
|
|
880
|
+
"hostedContents": hostedContents,
|
|
881
|
+
"replies": replies,
|
|
882
|
+
}
|
|
883
|
+
request_body_data = {
|
|
884
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
885
|
+
}
|
|
886
|
+
url = f"{self.base_url}/chats/{chat_id}/messages/{chatMessage_id}/replies"
|
|
887
|
+
query_params = {}
|
|
888
|
+
response = self._post(
|
|
889
|
+
url,
|
|
890
|
+
data=request_body_data,
|
|
891
|
+
params=query_params,
|
|
892
|
+
content_type="application/json",
|
|
893
|
+
)
|
|
894
|
+
return self._handle_response(response)
|
|
895
|
+
|
|
896
|
+
def get_chat_replies(
|
|
897
|
+
self,
|
|
898
|
+
chat_id: str,
|
|
899
|
+
chatMessage_id: str,
|
|
900
|
+
chatMessage_id1: str,
|
|
901
|
+
select: list[str] | None = None,
|
|
902
|
+
expand: list[str] | None = None,
|
|
903
|
+
) -> Any:
|
|
904
|
+
"""
|
|
905
|
+
Get replies from chats
|
|
906
|
+
|
|
907
|
+
Args:
|
|
908
|
+
chat_id (string): chat-id
|
|
909
|
+
chatMessage_id (string): chatMessage-id
|
|
910
|
+
chatMessage_id1 (string): chatMessage-id1
|
|
911
|
+
select (array): Select properties to be returned
|
|
912
|
+
expand (array): Expand related entities
|
|
913
|
+
|
|
914
|
+
Returns:
|
|
915
|
+
Any: Retrieved navigation property
|
|
916
|
+
|
|
917
|
+
Raises:
|
|
918
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
919
|
+
|
|
920
|
+
Tags:
|
|
921
|
+
chats.chatMessage
|
|
922
|
+
"""
|
|
923
|
+
if chat_id is None:
|
|
924
|
+
raise ValueError("Missing required parameter 'chat-id'.")
|
|
925
|
+
if chatMessage_id is None:
|
|
926
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
927
|
+
if chatMessage_id1 is None:
|
|
928
|
+
raise ValueError("Missing required parameter 'chatMessage-id1'.")
|
|
929
|
+
url = f"{self.base_url}/chats/{chat_id}/messages/{chatMessage_id}/replies/{chatMessage_id1}"
|
|
930
|
+
query_params = {
|
|
931
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
932
|
+
}
|
|
933
|
+
response = self._get(url, params=query_params)
|
|
934
|
+
return self._handle_response(response)
|
|
935
|
+
|
|
936
|
+
def create_team_from_group(
|
|
937
|
+
self,
|
|
938
|
+
group_id: str,
|
|
939
|
+
id: str | None = None,
|
|
940
|
+
classification: str | None = None,
|
|
941
|
+
createdDateTime: str | None = None,
|
|
942
|
+
description: str | None = None,
|
|
943
|
+
displayName: str | None = None,
|
|
944
|
+
firstChannelName: str | None = None,
|
|
945
|
+
funSettings: dict[str, dict[str, Any]] | None = None,
|
|
946
|
+
guestSettings: dict[str, dict[str, Any]] | None = None,
|
|
947
|
+
internalId: str | None = None,
|
|
948
|
+
isArchived: bool | None = None,
|
|
949
|
+
memberSettings: dict[str, dict[str, Any]] | None = None,
|
|
950
|
+
messagingSettings: dict[str, dict[str, Any]] | None = None,
|
|
951
|
+
specialization: str | None = None,
|
|
952
|
+
summary: dict[str, dict[str, Any]] | None = None,
|
|
953
|
+
tenantId: str | None = None,
|
|
954
|
+
visibility: str | None = None,
|
|
955
|
+
webUrl: str | None = None,
|
|
956
|
+
allChannels: list[Any] | None = None,
|
|
957
|
+
channels: list[Any] | None = None,
|
|
958
|
+
group: Any | None = None,
|
|
959
|
+
incomingChannels: list[Any] | None = None,
|
|
960
|
+
installedApps: list[Any] | None = None,
|
|
961
|
+
members: list[Any] | None = None,
|
|
962
|
+
operations: list[Any] | None = None,
|
|
963
|
+
permissionGrants: list[Any] | None = None,
|
|
964
|
+
photo: Any | None = None,
|
|
965
|
+
primaryChannel: Any | None = None,
|
|
966
|
+
schedule: Any | None = None,
|
|
967
|
+
tags: list[Any] | None = None,
|
|
968
|
+
template: Any | None = None,
|
|
969
|
+
) -> Any:
|
|
970
|
+
"""
|
|
971
|
+
Create team from group
|
|
972
|
+
|
|
973
|
+
Args:
|
|
974
|
+
group_id (string): group-id
|
|
975
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
976
|
+
classification (string): An optional label. Typically describes the data or business sensitivity of the team. Must match one of a preconfigured set in the tenant's directory.
|
|
977
|
+
createdDateTime (string): Timestamp at which the team was created.
|
|
978
|
+
description (string): An optional description for the team. Maximum length: 1,024 characters.
|
|
979
|
+
displayName (string): The name of the team.
|
|
980
|
+
firstChannelName (string): The name of the first channel in the team. This is an optional property, only used during team creation and isn't returned in methods to get and list teams.
|
|
981
|
+
funSettings (object): funSettings
|
|
982
|
+
guestSettings (object): guestSettings
|
|
983
|
+
internalId (string): A unique ID for the team that was used in a few places such as the audit log/Office 365 Management Activity API.
|
|
984
|
+
isArchived (boolean): Whether this team is in read-only mode.
|
|
985
|
+
memberSettings (object): memberSettings
|
|
986
|
+
messagingSettings (object): messagingSettings
|
|
987
|
+
specialization (string): specialization
|
|
988
|
+
summary (object): summary
|
|
989
|
+
tenantId (string): The ID of the Microsoft Entra tenant.
|
|
990
|
+
visibility (string): visibility
|
|
991
|
+
webUrl (string): A hyperlink that goes to the team in the Microsoft Teams client. You get this URL when you right-click a team in the Microsoft Teams client and select Get link to team. This URL should be treated as an opaque blob, and not parsed.
|
|
992
|
+
allChannels (array): List of channels either hosted in or shared with the team (incoming channels).
|
|
993
|
+
channels (array): The collection of channels and messages associated with the team.
|
|
994
|
+
group (string): group
|
|
995
|
+
incomingChannels (array): List of channels shared with the team.
|
|
996
|
+
installedApps (array): The apps installed in this team.
|
|
997
|
+
members (array): Members and owners of the team.
|
|
998
|
+
operations (array): The async operations that ran or are running on this team.
|
|
999
|
+
permissionGrants (array): A collection of permissions granted to apps to access the team.
|
|
1000
|
+
photo (string): photo
|
|
1001
|
+
primaryChannel (string): primaryChannel
|
|
1002
|
+
schedule (string): schedule
|
|
1003
|
+
tags (array): The tags associated with the team.
|
|
1004
|
+
template (string): template
|
|
1005
|
+
|
|
1006
|
+
Returns:
|
|
1007
|
+
Any: Success
|
|
1008
|
+
|
|
1009
|
+
Raises:
|
|
1010
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1011
|
+
|
|
1012
|
+
Tags:
|
|
1013
|
+
groups.team
|
|
1014
|
+
"""
|
|
1015
|
+
if group_id is None:
|
|
1016
|
+
raise ValueError("Missing required parameter 'group-id'.")
|
|
1017
|
+
request_body_data = None
|
|
1018
|
+
request_body_data = {
|
|
1019
|
+
"id": id,
|
|
1020
|
+
"classification": classification,
|
|
1021
|
+
"createdDateTime": createdDateTime,
|
|
1022
|
+
"description": description,
|
|
1023
|
+
"displayName": displayName,
|
|
1024
|
+
"firstChannelName": firstChannelName,
|
|
1025
|
+
"funSettings": funSettings,
|
|
1026
|
+
"guestSettings": guestSettings,
|
|
1027
|
+
"internalId": internalId,
|
|
1028
|
+
"isArchived": isArchived,
|
|
1029
|
+
"memberSettings": memberSettings,
|
|
1030
|
+
"messagingSettings": messagingSettings,
|
|
1031
|
+
"specialization": specialization,
|
|
1032
|
+
"summary": summary,
|
|
1033
|
+
"tenantId": tenantId,
|
|
1034
|
+
"visibility": visibility,
|
|
1035
|
+
"webUrl": webUrl,
|
|
1036
|
+
"allChannels": allChannels,
|
|
1037
|
+
"channels": channels,
|
|
1038
|
+
"group": group,
|
|
1039
|
+
"incomingChannels": incomingChannels,
|
|
1040
|
+
"installedApps": installedApps,
|
|
1041
|
+
"members": members,
|
|
1042
|
+
"operations": operations,
|
|
1043
|
+
"permissionGrants": permissionGrants,
|
|
1044
|
+
"photo": photo,
|
|
1045
|
+
"primaryChannel": primaryChannel,
|
|
1046
|
+
"schedule": schedule,
|
|
1047
|
+
"tags": tags,
|
|
1048
|
+
"template": template,
|
|
1049
|
+
}
|
|
1050
|
+
request_body_data = {
|
|
1051
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1052
|
+
}
|
|
1053
|
+
url = f"{self.base_url}/groups/{group_id}/team"
|
|
1054
|
+
query_params = {}
|
|
1055
|
+
response = self._put(
|
|
1056
|
+
url,
|
|
1057
|
+
data=request_body_data,
|
|
1058
|
+
params=query_params,
|
|
1059
|
+
content_type="application/json",
|
|
1060
|
+
)
|
|
1061
|
+
return self._handle_response(response)
|
|
1062
|
+
|
|
1063
|
+
def create_team(
|
|
1064
|
+
self,
|
|
1065
|
+
id: str | None = None,
|
|
1066
|
+
classification: str | None = None,
|
|
1067
|
+
createdDateTime: str | None = None,
|
|
1068
|
+
description: str | None = None,
|
|
1069
|
+
displayName: str | None = None,
|
|
1070
|
+
firstChannelName: str | None = None,
|
|
1071
|
+
funSettings: dict[str, dict[str, Any]] | None = None,
|
|
1072
|
+
guestSettings: dict[str, dict[str, Any]] | None = None,
|
|
1073
|
+
internalId: str | None = None,
|
|
1074
|
+
isArchived: bool | None = None,
|
|
1075
|
+
memberSettings: dict[str, dict[str, Any]] | None = None,
|
|
1076
|
+
messagingSettings: dict[str, dict[str, Any]] | None = None,
|
|
1077
|
+
specialization: str | None = None,
|
|
1078
|
+
summary: dict[str, dict[str, Any]] | None = None,
|
|
1079
|
+
tenantId: str | None = None,
|
|
1080
|
+
visibility: str | None = None,
|
|
1081
|
+
webUrl: str | None = None,
|
|
1082
|
+
allChannels: list[Any] | None = None,
|
|
1083
|
+
channels: list[Any] | None = None,
|
|
1084
|
+
group: Any | None = None,
|
|
1085
|
+
incomingChannels: list[Any] | None = None,
|
|
1086
|
+
installedApps: list[Any] | None = None,
|
|
1087
|
+
members: list[Any] | None = None,
|
|
1088
|
+
operations: list[Any] | None = None,
|
|
1089
|
+
permissionGrants: list[Any] | None = None,
|
|
1090
|
+
photo: Any | None = None,
|
|
1091
|
+
primaryChannel: Any | None = None,
|
|
1092
|
+
schedule: Any | None = None,
|
|
1093
|
+
tags: list[Any] | None = None,
|
|
1094
|
+
template: Any | None = None,
|
|
1095
|
+
) -> Any:
|
|
1096
|
+
"""
|
|
1097
|
+
Create team
|
|
1098
|
+
|
|
1099
|
+
Args:
|
|
1100
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
1101
|
+
classification (string): An optional label. Typically describes the data or business sensitivity of the team. Must match one of a preconfigured set in the tenant's directory.
|
|
1102
|
+
createdDateTime (string): Timestamp at which the team was created.
|
|
1103
|
+
description (string): An optional description for the team. Maximum length: 1,024 characters.
|
|
1104
|
+
displayName (string): The name of the team.
|
|
1105
|
+
firstChannelName (string): The name of the first channel in the team. This is an optional property, only used during team creation and isn't returned in methods to get and list teams.
|
|
1106
|
+
funSettings (object): funSettings
|
|
1107
|
+
guestSettings (object): guestSettings
|
|
1108
|
+
internalId (string): A unique ID for the team that was used in a few places such as the audit log/Office 365 Management Activity API.
|
|
1109
|
+
isArchived (boolean): Whether this team is in read-only mode.
|
|
1110
|
+
memberSettings (object): memberSettings
|
|
1111
|
+
messagingSettings (object): messagingSettings
|
|
1112
|
+
specialization (string): specialization
|
|
1113
|
+
summary (object): summary
|
|
1114
|
+
tenantId (string): The ID of the Microsoft Entra tenant.
|
|
1115
|
+
visibility (string): visibility
|
|
1116
|
+
webUrl (string): A hyperlink that goes to the team in the Microsoft Teams client. You get this URL when you right-click a team in the Microsoft Teams client and select Get link to team. This URL should be treated as an opaque blob, and not parsed.
|
|
1117
|
+
allChannels (array): List of channels either hosted in or shared with the team (incoming channels).
|
|
1118
|
+
channels (array): The collection of channels and messages associated with the team.
|
|
1119
|
+
group (string): group
|
|
1120
|
+
incomingChannels (array): List of channels shared with the team.
|
|
1121
|
+
installedApps (array): The apps installed in this team.
|
|
1122
|
+
members (array): Members and owners of the team.
|
|
1123
|
+
operations (array): The async operations that ran or are running on this team.
|
|
1124
|
+
permissionGrants (array): A collection of permissions granted to apps to access the team.
|
|
1125
|
+
photo (string): photo
|
|
1126
|
+
primaryChannel (string): primaryChannel
|
|
1127
|
+
schedule (string): schedule
|
|
1128
|
+
tags (array): The tags associated with the team.
|
|
1129
|
+
template (string): template
|
|
1130
|
+
|
|
1131
|
+
Returns:
|
|
1132
|
+
Any: Created entity
|
|
1133
|
+
|
|
1134
|
+
Raises:
|
|
1135
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1136
|
+
|
|
1137
|
+
Tags:
|
|
1138
|
+
teams.team
|
|
1139
|
+
"""
|
|
1140
|
+
request_body_data = None
|
|
1141
|
+
request_body_data = {
|
|
1142
|
+
"id": id,
|
|
1143
|
+
"classification": classification,
|
|
1144
|
+
"createdDateTime": createdDateTime,
|
|
1145
|
+
"description": description,
|
|
1146
|
+
"displayName": displayName,
|
|
1147
|
+
"firstChannelName": firstChannelName,
|
|
1148
|
+
"funSettings": funSettings,
|
|
1149
|
+
"guestSettings": guestSettings,
|
|
1150
|
+
"internalId": internalId,
|
|
1151
|
+
"isArchived": isArchived,
|
|
1152
|
+
"memberSettings": memberSettings,
|
|
1153
|
+
"messagingSettings": messagingSettings,
|
|
1154
|
+
"specialization": specialization,
|
|
1155
|
+
"summary": summary,
|
|
1156
|
+
"tenantId": tenantId,
|
|
1157
|
+
"visibility": visibility,
|
|
1158
|
+
"webUrl": webUrl,
|
|
1159
|
+
"allChannels": allChannels,
|
|
1160
|
+
"channels": channels,
|
|
1161
|
+
"group": group,
|
|
1162
|
+
"incomingChannels": incomingChannels,
|
|
1163
|
+
"installedApps": installedApps,
|
|
1164
|
+
"members": members,
|
|
1165
|
+
"operations": operations,
|
|
1166
|
+
"permissionGrants": permissionGrants,
|
|
1167
|
+
"photo": photo,
|
|
1168
|
+
"primaryChannel": primaryChannel,
|
|
1169
|
+
"schedule": schedule,
|
|
1170
|
+
"tags": tags,
|
|
1171
|
+
"template": template,
|
|
1172
|
+
}
|
|
1173
|
+
request_body_data = {
|
|
1174
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1175
|
+
}
|
|
1176
|
+
url = f"{self.base_url}/teams"
|
|
1177
|
+
query_params = {}
|
|
1178
|
+
response = self._post(
|
|
1179
|
+
url,
|
|
1180
|
+
data=request_body_data,
|
|
1181
|
+
params=query_params,
|
|
1182
|
+
content_type="application/json",
|
|
1183
|
+
)
|
|
1184
|
+
return self._handle_response(response)
|
|
1185
|
+
|
|
1186
|
+
def get_team_channel_info(
|
|
1187
|
+
self,
|
|
1188
|
+
team_id: str,
|
|
1189
|
+
channel_id: str,
|
|
1190
|
+
select: list[str] | None = None,
|
|
1191
|
+
expand: list[str] | None = None,
|
|
1192
|
+
) -> Any:
|
|
1193
|
+
"""
|
|
1194
|
+
Get channel
|
|
1195
|
+
|
|
1196
|
+
Args:
|
|
1197
|
+
team_id (string): team-id
|
|
1198
|
+
channel_id (string): channel-id
|
|
1199
|
+
select (array): Select properties to be returned
|
|
1200
|
+
expand (array): Expand related entities
|
|
1201
|
+
|
|
1202
|
+
Returns:
|
|
1203
|
+
Any: Retrieved navigation property
|
|
1204
|
+
|
|
1205
|
+
Raises:
|
|
1206
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1207
|
+
|
|
1208
|
+
Tags:
|
|
1209
|
+
teams.channel
|
|
1210
|
+
"""
|
|
1211
|
+
if team_id is None:
|
|
1212
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1213
|
+
if channel_id is None:
|
|
1214
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1215
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}"
|
|
1216
|
+
query_params = {
|
|
1217
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
1218
|
+
}
|
|
1219
|
+
response = self._get(url, params=query_params)
|
|
1220
|
+
return self._handle_response(response)
|
|
1221
|
+
|
|
1222
|
+
def update_chat_message_by_team_channel(
|
|
1223
|
+
self,
|
|
1224
|
+
team_id: str,
|
|
1225
|
+
channel_id: str,
|
|
1226
|
+
chatMessage_id: str,
|
|
1227
|
+
id: str | None = None,
|
|
1228
|
+
attachments: list[dict[str, dict[str, Any]]] | None = None,
|
|
1229
|
+
body: dict[str, dict[str, Any]] | None = None,
|
|
1230
|
+
channelIdentity: dict[str, dict[str, Any]] | None = None,
|
|
1231
|
+
chatId: str | None = None,
|
|
1232
|
+
createdDateTime: str | None = None,
|
|
1233
|
+
deletedDateTime: str | None = None,
|
|
1234
|
+
etag: str | None = None,
|
|
1235
|
+
eventDetail: dict[str, dict[str, Any]] | None = None,
|
|
1236
|
+
from_: Any | None = None,
|
|
1237
|
+
importance: str | None = None,
|
|
1238
|
+
lastEditedDateTime: str | None = None,
|
|
1239
|
+
lastModifiedDateTime: str | None = None,
|
|
1240
|
+
locale: str | None = None,
|
|
1241
|
+
mentions: list[dict[str, dict[str, Any]]] | None = None,
|
|
1242
|
+
messageHistory: list[dict[str, dict[str, Any]]] | None = None,
|
|
1243
|
+
messageType: str | None = None,
|
|
1244
|
+
policyViolation: dict[str, dict[str, Any]] | None = None,
|
|
1245
|
+
reactions: list[dict[str, dict[str, Any]]] | None = None,
|
|
1246
|
+
replyToId: str | None = None,
|
|
1247
|
+
subject: str | None = None,
|
|
1248
|
+
summary: str | None = None,
|
|
1249
|
+
webUrl: str | None = None,
|
|
1250
|
+
hostedContents: list[Any] | None = None,
|
|
1251
|
+
replies: list[Any] | None = None,
|
|
1252
|
+
) -> Any:
|
|
1253
|
+
"""
|
|
1254
|
+
Update chatMessage
|
|
1255
|
+
|
|
1256
|
+
Args:
|
|
1257
|
+
team_id (string): team-id
|
|
1258
|
+
channel_id (string): channel-id
|
|
1259
|
+
chatMessage_id (string): chatMessage-id
|
|
1260
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
1261
|
+
attachments (array): References to attached objects like files, tabs, meetings etc.
|
|
1262
|
+
body (object): body
|
|
1263
|
+
channelIdentity (object): channelIdentity
|
|
1264
|
+
chatId (string): If the message was sent in a chat, represents the identity of the chat.
|
|
1265
|
+
createdDateTime (string): Timestamp of when the chat message was created.
|
|
1266
|
+
deletedDateTime (string): Read only. Timestamp at which the chat message was deleted, or null if not deleted.
|
|
1267
|
+
etag (string): Read-only. Version number of the chat message.
|
|
1268
|
+
eventDetail (object): eventDetail
|
|
1269
|
+
from_ (string): from
|
|
1270
|
+
importance (string): importance
|
|
1271
|
+
lastEditedDateTime (string): Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.
|
|
1272
|
+
lastModifiedDateTime (string): Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
|
|
1273
|
+
locale (string): Locale of the chat message set by the client. Always set to en-us.
|
|
1274
|
+
mentions (array): List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag.
|
|
1275
|
+
messageHistory (array): List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.
|
|
1276
|
+
messageType (string): messageType
|
|
1277
|
+
policyViolation (object): policyViolation
|
|
1278
|
+
reactions (array): Reactions for this chat message (for example, Like).
|
|
1279
|
+
replyToId (string): Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)
|
|
1280
|
+
subject (string): The subject of the chat message, in plaintext.
|
|
1281
|
+
summary (string): Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.
|
|
1282
|
+
webUrl (string): Read-only. Link to the message in Microsoft Teams.
|
|
1283
|
+
hostedContents (array): Content in a message hosted by Microsoft Teams - for example, images or code snippets.
|
|
1284
|
+
replies (array): Replies for a specified message. Supports $expand for channel messages.
|
|
1285
|
+
|
|
1286
|
+
Returns:
|
|
1287
|
+
Any: Success
|
|
1288
|
+
|
|
1289
|
+
Raises:
|
|
1290
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1291
|
+
|
|
1292
|
+
Tags:
|
|
1293
|
+
teams.channel
|
|
1294
|
+
"""
|
|
1295
|
+
if team_id is None:
|
|
1296
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1297
|
+
if channel_id is None:
|
|
1298
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1299
|
+
if chatMessage_id is None:
|
|
1300
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
1301
|
+
request_body_data = None
|
|
1302
|
+
request_body_data = {
|
|
1303
|
+
"id": id,
|
|
1304
|
+
"attachments": attachments,
|
|
1305
|
+
"body": body,
|
|
1306
|
+
"channelIdentity": channelIdentity,
|
|
1307
|
+
"chatId": chatId,
|
|
1308
|
+
"createdDateTime": createdDateTime,
|
|
1309
|
+
"deletedDateTime": deletedDateTime,
|
|
1310
|
+
"etag": etag,
|
|
1311
|
+
"eventDetail": eventDetail,
|
|
1312
|
+
"from": from_,
|
|
1313
|
+
"importance": importance,
|
|
1314
|
+
"lastEditedDateTime": lastEditedDateTime,
|
|
1315
|
+
"lastModifiedDateTime": lastModifiedDateTime,
|
|
1316
|
+
"locale": locale,
|
|
1317
|
+
"mentions": mentions,
|
|
1318
|
+
"messageHistory": messageHistory,
|
|
1319
|
+
"messageType": messageType,
|
|
1320
|
+
"policyViolation": policyViolation,
|
|
1321
|
+
"reactions": reactions,
|
|
1322
|
+
"replyToId": replyToId,
|
|
1323
|
+
"subject": subject,
|
|
1324
|
+
"summary": summary,
|
|
1325
|
+
"webUrl": webUrl,
|
|
1326
|
+
"hostedContents": hostedContents,
|
|
1327
|
+
"replies": replies,
|
|
1328
|
+
}
|
|
1329
|
+
request_body_data = {
|
|
1330
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1331
|
+
}
|
|
1332
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/messages/{chatMessage_id}"
|
|
1333
|
+
query_params = {}
|
|
1334
|
+
response = self._patch(url, data=request_body_data, params=query_params)
|
|
1335
|
+
return self._handle_response(response)
|
|
1336
|
+
|
|
1337
|
+
def update_message_reply(
|
|
1338
|
+
self,
|
|
1339
|
+
team_id: str,
|
|
1340
|
+
channel_id: str,
|
|
1341
|
+
chatMessage_id: str,
|
|
1342
|
+
chatMessage_id1: str,
|
|
1343
|
+
id: str | None = None,
|
|
1344
|
+
attachments: list[dict[str, dict[str, Any]]] | None = None,
|
|
1345
|
+
body: dict[str, dict[str, Any]] | None = None,
|
|
1346
|
+
channelIdentity: dict[str, dict[str, Any]] | None = None,
|
|
1347
|
+
chatId: str | None = None,
|
|
1348
|
+
createdDateTime: str | None = None,
|
|
1349
|
+
deletedDateTime: str | None = None,
|
|
1350
|
+
etag: str | None = None,
|
|
1351
|
+
eventDetail: dict[str, dict[str, Any]] | None = None,
|
|
1352
|
+
from_: Any | None = None,
|
|
1353
|
+
importance: str | None = None,
|
|
1354
|
+
lastEditedDateTime: str | None = None,
|
|
1355
|
+
lastModifiedDateTime: str | None = None,
|
|
1356
|
+
locale: str | None = None,
|
|
1357
|
+
mentions: list[dict[str, dict[str, Any]]] | None = None,
|
|
1358
|
+
messageHistory: list[dict[str, dict[str, Any]]] | None = None,
|
|
1359
|
+
messageType: str | None = None,
|
|
1360
|
+
policyViolation: dict[str, dict[str, Any]] | None = None,
|
|
1361
|
+
reactions: list[dict[str, dict[str, Any]]] | None = None,
|
|
1362
|
+
replyToId: str | None = None,
|
|
1363
|
+
subject: str | None = None,
|
|
1364
|
+
summary: str | None = None,
|
|
1365
|
+
webUrl: str | None = None,
|
|
1366
|
+
hostedContents: list[Any] | None = None,
|
|
1367
|
+
replies: list[Any] | None = None,
|
|
1368
|
+
) -> Any:
|
|
1369
|
+
"""
|
|
1370
|
+
Update the navigation property replies in teams
|
|
1371
|
+
|
|
1372
|
+
Args:
|
|
1373
|
+
team_id (string): team-id
|
|
1374
|
+
channel_id (string): channel-id
|
|
1375
|
+
chatMessage_id (string): chatMessage-id
|
|
1376
|
+
chatMessage_id1 (string): chatMessage-id1
|
|
1377
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
1378
|
+
attachments (array): References to attached objects like files, tabs, meetings etc.
|
|
1379
|
+
body (object): body
|
|
1380
|
+
channelIdentity (object): channelIdentity
|
|
1381
|
+
chatId (string): If the message was sent in a chat, represents the identity of the chat.
|
|
1382
|
+
createdDateTime (string): Timestamp of when the chat message was created.
|
|
1383
|
+
deletedDateTime (string): Read only. Timestamp at which the chat message was deleted, or null if not deleted.
|
|
1384
|
+
etag (string): Read-only. Version number of the chat message.
|
|
1385
|
+
eventDetail (object): eventDetail
|
|
1386
|
+
from_ (string): from
|
|
1387
|
+
importance (string): importance
|
|
1388
|
+
lastEditedDateTime (string): Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.
|
|
1389
|
+
lastModifiedDateTime (string): Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
|
|
1390
|
+
locale (string): Locale of the chat message set by the client. Always set to en-us.
|
|
1391
|
+
mentions (array): List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag.
|
|
1392
|
+
messageHistory (array): List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.
|
|
1393
|
+
messageType (string): messageType
|
|
1394
|
+
policyViolation (object): policyViolation
|
|
1395
|
+
reactions (array): Reactions for this chat message (for example, Like).
|
|
1396
|
+
replyToId (string): Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)
|
|
1397
|
+
subject (string): The subject of the chat message, in plaintext.
|
|
1398
|
+
summary (string): Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.
|
|
1399
|
+
webUrl (string): Read-only. Link to the message in Microsoft Teams.
|
|
1400
|
+
hostedContents (array): Content in a message hosted by Microsoft Teams - for example, images or code snippets.
|
|
1401
|
+
replies (array): Replies for a specified message. Supports $expand for channel messages.
|
|
1402
|
+
|
|
1403
|
+
Returns:
|
|
1404
|
+
Any: Success
|
|
1405
|
+
|
|
1406
|
+
Raises:
|
|
1407
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1408
|
+
|
|
1409
|
+
Tags:
|
|
1410
|
+
teams.channel
|
|
1411
|
+
"""
|
|
1412
|
+
if team_id is None:
|
|
1413
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1414
|
+
if channel_id is None:
|
|
1415
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1416
|
+
if chatMessage_id is None:
|
|
1417
|
+
raise ValueError("Missing required parameter 'chatMessage-id'.")
|
|
1418
|
+
if chatMessage_id1 is None:
|
|
1419
|
+
raise ValueError("Missing required parameter 'chatMessage-id1'.")
|
|
1420
|
+
request_body_data = None
|
|
1421
|
+
request_body_data = {
|
|
1422
|
+
"id": id,
|
|
1423
|
+
"attachments": attachments,
|
|
1424
|
+
"body": body,
|
|
1425
|
+
"channelIdentity": channelIdentity,
|
|
1426
|
+
"chatId": chatId,
|
|
1427
|
+
"createdDateTime": createdDateTime,
|
|
1428
|
+
"deletedDateTime": deletedDateTime,
|
|
1429
|
+
"etag": etag,
|
|
1430
|
+
"eventDetail": eventDetail,
|
|
1431
|
+
"from": from_,
|
|
1432
|
+
"importance": importance,
|
|
1433
|
+
"lastEditedDateTime": lastEditedDateTime,
|
|
1434
|
+
"lastModifiedDateTime": lastModifiedDateTime,
|
|
1435
|
+
"locale": locale,
|
|
1436
|
+
"mentions": mentions,
|
|
1437
|
+
"messageHistory": messageHistory,
|
|
1438
|
+
"messageType": messageType,
|
|
1439
|
+
"policyViolation": policyViolation,
|
|
1440
|
+
"reactions": reactions,
|
|
1441
|
+
"replyToId": replyToId,
|
|
1442
|
+
"subject": subject,
|
|
1443
|
+
"summary": summary,
|
|
1444
|
+
"webUrl": webUrl,
|
|
1445
|
+
"hostedContents": hostedContents,
|
|
1446
|
+
"replies": replies,
|
|
1447
|
+
}
|
|
1448
|
+
request_body_data = {
|
|
1449
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1450
|
+
}
|
|
1451
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/messages/{chatMessage_id}/replies/{chatMessage_id1}"
|
|
1452
|
+
query_params = {}
|
|
1453
|
+
response = self._patch(url, data=request_body_data, params=query_params)
|
|
1454
|
+
return self._handle_response(response)
|
|
1455
|
+
|
|
1456
|
+
def get_channel_tabs(
|
|
1457
|
+
self,
|
|
1458
|
+
team_id: str,
|
|
1459
|
+
channel_id: str,
|
|
1460
|
+
top: int | None = None,
|
|
1461
|
+
skip: int | None = None,
|
|
1462
|
+
search: str | None = None,
|
|
1463
|
+
filter: str | None = None,
|
|
1464
|
+
count: bool | None = None,
|
|
1465
|
+
orderby: list[str] | None = None,
|
|
1466
|
+
select: list[str] | None = None,
|
|
1467
|
+
expand: list[str] | None = None,
|
|
1468
|
+
) -> dict[str, Any]:
|
|
1469
|
+
"""
|
|
1470
|
+
List tabs in channel
|
|
1471
|
+
|
|
1472
|
+
Args:
|
|
1473
|
+
team_id (string): team-id
|
|
1474
|
+
channel_id (string): channel-id
|
|
1475
|
+
top (integer): Show only the first n items Example: '50'.
|
|
1476
|
+
skip (integer): Skip the first n items
|
|
1477
|
+
search (string): Search items by search phrases
|
|
1478
|
+
filter (string): Filter items by property values
|
|
1479
|
+
count (boolean): Include count of items
|
|
1480
|
+
orderby (array): Order items by property values
|
|
1481
|
+
select (array): Select properties to be returned
|
|
1482
|
+
expand (array): Expand related entities
|
|
1483
|
+
|
|
1484
|
+
Returns:
|
|
1485
|
+
dict[str, Any]: Retrieved collection
|
|
1486
|
+
|
|
1487
|
+
Raises:
|
|
1488
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1489
|
+
|
|
1490
|
+
Tags:
|
|
1491
|
+
teams.channel
|
|
1492
|
+
"""
|
|
1493
|
+
if team_id is None:
|
|
1494
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1495
|
+
if channel_id is None:
|
|
1496
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1497
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/tabs"
|
|
1498
|
+
query_params = {
|
|
1499
|
+
k: v
|
|
1500
|
+
for k, v in [
|
|
1501
|
+
("$top", top),
|
|
1502
|
+
("$skip", skip),
|
|
1503
|
+
("$search", search),
|
|
1504
|
+
("$filter", filter),
|
|
1505
|
+
("$count", count),
|
|
1506
|
+
("$orderby", orderby),
|
|
1507
|
+
("$select", select),
|
|
1508
|
+
("$expand", expand),
|
|
1509
|
+
]
|
|
1510
|
+
if v is not None
|
|
1511
|
+
}
|
|
1512
|
+
response = self._get(url, params=query_params)
|
|
1513
|
+
return self._handle_response(response)
|
|
1514
|
+
|
|
1515
|
+
def add_channel_tab(
|
|
1516
|
+
self,
|
|
1517
|
+
team_id: str,
|
|
1518
|
+
channel_id: str,
|
|
1519
|
+
id: str | None = None,
|
|
1520
|
+
configuration: dict[str, dict[str, Any]] | None = None,
|
|
1521
|
+
displayName: str | None = None,
|
|
1522
|
+
webUrl: str | None = None,
|
|
1523
|
+
teamsApp: Any | None = None,
|
|
1524
|
+
) -> Any:
|
|
1525
|
+
"""
|
|
1526
|
+
Add tab to channel
|
|
1527
|
+
|
|
1528
|
+
Args:
|
|
1529
|
+
team_id (string): team-id
|
|
1530
|
+
channel_id (string): channel-id
|
|
1531
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
1532
|
+
configuration (object): configuration
|
|
1533
|
+
displayName (string): Name of the tab.
|
|
1534
|
+
webUrl (string): Deep link URL of the tab instance. Read only.
|
|
1535
|
+
teamsApp (string): teamsApp
|
|
1536
|
+
|
|
1537
|
+
Returns:
|
|
1538
|
+
Any: Created navigation property.
|
|
1539
|
+
|
|
1540
|
+
Raises:
|
|
1541
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1542
|
+
|
|
1543
|
+
Tags:
|
|
1544
|
+
teams.channel
|
|
1545
|
+
"""
|
|
1546
|
+
if team_id is None:
|
|
1547
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1548
|
+
if channel_id is None:
|
|
1549
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1550
|
+
request_body_data = None
|
|
1551
|
+
request_body_data = {
|
|
1552
|
+
"id": id,
|
|
1553
|
+
"configuration": configuration,
|
|
1554
|
+
"displayName": displayName,
|
|
1555
|
+
"webUrl": webUrl,
|
|
1556
|
+
"teamsApp": teamsApp,
|
|
1557
|
+
}
|
|
1558
|
+
request_body_data = {
|
|
1559
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1560
|
+
}
|
|
1561
|
+
url = f"{self.base_url}/teams/{team_id}/channels/{channel_id}/tabs"
|
|
1562
|
+
query_params = {}
|
|
1563
|
+
response = self._post(
|
|
1564
|
+
url,
|
|
1565
|
+
data=request_body_data,
|
|
1566
|
+
params=query_params,
|
|
1567
|
+
content_type="application/json",
|
|
1568
|
+
)
|
|
1569
|
+
return self._handle_response(response)
|
|
1570
|
+
|
|
1571
|
+
def get_team_tab_info(
|
|
1572
|
+
self,
|
|
1573
|
+
team_id: str,
|
|
1574
|
+
channel_id: str,
|
|
1575
|
+
teamsTab_id: str,
|
|
1576
|
+
select: list[str] | None = None,
|
|
1577
|
+
expand: list[str] | None = None,
|
|
1578
|
+
) -> Any:
|
|
1579
|
+
"""
|
|
1580
|
+
Get tab
|
|
1581
|
+
|
|
1582
|
+
Args:
|
|
1583
|
+
team_id (string): team-id
|
|
1584
|
+
channel_id (string): channel-id
|
|
1585
|
+
teamsTab_id (string): teamsTab-id
|
|
1586
|
+
select (array): Select properties to be returned
|
|
1587
|
+
expand (array): Expand related entities
|
|
1588
|
+
|
|
1589
|
+
Returns:
|
|
1590
|
+
Any: Retrieved navigation property
|
|
1591
|
+
|
|
1592
|
+
Raises:
|
|
1593
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1594
|
+
|
|
1595
|
+
Tags:
|
|
1596
|
+
teams.channel
|
|
1597
|
+
"""
|
|
1598
|
+
if team_id is None:
|
|
1599
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1600
|
+
if channel_id is None:
|
|
1601
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1602
|
+
if teamsTab_id is None:
|
|
1603
|
+
raise ValueError("Missing required parameter 'teamsTab-id'.")
|
|
1604
|
+
url = (
|
|
1605
|
+
f"{self.base_url}/teams/{team_id}/channels/{channel_id}/tabs/{teamsTab_id}"
|
|
1606
|
+
)
|
|
1607
|
+
query_params = {
|
|
1608
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
1609
|
+
}
|
|
1610
|
+
response = self._get(url, params=query_params)
|
|
1611
|
+
return self._handle_response(response)
|
|
1612
|
+
|
|
1613
|
+
def update_tab_info(
|
|
1614
|
+
self,
|
|
1615
|
+
team_id: str,
|
|
1616
|
+
channel_id: str,
|
|
1617
|
+
teamsTab_id: str,
|
|
1618
|
+
id: str | None = None,
|
|
1619
|
+
configuration: dict[str, dict[str, Any]] | None = None,
|
|
1620
|
+
displayName: str | None = None,
|
|
1621
|
+
webUrl: str | None = None,
|
|
1622
|
+
teamsApp: Any | None = None,
|
|
1623
|
+
) -> Any:
|
|
1624
|
+
"""
|
|
1625
|
+
Update tab
|
|
1626
|
+
|
|
1627
|
+
Args:
|
|
1628
|
+
team_id (string): team-id
|
|
1629
|
+
channel_id (string): channel-id
|
|
1630
|
+
teamsTab_id (string): teamsTab-id
|
|
1631
|
+
id (string): The unique identifier for an entity. Read-only.
|
|
1632
|
+
configuration (object): configuration
|
|
1633
|
+
displayName (string): Name of the tab.
|
|
1634
|
+
webUrl (string): Deep link URL of the tab instance. Read only.
|
|
1635
|
+
teamsApp (string): teamsApp
|
|
1636
|
+
|
|
1637
|
+
Returns:
|
|
1638
|
+
Any: Success
|
|
1639
|
+
|
|
1640
|
+
Raises:
|
|
1641
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1642
|
+
|
|
1643
|
+
Tags:
|
|
1644
|
+
teams.channel
|
|
1645
|
+
"""
|
|
1646
|
+
if team_id is None:
|
|
1647
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1648
|
+
if channel_id is None:
|
|
1649
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1650
|
+
if teamsTab_id is None:
|
|
1651
|
+
raise ValueError("Missing required parameter 'teamsTab-id'.")
|
|
1652
|
+
request_body_data = None
|
|
1653
|
+
request_body_data = {
|
|
1654
|
+
"id": id,
|
|
1655
|
+
"configuration": configuration,
|
|
1656
|
+
"displayName": displayName,
|
|
1657
|
+
"webUrl": webUrl,
|
|
1658
|
+
"teamsApp": teamsApp,
|
|
1659
|
+
}
|
|
1660
|
+
request_body_data = {
|
|
1661
|
+
k: v for k, v in request_body_data.items() if v is not None
|
|
1662
|
+
}
|
|
1663
|
+
url = (
|
|
1664
|
+
f"{self.base_url}/teams/{team_id}/channels/{channel_id}/tabs/{teamsTab_id}"
|
|
1665
|
+
)
|
|
1666
|
+
query_params = {}
|
|
1667
|
+
response = self._patch(url, data=request_body_data, params=query_params)
|
|
1668
|
+
return self._handle_response(response)
|
|
1669
|
+
|
|
1670
|
+
def delete_channel_tab_by_id(
|
|
1671
|
+
self, team_id: str, channel_id: str, teamsTab_id: str
|
|
1672
|
+
) -> Any:
|
|
1673
|
+
"""
|
|
1674
|
+
Delete tab from channel
|
|
1675
|
+
|
|
1676
|
+
Args:
|
|
1677
|
+
team_id (string): team-id
|
|
1678
|
+
channel_id (string): channel-id
|
|
1679
|
+
teamsTab_id (string): teamsTab-id
|
|
1680
|
+
|
|
1681
|
+
Returns:
|
|
1682
|
+
Any: Success
|
|
1683
|
+
|
|
1684
|
+
Raises:
|
|
1685
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1686
|
+
|
|
1687
|
+
Tags:
|
|
1688
|
+
teams.channel
|
|
1689
|
+
"""
|
|
1690
|
+
if team_id is None:
|
|
1691
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1692
|
+
if channel_id is None:
|
|
1693
|
+
raise ValueError("Missing required parameter 'channel-id'.")
|
|
1694
|
+
if teamsTab_id is None:
|
|
1695
|
+
raise ValueError("Missing required parameter 'teamsTab-id'.")
|
|
1696
|
+
url = (
|
|
1697
|
+
f"{self.base_url}/teams/{team_id}/channels/{channel_id}/tabs/{teamsTab_id}"
|
|
1698
|
+
)
|
|
1699
|
+
query_params = {}
|
|
1700
|
+
response = self._delete(url, params=query_params)
|
|
1701
|
+
return self._handle_response(response)
|
|
1702
|
+
|
|
1703
|
+
def get_primary_team_channel(
|
|
1704
|
+
self,
|
|
1705
|
+
team_id: str,
|
|
1706
|
+
select: list[str] | None = None,
|
|
1707
|
+
expand: list[str] | None = None,
|
|
1708
|
+
) -> Any:
|
|
1709
|
+
"""
|
|
1710
|
+
Get primaryChannel
|
|
1711
|
+
|
|
1712
|
+
Args:
|
|
1713
|
+
team_id (string): team-id
|
|
1714
|
+
select (array): Select properties to be returned
|
|
1715
|
+
expand (array): Expand related entities
|
|
1716
|
+
|
|
1717
|
+
Returns:
|
|
1718
|
+
Any: Retrieved navigation property
|
|
1719
|
+
|
|
1720
|
+
Raises:
|
|
1721
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1722
|
+
|
|
1723
|
+
Tags:
|
|
1724
|
+
teams.channel
|
|
1725
|
+
"""
|
|
1726
|
+
if team_id is None:
|
|
1727
|
+
raise ValueError("Missing required parameter 'team-id'.")
|
|
1728
|
+
url = f"{self.base_url}/teams/{team_id}/primaryChannel"
|
|
1729
|
+
query_params = {
|
|
1730
|
+
k: v for k, v in [("$select", select), ("$expand", expand)] if v is not None
|
|
1731
|
+
}
|
|
1732
|
+
response = self._get(url, params=query_params)
|
|
1733
|
+
return self._handle_response(response)
|
|
1734
|
+
|
|
1735
|
+
def get_user_installed_apps(
|
|
1736
|
+
self,
|
|
1737
|
+
user_id: str,
|
|
1738
|
+
top: int | None = None,
|
|
1739
|
+
skip: int | None = None,
|
|
1740
|
+
search: str | None = None,
|
|
1741
|
+
filter: str | None = None,
|
|
1742
|
+
count: bool | None = None,
|
|
1743
|
+
orderby: list[str] | None = None,
|
|
1744
|
+
select: list[str] | None = None,
|
|
1745
|
+
expand: list[str] | None = None,
|
|
1746
|
+
) -> dict[str, Any]:
|
|
1747
|
+
"""
|
|
1748
|
+
List apps installed for user
|
|
1749
|
+
|
|
1750
|
+
Args:
|
|
1751
|
+
user_id (string): user-id
|
|
1752
|
+
top (integer): Show only the first n items Example: '50'.
|
|
1753
|
+
skip (integer): Skip the first n items
|
|
1754
|
+
search (string): Search items by search phrases
|
|
1755
|
+
filter (string): Filter items by property values
|
|
1756
|
+
count (boolean): Include count of items
|
|
1757
|
+
orderby (array): Order items by property values
|
|
1758
|
+
select (array): Select properties to be returned
|
|
1759
|
+
expand (array): Expand related entities
|
|
1760
|
+
|
|
1761
|
+
Returns:
|
|
1762
|
+
dict[str, Any]: Retrieved collection
|
|
1763
|
+
|
|
1764
|
+
Raises:
|
|
1765
|
+
HTTPStatusError: Raised when the API request fails with detailed error information including status code and response body.
|
|
1766
|
+
|
|
1767
|
+
Tags:
|
|
1768
|
+
users.userTeamwork
|
|
1769
|
+
"""
|
|
1770
|
+
if user_id is None:
|
|
1771
|
+
raise ValueError("Missing required parameter 'user-id'.")
|
|
1772
|
+
url = f"{self.base_url}/users/{user_id}/teamwork/installedApps"
|
|
1773
|
+
query_params = {
|
|
1774
|
+
k: v
|
|
1775
|
+
for k, v in [
|
|
1776
|
+
("$top", top),
|
|
1777
|
+
("$skip", skip),
|
|
1778
|
+
("$search", search),
|
|
1779
|
+
("$filter", filter),
|
|
1780
|
+
("$count", count),
|
|
1781
|
+
("$orderby", orderby),
|
|
1782
|
+
("$select", select),
|
|
1783
|
+
("$expand", expand),
|
|
1784
|
+
]
|
|
1785
|
+
if v is not None
|
|
1786
|
+
}
|
|
1787
|
+
response = self._get(url, params=query_params)
|
|
1788
|
+
return self._handle_response(response)
|
|
1789
|
+
|
|
1790
|
+
def list_tools(self):
|
|
1791
|
+
return [
|
|
1792
|
+
self.list_chats,
|
|
1793
|
+
self.get_joined_teams,
|
|
1794
|
+
self.list_channels_for_team,
|
|
1795
|
+
self.send_chat_message,
|
|
1796
|
+
self.send_channel_message,
|
|
1797
|
+
self.reply_to_channel_message,
|
|
1798
|
+
self.create_chat_operation,
|
|
1799
|
+
self.get_chat,
|
|
1800
|
+
self.update_chat_details,
|
|
1801
|
+
self.list_chat_apps,
|
|
1802
|
+
self.list_chat_members,
|
|
1803
|
+
self.add_member_to_chat,
|
|
1804
|
+
self.get_chat_member_details,
|
|
1805
|
+
self.delete_chat_member,
|
|
1806
|
+
self.list_chat_messages,
|
|
1807
|
+
self.get_chat_message_detail,
|
|
1808
|
+
self.read_chat_replies,
|
|
1809
|
+
self.create_chat_reply,
|
|
1810
|
+
self.get_chat_replies,
|
|
1811
|
+
self.create_team_from_group,
|
|
1812
|
+
self.create_team,
|
|
1813
|
+
self.get_team_channel_info,
|
|
1814
|
+
self.update_chat_message_by_team_channel,
|
|
1815
|
+
self.update_message_reply,
|
|
1816
|
+
self.get_channel_tabs,
|
|
1817
|
+
self.add_channel_tab,
|
|
1818
|
+
self.get_team_tab_info,
|
|
1819
|
+
self.update_tab_info,
|
|
1820
|
+
self.delete_channel_tab_by_id,
|
|
1821
|
+
self.get_primary_team_channel,
|
|
1822
|
+
self.get_user_installed_apps,
|
|
1823
|
+
]
|