|
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 | 30 | _update_call_participants, |
27 | 31 | _warn_if_message_text_content_is_missing, |
| 32 | + _print_files_upload_v2_suggestion, |
28 | 33 | _remove_none_values, |
29 | 34 | _to_v2_file_upload_item, |
| 35 | + _update_call_participants, |
30 | 36 | _validate_for_legacy_client, |
31 | | - _print_files_upload_v2_suggestion, |
| 37 | + _warn_if_text_or_attachment_fallback_is_missing, |
32 | 38 | ) |
33 | | -from ..models.attachments import Attachment |
34 | | -from ..models.blocks import Block |
35 | | -from ..models.metadata import Metadata |
36 | 39 |
|
37 | 40 |
|
38 | 41 | class LegacyWebClient(LegacyBaseClient): |
@@ -5425,6 +5428,72 @@ def views_publish( |
5425 | 5428 | # NOTE: Intentionally using json for the "view" parameter |
5426 | 5429 | return self.api_call("views.publish", json=kwargs) |
5427 | 5430 |
|
| 5431 | + def workflows_featured_add( |
| 5432 | + self, |
| 5433 | + *, |
| 5434 | + channel_id: str, |
| 5435 | + trigger_ids: Union[str, Sequence[str]], |
| 5436 | + **kwargs, |
| 5437 | + ) -> Union[Future, SlackResponse]: |
| 5438 | + """Add featured workflows to a channel. |
| 5439 | + https://api.slack.com/methods/workflows.featured.add |
| 5440 | + """ |
| 5441 | + kwargs.update({"channel_id": channel_id}) |
| 5442 | + if isinstance(trigger_ids, (list, tuple)): |
| 5443 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5444 | + else: |
| 5445 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5446 | + return self.api_call("workflows.featured.add", params=kwargs) |
| 5447 | + |
| 5448 | + def workflows_featured_list( |
| 5449 | + self, |
| 5450 | + *, |
| 5451 | + channel_ids: Union[str, Sequence[str]], |
| 5452 | + **kwargs, |
| 5453 | + ) -> Union[Future, SlackResponse]: |
| 5454 | + """List the featured workflows for specified channels. |
| 5455 | + https://api.slack.com/methods/workflows.featured.list |
| 5456 | + """ |
| 5457 | + if isinstance(channel_ids, (list, tuple)): |
| 5458 | + kwargs.update({"channel_ids": ",".join(channel_ids)}) |
| 5459 | + else: |
| 5460 | + kwargs.update({"channel_ids": channel_ids}) |
| 5461 | + return self.api_call("workflows.featured.list", params=kwargs) |
| 5462 | + |
| 5463 | + def workflows_featured_remove( |
| 5464 | + self, |
| 5465 | + *, |
| 5466 | + channel_id: str, |
| 5467 | + trigger_ids: Union[str, Sequence[str]], |
| 5468 | + **kwargs, |
| 5469 | + ) -> Union[Future, SlackResponse]: |
| 5470 | + """Remove featured workflows from a channel. |
| 5471 | + https://api.slack.com/methods/workflows.featured.remove |
| 5472 | + """ |
| 5473 | + kwargs.update({"channel_id": channel_id}) |
| 5474 | + if isinstance(trigger_ids, (list, tuple)): |
| 5475 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5476 | + else: |
| 5477 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5478 | + return self.api_call("workflows.featured.remove", params=kwargs) |
| 5479 | + |
| 5480 | + def workflows_featured_set( |
| 5481 | + self, |
| 5482 | + *, |
| 5483 | + channel_id: str, |
| 5484 | + trigger_ids: Union[str, Sequence[str]], |
| 5485 | + **kwargs, |
| 5486 | + ) -> Union[Future, SlackResponse]: |
| 5487 | + """Set featured workflows for a channel. |
| 5488 | + https://api.slack.com/methods/workflows.featured.set |
| 5489 | + """ |
| 5490 | + kwargs.update({"channel_id": channel_id}) |
| 5491 | + if isinstance(trigger_ids, (list, tuple)): |
| 5492 | + kwargs.update({"trigger_ids": ",".join(trigger_ids)}) |
| 5493 | + else: |
| 5494 | + kwargs.update({"trigger_ids": trigger_ids}) |
| 5495 | + return self.api_call("workflows.featured.set", params=kwargs) |
| 5496 | + |
5428 | 5497 | def workflows_stepCompleted( |
5429 | 5498 | self, |
5430 | 5499 | *, |
|
0 commit comments