Skip to content

Commit fe8094a

Browse files
committed
feat(web): add workflows.featured.{add|list|remove|set} methods
1 parent 97f546f commit fe8094a

4 files changed

Lines changed: 213 additions & 4 deletions

File tree

slack_sdk/web/async_client.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5415,6 +5415,72 @@ async def views_publish(
54155415
# NOTE: Intentionally using json for the "view" parameter
54165416
return await self.api_call("views.publish", json=kwargs)
54175417

5418+
async def workflows_featured_add(
5419+
self,
5420+
*,
5421+
channel_id: str,
5422+
trigger_ids: Union[str, Sequence[str]],
5423+
**kwargs,
5424+
) -> AsyncSlackResponse:
5425+
"""Add featured workflows to a channel.
5426+
https://api.slack.com/methods/workflows.featured.add
5427+
"""
5428+
kwargs.update({"channel_id": channel_id})
5429+
if isinstance(trigger_ids, (list, tuple)):
5430+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5431+
else:
5432+
kwargs.update({"trigger_ids": trigger_ids})
5433+
return await self.api_call("workflows.featured.add", params=kwargs)
5434+
5435+
async def workflows_featured_list(
5436+
self,
5437+
*,
5438+
channel_ids: Union[str, Sequence[str]],
5439+
**kwargs,
5440+
) -> AsyncSlackResponse:
5441+
"""List the featured workflows for specified channels.
5442+
https://api.slack.com/methods/workflows.featured.list
5443+
"""
5444+
if isinstance(channel_ids, (list, tuple)):
5445+
kwargs.update({"channel_ids": ",".join(channel_ids)})
5446+
else:
5447+
kwargs.update({"channel_ids": channel_ids})
5448+
return await self.api_call("workflows.featured.list", params=kwargs)
5449+
5450+
async def workflows_featured_remove(
5451+
self,
5452+
*,
5453+
channel_id: str,
5454+
trigger_ids: Union[str, Sequence[str]],
5455+
**kwargs,
5456+
) -> AsyncSlackResponse:
5457+
"""Remove featured workflows from a channel.
5458+
https://api.slack.com/methods/workflows.featured.remove
5459+
"""
5460+
kwargs.update({"channel_id": channel_id})
5461+
if isinstance(trigger_ids, (list, tuple)):
5462+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5463+
else:
5464+
kwargs.update({"trigger_ids": trigger_ids})
5465+
return await self.api_call("workflows.featured.remove", params=kwargs)
5466+
5467+
async def workflows_featured_set(
5468+
self,
5469+
*,
5470+
channel_id: str,
5471+
trigger_ids: Union[str, Sequence[str]],
5472+
**kwargs,
5473+
) -> AsyncSlackResponse:
5474+
"""Set featured workflows for a channel.
5475+
https://api.slack.com/methods/workflows.featured.set
5476+
"""
5477+
kwargs.update({"channel_id": channel_id})
5478+
if isinstance(trigger_ids, (list, tuple)):
5479+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5480+
else:
5481+
kwargs.update({"trigger_ids": trigger_ids})
5482+
return await self.api_call("workflows.featured.set", params=kwargs)
5483+
54185484
async def workflows_stepCompleted(
54195485
self,
54205486
*,

slack_sdk/web/client.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5405,6 +5405,72 @@ def views_publish(
54055405
# NOTE: Intentionally using json for the "view" parameter
54065406
return self.api_call("views.publish", json=kwargs)
54075407

5408+
def workflows_featured_add(
5409+
self,
5410+
*,
5411+
channel_id: str,
5412+
trigger_ids: Union[str, Sequence[str]],
5413+
**kwargs,
5414+
) -> SlackResponse:
5415+
"""Add featured workflows to a channel.
5416+
https://api.slack.com/methods/workflows.featured.add
5417+
"""
5418+
kwargs.update({"channel_id": channel_id})
5419+
if isinstance(trigger_ids, (list, tuple)):
5420+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5421+
else:
5422+
kwargs.update({"trigger_ids": trigger_ids})
5423+
return self.api_call("workflows.featured.add", params=kwargs)
5424+
5425+
def workflows_featured_list(
5426+
self,
5427+
*,
5428+
channel_ids: Union[str, Sequence[str]],
5429+
**kwargs,
5430+
) -> SlackResponse:
5431+
"""List the featured workflows for specified channels.
5432+
https://api.slack.com/methods/workflows.featured.list
5433+
"""
5434+
if isinstance(channel_ids, (list, tuple)):
5435+
kwargs.update({"channel_ids": ",".join(channel_ids)})
5436+
else:
5437+
kwargs.update({"channel_ids": channel_ids})
5438+
return self.api_call("workflows.featured.list", params=kwargs)
5439+
5440+
def workflows_featured_remove(
5441+
self,
5442+
*,
5443+
channel_id: str,
5444+
trigger_ids: Union[str, Sequence[str]],
5445+
**kwargs,
5446+
) -> SlackResponse:
5447+
"""Remove featured workflows from a channel.
5448+
https://api.slack.com/methods/workflows.featured.remove
5449+
"""
5450+
kwargs.update({"channel_id": channel_id})
5451+
if isinstance(trigger_ids, (list, tuple)):
5452+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5453+
else:
5454+
kwargs.update({"trigger_ids": trigger_ids})
5455+
return self.api_call("workflows.featured.remove", params=kwargs)
5456+
5457+
def workflows_featured_set(
5458+
self,
5459+
*,
5460+
channel_id: str,
5461+
trigger_ids: Union[str, Sequence[str]],
5462+
**kwargs,
5463+
) -> SlackResponse:
5464+
"""Set featured workflows for a channel.
5465+
https://api.slack.com/methods/workflows.featured.set
5466+
"""
5467+
kwargs.update({"channel_id": channel_id})
5468+
if isinstance(trigger_ids, (list, tuple)):
5469+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5470+
else:
5471+
kwargs.update({"trigger_ids": trigger_ids})
5472+
return self.api_call("workflows.featured.set", params=kwargs)
5473+
54085474
def workflows_stepCompleted(
54095475
self,
54105476
*,

slack_sdk/web/legacy_client.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5417,6 +5417,72 @@ def views_publish(
54175417
# NOTE: Intentionally using json for the "view" parameter
54185418
return self.api_call("views.publish", json=kwargs)
54195419

5420+
def workflows_featured_add(
5421+
self,
5422+
*,
5423+
channel_id: str,
5424+
trigger_ids: Union[str, Sequence[str]],
5425+
**kwargs,
5426+
) -> Union[Future, SlackResponse]:
5427+
"""Add featured workflows to a channel.
5428+
https://api.slack.com/methods/workflows.featured.add
5429+
"""
5430+
kwargs.update({"channel_id": channel_id})
5431+
if isinstance(trigger_ids, (list, tuple)):
5432+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5433+
else:
5434+
kwargs.update({"trigger_ids": trigger_ids})
5435+
return self.api_call("workflows.featured.add", params=kwargs)
5436+
5437+
def workflows_featured_list(
5438+
self,
5439+
*,
5440+
channel_ids: Union[str, Sequence[str]],
5441+
**kwargs,
5442+
) -> Union[Future, SlackResponse]:
5443+
"""List the featured workflows for specified channels.
5444+
https://api.slack.com/methods/workflows.featured.list
5445+
"""
5446+
if isinstance(channel_ids, (list, tuple)):
5447+
kwargs.update({"channel_ids": ",".join(channel_ids)})
5448+
else:
5449+
kwargs.update({"channel_ids": channel_ids})
5450+
return self.api_call("workflows.featured.list", params=kwargs)
5451+
5452+
def workflows_featured_remove(
5453+
self,
5454+
*,
5455+
channel_id: str,
5456+
trigger_ids: Union[str, Sequence[str]],
5457+
**kwargs,
5458+
) -> Union[Future, SlackResponse]:
5459+
"""Remove featured workflows from a channel.
5460+
https://api.slack.com/methods/workflows.featured.remove
5461+
"""
5462+
kwargs.update({"channel_id": channel_id})
5463+
if isinstance(trigger_ids, (list, tuple)):
5464+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5465+
else:
5466+
kwargs.update({"trigger_ids": trigger_ids})
5467+
return self.api_call("workflows.featured.remove", params=kwargs)
5468+
5469+
def workflows_featured_set(
5470+
self,
5471+
*,
5472+
channel_id: str,
5473+
trigger_ids: Union[str, Sequence[str]],
5474+
**kwargs,
5475+
) -> Union[Future, SlackResponse]:
5476+
"""Set featured workflows for a channel.
5477+
https://api.slack.com/methods/workflows.featured.set
5478+
"""
5479+
kwargs.update({"channel_id": channel_id})
5480+
if isinstance(trigger_ids, (list, tuple)):
5481+
kwargs.update({"trigger_ids": ",".join(trigger_ids)})
5482+
else:
5483+
kwargs.update({"trigger_ids": trigger_ids})
5484+
return self.api_call("workflows.featured.set", params=kwargs)
5485+
54205486
def workflows_stepCompleted(
54215487
self,
54225488
*,

0 commit comments

Comments
 (0)