Skip to content

Commit da8c0a1

Browse files
filmajseratch
andauthored
Adding the auth_teams_list method (#1213)
Co-authored-by: Kazuhiro Sera <[email protected]>
1 parent e4df183 commit da8c0a1

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

slack_sdk/web/async_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,19 @@ async def auth_test(
16021602
"""
16031603
return await self.api_call("auth.test", params=kwargs)
16041604

1605+
async def auth_teams_list(
1606+
self,
1607+
cursor: Optional[str] = None,
1608+
limit: Optional[int] = None,
1609+
include_icon: Optional[bool] = None,
1610+
**kwargs,
1611+
) -> AsyncSlackResponse:
1612+
"""List the workspaces a token can access.
1613+
https://api.slack.com/methods/auth.teams.list
1614+
"""
1615+
kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon})
1616+
return await self.api_call("auth.teams.list", params=kwargs)
1617+
16051618
async def bookmarks_add(
16061619
self,
16071620
*,

slack_sdk/web/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,19 @@ def auth_test(
15531553
"""
15541554
return self.api_call("auth.test", params=kwargs)
15551555

1556+
def auth_teams_list(
1557+
self,
1558+
cursor: Optional[str] = None,
1559+
limit: Optional[int] = None,
1560+
include_icon: Optional[bool] = None,
1561+
**kwargs,
1562+
) -> SlackResponse:
1563+
"""List the workspaces a token can access.
1564+
https://api.slack.com/methods/auth.teams.list
1565+
"""
1566+
kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon})
1567+
return self.api_call("auth.teams.list", params=kwargs)
1568+
15561569
def bookmarks_add(
15571570
self,
15581571
*,

slack_sdk/web/legacy_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,19 @@ def auth_test(
15641564
"""
15651565
return self.api_call("auth.test", params=kwargs)
15661566

1567+
def auth_teams_list(
1568+
self,
1569+
cursor: Optional[str] = None,
1570+
limit: Optional[int] = None,
1571+
include_icon: Optional[bool] = None,
1572+
**kwargs,
1573+
) -> Union[Future, SlackResponse]:
1574+
"""List the workspaces a token can access.
1575+
https://api.slack.com/methods/auth.teams.list
1576+
"""
1577+
kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon})
1578+
return self.api_call("auth.teams.list", params=kwargs)
1579+
15671580
def bookmarks_add(
15681581
self,
15691582
*,

tests/slack_sdk_async/web/test_web_client_coverage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def setUp(self):
4040
for api_method in self.all_api_methods:
4141
if api_method.startswith("apps.permissions.") or api_method in [
4242
"apps.connections.open", # app-level token
43-
"auth.teams.list", # app-level token
4443
"oauth.access",
4544
"oauth.v2.access",
4645
"oauth.v2.exchange",

0 commit comments

Comments
 (0)