Skip to content

Commit e8b104c

Browse files
committed
Add support for tooling.tokens.rotate
1 parent 4b88c31 commit e8b104c

File tree

4 files changed

+50
-9
lines changed

4 files changed

+50
-9
lines changed

slack_sdk/web/async_client.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ async def apps_manifest_delete(
15321532
app_id: str,
15331533
**kwargs,
15341534
) -> AsyncSlackResponse:
1535-
"""Deletes an app manifest.
1535+
"""Deletes an app.
15361536
https://api.slack.com/methods/apps.manifest.delete
15371537
"""
15381538
kwargs.update({"app_id": app_id})
@@ -1544,7 +1544,7 @@ async def apps_manifest_export(
15441544
app_id: str,
15451545
**kwargs,
15461546
) -> AsyncSlackResponse:
1547-
"""Exports the manifest of an existing app.
1547+
"""Retrieves the manifest of an app.
15481548
https://api.slack.com/methods/apps.manifest.export
15491549
"""
15501550
kwargs.update({"app_id": app_id})
@@ -1557,7 +1557,7 @@ async def apps_manifest_update(
15571557
manifest: str,
15581558
**kwargs,
15591559
) -> AsyncSlackResponse:
1560-
"""Updates an app manifest with a new manifest.
1560+
"""Updates an app using a manifest.
15611561
https://api.slack.com/methods/apps.manifest.update
15621562
"""
15631563
kwargs.update({"app_id": app_id, "manifest": manifest})
@@ -3914,6 +3914,18 @@ async def team_profile_get(
39143914
kwargs.update({"visibility": visibility})
39153915
return await self.api_call("team.profile.get", http_verb="GET", params=kwargs)
39163916

3917+
async def tooling_tokens_rotate(
3918+
self,
3919+
*,
3920+
refresh_token: str,
3921+
**kwargs,
3922+
) -> AsyncSlackResponse:
3923+
"""Refresh a tooling token.
3924+
https://api.slack.com/methods/tooling.tokens.rotate
3925+
"""
3926+
kwargs.update({"refresh_token": refresh_token})
3927+
return await self.api_call("tooling.tokens.rotate", params=kwargs)
3928+
39173929
async def usergroups_create(
39183930
self,
39193931
*,

slack_sdk/web/client.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ def apps_manifest_delete(
14851485
app_id: str,
14861486
**kwargs,
14871487
) -> SlackResponse:
1488-
"""Deletes an app manifest.
1488+
"""Deletes an app.
14891489
https://api.slack.com/methods/apps.manifest.delete
14901490
"""
14911491
kwargs.update({"app_id": app_id})
@@ -1497,7 +1497,7 @@ def apps_manifest_export(
14971497
app_id: str,
14981498
**kwargs,
14991499
) -> SlackResponse:
1500-
"""Exports the manifest of an existing app.
1500+
"""Retrieves the manifest of an app.
15011501
https://api.slack.com/methods/apps.manifest.export
15021502
"""
15031503
kwargs.update({"app_id": app_id})
@@ -1510,7 +1510,7 @@ def apps_manifest_update(
15101510
manifest: str,
15111511
**kwargs,
15121512
) -> SlackResponse:
1513-
"""Updates an app manifest with a new manifest.
1513+
"""Updates an app using a manifest.
15141514
https://api.slack.com/methods/apps.manifest.update
15151515
"""
15161516
kwargs.update({"app_id": app_id, "manifest": manifest})
@@ -3853,6 +3853,18 @@ def team_profile_get(
38533853
kwargs.update({"visibility": visibility})
38543854
return self.api_call("team.profile.get", http_verb="GET", params=kwargs)
38553855

3856+
def tooling_tokens_rotate(
3857+
self,
3858+
*,
3859+
refresh_token: str,
3860+
**kwargs,
3861+
) -> SlackResponse:
3862+
"""Refresh a tooling token.
3863+
https://api.slack.com/methods/tooling.tokens.rotate
3864+
"""
3865+
kwargs.update({"refresh_token": refresh_token})
3866+
return self.api_call("tooling.tokens.rotate", params=kwargs)
3867+
38563868
def usergroups_create(
38573869
self,
38583870
*,

slack_sdk/web/legacy_client.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ def apps_manifest_delete(
14961496
app_id: str,
14971497
**kwargs,
14981498
) -> Union[Future, SlackResponse]:
1499-
"""Deletes an app manifest.
1499+
"""Deletes an app.
15001500
https://api.slack.com/methods/apps.manifest.delete
15011501
"""
15021502
kwargs.update({"app_id": app_id})
@@ -1508,7 +1508,7 @@ def apps_manifest_export(
15081508
app_id: str,
15091509
**kwargs,
15101510
) -> Union[Future, SlackResponse]:
1511-
"""Exports the manifest of an existing app.
1511+
"""Retrieves the manifest of an app.
15121512
https://api.slack.com/methods/apps.manifest.export
15131513
"""
15141514
kwargs.update({"app_id": app_id})
@@ -1521,7 +1521,7 @@ def apps_manifest_update(
15211521
manifest: str,
15221522
**kwargs,
15231523
) -> Union[Future, SlackResponse]:
1524-
"""Updates an app manifest with a new manifest.
1524+
"""Updates an app using a manifest.
15251525
https://api.slack.com/methods/apps.manifest.update
15261526
"""
15271527
kwargs.update({"app_id": app_id, "manifest": manifest})
@@ -3864,6 +3864,18 @@ def team_profile_get(
38643864
kwargs.update({"visibility": visibility})
38653865
return self.api_call("team.profile.get", http_verb="GET", params=kwargs)
38663866

3867+
def tooling_tokens_rotate(
3868+
self,
3869+
*,
3870+
refresh_token: str,
3871+
**kwargs,
3872+
) -> Union[Future, SlackResponse]:
3873+
"""Refresh a tooling token.
3874+
https://api.slack.com/methods/tooling.tokens.rotate
3875+
"""
3876+
kwargs.update({"refresh_token": refresh_token})
3877+
return self.api_call("tooling.tokens.rotate", params=kwargs)
3878+
38673879
def usergroups_create(
38683880
self,
38693881
*,

tests/slack_sdk_async/web/test_web_client_coverage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,11 @@ async def run_method(self, method_name, method, async_method):
715715
elif method_name == "search_messages":
716716
self.api_methods_to_call.remove(method(query="Slack")["method"])
717717
await async_method(query="Slack")
718+
elif method_name == "tooling_tokens_rotate":
719+
self.api_methods_to_call.remove(
720+
method(refresh_token="xoxe-refresh")["method"]
721+
)
722+
await async_method(refresh_token="xoxe-refresh")
718723
elif method_name == "usergroups_create":
719724
self.api_methods_to_call.remove(
720725
method(name="Engineering Team")["method"]

0 commit comments

Comments
 (0)