Skip to content

Commit 8f3fc22

Browse files
Merge branch 'main' into support-markdown-text
2 parents f00fa90 + 8922dc8 commit 8f3fc22

File tree

9 files changed

+259
-33
lines changed

9 files changed

+259
-33
lines changed

docs/content/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This package supports Python 3.6 and higher. We recommend using [PyPI](https://pypi.python.org/pypi) for installation. Run the following command:
44

55
```bash
6-
pip install slack_sdk
6+
pip install slack-sdk
77
```
88

99
Alternatively, you can always pull the source code directly into your project:

docs/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"clsx": "^2.0.0",
2222
"docusaurus-theme-github-codeblock": "^2.0.2",
2323
"prism-react-renderer": "^2.4.1",
24-
"react": "^19.1.0",
25-
"react-dom": "^19.1.0"
24+
"react": "^19.1.1",
25+
"react-dom": "^19.1.1"
2626
},
2727
"devDependencies": {
2828
"@docusaurus/module-type-aliases": "^3.5.2",

requirements/documentation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
docutils==0.21.2
1+
docutils==0.22
22
pdoc3==0.11.6

requirements/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pip install -r requirements/testing.txt
22
aiohttp<4 # used for a WebSocket server mock
33
pytest>=7.0.1,<9
4-
pytest-asyncio<1 # for async
4+
pytest-asyncio<2 # for async
55
pytest-cov>=2,<7
66
# while flake8 5.x have issues with Python 3.12, flake8 6.x requires Python >= 3.8.1,
77
# so 5.x should be kept in order to stay compatible with Python 3.6/3.7

slack_sdk/web/async_client.py

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@
1414
import os
1515
import warnings
1616
from io import IOBase
17-
from typing import Union, Sequence, Optional, Dict, Any, List
17+
from typing import Any, Dict, List, Optional, Sequence, Union
1818

1919
import slack_sdk.errors as e
2020
from slack_sdk.models.views import View
21+
22+
from ..models.attachments import Attachment
23+
from ..models.blocks import Block
24+
from ..models.metadata import Metadata
2125
from .async_base_client import AsyncBaseClient, AsyncSlackResponse
2226
from .internal_utils import (
2327
_parse_web_class_objects,
2428
_update_call_participants,
2529
_warn_if_message_text_content_is_missing,
30+
_print_files_upload_v2_suggestion,
2631
_remove_none_values,
2732
_to_v2_file_upload_item,
33+
_update_call_participants,
2834
_validate_for_legacy_client,
29-
_print_files_upload_v2_suggestion,
35+
_warn_if_text_or_attachment_fallback_is_missing,
3036
)
31-
from ..models.attachments import Attachment
32-
from ..models.blocks import Block
33-
from ..models.metadata import Metadata
3437

3538

3639
class AsyncWebClient(AsyncBaseClient):
@@ -5423,6 +5426,72 @@ async def views_publish(
54235426
# NOTE: Intentionally using json for the "view" parameter
54245427
return await self.api_call("views.publish", json=kwargs)
54255428

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

slack_sdk/web/client.py

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,26 @@
44
import os
55
import warnings
66
from io import IOBase
7-
from typing import Union, Sequence, Optional, Dict, Any, List
7+
from typing import Any, Dict, List, Optional, Sequence, Union
88

99
import slack_sdk.errors as e
1010
from slack_sdk.models.views import View
11+
12+
from ..models.attachments import Attachment
13+
from ..models.blocks import Block
14+
from ..models.metadata import Metadata
1115
from .base_client import BaseClient, SlackResponse
1216
from .internal_utils import (
1317
_parse_web_class_objects,
1418
_update_call_participants,
1519
_warn_if_message_text_content_is_missing,
20+
_print_files_upload_v2_suggestion,
1621
_remove_none_values,
1722
_to_v2_file_upload_item,
23+
_update_call_participants,
1824
_validate_for_legacy_client,
19-
_print_files_upload_v2_suggestion,
25+
_warn_if_text_or_attachment_fallback_is_missing,
2026
)
21-
from ..models.attachments import Attachment
22-
from ..models.blocks import Block
23-
from ..models.metadata import Metadata
2427

2528

2629
class WebClient(BaseClient):
@@ -5413,6 +5416,72 @@ def views_publish(
54135416
# NOTE: Intentionally using json for the "view" parameter
54145417
return self.api_call("views.publish", json=kwargs)
54155418

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

slack_sdk/web/legacy_client.py

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@
1616
import os
1717
import warnings
1818
from io import IOBase
19-
from typing import Union, Sequence, Optional, Dict, Any, List
19+
from typing import Any, Dict, List, Optional, Sequence, Union
2020

2121
import slack_sdk.errors as e
2222
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
2327
from .legacy_base_client import LegacyBaseClient, SlackResponse
2428
from .internal_utils import (
2529
_parse_web_class_objects,
2630
_update_call_participants,
2731
_warn_if_message_text_content_is_missing,
32+
_print_files_upload_v2_suggestion,
2833
_remove_none_values,
2934
_to_v2_file_upload_item,
35+
_update_call_participants,
3036
_validate_for_legacy_client,
31-
_print_files_upload_v2_suggestion,
37+
_warn_if_text_or_attachment_fallback_is_missing,
3238
)
33-
from ..models.attachments import Attachment
34-
from ..models.blocks import Block
35-
from ..models.metadata import Metadata
3639

3740

3841
class LegacyWebClient(LegacyBaseClient):
@@ -5425,6 +5428,72 @@ def views_publish(
54255428
# NOTE: Intentionally using json for the "view" parameter
54265429
return self.api_call("views.publish", json=kwargs)
54275430

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+
54285497
def workflows_stepCompleted(
54295498
self,
54305499
*,

0 commit comments

Comments
 (0)