|
16 | 16 | import os |
17 | 17 | import warnings |
18 | 18 | from io import IOBase |
19 | | -from typing import Union, Sequence, Optional, Dict, Any, List |
| 19 | +from typing import Any, Dict, List, Optional, Sequence, Union |
20 | 20 |
|
21 | 21 | import slack_sdk.errors as e |
22 | 22 | from slack_sdk.models.views import View |
| 23 | + |
| 24 | +from ..models.attachments import Attachment |
| 25 | +from ..models.blocks import Block |
| 26 | +from ..models.metadata import Metadata |
23 | 27 | from .legacy_base_client import LegacyBaseClient, SlackResponse |
24 | 28 | from .internal_utils import ( |
25 | 29 | _parse_web_class_objects, |
26 | | - _update_call_participants, |
27 | | - _warn_if_text_or_attachment_fallback_is_missing, |
| 30 | + _print_files_upload_v2_suggestion, |
28 | 31 | _remove_none_values, |
29 | 32 | _to_v2_file_upload_item, |
| 33 | + _update_call_participants, |
30 | 34 | _validate_for_legacy_client, |
31 | | - _print_files_upload_v2_suggestion, |
| 35 | + _warn_if_text_or_attachment_fallback_is_missing, |
32 | 36 | ) |
33 | | -from ..models.attachments import Attachment |
34 | | -from ..models.blocks import Block |
35 | | -from ..models.metadata import Metadata |
36 | 37 |
|
37 | 38 |
|
38 | 39 | class LegacyWebClient(LegacyBaseClient): |
@@ -5417,6 +5418,72 @@ def views_publish( |
5417 | 5418 | # NOTE: Intentionally using json for the "view" parameter |
5418 | 5419 | return self.api_call("views.publish", json=kwargs) |
5419 | 5420 |
|
| 5421 | + def workflows_featured_add( |
| 5422 | + self, |
| 5423 | + *, |
| 5424 | + channel_id: str, |
| 5425 | + trigger_ids: Union[str, Sequence[str]], |
| 5426 | + **kwargs, |
| 5427 | + ) -> Union[Future, SlackResponse]: |
| 5428 | + """Add featured workflows to a channel. |
| 5429 | + https://api.slack.com/methods/workflows.featured.add |
| 5430 | + """ |
| 5431 | + kwargs.update({"channel_id": channel_id}) |
| 5432 | + if isinstance(trigger_ids, (list, tuple)): |
| 5433 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5434 | + else: |
| 5435 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5436 | + return self.api_call("workflows.featured.add", params=kwargs) |
| 5437 | + |
| 5438 | + def workflows_featured_list( |
| 5439 | + self, |
| 5440 | + *, |
| 5441 | + channel_ids: Union[str, Sequence[str]], |
| 5442 | + **kwargs, |
| 5443 | + ) -> Union[Future, SlackResponse]: |
| 5444 | + """List the featured workflows for specified channels. |
| 5445 | + https://api.slack.com/methods/workflows.featured.list |
| 5446 | + """ |
| 5447 | + if isinstance(channel_ids, (list, tuple)): |
| 5448 | + kwargs.update({"channel_ids": ",".join(channel_ids)}) |
| 5449 | + else: |
| 5450 | + kwargs.update({"channel_ids": channel_ids}) |
| 5451 | + return self.api_call("workflows.featured.list", params=kwargs) |
| 5452 | + |
| 5453 | + def workflows_featured_remove( |
| 5454 | + self, |
| 5455 | + *, |
| 5456 | + channel_id: str, |
| 5457 | + trigger_ids: Union[str, Sequence[str]], |
| 5458 | + **kwargs, |
| 5459 | + ) -> Union[Future, SlackResponse]: |
| 5460 | + """Remove featured workflows from a channel. |
| 5461 | + https://api.slack.com/methods/workflows.featured.remove |
| 5462 | + """ |
| 5463 | + kwargs.update({"channel_id": channel_id}) |
| 5464 | + if isinstance(trigger_ids, (list, tuple)): |
| 5465 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5466 | + else: |
| 5467 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5468 | + return self.api_call("workflows.featured.remove", params=kwargs) |
| 5469 | + |
| 5470 | + def workflows_featured_set( |
| 5471 | + self, |
| 5472 | + *, |
| 5473 | + channel_id: str, |
| 5474 | + trigger_ids: Union[str, Sequence[str]], |
| 5475 | + **kwargs, |
| 5476 | + ) -> Union[Future, SlackResponse]: |
| 5477 | + """Set featured workflows for a channel. |
| 5478 | + https://api.slack.com/methods/workflows.featured.set |
| 5479 | + """ |
| 5480 | + kwargs.update({"channel_id": channel_id}) |
| 5481 | + if isinstance(trigger_ids, (list, tuple)): |
| 5482 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5483 | + else: |
| 5484 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5485 | + return self.api_call("workflows.featured.set", params=kwargs) |
| 5486 | + |
5420 | 5487 | def workflows_stepCompleted( |
5421 | 5488 | self, |
5422 | 5489 | *, |
|
0 commit comments