diff --git a/pyproject.toml b/pyproject.toml index 359440348..7695eb67d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,26 @@ universal = true line-length = 125 [tool.ruff.lint] -select = ["E", "W", "F"] +select = ["E", "W", "F", "D"] +ignore = [ + # missing-docstring: do not add docstrings where none exist + "D100", + "D101", + "D102", + "D103", + "D104", + "D105", + "D106", + "D107", + # undocumented-param: 51/54 cases are just **others/**kwargs boilerplate in Block Kit models + "D417", +] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.ruff.format] +docstring-code-format = true [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/slack/signature/verifier.py b/slack/signature/verifier.py index da9c6ef5e..932001f1d 100644 --- a/slack/signature/verifier.py +++ b/slack/signature/verifier.py @@ -12,7 +12,7 @@ def now() -> float: class SignatureVerifier: def __init__(self, signing_secret: str, clock: Clock = Clock()): - """Slack request signature verifier + """Slack request signature verifier. Slack signs its requests using a secret that's unique to your app. With the help of signing secrets, your app can more confidently verify @@ -27,7 +27,7 @@ def is_valid_request( body: Union[str, bytes], headers: Dict[str, str], ) -> bool: - """Verifies if the given signature is valid""" + """Verifies if the given signature is valid.""" if headers is None: return False normalized_headers = {k.lower(): v for k, v in headers.items()} @@ -43,7 +43,7 @@ def is_valid( timestamp: str, signature: str, ) -> bool: - """Verifies if the given signature is valid""" + """Verifies if the given signature is valid.""" if timestamp is None or signature is None: return False @@ -56,7 +56,7 @@ def is_valid( return hmac.compare_digest(calculated_signature, signature) def generate_signature(self, *, timestamp: str, body: Union[str, bytes]) -> Optional[str]: - """Generates a signature""" + """Generates a signature.""" if timestamp is None: return None if body is None: diff --git a/slack/web/async_base_client.py b/slack/web/async_base_client.py index c0cc3f962..917a64268 100644 --- a/slack/web/async_base_client.py +++ b/slack/web/async_base_client.py @@ -88,7 +88,6 @@ async def api_call( # skipcq: PYL-R1710 SlackRequestError: Json data can only be submitted as POST requests. """ - api_url = _get_url(self.base_url, api_method) headers = headers or {} headers.update(self.headers) @@ -128,6 +127,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> AsyncSlac 'channel': '#random' } } + Returns: The response parsed into a AsyncSlackResponse object. """ @@ -152,6 +152,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> AsyncSlac async def _request(self, *, http_verb, api_url, req_args) -> Dict[str, any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ diff --git a/slack/web/async_internal_utils.py b/slack/web/async_internal_utils.py index 1148dc9e7..4d4088e74 100644 --- a/slack/web/async_internal_utils.py +++ b/slack/web/async_internal_utils.py @@ -46,6 +46,7 @@ def _get_headers( request_specific_headers: Optional[dict], ) -> Dict[str, str]: """Constructs the headers need for a request. + Args: has_json (bool): Whether or not the request has json. has_files (bool): Whether or not the request has files. @@ -163,6 +164,7 @@ async def _request_with_session( req_args: dict, ) -> Dict[str, any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ diff --git a/slack/web/async_slack_response.py b/slack/web/async_slack_response.py index 150bc519e..e57a29e09 100644 --- a/slack/web/async_slack_response.py +++ b/slack/web/async_slack_response.py @@ -24,17 +24,17 @@ class AsyncSlackResponse: import os import slack - client = slack.AsyncWebClient(token=os.environ['SLACK_API_TOKEN']) + client = slack.AsyncWebClient(token=os.environ["SLACK_API_TOKEN"]) - response1 = await client.auth_revoke(test='true') - assert not response1['revoked'] + response1 = await client.auth_revoke(test="true") + assert not response1["revoked"] response2 = await client.auth_test() - assert response2.get('ok', False) + assert response2.get("ok", False) users = [] async for page in await client.users_list(limit=2): - users = users + page['members'] + users = users + page["members"] ``` Note: @@ -100,6 +100,7 @@ def __getitem__(self, key): def __aiter__(self): """Enables the ability to iterate over the response. + It's required async-for the iterator protocol. Note: diff --git a/slack/web/base_client.py b/slack/web/base_client.py index 28f597411..e900e437f 100644 --- a/slack/web/base_client.py +++ b/slack/web/base_client.py @@ -111,7 +111,6 @@ def api_call( # skipcq: PYL-R1710 SlackRequestError: Json data can only be submitted as POST requests. """ - api_url = _get_url(self.base_url, api_method) headers = headers or {} headers.update(self.headers) @@ -165,6 +164,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> SlackResp 'channel': '#random' } } + Returns: The response parsed into a SlackResponse object. """ @@ -190,6 +190,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> SlackResp async def _request(self, *, http_verb, api_url, req_args) -> Dict[str, any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ @@ -239,7 +240,7 @@ def _sync_send(self, api_url, req_args) -> SlackResponse: ) def _request_for_pagination(self, api_url, req_args) -> Dict[str, any]: - """This method is supposed to be used only for SlackResponse pagination + """This method is supposed to be used only for SlackResponse pagination. You can paginate using Python's for iterator as below: @@ -463,9 +464,9 @@ def _build_urllib_request_headers( @staticmethod def validate_slack_signature(*, signing_secret: str, data: str, timestamp: str, signature: str) -> bool: - """ - Slack creates a unique string for your app and shares it with you. Verify - requests from Slack with confidence by verifying signatures using your + """Slack creates a unique string for your app and shares it with you. + + Verify requests from Slack with confidence by verifying signatures using your signing secret. On each HTTP request that Slack sends, we add an X-Slack-Signature HTTP diff --git a/slack/web/classes/interactions.py b/slack/web/classes/interactions.py index f4d871efa..e9528fa83 100644 --- a/slack/web/classes/interactions.py +++ b/slack/web/classes/interactions.py @@ -5,7 +5,7 @@ class IDNamePair(NamedTuple): - """Simple type used to help with unpacking event data""" + """Simple type used to help with unpacking event data.""" id: str name: str @@ -33,8 +33,7 @@ class MessageInteractiveEvent(InteractiveEvent): message: dict def __init__(self, event: dict): - """ - Convenience class to parse an interactive message payload from the events API + """Convenience class to parse an interactive message payload from the events API. Args: event: the raw event dictionary @@ -64,8 +63,7 @@ class DialogInteractiveEvent(InteractiveEvent): state: dict def __init__(self, event: dict): - """ - Convenience class to parse a dialog interaction payload from the events API + """Convenience class to parse a dialog interaction payload from the events API. Args: event: the raw event dictionary @@ -83,9 +81,7 @@ def __init__(self, event: dict): self.state = {} def require_any(self, requirements: List[str]) -> dict: - """ - Convenience method to construct the 'errors' response to send directly back to - the invoking HTTP request + """Convenience method to construct the 'errors' response to send directly back to the invoking HTTP request. Args: requirements: List of required dialog components, by name @@ -106,8 +102,7 @@ class SlashCommandInteractiveEvent(InteractiveEvent): text: str def __init__(self, event: dict): - """ - Convenience class to parse a slash command payload from the events API + """Convenience class to parse a slash command payload from the events API. Args: event: the raw event dictionary @@ -122,8 +117,7 @@ def __init__(self, event: dict): @staticmethod def create_reply(message, ephemeral=False) -> dict: - """ - Create a reply suitable to send directly back to the invoking HTTP request + """Create a reply suitable to send directly back to the invoking HTTP request. Args: message: Text to send diff --git a/slack/web/deprecation.py b/slack/web/deprecation.py index 059bf149f..3643dab11 100644 --- a/slack/web/deprecation.py +++ b/slack/web/deprecation.py @@ -12,8 +12,7 @@ def show_2020_01_deprecation(method_name: str): - """Prints a warning if the given method is deprecated""" - + """Prints a warning if the given method is deprecated.""" skip_deprecation = os.environ.get("SLACKCLIENT_SKIP_DEPRECATION") # for unit tests etc. if skip_deprecation: return diff --git a/slack/web/internal_utils.py b/slack/web/internal_utils.py index 67ce3d364..87c6f5a00 100644 --- a/slack/web/internal_utils.py +++ b/slack/web/internal_utils.py @@ -38,8 +38,7 @@ def _update_call_participants(kwargs, users: Union[str, List[Dict[str, str]]]) - def _next_cursor_is_present(data) -> bool: - """Determine if the response contains 'next_cursor' - and 'next_cursor' is not empty. + """Determine if the response contains 'next_cursor' and 'next_cursor' is not empty. Returns: A boolean value. diff --git a/slack_sdk/__init__.py b/slack_sdk/__init__.py index b5204e3e3..f0aeab846 100644 --- a/slack_sdk/__init__.py +++ b/slack_sdk/__init__.py @@ -1,5 +1,5 @@ -""" -* The SDK website: https://docs.slack.dev/tools/python-slack-sdk +"""* The SDK website: https://docs.slack.dev/tools/python-slack-sdk. + * PyPI package: https://pypi.org/project/slack-sdk/ Here is the list of key modules in this SDK: diff --git a/slack_sdk/aiohttp_version_checker.py b/slack_sdk/aiohttp_version_checker.py index 1eff14efa..f52a07973 100644 --- a/slack_sdk/aiohttp_version_checker.py +++ b/slack_sdk/aiohttp_version_checker.py @@ -1,4 +1,4 @@ -"""Internal module for checking aiohttp compatibility of async modules""" +"""Internal module for checking aiohttp compatibility of async modules.""" import logging from typing import Callable diff --git a/slack_sdk/audit_logs/v1/async_client.py b/slack_sdk/audit_logs/v1/async_client.py index 098e712f0..03427b45a 100644 --- a/slack_sdk/audit_logs/v1/async_client.py +++ b/slack_sdk/audit_logs/v1/async_client.py @@ -58,7 +58,8 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[AsyncRetryHandler]] = None, ): - """API client for Audit Logs API + """API client for Audit Logs API. + See https://docs.slack.dev/admins/audit-logs-api/ for more details Args: @@ -100,9 +101,9 @@ async def schemas( query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: - """Returns information about the kind of objects which the Audit Logs API - returns as a list of all objects and a short description. - Authentication not required. + """Returns information about the kind of objects the Audit Logs API returns. + + Returned as a list of all objects, each with a short description. Authentication not required. Args: query_params: Set any values if you want to add query params @@ -122,9 +123,9 @@ async def actions( query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: - """Returns information about the kind of actions that the Audit Logs API - returns as a list of all actions and a short description of each. - Authentication not required. + """Returns information about the kind of actions the Audit Logs API returns. + + Returned as a list of all actions, each with a short description. Authentication not required. Args: query_params: Set any values if you want to add query params @@ -153,6 +154,7 @@ async def logs( headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: """This is the primary endpoint for retrieving actual audit events from your organization. + It will return a list of actions that have occurred on the installed workspace or grid organization. Authentication required. diff --git a/slack_sdk/audit_logs/v1/client.py b/slack_sdk/audit_logs/v1/client.py index 704b872fa..73859a60f 100644 --- a/slack_sdk/audit_logs/v1/client.py +++ b/slack_sdk/audit_logs/v1/client.py @@ -53,7 +53,8 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[RetryHandler]] = None, ): - """API client for Audit Logs API + """API client for Audit Logs API. + See https://docs.slack.dev/admins/audit-logs-api/ for more details Args: @@ -89,9 +90,9 @@ def schemas( query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: - """Returns information about the kind of objects which the Audit Logs API - returns as a list of all objects and a short description. - Authentication not required. + """Returns information about the kind of objects the Audit Logs API returns. + + Returned as a list of all objects, each with a short description. Authentication not required. Args: query_params: Set any values if you want to add query params @@ -111,9 +112,9 @@ def actions( query_params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: - """Returns information about the kind of actions that the Audit Logs API - returns as a list of all actions and a short description of each. - Authentication not required. + """Returns information about the kind of actions the Audit Logs API returns. + + Returned as a list of all actions, each with a short description. Authentication not required. Args: query_params: Set any values if you want to add query params @@ -142,6 +143,7 @@ def logs( headers: Optional[Dict[str, str]] = None, ) -> AuditLogsResponse: """This is the primary endpoint for retrieving actual audit events from your organization. + It will return a list of actions that have occurred on the installed workspace or grid organization. Authentication required. diff --git a/slack_sdk/errors/__init__.py b/slack_sdk/errors/__init__.py index 51b9a04f6..e10bf5f19 100644 --- a/slack_sdk/errors/__init__.py +++ b/slack_sdk/errors/__init__.py @@ -1,14 +1,12 @@ -"""Errors that can be raised by this SDK""" +"""Errors that can be raised by this SDK.""" class SlackClientError(Exception): - """Base class for Client errors""" + """Base class for Client errors.""" class BotUserAccessError(SlackClientError): - """Error raised when an 'xoxb-*' token is - being used for a Slack API method that only accepts 'xoxp-*' tokens. - """ + """Error raised when an 'xoxb-*' token is being used for a Slack API method that only accepts 'xoxp-*' tokens.""" class SlackRequestError(SlackClientError): @@ -34,7 +32,7 @@ def __init__(self, message, response): class SlackTokenRotationError(SlackClientError): - """Error raised when the oauth.v2.access call for token rotation fails""" + """Error raised when the oauth.v2.access call for token rotation fails.""" api_error: SlackApiError @@ -43,16 +41,16 @@ def __init__(self, api_error: SlackApiError): class SlackClientNotConnectedError(SlackClientError): - """Error raised when attempting to send messages over the websocket when the - connection is closed.""" + """Error raised when attempting to send messages over the websocket when the connection is closed.""" class SlackObjectFormationError(SlackClientError): - """Error raised when a constructed object is not valid/malformed""" + """Error raised when a constructed object is not valid/malformed.""" class SlackClientConfigurationError(SlackClientError): - """Error raised because of invalid configuration on the client side: + """Error raised because of invalid configuration on the client side. + * when attempting to send messages over the websocket when the connection is closed. * when external system (e.g., Amazon S3) configuration / credentials are not correct """ diff --git a/slack_sdk/http_retry/async_handler.py b/slack_sdk/http_retry/async_handler.py index ed9f6115a..7612aa47e 100644 --- a/slack_sdk/http_retry/async_handler.py +++ b/slack_sdk/http_retry/async_handler.py @@ -1,4 +1,5 @@ """asyncio compatible RetryHandler interface. + You can pass an array of handlers to customize retry logics in supported API clients. """ @@ -18,6 +19,7 @@ class AsyncRetryHandler: """asyncio compatible RetryHandler interface. + You can pass an array of handlers to customize retry logics in supported API clients. """ diff --git a/slack_sdk/http_retry/builtin_interval_calculators.py b/slack_sdk/http_retry/builtin_interval_calculators.py index 6354171f5..511fbe025 100644 --- a/slack_sdk/http_retry/builtin_interval_calculators.py +++ b/slack_sdk/http_retry/builtin_interval_calculators.py @@ -21,7 +21,8 @@ def calculate_sleep_duration(self, current_attempt: int) -> float: class BackoffRetryIntervalCalculator(RetryIntervalCalculator): - """Retry interval calculator that calculates in the manner of Exponential Backoff And Jitter + """Retry interval calculator that calculates in the manner of Exponential Backoff And Jitter. + see also: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ """ @@ -29,7 +30,7 @@ class BackoffRetryIntervalCalculator(RetryIntervalCalculator): jitter: Jitter def __init__(self, backoff_factor: float = 0.5, jitter: Optional[Jitter] = None): - """Retry interval calculator that calculates in the manner of Exponential Backoff And Jitter + """Retry interval calculator that calculates in the manner of Exponential Backoff And Jitter. Args: backoff_factor: The factor for the backoff interval calculation diff --git a/slack_sdk/http_retry/handler.py b/slack_sdk/http_retry/handler.py index 7c8aa46bd..12c9004c7 100644 --- a/slack_sdk/http_retry/handler.py +++ b/slack_sdk/http_retry/handler.py @@ -1,4 +1,5 @@ """RetryHandler interface. + You can pass an array of handlers to customize retry logics in supported API clients. """ @@ -19,6 +20,7 @@ # Note that you cannot add aiohttp to this class as the external dependency is optional class RetryHandler: """RetryHandler interface. + You can pass an array of handlers to customize retry logics in supported API clients. """ diff --git a/slack_sdk/http_retry/interval_calculator.py b/slack_sdk/http_retry/interval_calculator.py index 3911dd338..69f351c6d 100644 --- a/slack_sdk/http_retry/interval_calculator.py +++ b/slack_sdk/http_retry/interval_calculator.py @@ -6,6 +6,7 @@ def calculate_sleep_duration(self, current_attempt: int) -> float: Args: current_attempt: the number of the current attempt (zero-origin; 0 means no retries are done so far) + Returns: calculated interval duration in seconds """ diff --git a/slack_sdk/http_retry/jitter.py b/slack_sdk/http_retry/jitter.py index 852eaac60..c90cda9eb 100644 --- a/slack_sdk/http_retry/jitter.py +++ b/slack_sdk/http_retry/jitter.py @@ -2,10 +2,11 @@ class Jitter: - """Jitter interface""" + """Jitter interface.""" def recalculate(self, duration: float) -> float: """Recalculate the given duration. + see also: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ Args: @@ -18,7 +19,7 @@ def recalculate(self, duration: float) -> float: class RandomJitter(Jitter): - """Random jitter implementation""" + """Random jitter implementation.""" def recalculate(self, duration: float) -> float: return duration + random.random() diff --git a/slack_sdk/http_retry/request.py b/slack_sdk/http_retry/request.py index 420c7181a..f5d2cc2ec 100644 --- a/slack_sdk/http_retry/request.py +++ b/slack_sdk/http_retry/request.py @@ -3,7 +3,7 @@ class HttpRequest: - """HTTP request representation""" + """HTTP request representation.""" method: str url: str diff --git a/slack_sdk/http_retry/response.py b/slack_sdk/http_retry/response.py index cb3ca6cef..d0c6262ea 100644 --- a/slack_sdk/http_retry/response.py +++ b/slack_sdk/http_retry/response.py @@ -2,7 +2,7 @@ class HttpResponse: - """HTTP response representation""" + """HTTP response representation.""" status_code: int headers: Dict[str, Union[List[str], str]] diff --git a/slack_sdk/models/__init__.py b/slack_sdk/models/__init__.py index 25ecfe998..bef23cbdc 100644 --- a/slack_sdk/models/__init__.py +++ b/slack_sdk/models/__init__.py @@ -1,4 +1,4 @@ -"""Classes for constructing Slack-specific data structure""" +"""Classes for constructing Slack-specific data structure.""" import logging from typing import Union, Dict, Any, Sequence, List @@ -13,9 +13,9 @@ def extract_json( item_or_items: Union[JsonObject, Sequence[JsonObject]], *format_args ) -> Union[Dict[Any, Any], List[Dict[Any, Any]], Sequence[JsonObject]]: - """ - Given a sequence (or single item), attempt to call the to_dict() method on each - item and return a plain list. If item is not the expected type, return it + """Given a sequence (or single item), attempt to call the to_dict() method on each item and return a plain list. + + If item is not the expected type, return it unmodified, in case it's already a plain dict or some other user created class. Args: diff --git a/slack_sdk/models/attachments/__init__.py b/slack_sdk/models/attachments/__init__.py index 85695cfb1..f7179188c 100644 --- a/slack_sdk/models/attachments/__init__.py +++ b/slack_sdk/models/attachments/__init__.py @@ -18,7 +18,8 @@ class Action(JsonObject): - """Action in attachments + """Action in attachments. + https://docs.slack.dev/messaging/formatting-message-text/#rich-layouts https://docs.slack.dev/legacy/legacy-messaging/legacy-interactive-message-field-guide/#message_action_fields """ @@ -64,7 +65,7 @@ def __init__( confirm: Optional[ConfirmObject] = None, style: Optional[str] = None, ): - """Simple button for use inside attachments + """Simple button for use inside attachments. https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ @@ -106,7 +107,7 @@ def to_dict(self) -> dict: class ActionLinkButton(Action): def __init__(self, *, text: str, url: str): - """A simple interactive button that just opens a URL + """A simple interactive button that just opens a URL. https://docs.slack.dev/messaging/formatting-message-text/#rich-layouts @@ -168,9 +169,7 @@ class ActionChannelSelector(AbstractActionSelector): data_source = "channels" def __init__(self, name: str, text: str, selected_channel: Optional[Option] = None): - """ - Automatically populate the selector with a list of public channels in the - workspace. + """Automatically populate the selector with a list of public channels in the workspace. https://docs.slack.dev/legacy/legacy-messaging/legacy-adding-menus-to-messages/#menu_channels @@ -190,9 +189,7 @@ class ActionConversationSelector(AbstractActionSelector): data_source = "conversations" def __init__(self, name: str, text: str, selected_conversation: Optional[Option] = None): - """ - Automatically populate the selector with a list of conversations they have in - the workspace. + """Automatically populate the selector with a list of conversations they have in the workspace. https://docs.slack.dev/legacy/legacy-messaging/legacy-adding-menus-to-messages/#menu_conversations @@ -223,8 +220,7 @@ def __init__( selected_option: Optional[Option] = None, min_query_length: Optional[int] = None, ): - """ - Populate a message select menu from your own application dynamically. + """Populate a message select menu from your own application dynamically. https://docs.slack.dev/legacy/legacy-messaging/legacy-adding-menus-to-messages/#menu_dynamic @@ -308,8 +304,8 @@ def __init__( footer_icon: Optional[str] = None, ts: Optional[int] = None, ): - """ - A supplemental object that will display after the rest of the message. + """A supplemental object that will display after the rest of the message. + Considered legacy - recommended replacement is to use message blocks instead. https://docs.slack.dev/legacy/legacy-messaging/legacy-secondary-message-attachments#fields @@ -440,9 +436,9 @@ def __init__( color: Optional[str] = None, fallback: Optional[str] = None, ): - """ - A bridge between legacy attachments and Block Kit formatting - pass a list of - Block objects directly to this attachment. + """A bridge between legacy attachments and Block Kit formatting. + + Pass a list of Block objects directly to this attachment. https://docs.slack.dev/legacy/legacy-messaging/legacy-secondary-message-attachments#fields @@ -497,8 +493,8 @@ def __init__( footer_icon: Optional[str] = None, ts: Optional[int] = None, ): - """ - An Attachment, but designed to contain interactive Actions + """An Attachment, but designed to contain interactive Actions. + Considered legacy - recommended replacement is to use message blocks instead. https://docs.slack.dev/legacy/legacy-messaging/legacy-interactive-message-field-guide/#attachment_fields diff --git a/slack_sdk/models/basic_objects.py b/slack_sdk/models/basic_objects.py index 8f1de85b9..da3af6274 100644 --- a/slack_sdk/models/basic_objects.py +++ b/slack_sdk/models/basic_objects.py @@ -6,7 +6,7 @@ class BaseObject: - """The base class for all model objects in this module""" + """The base class for all model objects in this module.""" def __str__(self): return f"" @@ -22,18 +22,19 @@ def __str__(self): class JsonObject(BaseObject, metaclass=ABCMeta): - """The base class for JSON serializable class objects""" + """The base class for JSON serializable class objects.""" @property @abstractmethod def attributes(self) -> Set[str]: - """Provide a set of attributes of this object that will make up its JSON structure""" + """Provide a set of attributes of this object that will make up its JSON structure.""" return set() def validate_json(self) -> None: - """ + """Validate this object against its attribute validators. + Raises: - SlackObjectFormationError if the object was not valid + SlackObjectFormationError: if the object was not valid """ for attribute in (func for func in dir(self) if not func.startswith("__")): method = getattr(self, attribute, None) @@ -44,10 +45,7 @@ def get_object_attribute(self, key: str): return getattr(self, key, None) def get_non_null_attributes(self) -> dict: - """ - Construct a dictionary out of non-null keys (from attributes property) - present on this object - """ + """Construct a dictionary out of non-null keys (from attributes property) present on this object.""" def to_dict_compatible(value: Union[dict, list, object, tuple]) -> Union[dict, list, Any]: if isinstance(value, (list, tuple)): @@ -84,8 +82,7 @@ def is_not_empty(self, key: str) -> bool: } def to_dict(self, *args) -> dict: - """ - Extract this object as a JSON-compatible, Slack-API-valid dictionary + """Extract this object as a JSON-compatible, Slack-API-valid dictionary. Args: *args: Any specific formatting args (rare; generally not required) @@ -111,9 +108,9 @@ def __eq__(self, other: Any) -> bool: class JsonValidator: def __init__(self, message: str): - """ - Decorate a method on a class to mark it as a JSON validator. Validation - functions should return true if valid, false if not. + """Decorate a method on a class to mark it as a JSON validator. + + Validation functions should return true if valid, false if not. Args: message: Message to be attached to the thrown SlackObjectFormationError diff --git a/slack_sdk/models/blocks/__init__.py b/slack_sdk/models/blocks/__init__.py index c14e15c7c..db11558ab 100644 --- a/slack_sdk/models/blocks/__init__.py +++ b/slack_sdk/models/blocks/__init__.py @@ -1,4 +1,4 @@ -"""Block Kit data model objects +"""Block Kit data model objects. To learn more about Block Kit, please check the following resources and tools: diff --git a/slack_sdk/models/blocks/basic_components.py b/slack_sdk/models/blocks/basic_components.py index 6daffe067..c86007bab 100644 --- a/slack_sdk/models/blocks/basic_components.py +++ b/slack_sdk/models/blocks/basic_components.py @@ -12,7 +12,7 @@ class TextObject(JsonObject): - """The interface for text objects (types: plain_text, mrkdwn)""" + """The interface for text objects (types: plain_text, mrkdwn).""" attributes = {"text", "type", "emoji"} logger = logging.getLogger(__name__) @@ -61,7 +61,7 @@ def __init__( emoji: Optional[bool] = None, **kwargs, ): - """Super class for new text "objects" used in Block kit""" + """Super class for new text "objects" used in Block kit.""" if subtype: self._subtype_warning() @@ -71,7 +71,7 @@ def __init__( class PlainTextObject(TextObject): - """plain_text typed text object""" + """plain_text typed text object.""" type = "plain_text" @@ -80,8 +80,8 @@ def attributes(self) -> Set[str]: # type: ignore[override] return super().attributes.union({"emoji"}) def __init__(self, *, text: str, emoji: Optional[bool] = None): - """A plain text object, meaning markdown characters will not be parsed as - formatting information. + """A plain text object, meaning markdown characters will not be parsed as formatting information. + https://docs.slack.dev/reference/block-kit/composition-objects/text-object Args: @@ -99,12 +99,12 @@ def from_str(text: str) -> "PlainTextObject": @staticmethod def direct_from_string(text: str) -> Dict[str, Any]: - """Transforms a string into the required object shape to act as a PlainTextObject""" + """Transforms a string into the required object shape to act as a PlainTextObject.""" return PlainTextObject.from_str(text).to_dict() class MarkdownTextObject(TextObject): - """mrkdwn typed text object""" + """mrkdwn typed text object.""" type = "mrkdwn" @@ -113,8 +113,8 @@ def attributes(self) -> Set[str]: # type: ignore[override] return super().attributes.union({"verbatim"}) def __init__(self, *, text: str, verbatim: Optional[bool] = None): - """A Markdown text object, meaning markdown characters will be parsed as - formatting information. + """A Markdown text object, meaning markdown characters will be parsed as formatting information. + https://docs.slack.dev/reference/block-kit/composition-objects/text-object Args: @@ -130,35 +130,29 @@ def __init__(self, *, text: str, verbatim: Optional[bool] = None): @staticmethod def from_str(text: str) -> "MarkdownTextObject": - """Transforms a string into the required object shape to act as a MarkdownTextObject""" + """Transforms a string into the required object shape to act as a MarkdownTextObject.""" return MarkdownTextObject(text=text) @staticmethod def direct_from_string(text: str) -> Dict[str, Any]: - """Transforms a string into the required object shape to act as a MarkdownTextObject""" + """Transforms a string into the required object shape to act as a MarkdownTextObject.""" return MarkdownTextObject.from_str(text).to_dict() @staticmethod def from_link(link: Link, title: str = "") -> "MarkdownTextObject": - """ - Transform a Link object directly into the required object shape - to act as a MarkdownTextObject - """ + """Transform a Link object directly into the required object shape to act as a MarkdownTextObject.""" if title: title = f": {title}" return MarkdownTextObject(text=f"{link}{title}") @staticmethod def direct_from_link(link: Link, title: str = "") -> Dict[str, Any]: - """ - Transform a Link object directly into the required object shape - to act as a MarkdownTextObject - """ + """Transform a Link object directly into the required object shape to act as a MarkdownTextObject.""" return MarkdownTextObject.from_link(link, title).to_dict() class RawTextObject(TextObject): - """raw_text typed text object""" + """raw_text typed text object.""" type = "raw_text" @@ -168,6 +162,7 @@ def attributes(self) -> Set[str]: # type: ignore[override] def __init__(self, *, text: str): """A raw text object used in table block cells. + https://docs.slack.dev/reference/block-kit/composition-objects/text-object/ https://docs.slack.dev/reference/block-kit/blocks/table-block @@ -178,12 +173,12 @@ def __init__(self, *, text: str): @staticmethod def from_str(text: str) -> "RawTextObject": - """Transforms a string into a RawTextObject""" + """Transforms a string into a RawTextObject.""" return RawTextObject(text=text) @staticmethod def direct_from_string(text: str) -> Dict[str, Any]: - """Transforms a string into the required object shape to act as a RawTextObject""" + """Transforms a string into the required object shape to act as a RawTextObject.""" return RawTextObject.from_str(text).to_dict() @JsonValidator("text attribute must have at least 1 character") @@ -206,6 +201,7 @@ def __init__( **others: dict, ): """Settings for a single column in a table block. + https://docs.slack.dev/reference/block-kit/blocks/table-block Args: @@ -232,8 +228,9 @@ def parse( class Option(JsonObject): - """Option object used in dialogs, legacy message actions (interactivity in attachments), - and blocks. JSON must be retrieved with an explicit option_type - the Slack API has + """Option object used in dialogs, legacy message actions (interactivity in attachments), and blocks. + + JSON must be retrieved with an explicit option_type - the Slack API has different required formats in different situations """ @@ -253,10 +250,10 @@ def __init__( url: Optional[str] = None, **others: Dict[str, Any], ): - """ - An object that represents a single selectable item in a block element ( - SelectElement, OverflowMenuElement) or dialog element - (StaticDialogSelectElement) + """An object that represents a single selectable item in a block or dialog element. + + Usable in a block element (SelectElement, OverflowMenuElement) or a dialog element + (StaticDialogSelectElement). Blocks: https://docs.slack.dev/reference/block-kit/composition-objects/option-object @@ -345,9 +342,9 @@ def parse_all(cls, options: Optional[Sequence[Union[Dict[str, Any], "Option"]]]) return option_objects def to_dict(self, option_type: str = "block") -> Dict[str, Any]: - """ - Different parent classes must call this with a valid value from OptionTypes - - either "dialog", "action", or "block", so that JSON is returned in the + """Different parent classes must call this with a valid value from OptionTypes. + + It must be either "dialog", "action", or "block", so that JSON is returned in the correct shape. """ self.validate_json() @@ -374,14 +371,14 @@ def to_dict(self, option_type: str = "block") -> Dict[str, Any]: @staticmethod def from_single_value(value_and_label: str): - """Creates a simple Option instance with the same value and label""" + """Creates a simple Option instance with the same value and label.""" return Option(value=value_and_label, label=value_and_label) class OptionGroup(JsonObject): - """ - JSON must be retrieved with an explicit option_type - the Slack API has - different required formats in different situations + """JSON must be retrieved with an explicit option_type. + + The Slack API has different required formats in different situations. """ attributes: Set[str] = set() @@ -396,9 +393,9 @@ def __init__( options: Sequence[Union[Dict[str, Any], Option]], **others: Dict[str, Any], ): - """ - Create a group of Option objects - pass in a label (that will be part of the - UI) and a list of Option objects. + """Create a group of Option objects. + + Pass in a label (that will be part of the UI) and a list of Option objects. Blocks: https://docs.slack.dev/reference/block-kit/composition-objects/option-group-object @@ -494,9 +491,9 @@ def __init__( deny: Union[str, Dict[str, Any], PlainTextObject] = "No", style: Optional[str] = None, ): - """ - An object that defines a dialog that provides a confirmation step to any - interactive element. This dialog will ask the user to confirm their action by + """An object that defines a dialog that provides a confirmation step to any interactive element. + + This dialog will ask the user to confirm their action by offering a confirm and deny button. https://docs.slack.dev/reference/block-kit/composition-objects/confirmation-dialog-object/ """ @@ -583,8 +580,8 @@ def __init__( *, trigger_actions_on: Optional[List[Any]] = None, ): - """ - Determines when a plain-text input element will return a block_actions interaction payload. + """Determines when a plain-text input element will return a block_actions interaction payload. + https://docs.slack.dev/reference/block-kit/composition-objects/dispatch-action-configuration-object """ self._trigger_actions_on = trigger_actions_on or [] @@ -623,8 +620,8 @@ def __init__( value: str, **others: Dict[str, Any], ): - """ - A feedback button element object for either positive or negative feedback. + """A feedback button element object for either positive or negative feedback. + https://docs.slack.dev/reference/block-kit/block-elements/feedback-buttons-element#button-object-fields Args: @@ -703,6 +700,7 @@ def __init__( url: Optional[str] = None, ): """An object containing Slack file information to be used in an image block or image element. + https://docs.slack.dev/reference/block-kit/composition-objects/slack-file-object Args: diff --git a/slack_sdk/models/blocks/block_elements.py b/slack_sdk/models/blocks/block_elements.py index 5ffa1f0d6..987100dc8 100644 --- a/slack_sdk/models/blocks/block_elements.py +++ b/slack_sdk/models/blocks/block_elements.py @@ -29,6 +29,7 @@ class BlockElement(JsonObject, metaclass=ABCMeta): """Block Elements are things that exists inside of your Blocks. + https://docs.slack.dev/reference/block-kit/block-elements/ """ @@ -152,7 +153,7 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """InteractiveElement that is usable in input blocks + """InteractiveElement that is usable in input blocks. We generally recommend using the concrete subclasses for better supports of available properties. """ @@ -204,8 +205,9 @@ def __init__( accessibility_label: Optional[str] = None, **others: dict, ): - """An interactive element that inserts a button. The button can be a trigger for - anything from opening a simple link to starting a complex workflow. + """An interactive element that inserts a button. + + The button can be a trigger for anything from opening a simple link to starting a complex workflow. https://docs.slack.dev/reference/block-kit/block-elements/button-element/ Args: @@ -275,8 +277,9 @@ def __init__( style: Optional[str] = None, **others: dict, ): - """A simple button that simply opens a given URL. You will still receive an - interaction payload and will need to send an acknowledgement response. + """A simple button that simply opens a given URL. + + You will still receive an interaction payload and will need to send an acknowledgement response. This is a helper class that makes creating links simpler. https://docs.slack.dev/reference/block-kit/block-elements/button-element/ @@ -333,6 +336,7 @@ def __init__( **others: dict, ): """A checkbox group that allows a user to choose multiple items from a list of possible options. + https://docs.slack.dev/reference/block-kit/block-elements/checkboxes-element/ Args: @@ -382,8 +386,8 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - An element which lets users easily select a date from a calendar style UI. + """An element which lets users easily select a date from a calendar style UI. + Date picker elements can be used inside of SectionBlocks and ActionsBlocks. https://docs.slack.dev/reference/block-kit/block-elements/date-picker-element @@ -443,8 +447,8 @@ def __init__( timezone: Optional[str] = None, **others: dict, ): - """ - An element which allows selection of a time of day. + """An element which allows selection of a time of day. + On desktop clients, this time picker will take the form of a dropdown list with free-text entry for precise choices. On mobile clients, the time picker will use native time picker UIs. @@ -504,8 +508,8 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - An element that allows the selection of a time of day formatted as a UNIX timestamp. + """An element that allows the selection of a time of day formatted as a UNIX timestamp. + On desktop clients, this time picker will take the form of a dropdown list and the date picker will take the form of a dropdown calendar. Both options will have free-text entry for precise choices. On mobile clients, the time picker and date @@ -561,6 +565,7 @@ def __init__( **others: dict, ): """Buttons to indicate positive or negative feedback. + https://docs.slack.dev/reference/block-kit/block-elements/feedback-buttons-element Args: @@ -600,8 +605,9 @@ def __init__( slack_file: Optional[Union[Dict[str, Any], SlackFile]] = None, **others: dict, ): - """An element to insert an image - this element can be used in section and - context blocks only. If you want a block with only an image in it, + """An element to insert an image - this element can be used in section and context blocks only. + + If you want a block with only an image in it, you're looking for the image block. https://docs.slack.dev/reference/block-kit/block-elements/image-element @@ -651,6 +657,7 @@ def __init__( **others: dict, ): """An icon button to perform actions. + https://docs.slack.dev/reference/block-kit/block-elements/icon-button-element Args: @@ -707,6 +714,7 @@ def __init__( **others: dict, ): """This is the simplest form of select menu, with a static list of options passed in when defining the element. + https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#static_select Args: @@ -781,8 +789,8 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This is the simplest form of select menu, with a static list of options passed in when defining the element. + """This is the simplest form of select menu, with a static list of options passed in when defining the element. + https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#static_multi_select Args: @@ -861,6 +869,7 @@ def __init__( **others: dict, ): """This is the simplest form of select menu, with a static list of options passed in when defining the element. + https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#static_select Args: @@ -936,9 +945,8 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will load its options from an external data source, allowing - for a dynamic list of options. + """This select menu will load its options from an external data source, allowing for a dynamic list of options. + https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select Args: @@ -993,9 +1001,8 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will load its options from an external data source, allowing - for a dynamic list of options. + """This select menu will load its options from an external data source, allowing for a dynamic list of options. + https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select Args: @@ -1055,9 +1062,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will populate its options with a list of Slack users visible to - the current user in the active workspace. + """This select menu will populate its options with a list of Slack users. + + The list is limited to users visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#users_select Args: @@ -1103,9 +1110,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will populate its options with a list of Slack users visible to - the current user in the active workspace. + """This select menu will populate its options with a list of Slack users. + + The list is limited to users visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#users_multi_select Args: @@ -1152,8 +1159,8 @@ def __init__( exclude_bot_users: Optional[bool] = None, exclude_external_shared_channels: Optional[bool] = None, ): - """Provides a way to filter the list of options in a conversations select menu - or conversations multi-select menu. + """Provides a way to filter the list of options in a conversations select menu or conversations multi-select menu. + https://docs.slack.dev/reference/block-kit/composition-objects/conversation-filter-object Args: @@ -1210,9 +1217,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will populate its options with a list of public and private - channels, DMs, and MPIMs visible to the current user in the active workspace. + """This select menu will populate its options with a list of public and private channels, DMs, and MPIMs. + + They are visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element/#conversations_select Args: @@ -1278,9 +1285,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This multi-select menu will populate its options with a list of public and private channels, - DMs, and MPIMs visible to the current user in the active workspace. + """This multi-select menu will populate its options with a list of public and private channels, DMs, and MPIMs. + + These are visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element/#conversation_multi_select Args: @@ -1341,9 +1348,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This select menu will populate its options with a list of public channels - visible to the current user in the active workspace. + """This select menu will populate its options with a list of public channels. + + The channels are visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element/#channels_select Args: @@ -1394,9 +1401,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - This multi-select menu will populate its options with a list of public channels visible - to the current user in the active workspace. + """This multi-select menu will populate its options with a list of public channels. + + The channels are visible to the current user in the active workspace. https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#channel_multi_select Args: @@ -1507,9 +1514,9 @@ def __init__( focus_on_load: Optional[bool] = None, **others: dict, ): - """ - A plain-text input, similar to the HTML tag, creates a field - where a user can enter freeform data. It can appear as a single-line + """A plain-text input, similar to the HTML tag, creates a field where a user can enter freeform data. + + It can appear as a single-line field or a larger textarea using the multiline flag. Plain-text input elements can be used inside of SectionBlocks and ActionsBlocks. https://docs.slack.dev/reference/block-kit/block-elements/plain-text-input-element @@ -1575,8 +1582,7 @@ def __init__( placeholder: Optional[Union[str, dict, TextObject]] = None, **others: dict, ): - """ - https://docs.slack.dev/reference/block-kit/block-elements/email-input-element + """https://docs.slack.dev/reference/block-kit/block-elements/email-input-element. Args: action_id (required): An identifier for the input value when the parent modal is submitted. @@ -1630,9 +1636,9 @@ def __init__( placeholder: Optional[Union[str, dict, TextObject]] = None, **others: dict, ): - """ - A URL input element, similar to the Plain-text input element, - creates a single line field where a user can enter URL-encoded data. + """A URL input element, similar to the Plain-text input element. + + It creates a single line field where a user can enter URL-encoded data. https://docs.slack.dev/reference/block-kit/block-elements/url-input-element Args: @@ -1684,8 +1690,8 @@ def __init__( text: str, **others: Dict, ): - """ - A URL source element that displays a URL source for referencing within a task card block. + """A URL source element that displays a URL source for referencing within a task card block. + https://docs.slack.dev/reference/block-kit/block-elements/url-source-element Args: @@ -1731,8 +1737,7 @@ def __init__( placeholder: Optional[Union[str, dict, TextObject]] = None, **others: dict, ): - """ - https://docs.slack.dev/reference/block-kit/block-elements/number-input-element/ + """https://docs.slack.dev/reference/block-kit/block-elements/number-input-element/. Args: action_id (required): An identifier for the input value when the parent modal is submitted. @@ -1791,8 +1796,7 @@ def __init__( max_files: Optional[int] = None, **others: dict, ): - """ - https://docs.slack.dev/reference/block-kit/block-elements/file-input-element + """https://docs.slack.dev/reference/block-kit/block-elements/file-input-element. Args: action_id (required): An identifier for the input value when the parent modal is submitted. @@ -1838,6 +1842,7 @@ def __init__( **others: dict, ): """A radio button group that allows a user to choose one item from a list of possible options. + https://docs.slack.dev/reference/block-kit/block-elements/radio-button-group-element Args: @@ -1887,8 +1892,9 @@ def __init__( confirm: Optional[Union[dict, ConfirmObject]] = None, **others: dict, ): - """ - This is like a cross between a button and a select menu - when a user clicks + """This is like a cross between a button and a select menu. + + When a user clicks on this overflow button, they will be presented with a list of options to choose from. Unlike the select menu, there is no typeahead field, and the button always appears with an ellipsis ("…") rather than customisable text. @@ -1943,7 +1949,8 @@ def __init__( accessibility_label: Optional[str] = None, **others: dict, ): - """Allows users to run a link trigger with customizable inputs + """Allows users to run a link trigger with customizable inputs. + Interactive component - but interactions with workflow button elements will not send block_actions events, since these are used to start new workflow runs. https://docs.slack.dev/reference/block-kit/block-elements/workflow-button-element diff --git a/slack_sdk/models/blocks/blocks.py b/slack_sdk/models/blocks/blocks.py index 9b4596571..04b224159 100644 --- a/slack_sdk/models/blocks/blocks.py +++ b/slack_sdk/models/blocks/blocks.py @@ -32,8 +32,8 @@ class Block(JsonObject): - """Blocks are a series of components that can be combined - to create visually rich and compellingly interactive messages. + """Blocks are a series of components that can be combined to create visually rich and compellingly interactive messages. + https://docs.slack.dev/reference/block-kit/blocks """ @@ -154,6 +154,7 @@ def __init__( **others: dict, ): """A section is one of the most flexible blocks available. + https://docs.slack.dev/reference/block-kit/blocks/section-block Args: @@ -222,6 +223,7 @@ def __init__( **others: dict, ): """A content divider, like an
, to split up different blocks inside of a message. + https://docs.slack.dev/reference/block-kit/blocks/divider-block Args: @@ -257,6 +259,7 @@ def __init__( **others: dict, ): """A simple image block, designed to make those cat photos really pop. + https://docs.slack.dev/reference/block-kit/blocks/image-block Args: @@ -324,6 +327,7 @@ def __init__( **others: dict, ): """A block that is used to hold interactive elements. + https://docs.slack.dev/reference/block-kit/blocks/actions-block Args: @@ -362,6 +366,7 @@ def __init__( **others: dict, ): """Displays message context, which can include both images and text. + https://docs.slack.dev/reference/block-kit/blocks/context-block Args: @@ -397,6 +402,7 @@ def __init__( **others: dict, ): """Displays actions as contextual info, which can include both feedback buttons and icon buttons. + https://docs.slack.dev/reference/block-kit/blocks/context-actions-block Args: @@ -440,8 +446,9 @@ def __init__( optional: Optional[bool] = None, **others: dict, ): - """A block that collects information from users - it can hold a plain-text input element, - a select menu element, a multi-select menu element, or a datepicker. + """A block that collects information from users. + + It can hold a plain-text input element, a select menu element, a multi-select menu element, or a datepicker. https://docs.slack.dev/reference/block-kit/blocks/input-block Args: @@ -504,6 +511,7 @@ def __init__( **others: dict, ): """Displays a remote file. + https://docs.slack.dev/reference/block-kit/blocks/file-block Args: @@ -537,7 +545,8 @@ def __init__( block_id: Optional[str] = None, **others: dict, ): - """Displays a call information + """Displays a call information. + https://docs.slack.dev/reference/block-kit/blocks#call """ super().__init__(type=self.type, block_id=block_id) @@ -564,6 +573,7 @@ def __init__( **others: dict, ): """A header is a plain-text block that displays in a larger, bold font. + https://docs.slack.dev/reference/block-kit/blocks/header-block Args: @@ -604,6 +614,7 @@ def __init__( **others: dict, ): """Displays formatted markdown. + https://docs.slack.dev/reference/block-kit/blocks/markdown-block/ Args: @@ -663,7 +674,8 @@ def __init__( author_name: Optional[str] = None, **others: dict, ): - """A video block is designed to embed videos in all app surfaces + """A video block is designed to embed videos in all app surfaces. + (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks! To use the video block within your app, you must have the links.embed:write scope. @@ -739,6 +751,7 @@ def __init__( **others: dict, ): """A block that is used to hold interactive elements. + https://docs.slack.dev/reference/block-kit/blocks/rich-text-block Args: @@ -771,6 +784,7 @@ def __init__( **others: dict, ): """Displays structured information in a table. + https://docs.slack.dev/reference/block-kit/blocks/table-block Args: @@ -828,6 +842,7 @@ def __init__( **others: dict, ): """Displays a single task, representing a single action. + https://docs.slack.dev/reference/block-kit/blocks/task-card-block/ Args: @@ -878,6 +893,7 @@ def __init__( **others: dict, ): """Displays a collection of related tasks. + https://docs.slack.dev/reference/block-kit/blocks/plan-block/ Args: @@ -912,6 +928,7 @@ def __init__( **others: dict, ): """Displays alerts, warnings, and informational messages. + https://docs.slack.dev/reference/block-kit/blocks/alert-block Args: @@ -967,6 +984,7 @@ def __init__( **others: dict, ): """Displays content in a card. + https://docs.slack.dev/reference/block-kit/blocks/card-block Args: @@ -1046,6 +1064,7 @@ def __init__( **others: dict, ): """A general-purpose wrapper for grouping child blocks together, with a configurable size. + https://docs.slack.dev/reference/block-kit/blocks/container-block Args: @@ -1118,6 +1137,7 @@ def __init__( **others: dict, ): """Displays related card blocks in a horizontally-scrolling container. + https://docs.slack.dev/reference/block-kit/blocks/carousel-block Args: diff --git a/slack_sdk/models/dialogs/__init__.py b/slack_sdk/models/dialogs/__init__.py index cc67ed37e..a12e97fed 100644 --- a/slack_sdk/models/dialogs/__init__.py +++ b/slack_sdk/models/dialogs/__init__.py @@ -108,8 +108,7 @@ def subtype_valid(self) -> bool: class DialogTextField(DialogTextComponent): - """ - Text elements are single-line plain text fields. + """Text elements are single-line plain text fields. https://docs.slack.dev/legacy/legacy-dialogs/#text_elements """ @@ -119,9 +118,9 @@ class DialogTextField(DialogTextComponent): class DialogTextArea(DialogTextComponent): - """ - A textarea is a multi-line plain text editing control. You've likely encountered - these on the world wide web. Use this element if you want a relatively long + """A textarea is a multi-line plain text editing control. + + You've likely encountered these on the world wide web. Use this element if you want a relatively long answer from users. The element UI provides a remaining character count to the max_length you have set or the default, 3000. @@ -194,9 +193,9 @@ def to_dict(self) -> dict: class DialogStaticSelector(AbstractDialogSelector): - """ - Use the select element for multiple choice selections allowing users to pick a - single item from a list. True to web roots, this selection is displayed as a + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. https://docs.slack.dev/legacy/legacy-dialogs/#select_elements @@ -216,9 +215,9 @@ def __init__( value: Optional[Union[Option, str]] = None, placeholder: Optional[str] = None, ): - """ - Use the select element for multiple choice selections allowing users to pick - a single item from a list. True to web roots, this selection is displayed as + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. A select element may contain up to 100 selections, provided as a list of @@ -271,9 +270,9 @@ def __init__( value: Optional[str] = None, placeholder: Optional[str] = None, ): - """ - Now you can easily populate a select menu with a list of users. For example, - when you are creating a bug tracking app, you want to include a field for an + """Now you can easily populate a select menu with a list of users. + + For example, when you are creating a bug tracking app, you want to include a field for an assignee. Slack pre-populates the user list in client-side, so your app doesn't need access to a related OAuth scope. @@ -309,9 +308,9 @@ def __init__( value: Optional[str] = None, placeholder: Optional[str] = None, ): - """ - You can also provide a select menu with a list of channels. Specify your - data_source as channels to limit only to public channels + """You can also provide a select menu with a list of channels. + + Specify your data_source as channels to limit only to public channels https://docs.slack.dev/legacy/legacy-dialogs/#dynamic_select_elements_channels_conversations @@ -345,9 +344,9 @@ def __init__( value: Optional[str] = None, placeholder: Optional[str] = None, ): - """ - You can also provide a select menu with a list of conversations - including - private channels, direct messages, MPIMs, and whatever else we consider a + """You can also provide a select menu with a list of conversations. + + This includes private channels, direct messages, MPIMs, and whatever else we consider a conversation-like thing. https://docs.slack.dev/legacy/legacy-dialogs/#dynamic_select_elements_channels_conversations @@ -387,9 +386,9 @@ def __init__( optional: Optional[bool] = False, placeholder: Optional[str] = None, ): - """ - Use the select element for multiple choice selections allowing users to pick - a single item from a list. True to web roots, this selection is displayed as + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. A list of options can be loaded from an external URL and used in your dialog @@ -435,10 +434,7 @@ class DialogBuilder(JsonObject): state_max_length = 3000 def __init__(self): - """ - Create a DialogBuilder to more easily construct the JSON required to submit a - dialog to Slack - """ + """Create a DialogBuilder to more easily construct the JSON required to submit a dialog to Slack.""" self._title = None self._callback_id = None self._elements = [] @@ -447,8 +443,7 @@ def __init__(self): self._state = None def title(self, title: str) -> "DialogBuilder": - """ - Specify a title for this dialog + """Specify a title for this dialog. Args: title: must not exceed 24 characters @@ -457,9 +452,7 @@ def title(self, title: str) -> "DialogBuilder": return self def state(self, state: Union[dict, str]) -> "DialogBuilder": - """ - Pass state into this dialog - dictionaries will be automatically formatted to - JSON + """Pass state into this dialog - dictionaries will be automatically formatted to JSON. Args: state: Extra state information that you need to pass from this dialog @@ -472,9 +465,7 @@ def state(self, state: Union[dict, str]) -> "DialogBuilder": return self def callback_id(self, callback_id: str) -> "DialogBuilder": - """ - Specify a callback ID for this dialog, which your application will then - receive upon dialog submission + """Specify a callback ID for this dialog, which your application will then receive upon dialog submission. Args: callback_id: a string identifying this particular dialog @@ -483,9 +474,9 @@ def callback_id(self, callback_id: str) -> "DialogBuilder": return self def submit_label(self, label: str) -> "DialogBuilder": - """ - The label to use on the 'Submit' button on the dialog. Defaults to 'Submit' - if not specified. + """The label to use on the 'Submit' button on the dialog. + + Defaults to 'Submit' if not specified. Args: label: must not exceed 24 characters, and must be a single word (no @@ -495,9 +486,9 @@ def submit_label(self, label: str) -> "DialogBuilder": return self def notify_on_cancel(self, notify: bool) -> "DialogBuilder": - """ - Whether this dialog should send a request to your application even if the - user cancels their interaction. Defaults to False. + """Whether this dialog should send a request to your application even if the user cancels their interaction. + + Defaults to False. Args: notify: Set to True to indicate that your application should receive a @@ -519,8 +510,7 @@ def text_field( max_length: int = 150, subtype: Optional[str] = None, ) -> "DialogBuilder": - """ - Text elements are single-line plain text fields. + """Text elements are single-line plain text fields. https://docs.slack.dev/legacy/legacy-dialogs/#attributes_text_elements @@ -570,9 +560,9 @@ def text_area( max_length: int = 3000, subtype: Optional[str] = None, ) -> "DialogBuilder": - """ - A textarea is a multi-line plain text editing control. You've likely - encountered these on the world wide web. Use this element if you want a + """A textarea is a multi-line plain text editing control. + + You've likely encountered these on the world wide web. Use this element if you want a relatively long answer from users. The element UI provides a remaining character count to the max_length you have set or the default, 3000. @@ -622,9 +612,9 @@ def static_selector( value: Optional[str] = None, placeholder: Optional[str] = None, ) -> "DialogBuilder": - """ - Use the select element for multiple choice selections allowing users to pick - a single item from a list. True to web roots, this selection is displayed as + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. A select element may contain up to 100 selections, provided as a list of @@ -665,9 +655,9 @@ def external_selector( placeholder: Optional[str] = None, min_query_length: Optional[int] = None, ) -> "DialogBuilder": - """ - Use the select element for multiple choice selections allowing users to pick - a single item from a list. True to web roots, this selection is displayed as + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. A list of options can be loaded from an external URL and used in your dialog @@ -710,9 +700,9 @@ def user_selector( value: Optional[str] = None, placeholder: Optional[str] = None, ) -> "DialogBuilder": - """ - Now you can easily populate a select menu with a list of users. For example, - when you are creating a bug tracking app, you want to include a field for an + """Now you can easily populate a select menu with a list of users. + + For example, when you are creating a bug tracking app, you want to include a field for an assignee. Slack pre-populates the user list in client-side, so your app doesn't need access to a related OAuth scope. @@ -747,9 +737,9 @@ def channel_selector( value: Optional[str] = None, placeholder: Optional[str] = None, ) -> "DialogBuilder": - """ - You can also provide a select menu with a list of channels. Specify your - data_source as channels to limit only to public channels + """You can also provide a select menu with a list of channels. + + Specify your data_source as channels to limit only to public channels https://docs.slack.dev/legacy/legacy-dialogs/#dynamic_select_elements_channels_conversations @@ -782,9 +772,9 @@ def conversation_selector( value: Optional[str] = None, placeholder: Optional[str] = None, ) -> "DialogBuilder": - """ - You can also provide a select menu with a list of conversations - including - private channels, direct messages, MPIMs, and whatever else we consider a + """You can also provide a select menu with a list of conversations. + + This includes private channels, direct messages, MPIMs, and whatever else we consider a conversation-like thing. https://docs.slack.dev/legacy/legacy-dialogs/#dynamic_select_elements_channels_conversations @@ -853,9 +843,9 @@ def to_dict(self) -> dict: class ActionStaticSelector(AbstractActionSelector): - """ - Use the select element for multiple choice selections allowing users to pick a - single item from a list. True to web roots, this selection is displayed as a + """Use the select element for multiple choice selections allowing users to pick a single item from a list. + + True to web roots, this selection is displayed as a dropdown menu. https://docs.slack.dev/legacy/legacy-dialogs/#select_elements @@ -873,9 +863,7 @@ def __init__( options: Sequence[Union[Option, OptionGroup]], selected_option: Optional[Option] = None, ): - """ - Help users make clear, concise decisions by providing a menu of options - within messages. + """Help users make clear, concise decisions by providing a menu of options within messages. https://docs.slack.dev/legacy/legacy-messaging/legacy-adding-menus-to-messages/ diff --git a/slack_sdk/models/messages/__init__.py b/slack_sdk/models/messages/__init__.py index 47d42ddc6..74f551cab 100644 --- a/slack_sdk/models/messages/__init__.py +++ b/slack_sdk/models/messages/__init__.py @@ -6,7 +6,8 @@ class Link(BaseObject): def __init__(self, *, url: str, text: str): - """Base class used to generate links in Slack's not-quite Markdown, not quite HTML syntax + """Base class used to generate links in Slack's not-quite Markdown, not quite HTML syntax. + https://docs.slack.dev/messaging/formatting-message-text/#linking_to_urls """ self.url = url @@ -30,6 +31,7 @@ def __init__( link: Optional[str] = None, ): """Text containing a date or time should display that date in the local timezone of the person seeing the text. + https://docs.slack.dev/messaging/formatting-message-text/#date-formatting """ if isinstance(date, datetime): @@ -54,7 +56,8 @@ class ObjectLink(Link): } def __init__(self, *, object_id: str, text: str = ""): - """Convenience class to create links to specific object types + """Convenience class to create links to specific object types. + https://docs.slack.dev/messaging/formatting-message-text/#linking-channels """ prefix = self.prefix_mapping.get(object_id[0].upper(), "@") @@ -64,6 +67,7 @@ def __init__(self, *, object_id: str, text: str = ""): class ChannelLink(Link): def __init__(self): """Represents an @channel link, which notifies everyone present in this channel. + https://docs.slack.dev/messaging/formatting-message-text/ """ super().__init__(url="!channel", text="channel") @@ -72,6 +76,7 @@ def __init__(self): class HereLink(Link): def __init__(self): """Represents an @here link, which notifies all online users of this channel. + https://docs.slack.dev/messaging/formatting-message-text/ """ super().__init__(url="!here", text="here") @@ -80,6 +85,7 @@ def __init__(self): class EveryoneLink(Link): def __init__(self): """Represents an @everyone link, which notifies all users of this workspace. + https://docs.slack.dev/messaging/formatting-message-text/ """ super().__init__(url="!everyone", text="everyone") diff --git a/slack_sdk/models/messages/chunk.py b/slack_sdk/models/messages/chunk.py index a7dfc4de4..2e1620b84 100644 --- a/slack_sdk/models/messages/chunk.py +++ b/slack_sdk/models/messages/chunk.py @@ -8,8 +8,7 @@ class Chunk(JsonObject): - """ - Chunk for streaming messages. + """Chunk for streaming messages. https://docs.slack.dev/messaging/sending-and-scheduling-messages#text-streaming """ diff --git a/slack_sdk/models/messages/message.py b/slack_sdk/models/messages/message.py index 6d510dac1..575e48657 100644 --- a/slack_sdk/models/messages/message.py +++ b/slack_sdk/models/messages/message.py @@ -32,8 +32,7 @@ def __init__( blocks: Optional[Sequence[Block]] = None, markdown: bool = True, ): - """ - Create a message. + """Create a message. https://docs.slack.dev/messaging/#message-structure diff --git a/slack_sdk/models/metadata/__init__.py b/slack_sdk/models/metadata/__init__.py index 7e4918401..aa6372408 100644 --- a/slack_sdk/models/metadata/__init__.py +++ b/slack_sdk/models/metadata/__init__.py @@ -3,7 +3,7 @@ class Metadata(JsonObject): - """Message metadata + """Message metadata. https://docs.slack.dev/messaging/message-metadata/ """ @@ -64,7 +64,7 @@ def __repr__(self): class ExternalRef(JsonObject): - """Reference (and optional type) used to identify an entity within the developer's system""" + """Reference (and optional type) used to identify an entity within the developer's system.""" attributes = { "id", @@ -89,7 +89,7 @@ def __repr__(self): class FileEntitySlackFile(JsonObject): - """Slack file reference for file entities""" + """Slack file reference for file entities.""" attributes = { "id", @@ -114,7 +114,7 @@ def __repr__(self): class EntityIconSlackFile(JsonObject): - """Slack file reference for entity icon""" + """Slack file reference for entity icon.""" attributes = { "id", @@ -139,7 +139,7 @@ def __repr__(self): class EntityIconField(JsonObject): - """Icon field for entity attributes""" + """Icon field for entity attributes.""" attributes = { "alt_text", @@ -167,7 +167,7 @@ def __repr__(self): class EntityEditSelectConfig(JsonObject): - """Select configuration for entity edit support""" + """Select configuration for entity edit support.""" attributes = { "current_value", @@ -201,7 +201,7 @@ def __repr__(self): class EntityEditNumberConfig(JsonObject): - """Number configuration for entity edit support""" + """Number configuration for entity edit support.""" attributes = { "is_decimal_allowed", @@ -229,7 +229,7 @@ def __repr__(self): class EntityEditTextConfig(JsonObject): - """Text configuration for entity edit support""" + """Text configuration for entity edit support.""" attributes = { "min_length", @@ -254,7 +254,7 @@ def __repr__(self): class EntityEditSupport(JsonObject): - """Edit support configuration for entity fields""" + """Edit support configuration for entity fields.""" attributes = { "enabled", @@ -294,7 +294,7 @@ def __repr__(self): class EntityFullSizePreviewError(JsonObject): - """Error information for full-size preview""" + """Error information for full-size preview.""" attributes = { "code", @@ -319,7 +319,7 @@ def __repr__(self): class EntityFullSizePreview(JsonObject): - """Full-size preview configuration for entity""" + """Full-size preview configuration for entity.""" attributes = { "is_supported", @@ -350,7 +350,7 @@ def __repr__(self): class EntityUserIDField(JsonObject): - """User ID field for entity""" + """User ID field for entity.""" attributes = { "user_id", @@ -372,7 +372,7 @@ def __repr__(self): class EntityUserField(JsonObject): - """User field for entity""" + """User field for entity.""" attributes = { "text", @@ -403,7 +403,7 @@ def __repr__(self): class EntityRefField(JsonObject): - """Entity reference field""" + """Entity reference field.""" attributes = { "entity_url", @@ -437,7 +437,7 @@ def __repr__(self): class EntityTypedField(JsonObject): - """Typed field for entity with various display options""" + """Typed field for entity with various display options.""" attributes = { "type", @@ -498,7 +498,7 @@ def __repr__(self): class EntityStringField(JsonObject): - """String field for entity""" + """String field for entity.""" attributes = { "value", @@ -544,7 +544,7 @@ def __repr__(self): class EntityTimestampField(JsonObject): - """Timestamp field for entity""" + """Timestamp field for entity.""" attributes = { "value", @@ -575,7 +575,7 @@ def __repr__(self): class EntityImageField(JsonObject): - """Image field for entity""" + """Image field for entity.""" attributes = { "alt_text", @@ -612,7 +612,7 @@ def __repr__(self): class EntityBooleanCheckboxField(JsonObject): - """Boolean checkbox properties""" + """Boolean checkbox properties.""" attributes = {"type", "text", "description"} @@ -636,7 +636,7 @@ def __repr__(self): class EntityBooleanTextField(JsonObject): - """Boolean text properties""" + """Boolean text properties.""" attributes = {"type", "true_text", "false_text", "true_description", "false_description"} @@ -664,7 +664,7 @@ def __repr__(self): class EntityArrayItemField(JsonObject): - """Array item field for entity (similar to EntityTypedField but with optional type)""" + """Array item field for entity (similar to EntityTypedField but with optional type).""" attributes = { "type", @@ -725,7 +725,7 @@ def __repr__(self): class EntityCustomField(JsonObject): - """Custom field for entity with flexible types""" + """Custom field for entity with flexible types.""" attributes = { "label", @@ -799,7 +799,7 @@ def type_valid(self): class FileEntityFields(JsonObject): - """Fields specific to file entities""" + """Fields specific to file entities.""" attributes = { "preview", @@ -842,7 +842,7 @@ def __repr__(self): class TaskEntityFields(JsonObject): - """Fields specific to task entities""" + """Fields specific to task entities.""" attributes = { "description", @@ -885,7 +885,7 @@ def __repr__(self): class IncidentEntityFields(JsonObject): - """Fields specific to incident entities""" + """Fields specific to incident entities.""" attributes = { "status", @@ -931,7 +931,7 @@ def __repr__(self): class ContentItemEntityFields(JsonObject): - """Fields specific to content item entities""" + """Fields specific to content item entities.""" attributes = { "preview", @@ -968,7 +968,7 @@ def __repr__(self): class EntityActionProcessingState(JsonObject): - """Processing state configuration for entity action button""" + """Processing state configuration for entity action button.""" attributes = { "enabled", @@ -993,7 +993,7 @@ def __repr__(self): class EntityActionButton(JsonObject): - """Action button for entity""" + """Action button for entity.""" attributes = { "text", @@ -1033,7 +1033,7 @@ def __repr__(self): class EntityTitle(JsonObject): - """Title for entity attributes""" + """Title for entity attributes.""" attributes = { "text", @@ -1058,7 +1058,7 @@ def __repr__(self): class EntityAttributes(JsonObject): - """Attributes for an entity""" + """Attributes for an entity.""" attributes = { "title", @@ -1101,7 +1101,7 @@ def __repr__(self): class EntityActions(JsonObject): - """Actions configuration for entity""" + """Actions configuration for entity.""" attributes = { "primary_actions", @@ -1126,7 +1126,7 @@ def __repr__(self): class EntityPayload(JsonObject): - """Payload schema for an entity""" + """Payload schema for an entity.""" attributes = { "attributes", @@ -1187,7 +1187,7 @@ def __repr__(self): class EntityMetadata(JsonObject): - """Work object entity metadata + """Work object entity metadata. https://docs.slack.dev/messaging/work-objects/ """ @@ -1228,7 +1228,7 @@ def entity_type_valid(self): class EventAndEntityMetadata(JsonObject): - """Message metadata with entities + """Message metadata with entities. https://docs.slack.dev/messaging/message-metadata/ https://docs.slack.dev/messaging/work-objects/ diff --git a/slack_sdk/oauth/__init__.py b/slack_sdk/oauth/__init__.py index a27b606b0..640ed2884 100644 --- a/slack_sdk/oauth/__init__.py +++ b/slack_sdk/oauth/__init__.py @@ -1,4 +1,4 @@ -"""Modules for implementing the Slack OAuth flow +"""Modules for implementing the Slack OAuth flow. https://docs.slack.dev/tools/python-slack-sdk/oauth """ diff --git a/slack_sdk/oauth/authorize_url_generator/__init__.py b/slack_sdk/oauth/authorize_url_generator/__init__.py index 652fe7dc4..9f1b2d2f1 100644 --- a/slack_sdk/oauth/authorize_url_generator/__init__.py +++ b/slack_sdk/oauth/authorize_url_generator/__init__.py @@ -29,7 +29,7 @@ def generate(self, state: str, team: Optional[str] = None) -> str: class OpenIDConnectAuthorizeUrlGenerator: - """Refer to https://openid.net/specs/openid-connect-core-1_0.html""" + """Refer to https://openid.net/specs/openid-connect-core-1_0.html.""" def __init__( self, diff --git a/slack_sdk/oauth/installation_store/async_installation_store.py b/slack_sdk/oauth/installation_store/async_installation_store.py index f8b76b860..a244a3969 100644 --- a/slack_sdk/oauth/installation_store/async_installation_store.py +++ b/slack_sdk/oauth/installation_store/async_installation_store.py @@ -32,11 +32,11 @@ def logger(self) -> Logger: raise NotImplementedError() async def async_save(self, installation: Installation): - """Saves an installation data""" + """Saves an installation data.""" raise NotImplementedError() async def async_save_bot(self, bot: Bot): - """Saves a bot installation data""" + """Saves a bot installation data.""" raise NotImplementedError() async def async_find_bot( @@ -46,7 +46,7 @@ async def async_find_bot( team_id: Optional[str], is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: - """Finds a bot scope installation per workspace / org""" + """Finds a bot scope installation per workspace / org.""" raise NotImplementedError() async def async_find_installation( @@ -58,6 +58,7 @@ async def async_find_installation( is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: """Finds a relevant installation for the given IDs. + If the user_id is absent, this method may return the latest installation in the workspace / org. """ raise NotImplementedError() @@ -68,7 +69,7 @@ async def async_delete_bot( enterprise_id: Optional[str], team_id: Optional[str], ) -> None: - """Deletes a bot scope installation per workspace / org""" + """Deletes a bot scope installation per workspace / org.""" raise NotImplementedError() async def async_delete_installation( @@ -78,7 +79,7 @@ async def async_delete_installation( team_id: Optional[str], user_id: Optional[str] = None, ) -> None: - """Deletes an installation that matches the given IDs""" + """Deletes an installation that matches the given IDs.""" raise NotImplementedError() async def async_delete_all( @@ -87,6 +88,6 @@ async def async_delete_all( enterprise_id: Optional[str], team_id: Optional[str], ): - """Deletes all installation data for the given workspace / org""" + """Deletes all installation data for the given workspace / org.""" await self.async_delete_bot(enterprise_id=enterprise_id, team_id=team_id) await self.async_delete_installation(enterprise_id=enterprise_id, team_id=team_id) diff --git a/slack_sdk/oauth/installation_store/installation_store.py b/slack_sdk/oauth/installation_store/installation_store.py index 8143d2fb7..b12bee089 100644 --- a/slack_sdk/oauth/installation_store/installation_store.py +++ b/slack_sdk/oauth/installation_store/installation_store.py @@ -1,4 +1,4 @@ -"""Slack installation data store +"""Slack installation data store. Refer to https://docs.slack.dev/tools/python-slack-sdk/oauth for details. """ @@ -37,11 +37,11 @@ def logger(self) -> Logger: raise NotImplementedError() def save(self, installation: Installation): - """Saves an installation data""" + """Saves an installation data.""" raise NotImplementedError() def save_bot(self, bot: Bot): - """Saves a bot installation data""" + """Saves a bot installation data.""" raise NotImplementedError() def find_bot( @@ -51,7 +51,7 @@ def find_bot( team_id: Optional[str], is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: - """Finds a bot scope installation per workspace / org""" + """Finds a bot scope installation per workspace / org.""" raise NotImplementedError() def find_installation( @@ -63,6 +63,7 @@ def find_installation( is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: """Finds a relevant installation for the given IDs. + If the user_id is absent, this method may return the latest installation in the workspace / org. """ raise NotImplementedError() @@ -73,7 +74,7 @@ def delete_bot( enterprise_id: Optional[str], team_id: Optional[str], ) -> None: - """Deletes a bot scope installation per workspace / org""" + """Deletes a bot scope installation per workspace / org.""" raise NotImplementedError() def delete_installation( @@ -83,7 +84,7 @@ def delete_installation( team_id: Optional[str], user_id: Optional[str] = None, ) -> None: - """Deletes an installation that matches the given IDs""" + """Deletes an installation that matches the given IDs.""" raise NotImplementedError() def delete_all( @@ -92,6 +93,6 @@ def delete_all( enterprise_id: Optional[str], team_id: Optional[str], ): - """Deletes all installation data for the given workspace / org""" + """Deletes all installation data for the given workspace / org.""" self.delete_bot(enterprise_id=enterprise_id, team_id=team_id) self.delete_installation(enterprise_id=enterprise_id, team_id=team_id) diff --git a/slack_sdk/oauth/sqlalchemy_utils/__init__.py b/slack_sdk/oauth/sqlalchemy_utils/__init__.py index a0692bda3..d1a68f1f2 100644 --- a/slack_sdk/oauth/sqlalchemy_utils/__init__.py +++ b/slack_sdk/oauth/sqlalchemy_utils/__init__.py @@ -5,8 +5,7 @@ # TODO: Remove this function in next major release (v4.0.0) after updating all # DateTime columns to DateTime(timezone=True). See issue #1832 for context. def normalize_datetime_for_db(dt: Optional[datetime]) -> Optional[datetime]: - """ - Normalize timezone-aware datetime to naive UTC datetime for database storage. + """Normalize timezone-aware datetime to naive UTC datetime for database storage. Ensures compatibility with existing databases using TIMESTAMP WITHOUT TIME ZONE. SQLAlchemy DateTime columns without timezone=True create naive timestamp columns diff --git a/slack_sdk/oauth/state_store/__init__.py b/slack_sdk/oauth/state_store/__init__.py index c3fbd0c4e..cf2bd3a12 100644 --- a/slack_sdk/oauth/state_store/__init__.py +++ b/slack_sdk/oauth/state_store/__init__.py @@ -1,4 +1,4 @@ -"""OAuth state parameter data store +"""OAuth state parameter data store. Refer to https://docs.slack.dev/tools/python-slack-sdk/oauth for details. """ diff --git a/slack_sdk/oauth/token_rotation/async_rotator.py b/slack_sdk/oauth/token_rotation/async_rotator.py index c3506f004..01cd28441 100644 --- a/slack_sdk/oauth/token_rotation/async_rotator.py +++ b/slack_sdk/oauth/token_rotation/async_rotator.py @@ -37,7 +37,6 @@ async def perform_token_rotation( Returns: None if no rotation is necessary for now. """ - # TODO: make the following two calls in parallel for better performance # bot diff --git a/slack_sdk/oauth/token_rotation/rotator.py b/slack_sdk/oauth/token_rotation/rotator.py index e7dab22cc..259da684b 100644 --- a/slack_sdk/oauth/token_rotation/rotator.py +++ b/slack_sdk/oauth/token_rotation/rotator.py @@ -31,7 +31,6 @@ def perform_token_rotation( Returns: None if no rotation is necessary for now. """ - # TODO: make the following two calls in parallel for better performance # bot diff --git a/slack_sdk/proxy_env_variable_loader.py b/slack_sdk/proxy_env_variable_loader.py index 7df080b9b..52f881470 100644 --- a/slack_sdk/proxy_env_variable_loader.py +++ b/slack_sdk/proxy_env_variable_loader.py @@ -1,4 +1,4 @@ -"""Internal module for loading proxy-related env variables""" +"""Internal module for loading proxy-related env variables.""" import logging import os diff --git a/slack_sdk/rtm/__init__.py b/slack_sdk/rtm/__init__.py index 2af13db51..2d3ce7904 100644 --- a/slack_sdk/rtm/__init__.py +++ b/slack_sdk/rtm/__init__.py @@ -71,20 +71,18 @@ class RTMClient(object): import os from slack import RTMClient + @RTMClient.run_on(event="message") def say_hello(**payload): - data = payload['data'] - web_client = payload['web_client'] - if 'Hello' in data['text']: - channel_id = data['channel'] - thread_ts = data['ts'] - user = data['user'] - - web_client.chat_postMessage( - channel=channel_id, - text=f"Hi <@{user}>!", - thread_ts=thread_ts - ) + data = payload["data"] + web_client = payload["web_client"] + if "Hello" in data["text"]: + channel_id = data["channel"] + thread_ts = data["ts"] + user = data["user"] + + web_client.chat_postMessage(channel=channel_id, text=f"Hi <@{user}>!", thread_ts=thread_ts) + slack_token = os.environ["SLACK_API_TOKEN"] rtm_client = RTMClient(token=slack_token) @@ -303,7 +301,6 @@ def _validate_callback(callback): SlackClientError: The specified callback is not callable. SlackClientError: The callback must accept keyword arguments (**kwargs). """ - cb_name = callback.__name__ if hasattr(callback, "__name__") else callback if not callable(callback): msg = "The specified callback '{}' is not callable.".format(cb_name) diff --git a/slack_sdk/rtm_v2/__init__.py b/slack_sdk/rtm_v2/__init__.py index f54cb35b7..36d350f53 100644 --- a/slack_sdk/rtm_v2/__init__.py +++ b/slack_sdk/rtm_v2/__init__.py @@ -185,7 +185,7 @@ def is_connected(self) -> bool: return self.current_session is not None and self.current_session.is_active() def issue_new_wss_url(self) -> str: - """Acquires a new WSS URL using rtm.connect API method""" + """Acquires a new WSS URL using rtm.connect API method.""" try: api_response = self.web_client.rtm_connect() return api_response["url"] @@ -211,7 +211,7 @@ def connect_to_new_endpoint(self, force: bool = False): self.logger.info("Connected to a new endpoint...") def connect(self): - """Starts talking to the RTM server through a WebSocket connection""" + """Starts talking to the RTM server through a WebSocket connection.""" if self.bot_id is None: self.bot_id = self.web_client.auth_test()["bot_id"] @@ -257,8 +257,8 @@ def disconnect(self): self.current_session.disconnect() def close(self) -> None: - """ - Closes this instance and cleans up underlying resources. + """Closes this instance and cleans up underlying resources. + After calling this method, this instance is no longer usable. """ self.closed = True diff --git a/slack_sdk/scim/__init__.py b/slack_sdk/scim/__init__.py index 25ad76109..e8832d952 100644 --- a/slack_sdk/scim/__init__.py +++ b/slack_sdk/scim/__init__.py @@ -1,4 +1,5 @@ """SCIM API is a set of APIs for provisioning and managing user accounts and groups. + SCIM is used by Single Sign-On (SSO) services and identity providers to manage people across a variety of tools, including Slack. diff --git a/slack_sdk/scim/v1/__init__.py b/slack_sdk/scim/v1/__init__.py index 2e2842568..d8729c79e 100644 --- a/slack_sdk/scim/v1/__init__.py +++ b/slack_sdk/scim/v1/__init__.py @@ -1,4 +1,5 @@ """SCIM API is a set of APIs for provisioning and managing user accounts and groups. + SCIM is used by Single Sign-On (SSO) services and identity providers to manage people across a variety of tools, including Slack. diff --git a/slack_sdk/scim/v1/async_client.py b/slack_sdk/scim/v1/async_client.py index c18128366..b5d60a00f 100644 --- a/slack_sdk/scim/v1/async_client.py +++ b/slack_sdk/scim/v1/async_client.py @@ -72,7 +72,8 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[AsyncRetryHandler]] = None, ): - """API client for SCIM API + """API client for SCIM API. + See https://docs.slack.dev/admins/scim-api/ for more details Args: diff --git a/slack_sdk/scim/v1/client.py b/slack_sdk/scim/v1/client.py index 82710c6cc..93131233c 100644 --- a/slack_sdk/scim/v1/client.py +++ b/slack_sdk/scim/v1/client.py @@ -1,4 +1,5 @@ """SCIM API is a set of APIs for provisioning and managing user accounts and groups. + SCIM is used by Single Sign-On (SSO) services and identity providers to manage people across a variety of tools, including Slack. @@ -75,7 +76,8 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[RetryHandler]] = None, ): - """API client for SCIM API + """API client for SCIM API. + See https://docs.slack.dev/admins/scim-api/ for more details Args: diff --git a/slack_sdk/signature/__init__.py b/slack_sdk/signature/__init__.py index 0faba9c33..52cd7bcb5 100644 --- a/slack_sdk/signature/__init__.py +++ b/slack_sdk/signature/__init__.py @@ -1,4 +1,4 @@ -"""Slack request signature verifier""" +"""Slack request signature verifier.""" import hashlib import hmac @@ -19,7 +19,7 @@ def now(self) -> float: class SignatureVerifier: def __init__(self, signing_secret: str, clock: Clock = Clock()): - """Slack request signature verifier + """Slack request signature verifier. Slack signs its requests using a secret that's unique to your app. With the help of signing secrets, your app can more confidently verify @@ -46,7 +46,7 @@ def is_valid_request( body: Union[str, bytes], headers: Mapping[str, str], ) -> bool: - """Verifies if the given signature is valid""" + """Verifies if the given signature is valid.""" if headers is None: return False normalized_headers = {k.lower(): v for k, v in headers.items()} @@ -62,7 +62,7 @@ def is_valid( timestamp: Optional[str], signature: Optional[str], ) -> bool: - """Verifies if the given signature is valid""" + """Verifies if the given signature is valid.""" if timestamp is None or signature is None: return False @@ -75,7 +75,7 @@ def is_valid( return hmac.compare_digest(calculated_signature, signature) def generate_signature(self, *, timestamp: str, body: Union[str, bytes]) -> Optional[str]: - """Generates a signature""" + """Generates a signature.""" if timestamp is None: return None if body is None: diff --git a/slack_sdk/socket_mode/__init__.py b/slack_sdk/socket_mode/__init__.py index b8e1883c1..e758de667 100644 --- a/slack_sdk/socket_mode/__init__.py +++ b/slack_sdk/socket_mode/__init__.py @@ -1,4 +1,5 @@ """Socket Mode is a method of connecting your app to Slack’s APIs using WebSockets instead of HTTP. + You can use slack_sdk.socket_mode.SocketModeClient for managing Socket Mode connections and performing interactions with Slack. diff --git a/slack_sdk/socket_mode/aiohttp/__init__.py b/slack_sdk/socket_mode/aiohttp/__init__.py index da104b50e..5fb1d1171 100644 --- a/slack_sdk/socket_mode/aiohttp/__init__.py +++ b/slack_sdk/socket_mode/aiohttp/__init__.py @@ -1,4 +1,4 @@ -"""aiohttp based Socket Mode client +"""aiohttp based Socket Mode client. * https://docs.slack.dev/apis/events-api/using-socket-mode/ * https://docs.slack.dev/tools/python-slack-sdk/socket-mode/ @@ -82,7 +82,7 @@ def __init__( on_close_listeners: Optional[List[Callable[[WSMessage], Awaitable[None]]]] = None, loop: Optional[AbstractEventLoop] = None, ): - """Socket Mode client + """Socket Mode client. Args: app_token: App-level token diff --git a/slack_sdk/socket_mode/builtin/client.py b/slack_sdk/socket_mode/builtin/client.py index 43967ff29..a5e902b5e 100644 --- a/slack_sdk/socket_mode/builtin/client.py +++ b/slack_sdk/socket_mode/builtin/client.py @@ -1,4 +1,4 @@ -"""The built-in Socket Mode client +"""The built-in Socket Mode client. * https://docs.slack.dev/apis/events-api/using-socket-mode/ * https://docs.slack.dev/tools/python-slack-sdk/socket-mode/ @@ -84,7 +84,7 @@ def __init__( on_error_listeners: Optional[List[Callable[[Exception], None]]] = None, on_close_listeners: Optional[List[Callable[[int, Optional[str]], None]]] = None, ): - """Socket Mode client + """Socket Mode client. Args: app_token: App-level token diff --git a/slack_sdk/socket_mode/websocket_client/__init__.py b/slack_sdk/socket_mode/websocket_client/__init__.py index 85d42a9a1..16e037194 100644 --- a/slack_sdk/socket_mode/websocket_client/__init__.py +++ b/slack_sdk/socket_mode/websocket_client/__init__.py @@ -1,4 +1,4 @@ -"""websocket-client based Socket Mode client +"""websocket-client based Socket Mode client. * https://docs.slack.dev/apis/events-api/using-socket-mode/ * https://docs.slack.dev/tools/python-slack-sdk/socket-mode/ @@ -84,7 +84,7 @@ def __init__( on_error_listeners: Optional[List[Callable[[WebSocketApp, Exception], None]]] = None, on_close_listeners: Optional[List[Callable[[WebSocketApp], None]]] = None, ): - """ + """Socket Mode client implementation built with the websocket-client library. Args: app_token: App-level token diff --git a/slack_sdk/socket_mode/websockets/__init__.py b/slack_sdk/socket_mode/websockets/__init__.py index 018c0d183..3b217e4eb 100644 --- a/slack_sdk/socket_mode/websockets/__init__.py +++ b/slack_sdk/socket_mode/websockets/__init__.py @@ -1,4 +1,4 @@ -"""websockets based Socket Mode client +"""websockets based Socket Mode client. * https://docs.slack.dev/apis/events-api/using-socket-mode/ * https://docs.slack.dev/tools/python-slack-sdk/socket-mode/ @@ -88,7 +88,7 @@ def __init__( ping_interval: float = 10, trace_enabled: bool = False, ): - """Socket Mode client + """Socket Mode client. Args: app_token: App-level token diff --git a/slack_sdk/version.py b/slack_sdk/version.py index 3d0785b32..c3b97b00d 100644 --- a/slack_sdk/version.py +++ b/slack_sdk/version.py @@ -1,3 +1,3 @@ -"""Check the latest version at https://pypi.org/project/slack-sdk/""" +"""Check the latest version at https://pypi.org/project/slack-sdk/.""" __version__ = "3.44.1" diff --git a/slack_sdk/web/__init__.py b/slack_sdk/web/__init__.py index 41f3b5a77..d50123782 100644 --- a/slack_sdk/web/__init__.py +++ b/slack_sdk/web/__init__.py @@ -1,5 +1,7 @@ -"""The Slack Web API allows you to build applications that interact with Slack -in more complex ways than the integrations we provide out of the box.""" +"""The Slack Web API allows you to build applications that interact with Slack. + +These applications can work in more complex ways than the integrations we provide out of the box. +""" from .client import WebClient from .slack_response import SlackResponse diff --git a/slack_sdk/web/async_base_client.py b/slack_sdk/web/async_base_client.py index ebb0eb3d0..6dcf71d73 100644 --- a/slack_sdk/web/async_base_client.py +++ b/slack_sdk/web/async_base_client.py @@ -143,7 +143,6 @@ async def api_call( SlackRequestError: Json data can only be submitted as POST requests. """ - api_url = _get_url(self.base_url, api_method) if auth is not None: if isinstance(auth, Dict): @@ -192,6 +191,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> AsyncSlac 'channel': '#random' } } + Returns: The response parsed into a AsyncSlackResponse object. """ @@ -216,6 +216,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> AsyncSlac async def _request(self, *, http_verb, api_url, req_args) -> Dict[str, Any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ @@ -239,7 +240,7 @@ async def _upload_file( proxy: Optional[str], ssl: Optional[SSLContext], ) -> FileUploadV2Result: - """Upload a file using the issued upload URL""" + """Upload a file using the issued upload URL.""" result = await _request_with_session( current_session=self.session, timeout=timeout, diff --git a/slack_sdk/web/async_client.py b/slack_sdk/web/async_client.py index e485a9609..d2631b5fe 100644 --- a/slack_sdk/web/async_client.py +++ b/slack_sdk/web/async_client.py @@ -109,7 +109,8 @@ async def admin_analytics_getFile( metadata_only: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: - """Retrieve analytics data for a given date, presented as a compressed JSON file + """Retrieve analytics data for a given date, presented as a compressed JSON file. + https://docs.slack.dev/reference/methods/admin.analytics.getFile """ kwargs.update({"type": type}) @@ -129,6 +130,7 @@ async def admin_apps_approve( **kwargs, ) -> AsyncSlackResponse: """Approve an app for installation on a workspace. + Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -159,6 +161,7 @@ async def admin_apps_approved_list( **kwargs, ) -> AsyncSlackResponse: """List approved apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.approved.list """ kwargs.update( @@ -179,7 +182,8 @@ async def admin_apps_clearResolution( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Clear an app resolution + """Clear an app resolution. + https://docs.slack.dev/reference/methods/admin.apps.clearResolution """ kwargs.update( @@ -200,6 +204,7 @@ async def admin_apps_requests_cancel( **kwargs, ) -> AsyncSlackResponse: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.cancel """ kwargs.update( @@ -220,6 +225,7 @@ async def admin_apps_requests_list( **kwargs, ) -> AsyncSlackResponse: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.list """ kwargs.update( @@ -241,6 +247,7 @@ async def admin_apps_restrict( **kwargs, ) -> AsyncSlackResponse: """Restrict an app for installation on a workspace. + Exactly one of the team_id or enterprise_id arguments is required, not both. Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -271,6 +278,7 @@ async def admin_apps_restricted_list( **kwargs, ) -> AsyncSlackResponse: """List restricted apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.restricted.list """ kwargs.update( @@ -292,6 +300,7 @@ async def admin_apps_uninstall( **kwargs, ) -> AsyncSlackResponse: """Uninstall an app from one or many workspaces, or an entire enterprise organization. + With an org-level token, enterprise_id or team_ids is required. https://docs.slack.dev/reference/methods/admin.apps.uninstall """ @@ -323,7 +332,8 @@ async def admin_apps_activities_list( limit: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """Get logs for a specified team/org + """Get logs for a specified team/org. + https://docs.slack.dev/reference/methods/admin.apps.activities.list """ kwargs.update( @@ -351,7 +361,8 @@ async def admin_apps_config_lookup( app_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Look up the app config for connectors by their IDs + """Look up the app config for connectors by their IDs. + https://docs.slack.dev/reference/methods/admin.apps.config.lookup """ if isinstance(app_ids, (list, tuple)): @@ -368,7 +379,8 @@ async def admin_apps_config_set( workflow_auth_strategy: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Set the app config for a connector + """Set the app config for a connector. + https://docs.slack.dev/reference/methods/admin.apps.config.set """ kwargs.update( @@ -391,6 +403,7 @@ async def admin_auth_policy_getEntities( **kwargs, ) -> AsyncSlackResponse: """Fetch all the entities assigned to a particular authentication policy by name. + https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities """ kwargs.update({"policy_name": policy_name}) @@ -411,6 +424,7 @@ async def admin_auth_policy_assignEntities( **kwargs, ) -> AsyncSlackResponse: """Assign entities to a particular authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities """ if isinstance(entity_ids, (list, tuple)): @@ -430,6 +444,7 @@ async def admin_auth_policy_removeEntities( **kwargs, ) -> AsyncSlackResponse: """Remove specified entities from a specified authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities """ if isinstance(entity_ids, (list, tuple)): @@ -449,6 +464,7 @@ async def admin_conversations_createForObjects( **kwargs, ) -> AsyncSlackResponse: """Create a Salesforce channel for the corresponding object provided. + https://docs.slack.dev/reference/methods/admin.conversations.createForObjects """ kwargs.update( @@ -465,6 +481,7 @@ async def admin_conversations_linkObjects( **kwargs, ) -> AsyncSlackResponse: """Link a Salesforce record to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.linkObjects """ kwargs.update( @@ -484,6 +501,7 @@ async def admin_conversations_unlinkObjects( **kwargs, ) -> AsyncSlackResponse: """Unlink a Salesforce record from a channel. + https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects """ kwargs.update( @@ -502,7 +520,8 @@ async def admin_barriers_create( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Create an Information Barrier + """Create an Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.create """ kwargs.update({"primary_usergroup_id": primary_usergroup_id}) @@ -522,7 +541,8 @@ async def admin_barriers_delete( barrier_id: str, **kwargs, ) -> AsyncSlackResponse: - """Delete an existing Information Barrier + """Delete an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.delete """ kwargs.update({"barrier_id": barrier_id}) @@ -537,7 +557,8 @@ async def admin_barriers_update( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Update an existing Information Barrier + """Update an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.update """ kwargs.update({"barrier_id": barrier_id, "primary_usergroup_id": primary_usergroup_id}) @@ -558,8 +579,10 @@ async def admin_barriers_list( limit: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """Get all Information Barriers for your organization - https://docs.slack.dev/reference/methods/admin.barriers.list""" + """Get all Information Barriers for your organization. + + https://docs.slack.dev/reference/methods/admin.barriers.list + """ kwargs.update( { "cursor": cursor, @@ -579,6 +602,7 @@ async def admin_conversations_create( **kwargs, ) -> AsyncSlackResponse: """Create a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/admin.conversations.create """ kwargs.update( @@ -599,6 +623,7 @@ async def admin_conversations_delete( **kwargs, ) -> AsyncSlackResponse: """Delete a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.delete """ kwargs.update({"channel_id": channel_id}) @@ -612,6 +637,7 @@ async def admin_conversations_invite( **kwargs, ) -> AsyncSlackResponse: """Invite a user to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.invite """ kwargs.update({"channel_id": channel_id}) @@ -629,6 +655,7 @@ async def admin_conversations_archive( **kwargs, ) -> AsyncSlackResponse: """Archive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -641,6 +668,7 @@ async def admin_conversations_unarchive( **kwargs, ) -> AsyncSlackResponse: """Unarchive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -654,6 +682,7 @@ async def admin_conversations_rename( **kwargs, ) -> AsyncSlackResponse: """Rename a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.rename """ kwargs.update({"channel_id": channel_id, "name": name}) @@ -672,6 +701,7 @@ async def admin_conversations_search( **kwargs, ) -> AsyncSlackResponse: """Search for public or private channels in an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.conversations.search """ kwargs.update( @@ -703,6 +733,7 @@ async def admin_conversations_convertToPrivate( **kwargs, ) -> AsyncSlackResponse: """Convert a public channel to a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate """ kwargs.update({"channel_id": channel_id}) @@ -715,6 +746,7 @@ async def admin_conversations_convertToPublic( **kwargs, ) -> AsyncSlackResponse: """Convert a privte channel to a public channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic """ kwargs.update({"channel_id": channel_id}) @@ -728,6 +760,7 @@ async def admin_conversations_setConversationPrefs( **kwargs, ) -> AsyncSlackResponse: """Set the posting permissions for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -744,6 +777,7 @@ async def admin_conversations_getConversationPrefs( **kwargs, ) -> AsyncSlackResponse: """Get conversation preferences for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -757,6 +791,7 @@ async def admin_conversations_disconnectShared( **kwargs, ) -> AsyncSlackResponse: """Disconnect a connected channel from one or more workspaces. + https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared """ kwargs.update({"channel_id": channel_id}) @@ -777,6 +812,7 @@ async def admin_conversations_lookup( **kwargs, ) -> AsyncSlackResponse: """Returns channels on the given team using the filters. + https://docs.slack.dev/reference/methods/admin.conversations.lookup """ kwargs.update( @@ -802,9 +838,9 @@ async def admin_conversations_ekm_listOriginalConnectedChannelInfo( team_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> AsyncSlackResponse: - """List all disconnected channels—i.e., - channels that were once connected to other workspaces and then disconnected—and - the corresponding original channel IDs for key revocation with EKM. + """List all disconnected channels and the corresponding original channel IDs for key revocation with EKM. + + Disconnected channels are those that were once connected to other workspaces and then disconnected. https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo """ kwargs.update( @@ -832,6 +868,7 @@ async def admin_conversations_restrictAccess_addGroup( **kwargs, ) -> AsyncSlackResponse: """Add an allowlist of IDP groups for accessing a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup """ kwargs.update( @@ -855,6 +892,7 @@ async def admin_conversations_restrictAccess_listGroups( **kwargs, ) -> AsyncSlackResponse: """List all IDP Groups linked to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups """ kwargs.update( @@ -878,6 +916,7 @@ async def admin_conversations_restrictAccess_removeGroup( **kwargs, ) -> AsyncSlackResponse: """Remove a linked IDP group linked from a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup """ kwargs.update( @@ -903,6 +942,7 @@ async def admin_conversations_setTeams( **kwargs, ) -> AsyncSlackResponse: """Set the workspaces in an Enterprise grid org that connect to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setTeams """ kwargs.update( @@ -927,6 +967,7 @@ async def admin_conversations_getTeams( **kwargs, ) -> AsyncSlackResponse: """Set the workspaces in an Enterprise grid org that connect to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.getTeams """ kwargs.update( @@ -944,7 +985,8 @@ async def admin_conversations_getCustomRetention( channel_id: str, **kwargs, ) -> AsyncSlackResponse: - """Get a channel's retention policy + """Get a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -956,7 +998,8 @@ async def admin_conversations_removeCustomRetention( channel_id: str, **kwargs, ) -> AsyncSlackResponse: - """Remove a channel's retention policy + """Remove a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -969,7 +1012,8 @@ async def admin_conversations_setCustomRetention( duration_days: int, **kwargs, ) -> AsyncSlackResponse: - """Set a channel's retention policy + """Set a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention """ kwargs.update({"channel_id": channel_id, "duration_days": duration_days}) @@ -982,6 +1026,7 @@ async def admin_conversations_bulkArchive( **kwargs, ) -> AsyncSlackResponse: """Archive public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -994,6 +1039,7 @@ async def admin_conversations_bulkDelete( **kwargs, ) -> AsyncSlackResponse: """Delete public or private channels in bulk. + https://slack.com/api/admin.conversations.bulkDelete """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -1007,6 +1053,7 @@ async def admin_conversations_bulkMove( **kwargs, ) -> AsyncSlackResponse: """Move public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkMove """ kwargs.update( @@ -1025,6 +1072,7 @@ async def admin_emoji_add( **kwargs, ) -> AsyncSlackResponse: """Add an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.add """ kwargs.update({"name": name, "url": url}) @@ -1038,6 +1086,7 @@ async def admin_emoji_addAlias( **kwargs, ) -> AsyncSlackResponse: """Add an emoji alias. + https://docs.slack.dev/reference/methods/admin.emoji.addAlias """ kwargs.update({"alias_for": alias_for, "name": name}) @@ -1051,6 +1100,7 @@ async def admin_emoji_list( **kwargs, ) -> AsyncSlackResponse: """List emoji for an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1063,6 +1113,7 @@ async def admin_emoji_remove( **kwargs, ) -> AsyncSlackResponse: """Remove an emoji across an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.remove """ kwargs.update({"name": name}) @@ -1076,6 +1127,7 @@ async def admin_emoji_rename( **kwargs, ) -> AsyncSlackResponse: """Rename an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.rename """ kwargs.update({"name": name, "new_name": new_name}) @@ -1090,7 +1142,8 @@ async def admin_functions_list( limit: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """Look up functions by a set of apps + """Look up functions by a set of apps. + https://docs.slack.dev/reference/methods/admin.functions.list """ if isinstance(app_ids, (list, tuple)): @@ -1112,8 +1165,9 @@ async def admin_functions_permissions_lookup( function_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Lookup the visibility of multiple Slack functions - and include the users if it is limited to particular named entities. + """Lookup the visibility of multiple Slack functions. + + Include the users if the visibility is limited to particular named entities. https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup """ if isinstance(function_ids, (list, tuple)): @@ -1130,8 +1184,8 @@ async def admin_functions_permissions_set( user_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> AsyncSlackResponse: - """Set the visibility of a Slack function - and define the users or workspaces if it is set to named_entities + """Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities. + https://docs.slack.dev/reference/methods/admin.functions.permissions.set """ kwargs.update( @@ -1155,7 +1209,8 @@ async def admin_roles_addAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Adds members to the specified role with the specified scopes + """Adds members to the specified role with the specified scopes. + https://docs.slack.dev/reference/methods/admin.roles.addAssignments """ kwargs.update({"role_id": role_id}) @@ -1180,6 +1235,7 @@ async def admin_roles_listAssignments( **kwargs, ) -> AsyncSlackResponse: """Lists assignments for all roles across entities. + Options to scope results by any combination of roles or entities https://docs.slack.dev/reference/methods/admin.roles.listAssignments """ @@ -1202,7 +1258,8 @@ async def admin_roles_removeAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Removes a set of users from a role for the given scopes and entities + """Removes a set of users from a role for the given scopes and entities. + https://docs.slack.dev/reference/methods/admin.roles.removeAssignments """ kwargs.update({"role_id": role_id}) @@ -1225,6 +1282,7 @@ async def admin_users_session_reset( **kwargs, ) -> AsyncSlackResponse: """Wipes all valid sessions on all devices for a given user. + https://docs.slack.dev/reference/methods/admin.users.session.reset """ kwargs.update( @@ -1244,7 +1302,8 @@ async def admin_users_session_resetBulk( web_only: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: - """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users + """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users. + https://docs.slack.dev/reference/methods/admin.users.session.resetBulk """ if isinstance(user_ids, (list, tuple)): @@ -1267,6 +1326,7 @@ async def admin_users_session_invalidate( **kwargs, ) -> AsyncSlackResponse: """Invalidate a single session for a user by session_id. + https://docs.slack.dev/reference/methods/admin.users.session.invalidate """ kwargs.update({"session_id": session_id, "team_id": team_id}) @@ -1281,7 +1341,8 @@ async def admin_users_session_list( user_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Lists all active user sessions for an organization + """Lists all active user sessions for an organization. + https://docs.slack.dev/reference/methods/admin.users.session.list """ kwargs.update( @@ -1302,6 +1363,7 @@ async def admin_teams_settings_setDefaultChannels( **kwargs, ) -> AsyncSlackResponse: """Set the default channels of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels """ kwargs.update({"team_id": team_id}) @@ -1317,8 +1379,9 @@ async def admin_users_session_getSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Get user-specific session settings—the session duration - and what happens when the client closes—given a list of users. + """Get user-specific session settings for a given list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.getSettings """ if isinstance(user_ids, (list, tuple)): @@ -1335,8 +1398,9 @@ async def admin_users_session_setSettings( duration: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """Configure the user-level session settings—the session duration - and what happens when the client closes—for one or more users. + """Configure the user-level session settings for one or more users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.setSettings """ if isinstance(user_ids, (list, tuple)): @@ -1357,8 +1421,9 @@ async def admin_users_session_clearSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Clear user-specific session settings—the session duration - and what happens when the client closes—for a list of users. + """Clear user-specific session settings for a list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.clearSettings """ if isinstance(user_ids, (list, tuple)): @@ -1374,8 +1439,9 @@ async def admin_users_unsupportedVersions_export( date_sessions_started: Optional[Union[str, int]] = None, **kwargs, ) -> AsyncSlackResponse: - """Ask Slackbot to send you an export listing all workspace members using unsupported software, - presented as a zipped CSV file. + """Ask Slackbot to send you an export listing all workspace members using unsupported software. + + The export is presented as a zipped CSV file. https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export """ kwargs.update( @@ -1394,6 +1460,7 @@ async def admin_inviteRequests_approve( **kwargs, ) -> AsyncSlackResponse: """Approve a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approve """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1408,6 +1475,7 @@ async def admin_inviteRequests_approved_list( **kwargs, ) -> AsyncSlackResponse: """List all approved workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list """ kwargs.update( @@ -1428,6 +1496,7 @@ async def admin_inviteRequests_denied_list( **kwargs, ) -> AsyncSlackResponse: """List all denied workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list """ kwargs.update( @@ -1447,6 +1516,7 @@ async def admin_inviteRequests_deny( **kwargs, ) -> AsyncSlackResponse: """Deny a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.deny """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1468,6 +1538,7 @@ async def admin_teams_admins_list( **kwargs, ) -> AsyncSlackResponse: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.inviteRequests.list """ kwargs.update( @@ -1489,6 +1560,7 @@ async def admin_teams_create( **kwargs, ) -> AsyncSlackResponse: """Create an Enterprise team. + https://docs.slack.dev/reference/methods/admin.teams.create """ kwargs.update( @@ -1509,6 +1581,7 @@ async def admin_teams_list( **kwargs, ) -> AsyncSlackResponse: """List all teams on an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.teams.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1523,6 +1596,7 @@ async def admin_teams_owners_list( **kwargs, ) -> AsyncSlackResponse: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.owners.list """ kwargs.update({"team_id": team_id, "cursor": cursor, "limit": limit}) @@ -1534,7 +1608,8 @@ async def admin_teams_settings_info( team_id: str, **kwargs, ) -> AsyncSlackResponse: - """Fetch information about settings in a workspace + """Fetch information about settings in a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.info """ kwargs.update({"team_id": team_id}) @@ -1548,6 +1623,7 @@ async def admin_teams_settings_setDescription( **kwargs, ) -> AsyncSlackResponse: """Set the description of a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription """ kwargs.update({"team_id": team_id, "description": description}) @@ -1561,6 +1637,7 @@ async def admin_teams_settings_setDiscoverability( **kwargs, ) -> AsyncSlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability """ kwargs.update({"team_id": team_id, "discoverability": discoverability}) @@ -1574,6 +1651,7 @@ async def admin_teams_settings_setIcon( **kwargs, ) -> AsyncSlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon """ kwargs.update({"team_id": team_id, "image_url": image_url}) @@ -1587,6 +1665,7 @@ async def admin_teams_settings_setName( **kwargs, ) -> AsyncSlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setName """ kwargs.update({"team_id": team_id, "name": name}) @@ -1601,6 +1680,7 @@ async def admin_usergroups_addChannels( **kwargs, ) -> AsyncSlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addChannels """ kwargs.update({"team_id": team_id, "usergroup_id": usergroup_id}) @@ -1619,6 +1699,7 @@ async def admin_usergroups_addTeams( **kwargs, ) -> AsyncSlackResponse: """Associate one or more default workspaces with an organization-wide IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addTeams """ kwargs.update({"usergroup_id": usergroup_id, "auto_provision": auto_provision}) @@ -1637,6 +1718,7 @@ async def admin_usergroups_listChannels( **kwargs, ) -> AsyncSlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.listChannels """ kwargs.update( @@ -1656,6 +1738,7 @@ async def admin_usergroups_removeChannels( **kwargs, ) -> AsyncSlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels """ kwargs.update({"usergroup_id": usergroup_id}) @@ -1676,6 +1759,7 @@ async def admin_users_assign( **kwargs, ) -> AsyncSlackResponse: """Add an Enterprise user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.assign """ kwargs.update( @@ -1708,6 +1792,7 @@ async def admin_users_invite( **kwargs, ) -> AsyncSlackResponse: """Invite a user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.invite """ kwargs.update( @@ -1739,7 +1824,8 @@ async def admin_users_list( limit: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """List users on a workspace + """List users on a workspace. + https://docs.slack.dev/reference/methods/admin.users.list """ kwargs.update( @@ -1761,6 +1847,7 @@ async def admin_users_remove( **kwargs, ) -> AsyncSlackResponse: """Remove a user from a workspace. + https://docs.slack.dev/reference/methods/admin.users.remove """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1774,6 +1861,7 @@ async def admin_users_setAdmin( **kwargs, ) -> AsyncSlackResponse: """Set an existing guest, regular user, or owner to be an admin user. + https://docs.slack.dev/reference/methods/admin.users.setAdmin """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1788,6 +1876,7 @@ async def admin_users_setExpiration( **kwargs, ) -> AsyncSlackResponse: """Set an expiration for a guest user. + https://docs.slack.dev/reference/methods/admin.users.setExpiration """ kwargs.update({"expiration_ts": expiration_ts, "team_id": team_id, "user_id": user_id}) @@ -1801,6 +1890,7 @@ async def admin_users_setOwner( **kwargs, ) -> AsyncSlackResponse: """Set an existing guest, regular user, or admin user to be a workspace owner. + https://docs.slack.dev/reference/methods/admin.users.setOwner """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1814,6 +1904,7 @@ async def admin_users_setRegular( **kwargs, ) -> AsyncSlackResponse: """Set an existing guest user, admin user, or owner to be a regular user. + https://docs.slack.dev/reference/methods/admin.users.setRegular """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1834,7 +1925,8 @@ async def admin_workflows_search( source: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Search workflows within the team or enterprise + """Search workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.search """ if collaborator_ids is not None: @@ -1864,7 +1956,8 @@ async def admin_workflows_permissions_lookup( max_workflow_triggers: Optional[int] = None, **kwargs, ) -> AsyncSlackResponse: - """Look up the permissions for a set of workflows + """Look up the permissions for a set of workflows. + https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup """ if isinstance(workflow_ids, (list, tuple)): @@ -1885,7 +1978,8 @@ async def admin_workflows_collaborators_add( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Add collaborators to workflows within the team or enterprise + """Add collaborators to workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add """ if isinstance(collaborator_ids, (list, tuple)): @@ -1905,7 +1999,8 @@ async def admin_workflows_collaborators_remove( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Remove collaborators from workflows within the team or enterprise + """Remove collaborators from workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove """ if isinstance(collaborator_ids, (list, tuple)): @@ -1924,7 +2019,8 @@ async def admin_workflows_unpublish( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> AsyncSlackResponse: - """Unpublish workflows within the team or enterprise + """Unpublish workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.unpublish """ if isinstance(workflow_ids, (list, tuple)): @@ -1942,6 +2038,7 @@ async def agents_sessions_rename( **kwargs, ) -> AsyncSlackResponse: """Rename an agent session. + https://docs.slack.dev/reference/methods/agents.sessions.rename """ kwargs.update( @@ -1968,6 +2065,7 @@ async def agents_sessions_setStatus( **kwargs, ) -> AsyncSlackResponse: """Set an agent session's lifecycle status, creating the session if needed. + https://docs.slack.dev/reference/methods/agents.sessions.setStatus """ kwargs.update( @@ -1992,6 +2090,7 @@ async def api_test( **kwargs, ) -> AsyncSlackResponse: """Checks API calling code. + https://docs.slack.dev/reference/methods/api.test """ kwargs.update({"error": error}) @@ -2003,8 +2102,9 @@ async def apps_connections_open( app_token: str, **kwargs, ) -> AsyncSlackResponse: - """Generate a temporary Socket Mode WebSocket URL that your app can connect to - in order to receive events and interactive payloads + """Generate a temporary Socket Mode WebSocket URL for your app. + + Your app connects to this URL to receive events and interactive payloads. https://docs.slack.dev/reference/methods/apps.connections.open """ kwargs.update({"token": app_token}) @@ -2019,6 +2119,7 @@ async def apps_event_authorizations_list( **kwargs, ) -> AsyncSlackResponse: """Get a list of authorizations for the given event context. + Each authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list """ @@ -2033,6 +2134,7 @@ async def apps_uninstall( **kwargs, ) -> AsyncSlackResponse: """Uninstalls your app from a workspace. + https://docs.slack.dev/reference/methods/apps.uninstall """ kwargs.update({"client_id": client_id, "client_secret": client_secret}) @@ -2044,7 +2146,8 @@ async def apps_manifest_create( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> AsyncSlackResponse: - """Create an app from an app manifest + """Create an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.create """ if isinstance(manifest, str): @@ -2059,7 +2162,8 @@ async def apps_manifest_delete( app_id: str, **kwargs, ) -> AsyncSlackResponse: - """Permanently deletes an app created through app manifests + """Permanently deletes an app created through app manifests. + https://docs.slack.dev/reference/methods/apps.manifest.delete """ kwargs.update({"app_id": app_id}) @@ -2071,7 +2175,8 @@ async def apps_manifest_export( app_id: str, **kwargs, ) -> AsyncSlackResponse: - """Export an app manifest from an existing app + """Export an app manifest from an existing app. + https://docs.slack.dev/reference/methods/apps.manifest.export """ kwargs.update({"app_id": app_id}) @@ -2084,7 +2189,8 @@ async def apps_manifest_update( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> AsyncSlackResponse: - """Update an app from an app manifest + """Update an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.update """ if isinstance(manifest, str): @@ -2101,7 +2207,8 @@ async def apps_manifest_validate( app_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Validate an app manifest + """Validate an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.validate """ if isinstance(manifest, str): @@ -2119,6 +2226,7 @@ async def apps_user_connection_update( **kwargs, ) -> AsyncSlackResponse: """Updates the connection status between a user and an app. + https://docs.slack.dev/reference/methods/apps.user.connection.update """ kwargs.update({"user_id": user_id, "status": status}) @@ -2130,7 +2238,8 @@ async def tooling_tokens_rotate( refresh_token: str, **kwargs, ) -> AsyncSlackResponse: - """Exchanges a refresh token for a new app configuration token + """Exchanges a refresh token for a new app configuration token. + https://docs.slack.dev/reference/methods/tooling.tokens.rotate """ kwargs.update({"refresh_token": refresh_token}) @@ -2149,6 +2258,7 @@ async def assistant_threads_setStatus( **kwargs, ) -> AsyncSlackResponse: """Set the status for an AI assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setStatus """ kwargs.update( @@ -2174,6 +2284,7 @@ async def assistant_threads_setTitle( **kwargs, ) -> AsyncSlackResponse: """Set the title for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setTitle """ kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "title": title}) @@ -2189,6 +2300,7 @@ async def assistant_threads_setSuggestedPrompts( **kwargs, ) -> AsyncSlackResponse: """Set suggested prompts for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ kwargs.update({"channel_id": channel_id, "prompts": prompts}) @@ -2205,6 +2317,7 @@ async def auth_revoke( **kwargs, ) -> AsyncSlackResponse: """Revokes a token. + https://docs.slack.dev/reference/methods/auth.revoke """ kwargs.update({"test": test}) @@ -2215,6 +2328,7 @@ async def auth_test( **kwargs, ) -> AsyncSlackResponse: """Checks authentication & identity. + https://docs.slack.dev/reference/methods/auth.test """ return await self.api_call("auth.test", params=kwargs) @@ -2227,6 +2341,7 @@ async def auth_teams_list( **kwargs, ) -> AsyncSlackResponse: """List the workspaces a token can access. + https://docs.slack.dev/reference/methods/auth.teams.list """ kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon}) @@ -2241,6 +2356,7 @@ async def blocks_validate( **kwargs, ) -> AsyncSlackResponse: """Validates an array of blocks, or a message or view payload. + Provide exactly one of ``blocks``, ``message``, or ``view``. https://docs.slack.dev/reference/methods/blocks.validate """ @@ -2271,6 +2387,7 @@ async def bookmarks_add( **kwargs, ) -> AsyncSlackResponse: """Add bookmark to a channel. + https://docs.slack.dev/reference/methods/bookmarks.add """ kwargs.update( @@ -2297,6 +2414,7 @@ async def bookmarks_edit( **kwargs, ) -> AsyncSlackResponse: """Edit bookmark. + https://docs.slack.dev/reference/methods/bookmarks.edit """ kwargs.update( @@ -2317,6 +2435,7 @@ async def bookmarks_list( **kwargs, ) -> AsyncSlackResponse: """List bookmark for the channel. + https://docs.slack.dev/reference/methods/bookmarks.list """ kwargs.update({"channel_id": channel_id}) @@ -2330,6 +2449,7 @@ async def bookmarks_remove( **kwargs, ) -> AsyncSlackResponse: """Remove bookmark from the channel. + https://docs.slack.dev/reference/methods/bookmarks.remove """ kwargs.update({"bookmark_id": bookmark_id, "channel_id": channel_id}) @@ -2343,6 +2463,7 @@ async def bots_info( **kwargs, ) -> AsyncSlackResponse: """Gets information about a bot user. + https://docs.slack.dev/reference/methods/bots.info """ kwargs.update({"bot": bot, "team_id": team_id}) @@ -2362,6 +2483,7 @@ async def calls_add( **kwargs, ) -> AsyncSlackResponse: """Registers a new Call. + https://docs.slack.dev/reference/methods/calls.add """ kwargs.update( @@ -2389,6 +2511,7 @@ async def calls_end( **kwargs, ) -> AsyncSlackResponse: """Ends a Call. + https://docs.slack.dev/reference/methods/calls.end """ kwargs.update({"id": id, "duration": duration}) @@ -2401,6 +2524,7 @@ async def calls_info( **kwargs, ) -> AsyncSlackResponse: """Returns information about a Call. + https://docs.slack.dev/reference/methods/calls.info """ kwargs.update({"id": id}) @@ -2414,6 +2538,7 @@ async def calls_participants_add( **kwargs, ) -> AsyncSlackResponse: """Registers new participants added to a Call. + https://docs.slack.dev/reference/methods/calls.participants.add """ kwargs.update({"id": id}) @@ -2428,6 +2553,7 @@ async def calls_participants_remove( **kwargs, ) -> AsyncSlackResponse: """Registers participants removed from a Call. + https://docs.slack.dev/reference/methods/calls.participants.remove """ kwargs.update({"id": id}) @@ -2444,6 +2570,7 @@ async def calls_update( **kwargs, ) -> AsyncSlackResponse: """Updates information about a Call. + https://docs.slack.dev/reference/methods/calls.update """ kwargs.update( @@ -2463,7 +2590,8 @@ async def canvases_create( document_content: Dict[str, str], **kwargs, ) -> AsyncSlackResponse: - """Create Canvas for a user + """Create Canvas for a user. + https://docs.slack.dev/reference/methods/canvases.create """ kwargs.update({"title": title, "document_content": document_content}) @@ -2476,7 +2604,8 @@ async def canvases_edit( changes: Sequence[Dict[str, Any]], **kwargs, ) -> AsyncSlackResponse: - """Update an existing canvas + """Update an existing canvas. + https://docs.slack.dev/reference/methods/canvases.edit """ kwargs.update({"canvas_id": canvas_id, "changes": changes}) @@ -2488,7 +2617,8 @@ async def canvases_delete( canvas_id: str, **kwargs, ) -> AsyncSlackResponse: - """Deletes a canvas + """Deletes a canvas. + https://docs.slack.dev/reference/methods/canvases.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2503,7 +2633,8 @@ async def canvases_access_set( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> AsyncSlackResponse: - """Sets the access level to a canvas for specified entities + """Sets the access level to a canvas for specified entities. + https://docs.slack.dev/reference/methods/canvases.access.set """ kwargs.update({"canvas_id": canvas_id, "access_level": access_level}) @@ -2528,7 +2659,8 @@ async def canvases_access_delete( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> AsyncSlackResponse: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/canvases.access.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2551,7 +2683,8 @@ async def canvases_sections_lookup( criteria: Dict[str, Any], **kwargs, ) -> AsyncSlackResponse: - """Find sections matching the provided criteria + """Find sections matching the provided criteria. + https://docs.slack.dev/reference/methods/canvases.sections.lookup """ kwargs.update({"canvas_id": canvas_id, "criteria": json.dumps(criteria)}) @@ -2689,7 +2822,7 @@ async def channels_replies( thread_ts: str, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a thread of messages posted to a channel""" + """Retrieve a thread of messages posted to a channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return await self.api_call("channels.replies", http_verb="GET", params=kwargs) @@ -2740,6 +2873,7 @@ async def chat_appendStream( **kwargs, ) -> AsyncSlackResponse: """Appends text to an existing streaming conversation. + https://docs.slack.dev/reference/methods/chat.appendStream """ kwargs.update( @@ -2763,6 +2897,7 @@ async def chat_delete( **kwargs, ) -> AsyncSlackResponse: """Deletes a message. + https://docs.slack.dev/reference/methods/chat.delete """ kwargs.update({"channel": channel, "ts": ts, "as_user": as_user}) @@ -2777,6 +2912,7 @@ async def chat_deleteScheduledMessage( **kwargs, ) -> AsyncSlackResponse: """Deletes a scheduled message. + https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage """ kwargs.update( @@ -2795,7 +2931,8 @@ async def chat_getPermalink( message_ts: str, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a permalink URL for a specific extant message + """Retrieve a permalink URL for a specific extant message. + https://docs.slack.dev/reference/methods/chat.getPermalink """ kwargs.update({"channel": channel, "message_ts": message_ts}) @@ -2809,6 +2946,7 @@ async def chat_meMessage( **kwargs, ) -> AsyncSlackResponse: """Share a me message into a channel. + https://docs.slack.dev/reference/methods/chat.meMessage """ kwargs.update({"channel": channel, "text": text}) @@ -2833,6 +2971,7 @@ async def chat_postEphemeral( **kwargs, ) -> AsyncSlackResponse: """Sends an ephemeral message to a user in a channel. + https://docs.slack.dev/reference/methods/chat.postEphemeral """ kwargs.update( @@ -2882,6 +3021,7 @@ async def chat_postMessage( **kwargs, ) -> AsyncSlackResponse: """Sends a message to a channel. + https://docs.slack.dev/reference/methods/chat.postMessage """ kwargs.update( @@ -2932,6 +3072,7 @@ async def chat_scheduleMessage( **kwargs, ) -> AsyncSlackResponse: """Schedules a message. + https://docs.slack.dev/reference/methods/chat.scheduleMessage """ kwargs.update( @@ -2970,6 +3111,7 @@ async def chat_scheduledMessages_list( **kwargs, ) -> AsyncSlackResponse: """Lists all scheduled messages. + https://docs.slack.dev/reference/methods/chat.scheduledMessages.list """ kwargs.update( @@ -3000,6 +3142,7 @@ async def chat_startStream( **kwargs, ) -> AsyncSlackResponse: """Starts a new streaming conversation. + https://docs.slack.dev/reference/methods/chat.startStream """ kwargs.update( @@ -3033,6 +3176,7 @@ async def chat_stopStream( **kwargs, ) -> AsyncSlackResponse: """Stops a streaming conversation. + https://docs.slack.dev/reference/methods/chat.stopStream """ kwargs.update( @@ -3142,6 +3286,7 @@ async def chat_unfurl( **kwargs, ) -> AsyncSlackResponse: """Provide custom unfurl behavior for user-posted URLs. + https://docs.slack.dev/reference/methods/chat.unfurl """ kwargs.update( @@ -3181,6 +3326,7 @@ async def chat_update( **kwargs, ) -> AsyncSlackResponse: """Updates a message in a channel. + https://docs.slack.dev/reference/methods/chat.update """ kwargs.update( @@ -3220,6 +3366,7 @@ async def conversations_acceptSharedInvite( **kwargs, ) -> AsyncSlackResponse: """Accepts an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite """ if channel_id is None and invite_id is None: @@ -3244,6 +3391,7 @@ async def conversations_approveSharedInvite( **kwargs, ) -> AsyncSlackResponse: """Approves an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.approveSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3256,6 +3404,7 @@ async def conversations_archive( **kwargs, ) -> AsyncSlackResponse: """Archives a conversation. + https://docs.slack.dev/reference/methods/conversations.archive """ kwargs.update({"channel": channel}) @@ -3268,6 +3417,7 @@ async def conversations_close( **kwargs, ) -> AsyncSlackResponse: """Closes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.close """ kwargs.update({"channel": channel}) @@ -3281,7 +3431,8 @@ async def conversations_create( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Initiates a public or private channel-based conversation + """Initiates a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/conversations.create """ kwargs.update({"name": name, "is_private": is_private, "team_id": team_id}) @@ -3295,6 +3446,7 @@ async def conversations_declineSharedInvite( **kwargs, ) -> AsyncSlackResponse: """Declines a Slack Connect channel invite. + https://docs.slack.dev/reference/methods/conversations.declineSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3304,6 +3456,7 @@ async def conversations_externalInvitePermissions_set( self, *, action: str, channel: str, target_team: str, **kwargs ) -> AsyncSlackResponse: """Sets a team in a shared External Limited channel to a shared Slack Connect channel or vice versa. + https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set """ kwargs.update( @@ -3328,6 +3481,7 @@ async def conversations_history( **kwargs, ) -> AsyncSlackResponse: """Fetches a conversation's history of messages and events. + https://docs.slack.dev/reference/methods/conversations.history """ kwargs.update( @@ -3352,6 +3506,7 @@ async def conversations_info( **kwargs, ) -> AsyncSlackResponse: """Retrieve information about a conversation. + https://docs.slack.dev/reference/methods/conversations.info """ kwargs.update( @@ -3372,6 +3527,7 @@ async def conversations_invite( **kwargs, ) -> AsyncSlackResponse: """Invites users to a channel. + https://docs.slack.dev/reference/methods/conversations.invite """ kwargs.update( @@ -3395,6 +3551,7 @@ async def conversations_inviteShared( **kwargs, ) -> AsyncSlackResponse: """Sends an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.inviteShared """ if emails is None and user_ids is None: @@ -3417,6 +3574,7 @@ async def conversations_join( **kwargs, ) -> AsyncSlackResponse: """Joins an existing conversation. + https://docs.slack.dev/reference/methods/conversations.join """ kwargs.update({"channel": channel}) @@ -3430,6 +3588,7 @@ async def conversations_kick( **kwargs, ) -> AsyncSlackResponse: """Removes a user from a conversation. + https://docs.slack.dev/reference/methods/conversations.kick """ kwargs.update({"channel": channel, "user": user}) @@ -3442,6 +3601,7 @@ async def conversations_leave( **kwargs, ) -> AsyncSlackResponse: """Leaves a conversation. + https://docs.slack.dev/reference/methods/conversations.leave """ kwargs.update({"channel": channel}) @@ -3458,6 +3618,7 @@ async def conversations_list( **kwargs, ) -> AsyncSlackResponse: """Lists all channels in a Slack team. + https://docs.slack.dev/reference/methods/conversations.list """ kwargs.update( @@ -3482,8 +3643,8 @@ async def conversations_listConnectInvites( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """List shared channel invites that have been generated - or received but have not yet been approved by all parties. + """List shared channel invites that have been generated or received but have not yet been approved by all parties. + https://docs.slack.dev/reference/methods/conversations.listConnectInvites """ kwargs.update({"count": count, "cursor": cursor, "team_id": team_id}) @@ -3497,6 +3658,7 @@ async def conversations_mark( **kwargs, ) -> AsyncSlackResponse: """Sets the read cursor in a channel. + https://docs.slack.dev/reference/methods/conversations.mark """ kwargs.update({"channel": channel, "ts": ts}) @@ -3511,6 +3673,7 @@ async def conversations_members( **kwargs, ) -> AsyncSlackResponse: """Retrieve members of a conversation. + https://docs.slack.dev/reference/methods/conversations.members """ kwargs.update({"channel": channel, "cursor": cursor, "limit": limit}) @@ -3525,6 +3688,7 @@ async def conversations_open( **kwargs, ) -> AsyncSlackResponse: """Opens or resumes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.open """ if channel is None and users is None: @@ -3544,6 +3708,7 @@ async def conversations_rename( **kwargs, ) -> AsyncSlackResponse: """Renames a conversation. + https://docs.slack.dev/reference/methods/conversations.rename """ kwargs.update({"channel": channel, "name": name}) @@ -3562,7 +3727,8 @@ async def conversations_replies( oldest: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a thread of messages posted to a conversation + """Retrieve a thread of messages posted to a conversation. + https://docs.slack.dev/reference/methods/conversations.replies """ kwargs.update( @@ -3589,6 +3755,7 @@ async def conversations_requestSharedInvite_approve( **kwargs, ) -> AsyncSlackResponse: """Approve a request to add an external user to a channel. This also sends them a Slack Connect invite. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve """ kwargs.update( @@ -3610,6 +3777,7 @@ async def conversations_requestSharedInvite_deny( **kwargs, ) -> AsyncSlackResponse: """Deny a request to invite an external user to a channel. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny """ kwargs.update({"invite_id": invite_id, "message": message}) @@ -3628,6 +3796,7 @@ async def conversations_requestSharedInvite_list( **kwargs, ) -> AsyncSlackResponse: """Lists requests to add external users to channels with ability to filter. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list """ kwargs.update( @@ -3655,6 +3824,7 @@ async def conversations_setPurpose( **kwargs, ) -> AsyncSlackResponse: """Sets the purpose for a conversation. + https://docs.slack.dev/reference/methods/conversations.setPurpose """ kwargs.update({"channel": channel, "purpose": purpose}) @@ -3668,6 +3838,7 @@ async def conversations_setTopic( **kwargs, ) -> AsyncSlackResponse: """Sets the topic for a conversation. + https://docs.slack.dev/reference/methods/conversations.setTopic """ kwargs.update({"channel": channel, "topic": topic}) @@ -3680,6 +3851,7 @@ async def conversations_unarchive( **kwargs, ) -> AsyncSlackResponse: """Reverses conversation archival. + https://docs.slack.dev/reference/methods/conversations.unarchive """ kwargs.update({"channel": channel}) @@ -3692,7 +3864,8 @@ async def conversations_canvases_create( document_content: Dict[str, str], **kwargs, ) -> AsyncSlackResponse: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/conversations.canvases.create """ kwargs.update({"channel_id": channel_id, "document_content": document_content}) @@ -3706,6 +3879,7 @@ async def dialog_open( **kwargs, ) -> AsyncSlackResponse: """Open a dialog with a user. + https://docs.slack.dev/reference/methods/dialog.open """ kwargs.update({"dialog": dialog, "trigger_id": trigger_id}) @@ -3718,6 +3892,7 @@ async def dnd_endDnd( **kwargs, ) -> AsyncSlackResponse: """Ends the current user's Do Not Disturb session immediately. + https://docs.slack.dev/reference/methods/dnd.endDnd """ return await self.api_call("dnd.endDnd", params=kwargs) @@ -3727,6 +3902,7 @@ async def dnd_endSnooze( **kwargs, ) -> AsyncSlackResponse: """Ends the current user's snooze mode immediately. + https://docs.slack.dev/reference/methods/dnd.endSnooze """ return await self.api_call("dnd.endSnooze", params=kwargs) @@ -3739,6 +3915,7 @@ async def dnd_info( **kwargs, ) -> AsyncSlackResponse: """Retrieves a user's current Do Not Disturb status. + https://docs.slack.dev/reference/methods/dnd.info """ kwargs.update({"team_id": team_id, "user": user}) @@ -3751,6 +3928,7 @@ async def dnd_setSnooze( **kwargs, ) -> AsyncSlackResponse: """Turns on Do Not Disturb mode for the current user, or changes its duration. + https://docs.slack.dev/reference/methods/dnd.setSnooze """ kwargs.update({"num_minutes": num_minutes}) @@ -3763,6 +3941,7 @@ async def dnd_teamInfo( **kwargs, ) -> AsyncSlackResponse: """Retrieves the Do Not Disturb status for users on a team. + https://docs.slack.dev/reference/methods/dnd.teamInfo """ if isinstance(users, (list, tuple)): @@ -3778,6 +3957,7 @@ async def emoji_list( **kwargs, ) -> AsyncSlackResponse: """Lists custom emoji for a team. + https://docs.slack.dev/reference/methods/emoji.list """ kwargs.update({"include_categories": include_categories}) @@ -3793,6 +3973,7 @@ async def entity_presentDetails( **kwargs, ) -> AsyncSlackResponse: """Provides entity details for the flexpane. + https://docs.slack.dev/reference/methods/entity.presentDetails/ """ kwargs.update({"trigger_id": trigger_id}) @@ -3815,6 +3996,7 @@ async def files_comments_delete( **kwargs, ) -> AsyncSlackResponse: """Deletes an existing comment on a file. + https://docs.slack.dev/reference/methods/files.comments.delete """ kwargs.update({"file": file, "id": id}) @@ -3827,6 +4009,7 @@ async def files_delete( **kwargs, ) -> AsyncSlackResponse: """Deletes a file. + https://docs.slack.dev/reference/methods/files.delete """ kwargs.update({"file": file}) @@ -3843,6 +4026,7 @@ async def files_info( **kwargs, ) -> AsyncSlackResponse: """Gets information about a team file. + https://docs.slack.dev/reference/methods/files.info """ kwargs.update( @@ -3871,6 +4055,7 @@ async def files_list( **kwargs, ) -> AsyncSlackResponse: """Lists & filters team files. + https://docs.slack.dev/reference/methods/files.list """ kwargs.update( @@ -3899,6 +4084,7 @@ async def files_remote_info( **kwargs, ) -> AsyncSlackResponse: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.info """ kwargs.update({"external_id": external_id, "file": file}) @@ -3915,6 +4101,7 @@ async def files_remote_list( **kwargs, ) -> AsyncSlackResponse: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.list """ kwargs.update( @@ -3940,6 +4127,7 @@ async def files_remote_add( **kwargs, ) -> AsyncSlackResponse: """Adds a file from a remote service. + https://docs.slack.dev/reference/methods/files.remote.add """ kwargs.update( @@ -3979,6 +4167,7 @@ async def files_remote_update( **kwargs, ) -> AsyncSlackResponse: """Updates an existing remote file. + https://docs.slack.dev/reference/methods/files.remote.update """ kwargs.update( @@ -4014,6 +4203,7 @@ async def files_remote_remove( **kwargs, ) -> AsyncSlackResponse: """Remove a remote file. + https://docs.slack.dev/reference/methods/files.remote.remove """ kwargs.update({"external_id": external_id, "file": file}) @@ -4028,6 +4218,7 @@ async def files_remote_share( **kwargs, ) -> AsyncSlackResponse: """Share a remote file into a channel. + https://docs.slack.dev/reference/methods/files.remote.share """ if external_id is None and file is None: @@ -4045,7 +4236,8 @@ async def files_revokePublicURL( file: str, **kwargs, ) -> AsyncSlackResponse: - """Revokes public/external sharing access for a file + """Revokes public/external sharing access for a file. + https://docs.slack.dev/reference/methods/files.revokePublicURL """ kwargs.update({"file": file}) @@ -4058,6 +4250,7 @@ async def files_sharedPublicURL( **kwargs, ) -> AsyncSlackResponse: """Enables a file for public/external sharing. + https://docs.slack.dev/reference/methods/files.sharedPublicURL """ kwargs.update({"file": file}) @@ -4077,6 +4270,7 @@ async def files_upload( **kwargs, ) -> AsyncSlackResponse: """Uploads or creates a file. + https://docs.slack.dev/reference/methods/files.upload """ _print_files_upload_v2_suggestion() @@ -4129,7 +4323,7 @@ async def files_upload_v2( request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> AsyncSlackResponse: - """This wrapper method provides an easy way to upload files using the following endpoints: + """Provide an easy way to upload files using the following endpoints. - step1: https://docs.slack.dev/reference/methods/files.getUploadURLExternal @@ -4223,6 +4417,7 @@ async def files_getUploadURLExternal( **kwargs, ) -> AsyncSlackResponse: """Gets a URL for an edge external upload. + https://docs.slack.dev/reference/methods/files.getUploadURLExternal """ kwargs.update( @@ -4246,6 +4441,7 @@ async def files_completeUploadExternal( **kwargs, ) -> AsyncSlackResponse: """Finishes an upload started with files.getUploadURLExternal. + https://docs.slack.dev/reference/methods/files.completeUploadExternal """ _files = [{k: v for k, v in f.items() if v is not None} for f in files] @@ -4268,7 +4464,8 @@ async def functions_completeSuccess( outputs: Dict[str, Any], **kwargs, ) -> AsyncSlackResponse: - """Signal the successful completion of a function + """Signal the successful completion of a function. + https://docs.slack.dev/reference/methods/functions.completeSuccess """ kwargs.update({"function_execution_id": function_execution_id, "outputs": json.dumps(outputs)}) @@ -4281,7 +4478,8 @@ async def functions_completeError( error: str, **kwargs, ) -> AsyncSlackResponse: - """Signal the failure to execute a function + """Signal the failure to execute a function. + https://docs.slack.dev/reference/methods/functions.completeError """ kwargs.update({"function_execution_id": function_execution_id, "error": error}) @@ -4429,7 +4627,7 @@ async def groups_replies( thread_ts: str, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a thread of messages posted to a private channel""" + """Retrieve a thread of messages posted to a private channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return await self.api_call("groups.replies", http_verb="GET", params=kwargs) @@ -4532,7 +4730,7 @@ async def im_replies( thread_ts: str, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a thread of messages posted to a direct message conversation""" + """Retrieve a thread of messages posted to a direct message conversation.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return await self.api_call("im.replies", http_verb="GET", params=kwargs) @@ -4546,7 +4744,8 @@ async def migration_exchange( to_old: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: - """For Enterprise Grid workspaces, map local user IDs to global user IDs + """For Enterprise Grid workspaces, map local user IDs to global user IDs. + https://docs.slack.dev/reference/methods/migration.exchange """ if isinstance(users, (list, tuple)): @@ -4622,9 +4821,7 @@ async def mpim_replies( thread_ts: str, **kwargs, ) -> AsyncSlackResponse: - """Retrieve a thread of messages posted to a direct message conversation from a - multiparty direct message. - """ + """Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return await self.api_call("mpim.replies", http_verb="GET", params=kwargs) @@ -4646,6 +4843,7 @@ async def oauth_v2_access( **kwargs, ) -> AsyncSlackResponse: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.v2.access """ if redirect_uri is not None: @@ -4672,6 +4870,7 @@ async def oauth_access( **kwargs, ) -> AsyncSlackResponse: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.access """ if redirect_uri is not None: @@ -4691,7 +4890,8 @@ async def oauth_v2_exchange( client_secret: str, **kwargs, ) -> AsyncSlackResponse: - """Exchanges a legacy access token for a new expiring access token and refresh token + """Exchanges a legacy access token for a new expiring access token and refresh token. + https://docs.slack.dev/reference/methods/oauth.v2.exchange """ kwargs.update({"client_id": client_id, "client_secret": client_secret, "token": token}) @@ -4708,6 +4908,7 @@ async def openid_connect_token( **kwargs, ) -> AsyncSlackResponse: """Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.token """ if redirect_uri is not None: @@ -4729,6 +4930,7 @@ async def openid_connect_userInfo( **kwargs, ) -> AsyncSlackResponse: """Get the identity of a user who has authorized Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.userInfo """ return await self.api_call("openid.connect.userInfo", params=kwargs) @@ -4741,6 +4943,7 @@ async def pins_add( **kwargs, ) -> AsyncSlackResponse: """Pins an item to a channel. + https://docs.slack.dev/reference/methods/pins.add """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4753,6 +4956,7 @@ async def pins_list( **kwargs, ) -> AsyncSlackResponse: """Lists items pinned to a channel. + https://docs.slack.dev/reference/methods/pins.list """ kwargs.update({"channel": channel}) @@ -4766,6 +4970,7 @@ async def pins_remove( **kwargs, ) -> AsyncSlackResponse: """Un-pins an item from a channel. + https://docs.slack.dev/reference/methods/pins.remove """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4780,6 +4985,7 @@ async def reactions_add( **kwargs, ) -> AsyncSlackResponse: """Adds a reaction to an item. + https://docs.slack.dev/reference/methods/reactions.add """ kwargs.update({"channel": channel, "name": name, "timestamp": timestamp}) @@ -4796,6 +5002,7 @@ async def reactions_get( **kwargs, ) -> AsyncSlackResponse: """Gets reactions for an item. + https://docs.slack.dev/reference/methods/reactions.get """ kwargs.update( @@ -4822,6 +5029,7 @@ async def reactions_list( **kwargs, ) -> AsyncSlackResponse: """Lists reactions made by a user. + https://docs.slack.dev/reference/methods/reactions.list """ kwargs.update( @@ -4848,6 +5056,7 @@ async def reactions_remove( **kwargs, ) -> AsyncSlackResponse: """Removes a reaction from an item. + https://docs.slack.dev/reference/methods/reactions.remove """ kwargs.update( @@ -4872,6 +5081,7 @@ async def reminders_add( **kwargs, ) -> AsyncSlackResponse: """Creates a reminder. + https://docs.slack.dev/reference/methods/reminders.add """ kwargs.update( @@ -4893,6 +5103,7 @@ async def reminders_complete( **kwargs, ) -> AsyncSlackResponse: """Marks a reminder as complete. + https://docs.slack.dev/reference/methods/reminders.complete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4906,6 +5117,7 @@ async def reminders_delete( **kwargs, ) -> AsyncSlackResponse: """Deletes a reminder. + https://docs.slack.dev/reference/methods/reminders.delete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4919,6 +5131,7 @@ async def reminders_info( **kwargs, ) -> AsyncSlackResponse: """Gets information about a reminder. + https://docs.slack.dev/reference/methods/reminders.info """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4931,6 +5144,7 @@ async def reminders_list( **kwargs, ) -> AsyncSlackResponse: """Lists all reminders created by or for a given user. + https://docs.slack.dev/reference/methods/reminders.list """ kwargs.update({"team_id": team_id}) @@ -4944,6 +5158,7 @@ async def rtm_connect( **kwargs, ) -> AsyncSlackResponse: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.connect """ kwargs.update({"batch_presence_aware": batch_presence_aware, "presence_sub": presence_sub}) @@ -4962,6 +5177,7 @@ async def rtm_start( **kwargs, ) -> AsyncSlackResponse: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.start """ kwargs.update( @@ -4990,6 +5206,7 @@ async def search_all( **kwargs, ) -> AsyncSlackResponse: """Searches for messages and files matching a query. + https://docs.slack.dev/reference/methods/search.all """ kwargs.update( @@ -5018,6 +5235,7 @@ async def search_files( **kwargs, ) -> AsyncSlackResponse: """Searches for files matching a query. + https://docs.slack.dev/reference/methods/search.files """ kwargs.update( @@ -5047,6 +5265,7 @@ async def search_messages( **kwargs, ) -> AsyncSlackResponse: """Searches for messages matching a query. + https://docs.slack.dev/reference/methods/search.messages """ kwargs.update( @@ -5072,6 +5291,7 @@ async def slackLists_access_delete( **kwargs, ) -> AsyncSlackResponse: """Revoke access to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.delete """ kwargs.update({"list_id": list_id, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5088,6 +5308,7 @@ async def slackLists_access_set( **kwargs, ) -> AsyncSlackResponse: """Set the access level to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.set """ kwargs.update({"list_id": list_id, "access_level": access_level, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5106,6 +5327,7 @@ async def slackLists_create( **kwargs, ) -> AsyncSlackResponse: """Creates a List. + https://docs.slack.dev/reference/methods/slackLists.create """ kwargs.update( @@ -5129,6 +5351,7 @@ async def slackLists_download_get( **kwargs, ) -> AsyncSlackResponse: """Retrieve List download URL from an export job to download List contents. + https://docs.slack.dev/reference/methods/slackLists.download.get """ kwargs.update( @@ -5148,6 +5371,7 @@ async def slackLists_download_start( **kwargs, ) -> AsyncSlackResponse: """Initiate a job to export List contents. + https://docs.slack.dev/reference/methods/slackLists.download.start """ kwargs.update( @@ -5169,6 +5393,7 @@ async def slackLists_items_create( **kwargs, ) -> AsyncSlackResponse: """Add a new item to an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.create """ kwargs.update( @@ -5190,6 +5415,7 @@ async def slackLists_items_delete( **kwargs, ) -> AsyncSlackResponse: """Deletes an item from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.delete """ kwargs.update( @@ -5209,6 +5435,7 @@ async def slackLists_items_deleteMultiple( **kwargs, ) -> AsyncSlackResponse: """Deletes multiple items from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple """ kwargs.update( @@ -5229,6 +5456,7 @@ async def slackLists_items_info( **kwargs, ) -> AsyncSlackResponse: """Get a row from a List. + https://docs.slack.dev/reference/methods/slackLists.items.info """ kwargs.update( @@ -5251,6 +5479,7 @@ async def slackLists_items_list( **kwargs, ) -> AsyncSlackResponse: """Get records from a List. + https://docs.slack.dev/reference/methods/slackLists.items.list """ kwargs.update( @@ -5272,6 +5501,7 @@ async def slackLists_items_update( **kwargs, ) -> AsyncSlackResponse: """Updates cells in a List. + https://docs.slack.dev/reference/methods/slackLists.items.update """ kwargs.update( @@ -5293,6 +5523,7 @@ async def slackLists_update( **kwargs, ) -> AsyncSlackResponse: """Update a List. + https://docs.slack.dev/reference/methods/slackLists.update """ kwargs.update( @@ -5316,6 +5547,7 @@ async def stars_add( **kwargs, ) -> AsyncSlackResponse: """Adds a star to an item. + https://docs.slack.dev/reference/methods/stars.add """ kwargs.update( @@ -5339,6 +5571,7 @@ async def stars_list( **kwargs, ) -> AsyncSlackResponse: """Lists stars for a user. + https://docs.slack.dev/reference/methods/stars.list """ kwargs.update( @@ -5362,6 +5595,7 @@ async def stars_remove( **kwargs, ) -> AsyncSlackResponse: """Removes a star from an item. + https://docs.slack.dev/reference/methods/stars.remove """ kwargs.update( @@ -5386,6 +5620,7 @@ async def team_accessLogs( **kwargs, ) -> AsyncSlackResponse: """Gets the access logs for the current team. + https://docs.slack.dev/reference/methods/team.accessLogs """ kwargs.update( @@ -5408,6 +5643,7 @@ async def team_billableInfo( **kwargs, ) -> AsyncSlackResponse: """Gets billable users information for the current team. + https://docs.slack.dev/reference/methods/team.billableInfo """ kwargs.update({"team_id": team_id, "user": user}) @@ -5418,6 +5654,7 @@ async def team_billing_info( **kwargs, ) -> AsyncSlackResponse: """Reads a workspace's billing plan information. + https://docs.slack.dev/reference/methods/team.billing.info """ return await self.api_call("team.billing.info", params=kwargs) @@ -5429,6 +5666,7 @@ async def team_externalTeams_disconnect( **kwargs, ) -> AsyncSlackResponse: """Disconnects an external organization. + https://docs.slack.dev/reference/methods/team.externalTeams.disconnect """ kwargs.update( @@ -5451,6 +5689,7 @@ async def team_externalTeams_list( **kwargs, ) -> AsyncSlackResponse: """Returns a list of all the external teams connected and details about the connection. + https://docs.slack.dev/reference/methods/team.externalTeams.list """ kwargs.update( @@ -5482,6 +5721,7 @@ async def team_info( **kwargs, ) -> AsyncSlackResponse: """Gets information about the current team. + https://docs.slack.dev/reference/methods/team.info """ kwargs.update({"team": team, "domain": domain}) @@ -5500,6 +5740,7 @@ async def team_integrationLogs( **kwargs, ) -> AsyncSlackResponse: """Gets the integration logs for the current team. + https://docs.slack.dev/reference/methods/team.integrationLogs """ kwargs.update( @@ -5522,6 +5763,7 @@ async def team_profile_get( **kwargs, ) -> AsyncSlackResponse: """Retrieve a team's profile. + https://docs.slack.dev/reference/methods/team.profile.get """ kwargs.update({"visibility": visibility}) @@ -5532,6 +5774,7 @@ async def team_preferences_list( **kwargs, ) -> AsyncSlackResponse: """Retrieve a list of a workspace's team preferences. + https://docs.slack.dev/reference/methods/team.preferences.list """ return await self.api_call("team.preferences.list", params=kwargs) @@ -5547,7 +5790,8 @@ async def usergroups_create( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Create a User Group + """Create a User Group. + https://docs.slack.dev/reference/methods/usergroups.create """ kwargs.update( @@ -5573,7 +5817,8 @@ async def usergroups_disable( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Disable an existing User Group + """Disable an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.disable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5587,7 +5832,8 @@ async def usergroups_enable( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Enable a User Group + """Enable a User Group. + https://docs.slack.dev/reference/methods/usergroups.enable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5602,7 +5848,8 @@ async def usergroups_list( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """List all User Groups for a team + """List all User Groups for a team. + https://docs.slack.dev/reference/methods/usergroups.list """ kwargs.update( @@ -5627,7 +5874,8 @@ async def usergroups_update( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Update an existing User Group + """Update an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.update """ kwargs.update( @@ -5654,7 +5902,8 @@ async def usergroups_users_list( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """List all users in a User Group + """List all users in a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.list """ kwargs.update( @@ -5675,7 +5924,8 @@ async def usergroups_users_update( team_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: - """Update the list of users for a User Group + """Update the list of users for a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.update """ kwargs.update( @@ -5703,6 +5953,7 @@ async def users_conversations( **kwargs, ) -> AsyncSlackResponse: """List conversations the calling user may access. + https://docs.slack.dev/reference/methods/users.conversations """ kwargs.update( @@ -5724,7 +5975,8 @@ async def users_deletePhoto( self, **kwargs, ) -> AsyncSlackResponse: - """Delete the user profile photo + """Delete the user profile photo. + https://docs.slack.dev/reference/methods/users.deletePhoto """ return await self.api_call("users.deletePhoto", http_verb="GET", params=kwargs) @@ -5736,6 +5988,7 @@ async def users_getPresence( **kwargs, ) -> AsyncSlackResponse: """Gets user presence information. + https://docs.slack.dev/reference/methods/users.getPresence """ kwargs.update({"user": user}) @@ -5746,6 +5999,7 @@ async def users_identity( **kwargs, ) -> AsyncSlackResponse: """Get a user's identity. + https://docs.slack.dev/reference/methods/users.identity """ return await self.api_call("users.identity", http_verb="GET", params=kwargs) @@ -5758,6 +6012,7 @@ async def users_info( **kwargs, ) -> AsyncSlackResponse: """Gets information about a user. + https://docs.slack.dev/reference/methods/users.info """ kwargs.update({"user": user, "include_locale": include_locale}) @@ -5773,6 +6028,7 @@ async def users_list( **kwargs, ) -> AsyncSlackResponse: """Lists all users in a Slack team. + https://docs.slack.dev/reference/methods/users.list """ kwargs.update( @@ -5792,6 +6048,7 @@ async def users_lookupByEmail( **kwargs, ) -> AsyncSlackResponse: """Find a user with an email address. + https://docs.slack.dev/reference/methods/users.lookupByEmail """ kwargs.update({"email": email}) @@ -5806,7 +6063,8 @@ async def users_setPhoto( crop_y: Optional[Union[int, str]] = None, **kwargs, ) -> AsyncSlackResponse: - """Set the user profile photo + """Set the user profile photo. + https://docs.slack.dev/reference/methods/users.setPhoto """ kwargs.update({"crop_w": crop_w, "crop_x": crop_x, "crop_y": crop_y}) @@ -5819,6 +6077,7 @@ async def users_setPresence( **kwargs, ) -> AsyncSlackResponse: """Manually sets user presence. + https://docs.slack.dev/reference/methods/users.setPresence """ kwargs.update({"presence": presence}) @@ -5829,7 +6088,8 @@ async def users_discoverableContacts_lookup( email: str, **kwargs, ) -> AsyncSlackResponse: - """Lookup an email address to see if someone is on Slack + """Lookup an email address to see if someone is on Slack. + https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup """ kwargs.update({"email": email}) @@ -5843,6 +6103,7 @@ async def users_profile_get( **kwargs, ) -> AsyncSlackResponse: """Retrieves a user's profile information. + https://docs.slack.dev/reference/methods/users.profile.get """ kwargs.update({"user": user, "include_labels": include_labels}) @@ -5858,6 +6119,7 @@ async def users_profile_set( **kwargs, ) -> AsyncSlackResponse: """Set the profile information for a user. + https://docs.slack.dev/reference/methods/users.profile.set """ kwargs.update( @@ -5881,6 +6143,7 @@ async def views_open( **kwargs, ) -> AsyncSlackResponse: """Open a view for a user. + https://docs.slack.dev/reference/methods/views.open See https://docs.slack.dev/surfaces/modals/ for details. """ @@ -5902,6 +6165,7 @@ async def views_push( **kwargs, ) -> AsyncSlackResponse: """Push a view onto the stack of a root view. + Push a new view onto the existing view stack by passing a view payload and a valid trigger_id generated from an interaction within the existing modal. @@ -5928,6 +6192,7 @@ async def views_update( **kwargs, ) -> AsyncSlackResponse: """Update an existing view. + Update a view by passing a new view definition along with the view_id returned in views.open or the external_id. See the modals documentation (https://docs.slack.dev/surfaces/modals/#updating_views) @@ -5958,6 +6223,7 @@ async def views_publish( **kwargs, ) -> AsyncSlackResponse: """Publish a static view for a User. + Create or update the view that comprises an app's Home tab (https://docs.slack.dev/surfaces/app-home/) https://docs.slack.dev/reference/methods/views.publish @@ -5979,6 +6245,7 @@ async def workflows_featured_add( **kwargs, ) -> AsyncSlackResponse: """Add featured workflows to a channel. + https://docs.slack.dev/reference/methods/workflows.featured.add """ kwargs.update({"channel_id": channel_id}) @@ -5995,6 +6262,7 @@ async def workflows_featured_list( **kwargs, ) -> AsyncSlackResponse: """List the featured workflows for specified channels. + https://docs.slack.dev/reference/methods/workflows.featured.list """ if isinstance(channel_ids, (list, tuple)): @@ -6011,6 +6279,7 @@ async def workflows_featured_remove( **kwargs, ) -> AsyncSlackResponse: """Remove featured workflows from a channel. + https://docs.slack.dev/reference/methods/workflows.featured.remove """ kwargs.update({"channel_id": channel_id}) @@ -6028,6 +6297,7 @@ async def workflows_featured_set( **kwargs, ) -> AsyncSlackResponse: """Set featured workflows for a channel. + https://docs.slack.dev/reference/methods/workflows.featured.set """ kwargs.update({"channel_id": channel_id}) @@ -6045,6 +6315,7 @@ async def workflows_stepCompleted( **kwargs, ) -> AsyncSlackResponse: """Indicate a successful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepCompleted """ kwargs.update({"workflow_step_execute_id": workflow_step_execute_id}) @@ -6062,6 +6333,7 @@ async def workflows_stepFailed( **kwargs, ) -> AsyncSlackResponse: """Indicate an unsuccessful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepFailed """ kwargs.update( @@ -6083,6 +6355,7 @@ async def workflows_updateStep( **kwargs, ) -> AsyncSlackResponse: """Update the configuration for a workflow extension step. + https://docs.slack.dev/reference/methods/workflows.updateStep """ kwargs.update({"workflow_step_edit_id": workflow_step_edit_id}) diff --git a/slack_sdk/web/async_internal_utils.py b/slack_sdk/web/async_internal_utils.py index d41b34938..ac3f6d1eb 100644 --- a/slack_sdk/web/async_internal_utils.py +++ b/slack_sdk/web/async_internal_utils.py @@ -53,6 +53,7 @@ async def _request_with_session( retry_handlers: Optional[List[AsyncRetryHandler]] = None, ) -> Dict[str, Any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ diff --git a/slack_sdk/web/async_slack_response.py b/slack_sdk/web/async_slack_response.py index 0815599db..f6cc08fa3 100644 --- a/slack_sdk/web/async_slack_response.py +++ b/slack_sdk/web/async_slack_response.py @@ -27,17 +27,17 @@ class AsyncSlackResponse: import os import slack - client = slack.AsyncWebClient(token=os.environ['SLACK_API_TOKEN']) + client = slack.AsyncWebClient(token=os.environ["SLACK_API_TOKEN"]) - response1 = await client.auth_revoke(test='true') - assert not response1['revoked'] + response1 = await client.auth_revoke(test="true") + assert not response1["revoked"] response2 = await client.auth_test() - assert response2.get('ok', False) + assert response2.get("ok", False) users = [] async for page in await client.users_list(limit=2): - users = users + page['members'] + users = users + page["members"] ``` Note: @@ -103,6 +103,7 @@ def __getitem__(self, key): def __aiter__(self): """Enables the ability to iterate over the response. + It's required async-for the iterator protocol. Note: diff --git a/slack_sdk/web/base_client.py b/slack_sdk/web/base_client.py index 1f5ad58c7..67aba957c 100644 --- a/slack_sdk/web/base_client.py +++ b/slack_sdk/web/base_client.py @@ -147,7 +147,6 @@ def api_call( SlackRequestError: Json data can only be submitted as POST requests. """ - api_url = _get_url(self.base_url, api_method) headers = headers or {} headers.update(self.headers) @@ -208,7 +207,7 @@ def _sync_send(self, api_url, req_args) -> SlackResponse: ) def _request_for_pagination(self, api_url: str, req_args: Dict[str, Dict[str, Any]]) -> Dict[str, Any]: - """This method is supposed to be used only for SlackResponse pagination + """This method is supposed to be used only for SlackResponse pagination. You can paginate using Python's for iterator as below: @@ -588,7 +587,7 @@ def _upload_file( proxy: Optional[str], ssl: Optional[SSLContext], ) -> FileUploadV2Result: - """Upload a file using the issued upload URL""" + """Upload a file using the issued upload URL.""" result = _upload_file_via_v2_url( url=url, data=data, @@ -606,9 +605,9 @@ def _upload_file( @staticmethod def validate_slack_signature(*, signing_secret: str, data: str, timestamp: str, signature: str) -> bool: - """ - Slack creates a unique string for your app and shares it with you. Verify - requests from Slack with confidence by verifying signatures using your + """Slack creates a unique string for your app and shares it with you. + + Verify requests from Slack with confidence by verifying signatures using your signing secret. On each HTTP request that Slack sends, we add an X-Slack-Signature HTTP diff --git a/slack_sdk/web/client.py b/slack_sdk/web/client.py index 8adf2e589..743dd7842 100644 --- a/slack_sdk/web/client.py +++ b/slack_sdk/web/client.py @@ -99,7 +99,8 @@ def admin_analytics_getFile( metadata_only: Optional[bool] = None, **kwargs, ) -> SlackResponse: - """Retrieve analytics data for a given date, presented as a compressed JSON file + """Retrieve analytics data for a given date, presented as a compressed JSON file. + https://docs.slack.dev/reference/methods/admin.analytics.getFile """ kwargs.update({"type": type}) @@ -119,6 +120,7 @@ def admin_apps_approve( **kwargs, ) -> SlackResponse: """Approve an app for installation on a workspace. + Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -149,6 +151,7 @@ def admin_apps_approved_list( **kwargs, ) -> SlackResponse: """List approved apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.approved.list """ kwargs.update( @@ -169,7 +172,8 @@ def admin_apps_clearResolution( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Clear an app resolution + """Clear an app resolution. + https://docs.slack.dev/reference/methods/admin.apps.clearResolution """ kwargs.update( @@ -190,6 +194,7 @@ def admin_apps_requests_cancel( **kwargs, ) -> SlackResponse: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.cancel """ kwargs.update( @@ -210,6 +215,7 @@ def admin_apps_requests_list( **kwargs, ) -> SlackResponse: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.list """ kwargs.update( @@ -231,6 +237,7 @@ def admin_apps_restrict( **kwargs, ) -> SlackResponse: """Restrict an app for installation on a workspace. + Exactly one of the team_id or enterprise_id arguments is required, not both. Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -261,6 +268,7 @@ def admin_apps_restricted_list( **kwargs, ) -> SlackResponse: """List restricted apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.restricted.list """ kwargs.update( @@ -282,6 +290,7 @@ def admin_apps_uninstall( **kwargs, ) -> SlackResponse: """Uninstall an app from one or many workspaces, or an entire enterprise organization. + With an org-level token, enterprise_id or team_ids is required. https://docs.slack.dev/reference/methods/admin.apps.uninstall """ @@ -313,7 +322,8 @@ def admin_apps_activities_list( limit: Optional[int] = None, **kwargs, ) -> SlackResponse: - """Get logs for a specified team/org + """Get logs for a specified team/org. + https://docs.slack.dev/reference/methods/admin.apps.activities.list """ kwargs.update( @@ -341,7 +351,8 @@ def admin_apps_config_lookup( app_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Look up the app config for connectors by their IDs + """Look up the app config for connectors by their IDs. + https://docs.slack.dev/reference/methods/admin.apps.config.lookup """ if isinstance(app_ids, (list, tuple)): @@ -358,7 +369,8 @@ def admin_apps_config_set( workflow_auth_strategy: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Set the app config for a connector + """Set the app config for a connector. + https://docs.slack.dev/reference/methods/admin.apps.config.set """ kwargs.update( @@ -381,6 +393,7 @@ def admin_auth_policy_getEntities( **kwargs, ) -> SlackResponse: """Fetch all the entities assigned to a particular authentication policy by name. + https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities """ kwargs.update({"policy_name": policy_name}) @@ -401,6 +414,7 @@ def admin_auth_policy_assignEntities( **kwargs, ) -> SlackResponse: """Assign entities to a particular authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities """ if isinstance(entity_ids, (list, tuple)): @@ -420,6 +434,7 @@ def admin_auth_policy_removeEntities( **kwargs, ) -> SlackResponse: """Remove specified entities from a specified authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities """ if isinstance(entity_ids, (list, tuple)): @@ -439,6 +454,7 @@ def admin_conversations_createForObjects( **kwargs, ) -> SlackResponse: """Create a Salesforce channel for the corresponding object provided. + https://docs.slack.dev/reference/methods/admin.conversations.createForObjects """ kwargs.update( @@ -455,6 +471,7 @@ def admin_conversations_linkObjects( **kwargs, ) -> SlackResponse: """Link a Salesforce record to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.linkObjects """ kwargs.update( @@ -474,6 +491,7 @@ def admin_conversations_unlinkObjects( **kwargs, ) -> SlackResponse: """Unlink a Salesforce record from a channel. + https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects """ kwargs.update( @@ -492,7 +510,8 @@ def admin_barriers_create( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Create an Information Barrier + """Create an Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.create """ kwargs.update({"primary_usergroup_id": primary_usergroup_id}) @@ -512,7 +531,8 @@ def admin_barriers_delete( barrier_id: str, **kwargs, ) -> SlackResponse: - """Delete an existing Information Barrier + """Delete an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.delete """ kwargs.update({"barrier_id": barrier_id}) @@ -527,7 +547,8 @@ def admin_barriers_update( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Update an existing Information Barrier + """Update an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.update """ kwargs.update({"barrier_id": barrier_id, "primary_usergroup_id": primary_usergroup_id}) @@ -548,8 +569,10 @@ def admin_barriers_list( limit: Optional[int] = None, **kwargs, ) -> SlackResponse: - """Get all Information Barriers for your organization - https://docs.slack.dev/reference/methods/admin.barriers.list""" + """Get all Information Barriers for your organization. + + https://docs.slack.dev/reference/methods/admin.barriers.list + """ kwargs.update( { "cursor": cursor, @@ -569,6 +592,7 @@ def admin_conversations_create( **kwargs, ) -> SlackResponse: """Create a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/admin.conversations.create """ kwargs.update( @@ -589,6 +613,7 @@ def admin_conversations_delete( **kwargs, ) -> SlackResponse: """Delete a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.delete """ kwargs.update({"channel_id": channel_id}) @@ -602,6 +627,7 @@ def admin_conversations_invite( **kwargs, ) -> SlackResponse: """Invite a user to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.invite """ kwargs.update({"channel_id": channel_id}) @@ -619,6 +645,7 @@ def admin_conversations_archive( **kwargs, ) -> SlackResponse: """Archive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -631,6 +658,7 @@ def admin_conversations_unarchive( **kwargs, ) -> SlackResponse: """Unarchive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -644,6 +672,7 @@ def admin_conversations_rename( **kwargs, ) -> SlackResponse: """Rename a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.rename """ kwargs.update({"channel_id": channel_id, "name": name}) @@ -662,6 +691,7 @@ def admin_conversations_search( **kwargs, ) -> SlackResponse: """Search for public or private channels in an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.conversations.search """ kwargs.update( @@ -693,6 +723,7 @@ def admin_conversations_convertToPrivate( **kwargs, ) -> SlackResponse: """Convert a public channel to a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate """ kwargs.update({"channel_id": channel_id}) @@ -705,6 +736,7 @@ def admin_conversations_convertToPublic( **kwargs, ) -> SlackResponse: """Convert a privte channel to a public channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic """ kwargs.update({"channel_id": channel_id}) @@ -718,6 +750,7 @@ def admin_conversations_setConversationPrefs( **kwargs, ) -> SlackResponse: """Set the posting permissions for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -734,6 +767,7 @@ def admin_conversations_getConversationPrefs( **kwargs, ) -> SlackResponse: """Get conversation preferences for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -747,6 +781,7 @@ def admin_conversations_disconnectShared( **kwargs, ) -> SlackResponse: """Disconnect a connected channel from one or more workspaces. + https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared """ kwargs.update({"channel_id": channel_id}) @@ -767,6 +802,7 @@ def admin_conversations_lookup( **kwargs, ) -> SlackResponse: """Returns channels on the given team using the filters. + https://docs.slack.dev/reference/methods/admin.conversations.lookup """ kwargs.update( @@ -792,9 +828,9 @@ def admin_conversations_ekm_listOriginalConnectedChannelInfo( team_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> SlackResponse: - """List all disconnected channels—i.e., - channels that were once connected to other workspaces and then disconnected—and - the corresponding original channel IDs for key revocation with EKM. + """List all disconnected channels and the corresponding original channel IDs for key revocation with EKM. + + Disconnected channels are those that were once connected to other workspaces and then disconnected. https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo """ kwargs.update( @@ -822,6 +858,7 @@ def admin_conversations_restrictAccess_addGroup( **kwargs, ) -> SlackResponse: """Add an allowlist of IDP groups for accessing a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup """ kwargs.update( @@ -845,6 +882,7 @@ def admin_conversations_restrictAccess_listGroups( **kwargs, ) -> SlackResponse: """List all IDP Groups linked to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups """ kwargs.update( @@ -868,6 +906,7 @@ def admin_conversations_restrictAccess_removeGroup( **kwargs, ) -> SlackResponse: """Remove a linked IDP group linked from a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup """ kwargs.update( @@ -893,6 +932,7 @@ def admin_conversations_setTeams( **kwargs, ) -> SlackResponse: """Set the workspaces in an Enterprise grid org that connect to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setTeams """ kwargs.update( @@ -917,6 +957,7 @@ def admin_conversations_getTeams( **kwargs, ) -> SlackResponse: """Set the workspaces in an Enterprise grid org that connect to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.getTeams """ kwargs.update( @@ -934,7 +975,8 @@ def admin_conversations_getCustomRetention( channel_id: str, **kwargs, ) -> SlackResponse: - """Get a channel's retention policy + """Get a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -946,7 +988,8 @@ def admin_conversations_removeCustomRetention( channel_id: str, **kwargs, ) -> SlackResponse: - """Remove a channel's retention policy + """Remove a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -959,7 +1002,8 @@ def admin_conversations_setCustomRetention( duration_days: int, **kwargs, ) -> SlackResponse: - """Set a channel's retention policy + """Set a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention """ kwargs.update({"channel_id": channel_id, "duration_days": duration_days}) @@ -972,6 +1016,7 @@ def admin_conversations_bulkArchive( **kwargs, ) -> SlackResponse: """Archive public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -984,6 +1029,7 @@ def admin_conversations_bulkDelete( **kwargs, ) -> SlackResponse: """Delete public or private channels in bulk. + https://slack.com/api/admin.conversations.bulkDelete """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -997,6 +1043,7 @@ def admin_conversations_bulkMove( **kwargs, ) -> SlackResponse: """Move public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkMove """ kwargs.update( @@ -1015,6 +1062,7 @@ def admin_emoji_add( **kwargs, ) -> SlackResponse: """Add an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.add """ kwargs.update({"name": name, "url": url}) @@ -1028,6 +1076,7 @@ def admin_emoji_addAlias( **kwargs, ) -> SlackResponse: """Add an emoji alias. + https://docs.slack.dev/reference/methods/admin.emoji.addAlias """ kwargs.update({"alias_for": alias_for, "name": name}) @@ -1041,6 +1090,7 @@ def admin_emoji_list( **kwargs, ) -> SlackResponse: """List emoji for an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1053,6 +1103,7 @@ def admin_emoji_remove( **kwargs, ) -> SlackResponse: """Remove an emoji across an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.remove """ kwargs.update({"name": name}) @@ -1066,6 +1117,7 @@ def admin_emoji_rename( **kwargs, ) -> SlackResponse: """Rename an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.rename """ kwargs.update({"name": name, "new_name": new_name}) @@ -1080,7 +1132,8 @@ def admin_functions_list( limit: Optional[int] = None, **kwargs, ) -> SlackResponse: - """Look up functions by a set of apps + """Look up functions by a set of apps. + https://docs.slack.dev/reference/methods/admin.functions.list """ if isinstance(app_ids, (list, tuple)): @@ -1102,8 +1155,9 @@ def admin_functions_permissions_lookup( function_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Lookup the visibility of multiple Slack functions - and include the users if it is limited to particular named entities. + """Lookup the visibility of multiple Slack functions. + + Include the users if the visibility is limited to particular named entities. https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup """ if isinstance(function_ids, (list, tuple)): @@ -1120,8 +1174,8 @@ def admin_functions_permissions_set( user_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> SlackResponse: - """Set the visibility of a Slack function - and define the users or workspaces if it is set to named_entities + """Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities. + https://docs.slack.dev/reference/methods/admin.functions.permissions.set """ kwargs.update( @@ -1145,7 +1199,8 @@ def admin_roles_addAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Adds members to the specified role with the specified scopes + """Adds members to the specified role with the specified scopes. + https://docs.slack.dev/reference/methods/admin.roles.addAssignments """ kwargs.update({"role_id": role_id}) @@ -1170,6 +1225,7 @@ def admin_roles_listAssignments( **kwargs, ) -> SlackResponse: """Lists assignments for all roles across entities. + Options to scope results by any combination of roles or entities https://docs.slack.dev/reference/methods/admin.roles.listAssignments """ @@ -1192,7 +1248,8 @@ def admin_roles_removeAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Removes a set of users from a role for the given scopes and entities + """Removes a set of users from a role for the given scopes and entities. + https://docs.slack.dev/reference/methods/admin.roles.removeAssignments """ kwargs.update({"role_id": role_id}) @@ -1215,6 +1272,7 @@ def admin_users_session_reset( **kwargs, ) -> SlackResponse: """Wipes all valid sessions on all devices for a given user. + https://docs.slack.dev/reference/methods/admin.users.session.reset """ kwargs.update( @@ -1234,7 +1292,8 @@ def admin_users_session_resetBulk( web_only: Optional[bool] = None, **kwargs, ) -> SlackResponse: - """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users + """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users. + https://docs.slack.dev/reference/methods/admin.users.session.resetBulk """ if isinstance(user_ids, (list, tuple)): @@ -1257,6 +1316,7 @@ def admin_users_session_invalidate( **kwargs, ) -> SlackResponse: """Invalidate a single session for a user by session_id. + https://docs.slack.dev/reference/methods/admin.users.session.invalidate """ kwargs.update({"session_id": session_id, "team_id": team_id}) @@ -1271,7 +1331,8 @@ def admin_users_session_list( user_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Lists all active user sessions for an organization + """Lists all active user sessions for an organization. + https://docs.slack.dev/reference/methods/admin.users.session.list """ kwargs.update( @@ -1292,6 +1353,7 @@ def admin_teams_settings_setDefaultChannels( **kwargs, ) -> SlackResponse: """Set the default channels of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels """ kwargs.update({"team_id": team_id}) @@ -1307,8 +1369,9 @@ def admin_users_session_getSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Get user-specific session settings—the session duration - and what happens when the client closes—given a list of users. + """Get user-specific session settings for a given list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.getSettings """ if isinstance(user_ids, (list, tuple)): @@ -1325,8 +1388,9 @@ def admin_users_session_setSettings( duration: Optional[int] = None, **kwargs, ) -> SlackResponse: - """Configure the user-level session settings—the session duration - and what happens when the client closes—for one or more users. + """Configure the user-level session settings for one or more users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.setSettings """ if isinstance(user_ids, (list, tuple)): @@ -1347,8 +1411,9 @@ def admin_users_session_clearSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Clear user-specific session settings—the session duration - and what happens when the client closes—for a list of users. + """Clear user-specific session settings for a list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.clearSettings """ if isinstance(user_ids, (list, tuple)): @@ -1364,8 +1429,9 @@ def admin_users_unsupportedVersions_export( date_sessions_started: Optional[Union[str, int]] = None, **kwargs, ) -> SlackResponse: - """Ask Slackbot to send you an export listing all workspace members using unsupported software, - presented as a zipped CSV file. + """Ask Slackbot to send you an export listing all workspace members using unsupported software. + + The export is presented as a zipped CSV file. https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export """ kwargs.update( @@ -1384,6 +1450,7 @@ def admin_inviteRequests_approve( **kwargs, ) -> SlackResponse: """Approve a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approve """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1398,6 +1465,7 @@ def admin_inviteRequests_approved_list( **kwargs, ) -> SlackResponse: """List all approved workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list """ kwargs.update( @@ -1418,6 +1486,7 @@ def admin_inviteRequests_denied_list( **kwargs, ) -> SlackResponse: """List all denied workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list """ kwargs.update( @@ -1437,6 +1506,7 @@ def admin_inviteRequests_deny( **kwargs, ) -> SlackResponse: """Deny a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.deny """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1458,6 +1528,7 @@ def admin_teams_admins_list( **kwargs, ) -> SlackResponse: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.inviteRequests.list """ kwargs.update( @@ -1479,6 +1550,7 @@ def admin_teams_create( **kwargs, ) -> SlackResponse: """Create an Enterprise team. + https://docs.slack.dev/reference/methods/admin.teams.create """ kwargs.update( @@ -1499,6 +1571,7 @@ def admin_teams_list( **kwargs, ) -> SlackResponse: """List all teams on an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.teams.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1513,6 +1586,7 @@ def admin_teams_owners_list( **kwargs, ) -> SlackResponse: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.owners.list """ kwargs.update({"team_id": team_id, "cursor": cursor, "limit": limit}) @@ -1524,7 +1598,8 @@ def admin_teams_settings_info( team_id: str, **kwargs, ) -> SlackResponse: - """Fetch information about settings in a workspace + """Fetch information about settings in a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.info """ kwargs.update({"team_id": team_id}) @@ -1538,6 +1613,7 @@ def admin_teams_settings_setDescription( **kwargs, ) -> SlackResponse: """Set the description of a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription """ kwargs.update({"team_id": team_id, "description": description}) @@ -1551,6 +1627,7 @@ def admin_teams_settings_setDiscoverability( **kwargs, ) -> SlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability """ kwargs.update({"team_id": team_id, "discoverability": discoverability}) @@ -1564,6 +1641,7 @@ def admin_teams_settings_setIcon( **kwargs, ) -> SlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon """ kwargs.update({"team_id": team_id, "image_url": image_url}) @@ -1577,6 +1655,7 @@ def admin_teams_settings_setName( **kwargs, ) -> SlackResponse: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setName """ kwargs.update({"team_id": team_id, "name": name}) @@ -1591,6 +1670,7 @@ def admin_usergroups_addChannels( **kwargs, ) -> SlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addChannels """ kwargs.update({"team_id": team_id, "usergroup_id": usergroup_id}) @@ -1609,6 +1689,7 @@ def admin_usergroups_addTeams( **kwargs, ) -> SlackResponse: """Associate one or more default workspaces with an organization-wide IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addTeams """ kwargs.update({"usergroup_id": usergroup_id, "auto_provision": auto_provision}) @@ -1627,6 +1708,7 @@ def admin_usergroups_listChannels( **kwargs, ) -> SlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.listChannels """ kwargs.update( @@ -1646,6 +1728,7 @@ def admin_usergroups_removeChannels( **kwargs, ) -> SlackResponse: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels """ kwargs.update({"usergroup_id": usergroup_id}) @@ -1666,6 +1749,7 @@ def admin_users_assign( **kwargs, ) -> SlackResponse: """Add an Enterprise user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.assign """ kwargs.update( @@ -1698,6 +1782,7 @@ def admin_users_invite( **kwargs, ) -> SlackResponse: """Invite a user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.invite """ kwargs.update( @@ -1729,7 +1814,8 @@ def admin_users_list( limit: Optional[int] = None, **kwargs, ) -> SlackResponse: - """List users on a workspace + """List users on a workspace. + https://docs.slack.dev/reference/methods/admin.users.list """ kwargs.update( @@ -1751,6 +1837,7 @@ def admin_users_remove( **kwargs, ) -> SlackResponse: """Remove a user from a workspace. + https://docs.slack.dev/reference/methods/admin.users.remove """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1764,6 +1851,7 @@ def admin_users_setAdmin( **kwargs, ) -> SlackResponse: """Set an existing guest, regular user, or owner to be an admin user. + https://docs.slack.dev/reference/methods/admin.users.setAdmin """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1778,6 +1866,7 @@ def admin_users_setExpiration( **kwargs, ) -> SlackResponse: """Set an expiration for a guest user. + https://docs.slack.dev/reference/methods/admin.users.setExpiration """ kwargs.update({"expiration_ts": expiration_ts, "team_id": team_id, "user_id": user_id}) @@ -1791,6 +1880,7 @@ def admin_users_setOwner( **kwargs, ) -> SlackResponse: """Set an existing guest, regular user, or admin user to be a workspace owner. + https://docs.slack.dev/reference/methods/admin.users.setOwner """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1804,6 +1894,7 @@ def admin_users_setRegular( **kwargs, ) -> SlackResponse: """Set an existing guest user, admin user, or owner to be a regular user. + https://docs.slack.dev/reference/methods/admin.users.setRegular """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1824,7 +1915,8 @@ def admin_workflows_search( source: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Search workflows within the team or enterprise + """Search workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.search """ if collaborator_ids is not None: @@ -1854,7 +1946,8 @@ def admin_workflows_permissions_lookup( max_workflow_triggers: Optional[int] = None, **kwargs, ) -> SlackResponse: - """Look up the permissions for a set of workflows + """Look up the permissions for a set of workflows. + https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup """ if isinstance(workflow_ids, (list, tuple)): @@ -1875,7 +1968,8 @@ def admin_workflows_collaborators_add( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Add collaborators to workflows within the team or enterprise + """Add collaborators to workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add """ if isinstance(collaborator_ids, (list, tuple)): @@ -1895,7 +1989,8 @@ def admin_workflows_collaborators_remove( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Remove collaborators from workflows within the team or enterprise + """Remove collaborators from workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove """ if isinstance(collaborator_ids, (list, tuple)): @@ -1914,7 +2009,8 @@ def admin_workflows_unpublish( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> SlackResponse: - """Unpublish workflows within the team or enterprise + """Unpublish workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.unpublish """ if isinstance(workflow_ids, (list, tuple)): @@ -1932,6 +2028,7 @@ def agents_sessions_rename( **kwargs, ) -> SlackResponse: """Rename an agent session. + https://docs.slack.dev/reference/methods/agents.sessions.rename """ kwargs.update( @@ -1958,6 +2055,7 @@ def agents_sessions_setStatus( **kwargs, ) -> SlackResponse: """Set an agent session's lifecycle status, creating the session if needed. + https://docs.slack.dev/reference/methods/agents.sessions.setStatus """ kwargs.update( @@ -1982,6 +2080,7 @@ def api_test( **kwargs, ) -> SlackResponse: """Checks API calling code. + https://docs.slack.dev/reference/methods/api.test """ kwargs.update({"error": error}) @@ -1993,8 +2092,9 @@ def apps_connections_open( app_token: str, **kwargs, ) -> SlackResponse: - """Generate a temporary Socket Mode WebSocket URL that your app can connect to - in order to receive events and interactive payloads + """Generate a temporary Socket Mode WebSocket URL for your app. + + Your app connects to this URL to receive events and interactive payloads. https://docs.slack.dev/reference/methods/apps.connections.open """ kwargs.update({"token": app_token}) @@ -2009,6 +2109,7 @@ def apps_event_authorizations_list( **kwargs, ) -> SlackResponse: """Get a list of authorizations for the given event context. + Each authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list """ @@ -2023,6 +2124,7 @@ def apps_uninstall( **kwargs, ) -> SlackResponse: """Uninstalls your app from a workspace. + https://docs.slack.dev/reference/methods/apps.uninstall """ kwargs.update({"client_id": client_id, "client_secret": client_secret}) @@ -2034,7 +2136,8 @@ def apps_manifest_create( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> SlackResponse: - """Create an app from an app manifest + """Create an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.create """ if isinstance(manifest, str): @@ -2049,7 +2152,8 @@ def apps_manifest_delete( app_id: str, **kwargs, ) -> SlackResponse: - """Permanently deletes an app created through app manifests + """Permanently deletes an app created through app manifests. + https://docs.slack.dev/reference/methods/apps.manifest.delete """ kwargs.update({"app_id": app_id}) @@ -2061,7 +2165,8 @@ def apps_manifest_export( app_id: str, **kwargs, ) -> SlackResponse: - """Export an app manifest from an existing app + """Export an app manifest from an existing app. + https://docs.slack.dev/reference/methods/apps.manifest.export """ kwargs.update({"app_id": app_id}) @@ -2074,7 +2179,8 @@ def apps_manifest_update( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> SlackResponse: - """Update an app from an app manifest + """Update an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.update """ if isinstance(manifest, str): @@ -2091,7 +2197,8 @@ def apps_manifest_validate( app_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Validate an app manifest + """Validate an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.validate """ if isinstance(manifest, str): @@ -2109,6 +2216,7 @@ def apps_user_connection_update( **kwargs, ) -> SlackResponse: """Updates the connection status between a user and an app. + https://docs.slack.dev/reference/methods/apps.user.connection.update """ kwargs.update({"user_id": user_id, "status": status}) @@ -2120,7 +2228,8 @@ def tooling_tokens_rotate( refresh_token: str, **kwargs, ) -> SlackResponse: - """Exchanges a refresh token for a new app configuration token + """Exchanges a refresh token for a new app configuration token. + https://docs.slack.dev/reference/methods/tooling.tokens.rotate """ kwargs.update({"refresh_token": refresh_token}) @@ -2139,6 +2248,7 @@ def assistant_threads_setStatus( **kwargs, ) -> SlackResponse: """Set the status for an AI assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setStatus """ kwargs.update( @@ -2164,6 +2274,7 @@ def assistant_threads_setTitle( **kwargs, ) -> SlackResponse: """Set the title for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setTitle """ kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "title": title}) @@ -2179,6 +2290,7 @@ def assistant_threads_setSuggestedPrompts( **kwargs, ) -> SlackResponse: """Set suggested prompts for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ kwargs.update({"channel_id": channel_id, "prompts": prompts}) @@ -2195,6 +2307,7 @@ def auth_revoke( **kwargs, ) -> SlackResponse: """Revokes a token. + https://docs.slack.dev/reference/methods/auth.revoke """ kwargs.update({"test": test}) @@ -2205,6 +2318,7 @@ def auth_test( **kwargs, ) -> SlackResponse: """Checks authentication & identity. + https://docs.slack.dev/reference/methods/auth.test """ return self.api_call("auth.test", params=kwargs) @@ -2217,6 +2331,7 @@ def auth_teams_list( **kwargs, ) -> SlackResponse: """List the workspaces a token can access. + https://docs.slack.dev/reference/methods/auth.teams.list """ kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon}) @@ -2231,6 +2346,7 @@ def blocks_validate( **kwargs, ) -> SlackResponse: """Validates an array of blocks, or a message or view payload. + Provide exactly one of ``blocks``, ``message``, or ``view``. https://docs.slack.dev/reference/methods/blocks.validate """ @@ -2261,6 +2377,7 @@ def bookmarks_add( **kwargs, ) -> SlackResponse: """Add bookmark to a channel. + https://docs.slack.dev/reference/methods/bookmarks.add """ kwargs.update( @@ -2287,6 +2404,7 @@ def bookmarks_edit( **kwargs, ) -> SlackResponse: """Edit bookmark. + https://docs.slack.dev/reference/methods/bookmarks.edit """ kwargs.update( @@ -2307,6 +2425,7 @@ def bookmarks_list( **kwargs, ) -> SlackResponse: """List bookmark for the channel. + https://docs.slack.dev/reference/methods/bookmarks.list """ kwargs.update({"channel_id": channel_id}) @@ -2320,6 +2439,7 @@ def bookmarks_remove( **kwargs, ) -> SlackResponse: """Remove bookmark from the channel. + https://docs.slack.dev/reference/methods/bookmarks.remove """ kwargs.update({"bookmark_id": bookmark_id, "channel_id": channel_id}) @@ -2333,6 +2453,7 @@ def bots_info( **kwargs, ) -> SlackResponse: """Gets information about a bot user. + https://docs.slack.dev/reference/methods/bots.info """ kwargs.update({"bot": bot, "team_id": team_id}) @@ -2352,6 +2473,7 @@ def calls_add( **kwargs, ) -> SlackResponse: """Registers a new Call. + https://docs.slack.dev/reference/methods/calls.add """ kwargs.update( @@ -2379,6 +2501,7 @@ def calls_end( **kwargs, ) -> SlackResponse: """Ends a Call. + https://docs.slack.dev/reference/methods/calls.end """ kwargs.update({"id": id, "duration": duration}) @@ -2391,6 +2514,7 @@ def calls_info( **kwargs, ) -> SlackResponse: """Returns information about a Call. + https://docs.slack.dev/reference/methods/calls.info """ kwargs.update({"id": id}) @@ -2404,6 +2528,7 @@ def calls_participants_add( **kwargs, ) -> SlackResponse: """Registers new participants added to a Call. + https://docs.slack.dev/reference/methods/calls.participants.add """ kwargs.update({"id": id}) @@ -2418,6 +2543,7 @@ def calls_participants_remove( **kwargs, ) -> SlackResponse: """Registers participants removed from a Call. + https://docs.slack.dev/reference/methods/calls.participants.remove """ kwargs.update({"id": id}) @@ -2434,6 +2560,7 @@ def calls_update( **kwargs, ) -> SlackResponse: """Updates information about a Call. + https://docs.slack.dev/reference/methods/calls.update """ kwargs.update( @@ -2453,7 +2580,8 @@ def canvases_create( document_content: Dict[str, str], **kwargs, ) -> SlackResponse: - """Create Canvas for a user + """Create Canvas for a user. + https://docs.slack.dev/reference/methods/canvases.create """ kwargs.update({"title": title, "document_content": document_content}) @@ -2466,7 +2594,8 @@ def canvases_edit( changes: Sequence[Dict[str, Any]], **kwargs, ) -> SlackResponse: - """Update an existing canvas + """Update an existing canvas. + https://docs.slack.dev/reference/methods/canvases.edit """ kwargs.update({"canvas_id": canvas_id, "changes": changes}) @@ -2478,7 +2607,8 @@ def canvases_delete( canvas_id: str, **kwargs, ) -> SlackResponse: - """Deletes a canvas + """Deletes a canvas. + https://docs.slack.dev/reference/methods/canvases.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2493,7 +2623,8 @@ def canvases_access_set( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> SlackResponse: - """Sets the access level to a canvas for specified entities + """Sets the access level to a canvas for specified entities. + https://docs.slack.dev/reference/methods/canvases.access.set """ kwargs.update({"canvas_id": canvas_id, "access_level": access_level}) @@ -2518,7 +2649,8 @@ def canvases_access_delete( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> SlackResponse: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/canvases.access.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2541,7 +2673,8 @@ def canvases_sections_lookup( criteria: Dict[str, Any], **kwargs, ) -> SlackResponse: - """Find sections matching the provided criteria + """Find sections matching the provided criteria. + https://docs.slack.dev/reference/methods/canvases.sections.lookup """ kwargs.update({"canvas_id": canvas_id, "criteria": json.dumps(criteria)}) @@ -2679,7 +2812,7 @@ def channels_replies( thread_ts: str, **kwargs, ) -> SlackResponse: - """Retrieve a thread of messages posted to a channel""" + """Retrieve a thread of messages posted to a channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("channels.replies", http_verb="GET", params=kwargs) @@ -2730,6 +2863,7 @@ def chat_appendStream( **kwargs, ) -> SlackResponse: """Appends text to an existing streaming conversation. + https://docs.slack.dev/reference/methods/chat.appendStream """ kwargs.update( @@ -2753,6 +2887,7 @@ def chat_delete( **kwargs, ) -> SlackResponse: """Deletes a message. + https://docs.slack.dev/reference/methods/chat.delete """ kwargs.update({"channel": channel, "ts": ts, "as_user": as_user}) @@ -2767,6 +2902,7 @@ def chat_deleteScheduledMessage( **kwargs, ) -> SlackResponse: """Deletes a scheduled message. + https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage """ kwargs.update( @@ -2785,7 +2921,8 @@ def chat_getPermalink( message_ts: str, **kwargs, ) -> SlackResponse: - """Retrieve a permalink URL for a specific extant message + """Retrieve a permalink URL for a specific extant message. + https://docs.slack.dev/reference/methods/chat.getPermalink """ kwargs.update({"channel": channel, "message_ts": message_ts}) @@ -2799,6 +2936,7 @@ def chat_meMessage( **kwargs, ) -> SlackResponse: """Share a me message into a channel. + https://docs.slack.dev/reference/methods/chat.meMessage """ kwargs.update({"channel": channel, "text": text}) @@ -2823,6 +2961,7 @@ def chat_postEphemeral( **kwargs, ) -> SlackResponse: """Sends an ephemeral message to a user in a channel. + https://docs.slack.dev/reference/methods/chat.postEphemeral """ kwargs.update( @@ -2872,6 +3011,7 @@ def chat_postMessage( **kwargs, ) -> SlackResponse: """Sends a message to a channel. + https://docs.slack.dev/reference/methods/chat.postMessage """ kwargs.update( @@ -2922,6 +3062,7 @@ def chat_scheduleMessage( **kwargs, ) -> SlackResponse: """Schedules a message. + https://docs.slack.dev/reference/methods/chat.scheduleMessage """ kwargs.update( @@ -2960,6 +3101,7 @@ def chat_scheduledMessages_list( **kwargs, ) -> SlackResponse: """Lists all scheduled messages. + https://docs.slack.dev/reference/methods/chat.scheduledMessages.list """ kwargs.update( @@ -2990,6 +3132,7 @@ def chat_startStream( **kwargs, ) -> SlackResponse: """Starts a new streaming conversation. + https://docs.slack.dev/reference/methods/chat.startStream """ kwargs.update( @@ -3023,6 +3166,7 @@ def chat_stopStream( **kwargs, ) -> SlackResponse: """Stops a streaming conversation. + https://docs.slack.dev/reference/methods/chat.stopStream """ kwargs.update( @@ -3132,6 +3276,7 @@ def chat_unfurl( **kwargs, ) -> SlackResponse: """Provide custom unfurl behavior for user-posted URLs. + https://docs.slack.dev/reference/methods/chat.unfurl """ kwargs.update( @@ -3171,6 +3316,7 @@ def chat_update( **kwargs, ) -> SlackResponse: """Updates a message in a channel. + https://docs.slack.dev/reference/methods/chat.update """ kwargs.update( @@ -3210,6 +3356,7 @@ def conversations_acceptSharedInvite( **kwargs, ) -> SlackResponse: """Accepts an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite """ if channel_id is None and invite_id is None: @@ -3234,6 +3381,7 @@ def conversations_approveSharedInvite( **kwargs, ) -> SlackResponse: """Approves an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.approveSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3246,6 +3394,7 @@ def conversations_archive( **kwargs, ) -> SlackResponse: """Archives a conversation. + https://docs.slack.dev/reference/methods/conversations.archive """ kwargs.update({"channel": channel}) @@ -3258,6 +3407,7 @@ def conversations_close( **kwargs, ) -> SlackResponse: """Closes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.close """ kwargs.update({"channel": channel}) @@ -3271,7 +3421,8 @@ def conversations_create( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Initiates a public or private channel-based conversation + """Initiates a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/conversations.create """ kwargs.update({"name": name, "is_private": is_private, "team_id": team_id}) @@ -3285,6 +3436,7 @@ def conversations_declineSharedInvite( **kwargs, ) -> SlackResponse: """Declines a Slack Connect channel invite. + https://docs.slack.dev/reference/methods/conversations.declineSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3294,6 +3446,7 @@ def conversations_externalInvitePermissions_set( self, *, action: str, channel: str, target_team: str, **kwargs ) -> SlackResponse: """Sets a team in a shared External Limited channel to a shared Slack Connect channel or vice versa. + https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set """ kwargs.update( @@ -3318,6 +3471,7 @@ def conversations_history( **kwargs, ) -> SlackResponse: """Fetches a conversation's history of messages and events. + https://docs.slack.dev/reference/methods/conversations.history """ kwargs.update( @@ -3342,6 +3496,7 @@ def conversations_info( **kwargs, ) -> SlackResponse: """Retrieve information about a conversation. + https://docs.slack.dev/reference/methods/conversations.info """ kwargs.update( @@ -3362,6 +3517,7 @@ def conversations_invite( **kwargs, ) -> SlackResponse: """Invites users to a channel. + https://docs.slack.dev/reference/methods/conversations.invite """ kwargs.update( @@ -3385,6 +3541,7 @@ def conversations_inviteShared( **kwargs, ) -> SlackResponse: """Sends an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.inviteShared """ if emails is None and user_ids is None: @@ -3407,6 +3564,7 @@ def conversations_join( **kwargs, ) -> SlackResponse: """Joins an existing conversation. + https://docs.slack.dev/reference/methods/conversations.join """ kwargs.update({"channel": channel}) @@ -3420,6 +3578,7 @@ def conversations_kick( **kwargs, ) -> SlackResponse: """Removes a user from a conversation. + https://docs.slack.dev/reference/methods/conversations.kick """ kwargs.update({"channel": channel, "user": user}) @@ -3432,6 +3591,7 @@ def conversations_leave( **kwargs, ) -> SlackResponse: """Leaves a conversation. + https://docs.slack.dev/reference/methods/conversations.leave """ kwargs.update({"channel": channel}) @@ -3448,6 +3608,7 @@ def conversations_list( **kwargs, ) -> SlackResponse: """Lists all channels in a Slack team. + https://docs.slack.dev/reference/methods/conversations.list """ kwargs.update( @@ -3472,8 +3633,8 @@ def conversations_listConnectInvites( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """List shared channel invites that have been generated - or received but have not yet been approved by all parties. + """List shared channel invites that have been generated or received but have not yet been approved by all parties. + https://docs.slack.dev/reference/methods/conversations.listConnectInvites """ kwargs.update({"count": count, "cursor": cursor, "team_id": team_id}) @@ -3487,6 +3648,7 @@ def conversations_mark( **kwargs, ) -> SlackResponse: """Sets the read cursor in a channel. + https://docs.slack.dev/reference/methods/conversations.mark """ kwargs.update({"channel": channel, "ts": ts}) @@ -3501,6 +3663,7 @@ def conversations_members( **kwargs, ) -> SlackResponse: """Retrieve members of a conversation. + https://docs.slack.dev/reference/methods/conversations.members """ kwargs.update({"channel": channel, "cursor": cursor, "limit": limit}) @@ -3515,6 +3678,7 @@ def conversations_open( **kwargs, ) -> SlackResponse: """Opens or resumes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.open """ if channel is None and users is None: @@ -3534,6 +3698,7 @@ def conversations_rename( **kwargs, ) -> SlackResponse: """Renames a conversation. + https://docs.slack.dev/reference/methods/conversations.rename """ kwargs.update({"channel": channel, "name": name}) @@ -3552,7 +3717,8 @@ def conversations_replies( oldest: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Retrieve a thread of messages posted to a conversation + """Retrieve a thread of messages posted to a conversation. + https://docs.slack.dev/reference/methods/conversations.replies """ kwargs.update( @@ -3579,6 +3745,7 @@ def conversations_requestSharedInvite_approve( **kwargs, ) -> SlackResponse: """Approve a request to add an external user to a channel. This also sends them a Slack Connect invite. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve """ kwargs.update( @@ -3600,6 +3767,7 @@ def conversations_requestSharedInvite_deny( **kwargs, ) -> SlackResponse: """Deny a request to invite an external user to a channel. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny """ kwargs.update({"invite_id": invite_id, "message": message}) @@ -3618,6 +3786,7 @@ def conversations_requestSharedInvite_list( **kwargs, ) -> SlackResponse: """Lists requests to add external users to channels with ability to filter. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list """ kwargs.update( @@ -3645,6 +3814,7 @@ def conversations_setPurpose( **kwargs, ) -> SlackResponse: """Sets the purpose for a conversation. + https://docs.slack.dev/reference/methods/conversations.setPurpose """ kwargs.update({"channel": channel, "purpose": purpose}) @@ -3658,6 +3828,7 @@ def conversations_setTopic( **kwargs, ) -> SlackResponse: """Sets the topic for a conversation. + https://docs.slack.dev/reference/methods/conversations.setTopic """ kwargs.update({"channel": channel, "topic": topic}) @@ -3670,6 +3841,7 @@ def conversations_unarchive( **kwargs, ) -> SlackResponse: """Reverses conversation archival. + https://docs.slack.dev/reference/methods/conversations.unarchive """ kwargs.update({"channel": channel}) @@ -3682,7 +3854,8 @@ def conversations_canvases_create( document_content: Dict[str, str], **kwargs, ) -> SlackResponse: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/conversations.canvases.create """ kwargs.update({"channel_id": channel_id, "document_content": document_content}) @@ -3696,6 +3869,7 @@ def dialog_open( **kwargs, ) -> SlackResponse: """Open a dialog with a user. + https://docs.slack.dev/reference/methods/dialog.open """ kwargs.update({"dialog": dialog, "trigger_id": trigger_id}) @@ -3708,6 +3882,7 @@ def dnd_endDnd( **kwargs, ) -> SlackResponse: """Ends the current user's Do Not Disturb session immediately. + https://docs.slack.dev/reference/methods/dnd.endDnd """ return self.api_call("dnd.endDnd", params=kwargs) @@ -3717,6 +3892,7 @@ def dnd_endSnooze( **kwargs, ) -> SlackResponse: """Ends the current user's snooze mode immediately. + https://docs.slack.dev/reference/methods/dnd.endSnooze """ return self.api_call("dnd.endSnooze", params=kwargs) @@ -3729,6 +3905,7 @@ def dnd_info( **kwargs, ) -> SlackResponse: """Retrieves a user's current Do Not Disturb status. + https://docs.slack.dev/reference/methods/dnd.info """ kwargs.update({"team_id": team_id, "user": user}) @@ -3741,6 +3918,7 @@ def dnd_setSnooze( **kwargs, ) -> SlackResponse: """Turns on Do Not Disturb mode for the current user, or changes its duration. + https://docs.slack.dev/reference/methods/dnd.setSnooze """ kwargs.update({"num_minutes": num_minutes}) @@ -3753,6 +3931,7 @@ def dnd_teamInfo( **kwargs, ) -> SlackResponse: """Retrieves the Do Not Disturb status for users on a team. + https://docs.slack.dev/reference/methods/dnd.teamInfo """ if isinstance(users, (list, tuple)): @@ -3768,6 +3947,7 @@ def emoji_list( **kwargs, ) -> SlackResponse: """Lists custom emoji for a team. + https://docs.slack.dev/reference/methods/emoji.list """ kwargs.update({"include_categories": include_categories}) @@ -3783,6 +3963,7 @@ def entity_presentDetails( **kwargs, ) -> SlackResponse: """Provides entity details for the flexpane. + https://docs.slack.dev/reference/methods/entity.presentDetails/ """ kwargs.update({"trigger_id": trigger_id}) @@ -3805,6 +3986,7 @@ def files_comments_delete( **kwargs, ) -> SlackResponse: """Deletes an existing comment on a file. + https://docs.slack.dev/reference/methods/files.comments.delete """ kwargs.update({"file": file, "id": id}) @@ -3817,6 +3999,7 @@ def files_delete( **kwargs, ) -> SlackResponse: """Deletes a file. + https://docs.slack.dev/reference/methods/files.delete """ kwargs.update({"file": file}) @@ -3833,6 +4016,7 @@ def files_info( **kwargs, ) -> SlackResponse: """Gets information about a team file. + https://docs.slack.dev/reference/methods/files.info """ kwargs.update( @@ -3861,6 +4045,7 @@ def files_list( **kwargs, ) -> SlackResponse: """Lists & filters team files. + https://docs.slack.dev/reference/methods/files.list """ kwargs.update( @@ -3889,6 +4074,7 @@ def files_remote_info( **kwargs, ) -> SlackResponse: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.info """ kwargs.update({"external_id": external_id, "file": file}) @@ -3905,6 +4091,7 @@ def files_remote_list( **kwargs, ) -> SlackResponse: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.list """ kwargs.update( @@ -3930,6 +4117,7 @@ def files_remote_add( **kwargs, ) -> SlackResponse: """Adds a file from a remote service. + https://docs.slack.dev/reference/methods/files.remote.add """ kwargs.update( @@ -3969,6 +4157,7 @@ def files_remote_update( **kwargs, ) -> SlackResponse: """Updates an existing remote file. + https://docs.slack.dev/reference/methods/files.remote.update """ kwargs.update( @@ -4004,6 +4193,7 @@ def files_remote_remove( **kwargs, ) -> SlackResponse: """Remove a remote file. + https://docs.slack.dev/reference/methods/files.remote.remove """ kwargs.update({"external_id": external_id, "file": file}) @@ -4018,6 +4208,7 @@ def files_remote_share( **kwargs, ) -> SlackResponse: """Share a remote file into a channel. + https://docs.slack.dev/reference/methods/files.remote.share """ if external_id is None and file is None: @@ -4035,7 +4226,8 @@ def files_revokePublicURL( file: str, **kwargs, ) -> SlackResponse: - """Revokes public/external sharing access for a file + """Revokes public/external sharing access for a file. + https://docs.slack.dev/reference/methods/files.revokePublicURL """ kwargs.update({"file": file}) @@ -4048,6 +4240,7 @@ def files_sharedPublicURL( **kwargs, ) -> SlackResponse: """Enables a file for public/external sharing. + https://docs.slack.dev/reference/methods/files.sharedPublicURL """ kwargs.update({"file": file}) @@ -4067,6 +4260,7 @@ def files_upload( **kwargs, ) -> SlackResponse: """Uploads or creates a file. + https://docs.slack.dev/reference/methods/files.upload """ _print_files_upload_v2_suggestion() @@ -4119,7 +4313,7 @@ def files_upload_v2( request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: - """This wrapper method provides an easy way to upload files using the following endpoints: + """Provide an easy way to upload files using the following endpoints. - step1: https://docs.slack.dev/reference/methods/files.getUploadURLExternal @@ -4213,6 +4407,7 @@ def files_getUploadURLExternal( **kwargs, ) -> SlackResponse: """Gets a URL for an edge external upload. + https://docs.slack.dev/reference/methods/files.getUploadURLExternal """ kwargs.update( @@ -4236,6 +4431,7 @@ def files_completeUploadExternal( **kwargs, ) -> SlackResponse: """Finishes an upload started with files.getUploadURLExternal. + https://docs.slack.dev/reference/methods/files.completeUploadExternal """ _files = [{k: v for k, v in f.items() if v is not None} for f in files] @@ -4258,7 +4454,8 @@ def functions_completeSuccess( outputs: Dict[str, Any], **kwargs, ) -> SlackResponse: - """Signal the successful completion of a function + """Signal the successful completion of a function. + https://docs.slack.dev/reference/methods/functions.completeSuccess """ kwargs.update({"function_execution_id": function_execution_id, "outputs": json.dumps(outputs)}) @@ -4271,7 +4468,8 @@ def functions_completeError( error: str, **kwargs, ) -> SlackResponse: - """Signal the failure to execute a function + """Signal the failure to execute a function. + https://docs.slack.dev/reference/methods/functions.completeError """ kwargs.update({"function_execution_id": function_execution_id, "error": error}) @@ -4419,7 +4617,7 @@ def groups_replies( thread_ts: str, **kwargs, ) -> SlackResponse: - """Retrieve a thread of messages posted to a private channel""" + """Retrieve a thread of messages posted to a private channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("groups.replies", http_verb="GET", params=kwargs) @@ -4522,7 +4720,7 @@ def im_replies( thread_ts: str, **kwargs, ) -> SlackResponse: - """Retrieve a thread of messages posted to a direct message conversation""" + """Retrieve a thread of messages posted to a direct message conversation.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("im.replies", http_verb="GET", params=kwargs) @@ -4536,7 +4734,8 @@ def migration_exchange( to_old: Optional[bool] = None, **kwargs, ) -> SlackResponse: - """For Enterprise Grid workspaces, map local user IDs to global user IDs + """For Enterprise Grid workspaces, map local user IDs to global user IDs. + https://docs.slack.dev/reference/methods/migration.exchange """ if isinstance(users, (list, tuple)): @@ -4612,9 +4811,7 @@ def mpim_replies( thread_ts: str, **kwargs, ) -> SlackResponse: - """Retrieve a thread of messages posted to a direct message conversation from a - multiparty direct message. - """ + """Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("mpim.replies", http_verb="GET", params=kwargs) @@ -4636,6 +4833,7 @@ def oauth_v2_access( **kwargs, ) -> SlackResponse: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.v2.access """ if redirect_uri is not None: @@ -4662,6 +4860,7 @@ def oauth_access( **kwargs, ) -> SlackResponse: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.access """ if redirect_uri is not None: @@ -4681,7 +4880,8 @@ def oauth_v2_exchange( client_secret: str, **kwargs, ) -> SlackResponse: - """Exchanges a legacy access token for a new expiring access token and refresh token + """Exchanges a legacy access token for a new expiring access token and refresh token. + https://docs.slack.dev/reference/methods/oauth.v2.exchange """ kwargs.update({"client_id": client_id, "client_secret": client_secret, "token": token}) @@ -4698,6 +4898,7 @@ def openid_connect_token( **kwargs, ) -> SlackResponse: """Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.token """ if redirect_uri is not None: @@ -4719,6 +4920,7 @@ def openid_connect_userInfo( **kwargs, ) -> SlackResponse: """Get the identity of a user who has authorized Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.userInfo """ return self.api_call("openid.connect.userInfo", params=kwargs) @@ -4731,6 +4933,7 @@ def pins_add( **kwargs, ) -> SlackResponse: """Pins an item to a channel. + https://docs.slack.dev/reference/methods/pins.add """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4743,6 +4946,7 @@ def pins_list( **kwargs, ) -> SlackResponse: """Lists items pinned to a channel. + https://docs.slack.dev/reference/methods/pins.list """ kwargs.update({"channel": channel}) @@ -4756,6 +4960,7 @@ def pins_remove( **kwargs, ) -> SlackResponse: """Un-pins an item from a channel. + https://docs.slack.dev/reference/methods/pins.remove """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4770,6 +4975,7 @@ def reactions_add( **kwargs, ) -> SlackResponse: """Adds a reaction to an item. + https://docs.slack.dev/reference/methods/reactions.add """ kwargs.update({"channel": channel, "name": name, "timestamp": timestamp}) @@ -4786,6 +4992,7 @@ def reactions_get( **kwargs, ) -> SlackResponse: """Gets reactions for an item. + https://docs.slack.dev/reference/methods/reactions.get """ kwargs.update( @@ -4812,6 +5019,7 @@ def reactions_list( **kwargs, ) -> SlackResponse: """Lists reactions made by a user. + https://docs.slack.dev/reference/methods/reactions.list """ kwargs.update( @@ -4838,6 +5046,7 @@ def reactions_remove( **kwargs, ) -> SlackResponse: """Removes a reaction from an item. + https://docs.slack.dev/reference/methods/reactions.remove """ kwargs.update( @@ -4862,6 +5071,7 @@ def reminders_add( **kwargs, ) -> SlackResponse: """Creates a reminder. + https://docs.slack.dev/reference/methods/reminders.add """ kwargs.update( @@ -4883,6 +5093,7 @@ def reminders_complete( **kwargs, ) -> SlackResponse: """Marks a reminder as complete. + https://docs.slack.dev/reference/methods/reminders.complete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4896,6 +5107,7 @@ def reminders_delete( **kwargs, ) -> SlackResponse: """Deletes a reminder. + https://docs.slack.dev/reference/methods/reminders.delete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4909,6 +5121,7 @@ def reminders_info( **kwargs, ) -> SlackResponse: """Gets information about a reminder. + https://docs.slack.dev/reference/methods/reminders.info """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4921,6 +5134,7 @@ def reminders_list( **kwargs, ) -> SlackResponse: """Lists all reminders created by or for a given user. + https://docs.slack.dev/reference/methods/reminders.list """ kwargs.update({"team_id": team_id}) @@ -4934,6 +5148,7 @@ def rtm_connect( **kwargs, ) -> SlackResponse: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.connect """ kwargs.update({"batch_presence_aware": batch_presence_aware, "presence_sub": presence_sub}) @@ -4952,6 +5167,7 @@ def rtm_start( **kwargs, ) -> SlackResponse: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.start """ kwargs.update( @@ -4980,6 +5196,7 @@ def search_all( **kwargs, ) -> SlackResponse: """Searches for messages and files matching a query. + https://docs.slack.dev/reference/methods/search.all """ kwargs.update( @@ -5008,6 +5225,7 @@ def search_files( **kwargs, ) -> SlackResponse: """Searches for files matching a query. + https://docs.slack.dev/reference/methods/search.files """ kwargs.update( @@ -5037,6 +5255,7 @@ def search_messages( **kwargs, ) -> SlackResponse: """Searches for messages matching a query. + https://docs.slack.dev/reference/methods/search.messages """ kwargs.update( @@ -5062,6 +5281,7 @@ def slackLists_access_delete( **kwargs, ) -> SlackResponse: """Revoke access to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.delete """ kwargs.update({"list_id": list_id, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5078,6 +5298,7 @@ def slackLists_access_set( **kwargs, ) -> SlackResponse: """Set the access level to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.set """ kwargs.update({"list_id": list_id, "access_level": access_level, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5096,6 +5317,7 @@ def slackLists_create( **kwargs, ) -> SlackResponse: """Creates a List. + https://docs.slack.dev/reference/methods/slackLists.create """ kwargs.update( @@ -5119,6 +5341,7 @@ def slackLists_download_get( **kwargs, ) -> SlackResponse: """Retrieve List download URL from an export job to download List contents. + https://docs.slack.dev/reference/methods/slackLists.download.get """ kwargs.update( @@ -5138,6 +5361,7 @@ def slackLists_download_start( **kwargs, ) -> SlackResponse: """Initiate a job to export List contents. + https://docs.slack.dev/reference/methods/slackLists.download.start """ kwargs.update( @@ -5159,6 +5383,7 @@ def slackLists_items_create( **kwargs, ) -> SlackResponse: """Add a new item to an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.create """ kwargs.update( @@ -5180,6 +5405,7 @@ def slackLists_items_delete( **kwargs, ) -> SlackResponse: """Deletes an item from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.delete """ kwargs.update( @@ -5199,6 +5425,7 @@ def slackLists_items_deleteMultiple( **kwargs, ) -> SlackResponse: """Deletes multiple items from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple """ kwargs.update( @@ -5219,6 +5446,7 @@ def slackLists_items_info( **kwargs, ) -> SlackResponse: """Get a row from a List. + https://docs.slack.dev/reference/methods/slackLists.items.info """ kwargs.update( @@ -5241,6 +5469,7 @@ def slackLists_items_list( **kwargs, ) -> SlackResponse: """Get records from a List. + https://docs.slack.dev/reference/methods/slackLists.items.list """ kwargs.update( @@ -5262,6 +5491,7 @@ def slackLists_items_update( **kwargs, ) -> SlackResponse: """Updates cells in a List. + https://docs.slack.dev/reference/methods/slackLists.items.update """ kwargs.update( @@ -5283,6 +5513,7 @@ def slackLists_update( **kwargs, ) -> SlackResponse: """Update a List. + https://docs.slack.dev/reference/methods/slackLists.update """ kwargs.update( @@ -5306,6 +5537,7 @@ def stars_add( **kwargs, ) -> SlackResponse: """Adds a star to an item. + https://docs.slack.dev/reference/methods/stars.add """ kwargs.update( @@ -5329,6 +5561,7 @@ def stars_list( **kwargs, ) -> SlackResponse: """Lists stars for a user. + https://docs.slack.dev/reference/methods/stars.list """ kwargs.update( @@ -5352,6 +5585,7 @@ def stars_remove( **kwargs, ) -> SlackResponse: """Removes a star from an item. + https://docs.slack.dev/reference/methods/stars.remove """ kwargs.update( @@ -5376,6 +5610,7 @@ def team_accessLogs( **kwargs, ) -> SlackResponse: """Gets the access logs for the current team. + https://docs.slack.dev/reference/methods/team.accessLogs """ kwargs.update( @@ -5398,6 +5633,7 @@ def team_billableInfo( **kwargs, ) -> SlackResponse: """Gets billable users information for the current team. + https://docs.slack.dev/reference/methods/team.billableInfo """ kwargs.update({"team_id": team_id, "user": user}) @@ -5408,6 +5644,7 @@ def team_billing_info( **kwargs, ) -> SlackResponse: """Reads a workspace's billing plan information. + https://docs.slack.dev/reference/methods/team.billing.info """ return self.api_call("team.billing.info", params=kwargs) @@ -5419,6 +5656,7 @@ def team_externalTeams_disconnect( **kwargs, ) -> SlackResponse: """Disconnects an external organization. + https://docs.slack.dev/reference/methods/team.externalTeams.disconnect """ kwargs.update( @@ -5441,6 +5679,7 @@ def team_externalTeams_list( **kwargs, ) -> SlackResponse: """Returns a list of all the external teams connected and details about the connection. + https://docs.slack.dev/reference/methods/team.externalTeams.list """ kwargs.update( @@ -5472,6 +5711,7 @@ def team_info( **kwargs, ) -> SlackResponse: """Gets information about the current team. + https://docs.slack.dev/reference/methods/team.info """ kwargs.update({"team": team, "domain": domain}) @@ -5490,6 +5730,7 @@ def team_integrationLogs( **kwargs, ) -> SlackResponse: """Gets the integration logs for the current team. + https://docs.slack.dev/reference/methods/team.integrationLogs """ kwargs.update( @@ -5512,6 +5753,7 @@ def team_profile_get( **kwargs, ) -> SlackResponse: """Retrieve a team's profile. + https://docs.slack.dev/reference/methods/team.profile.get """ kwargs.update({"visibility": visibility}) @@ -5522,6 +5764,7 @@ def team_preferences_list( **kwargs, ) -> SlackResponse: """Retrieve a list of a workspace's team preferences. + https://docs.slack.dev/reference/methods/team.preferences.list """ return self.api_call("team.preferences.list", params=kwargs) @@ -5537,7 +5780,8 @@ def usergroups_create( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Create a User Group + """Create a User Group. + https://docs.slack.dev/reference/methods/usergroups.create """ kwargs.update( @@ -5563,7 +5807,8 @@ def usergroups_disable( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Disable an existing User Group + """Disable an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.disable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5577,7 +5822,8 @@ def usergroups_enable( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Enable a User Group + """Enable a User Group. + https://docs.slack.dev/reference/methods/usergroups.enable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5592,7 +5838,8 @@ def usergroups_list( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """List all User Groups for a team + """List all User Groups for a team. + https://docs.slack.dev/reference/methods/usergroups.list """ kwargs.update( @@ -5617,7 +5864,8 @@ def usergroups_update( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Update an existing User Group + """Update an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.update """ kwargs.update( @@ -5644,7 +5892,8 @@ def usergroups_users_list( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """List all users in a User Group + """List all users in a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.list """ kwargs.update( @@ -5665,7 +5914,8 @@ def usergroups_users_update( team_id: Optional[str] = None, **kwargs, ) -> SlackResponse: - """Update the list of users for a User Group + """Update the list of users for a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.update """ kwargs.update( @@ -5693,6 +5943,7 @@ def users_conversations( **kwargs, ) -> SlackResponse: """List conversations the calling user may access. + https://docs.slack.dev/reference/methods/users.conversations """ kwargs.update( @@ -5714,7 +5965,8 @@ def users_deletePhoto( self, **kwargs, ) -> SlackResponse: - """Delete the user profile photo + """Delete the user profile photo. + https://docs.slack.dev/reference/methods/users.deletePhoto """ return self.api_call("users.deletePhoto", http_verb="GET", params=kwargs) @@ -5726,6 +5978,7 @@ def users_getPresence( **kwargs, ) -> SlackResponse: """Gets user presence information. + https://docs.slack.dev/reference/methods/users.getPresence """ kwargs.update({"user": user}) @@ -5736,6 +5989,7 @@ def users_identity( **kwargs, ) -> SlackResponse: """Get a user's identity. + https://docs.slack.dev/reference/methods/users.identity """ return self.api_call("users.identity", http_verb="GET", params=kwargs) @@ -5748,6 +6002,7 @@ def users_info( **kwargs, ) -> SlackResponse: """Gets information about a user. + https://docs.slack.dev/reference/methods/users.info """ kwargs.update({"user": user, "include_locale": include_locale}) @@ -5763,6 +6018,7 @@ def users_list( **kwargs, ) -> SlackResponse: """Lists all users in a Slack team. + https://docs.slack.dev/reference/methods/users.list """ kwargs.update( @@ -5782,6 +6038,7 @@ def users_lookupByEmail( **kwargs, ) -> SlackResponse: """Find a user with an email address. + https://docs.slack.dev/reference/methods/users.lookupByEmail """ kwargs.update({"email": email}) @@ -5796,7 +6053,8 @@ def users_setPhoto( crop_y: Optional[Union[int, str]] = None, **kwargs, ) -> SlackResponse: - """Set the user profile photo + """Set the user profile photo. + https://docs.slack.dev/reference/methods/users.setPhoto """ kwargs.update({"crop_w": crop_w, "crop_x": crop_x, "crop_y": crop_y}) @@ -5809,6 +6067,7 @@ def users_setPresence( **kwargs, ) -> SlackResponse: """Manually sets user presence. + https://docs.slack.dev/reference/methods/users.setPresence """ kwargs.update({"presence": presence}) @@ -5819,7 +6078,8 @@ def users_discoverableContacts_lookup( email: str, **kwargs, ) -> SlackResponse: - """Lookup an email address to see if someone is on Slack + """Lookup an email address to see if someone is on Slack. + https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup """ kwargs.update({"email": email}) @@ -5833,6 +6093,7 @@ def users_profile_get( **kwargs, ) -> SlackResponse: """Retrieves a user's profile information. + https://docs.slack.dev/reference/methods/users.profile.get """ kwargs.update({"user": user, "include_labels": include_labels}) @@ -5848,6 +6109,7 @@ def users_profile_set( **kwargs, ) -> SlackResponse: """Set the profile information for a user. + https://docs.slack.dev/reference/methods/users.profile.set """ kwargs.update( @@ -5871,6 +6133,7 @@ def views_open( **kwargs, ) -> SlackResponse: """Open a view for a user. + https://docs.slack.dev/reference/methods/views.open See https://docs.slack.dev/surfaces/modals/ for details. """ @@ -5892,6 +6155,7 @@ def views_push( **kwargs, ) -> SlackResponse: """Push a view onto the stack of a root view. + Push a new view onto the existing view stack by passing a view payload and a valid trigger_id generated from an interaction within the existing modal. @@ -5918,6 +6182,7 @@ def views_update( **kwargs, ) -> SlackResponse: """Update an existing view. + Update a view by passing a new view definition along with the view_id returned in views.open or the external_id. See the modals documentation (https://docs.slack.dev/surfaces/modals/#updating_views) @@ -5948,6 +6213,7 @@ def views_publish( **kwargs, ) -> SlackResponse: """Publish a static view for a User. + Create or update the view that comprises an app's Home tab (https://docs.slack.dev/surfaces/app-home/) https://docs.slack.dev/reference/methods/views.publish @@ -5969,6 +6235,7 @@ def workflows_featured_add( **kwargs, ) -> SlackResponse: """Add featured workflows to a channel. + https://docs.slack.dev/reference/methods/workflows.featured.add """ kwargs.update({"channel_id": channel_id}) @@ -5985,6 +6252,7 @@ def workflows_featured_list( **kwargs, ) -> SlackResponse: """List the featured workflows for specified channels. + https://docs.slack.dev/reference/methods/workflows.featured.list """ if isinstance(channel_ids, (list, tuple)): @@ -6001,6 +6269,7 @@ def workflows_featured_remove( **kwargs, ) -> SlackResponse: """Remove featured workflows from a channel. + https://docs.slack.dev/reference/methods/workflows.featured.remove """ kwargs.update({"channel_id": channel_id}) @@ -6018,6 +6287,7 @@ def workflows_featured_set( **kwargs, ) -> SlackResponse: """Set featured workflows for a channel. + https://docs.slack.dev/reference/methods/workflows.featured.set """ kwargs.update({"channel_id": channel_id}) @@ -6035,6 +6305,7 @@ def workflows_stepCompleted( **kwargs, ) -> SlackResponse: """Indicate a successful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepCompleted """ kwargs.update({"workflow_step_execute_id": workflow_step_execute_id}) @@ -6052,6 +6323,7 @@ def workflows_stepFailed( **kwargs, ) -> SlackResponse: """Indicate an unsuccessful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepFailed """ kwargs.update( @@ -6073,6 +6345,7 @@ def workflows_updateStep( **kwargs, ) -> SlackResponse: """Update the configuration for a workflow extension step. + https://docs.slack.dev/reference/methods/workflows.updateStep """ kwargs.update({"workflow_step_edit_id": workflow_step_edit_id}) diff --git a/slack_sdk/web/deprecation.py b/slack_sdk/web/deprecation.py index c81c4b754..4290e7a29 100644 --- a/slack_sdk/web/deprecation.py +++ b/slack_sdk/web/deprecation.py @@ -16,8 +16,7 @@ def show_deprecation_warning_if_any(method_name: str): - """Prints a warning if the given method is deprecated""" - + """Prints a warning if the given method is deprecated.""" skip_deprecation = os.environ.get("SLACKCLIENT_SKIP_DEPRECATION") # for unit tests etc. if skip_deprecation: return diff --git a/slack_sdk/web/internal_utils.py b/slack_sdk/web/internal_utils.py index 8e725f138..3a6db7203 100644 --- a/slack_sdk/web/internal_utils.py +++ b/slack_sdk/web/internal_utils.py @@ -40,8 +40,7 @@ def convert_bool_to_0_or_1(params: Optional[Dict[str, Any]]) -> Optional[Dict[st def get_user_agent(prefix: Optional[str] = None, suffix: Optional[str] = None): - """Construct the user-agent header with the package info, - Python version and OS version. + """Construct the user-agent header with the package info, Python version and OS version. Returns: The user agent string. @@ -82,6 +81,7 @@ def _get_headers( request_specific_headers: Optional[dict], ) -> Dict[str, str]: """Constructs the headers need for a request. + Args: has_json (bool): Whether or not the request has json. has_files (bool): Whether or not the request has files. @@ -241,8 +241,7 @@ def _update_call_participants(kwargs, users: Union[str, Sequence[Dict[str, str]] def _next_cursor_is_present(data) -> bool: - """Determine if the response contains 'next_cursor' - and 'next_cursor' is not empty. + """Determine if the response contains 'next_cursor' and 'next_cursor' is not empty. Returns: A boolean value. diff --git a/slack_sdk/web/legacy_base_client.py b/slack_sdk/web/legacy_base_client.py index 4b6b63027..30939e59b 100644 --- a/slack_sdk/web/legacy_base_client.py +++ b/slack_sdk/web/legacy_base_client.py @@ -113,6 +113,7 @@ def api_call( auth: Optional[dict] = None, ) -> Union[asyncio.Future, SlackResponse]: """Create a request and execute the API call to Slack. + Args: api_method (str): The target Slack API method. e.g. 'chat.postMessage' @@ -135,13 +136,13 @@ def api_call( from the response can be accessed like a dict. If the response included 'next_cursor' it can be iterated on to execute subsequent requests. + Raises: SlackApiError: The following Slack API call failed: 'chat.postMessage'. SlackRequestError: Json data can only be submitted as POST requests. """ - api_url = _get_url(self.base_url, api_method) headers = headers or {} @@ -191,6 +192,7 @@ def api_call( async def _send(self, http_verb: str, api_url: str, req_args: dict) -> SlackResponse: """Sends the request out for transmission. + Args: http_verb (str): The HTTP verb. e.g. 'GET' or 'POST'. api_url (str): The Slack API url. e.g. 'https://slack.com/api/chat.postMessage' @@ -202,6 +204,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> SlackResp 'channel': '#random' } } + Returns: The response parsed into a SlackResponse object. """ @@ -227,6 +230,7 @@ async def _send(self, http_verb: str, api_url: str, req_args: dict) -> SlackResp async def _request(self, *, http_verb, api_url, req_args) -> Dict[str, Any]: """Submit the HTTP request with the running session or a new session. + Returns: A dictionary of the response data. """ @@ -277,7 +281,8 @@ def _sync_send(self, api_url, req_args) -> SlackResponse: ) def _request_for_pagination(self, api_url: str, req_args: Dict[str, Dict[str, Any]]) -> Dict[str, Any]: - """This method is supposed to be used only for SlackResponse pagination + """This method is supposed to be used only for SlackResponse pagination. + You can paginate using Python's for iterator as below: for response in client.conversations_list(limit=100): # do something with each response here @@ -558,9 +563,9 @@ def _upload_file( @staticmethod def validate_slack_signature(*, signing_secret: str, data: str, timestamp: str, signature: str) -> bool: - """ - Slack creates a unique string for your app and shares it with you. Verify - requests from Slack with confidence by verifying signatures using your + """Slack creates a unique string for your app and shares it with you. + + Verify requests from Slack with confidence by verifying signatures using your signing secret. On each HTTP request that Slack sends, we add an X-Slack-Signature HTTP header. The signature is created by combining the signing secret with the @@ -573,6 +578,7 @@ def validate_slack_signature(*, signing_secret: str, data: str, timestamp: str, timestamp: from the 'X-Slack-Request-Timestamp' header signature: from the 'X-Slack-Signature' header - the calculated signature should match this. + Returns: True if signatures matches """ diff --git a/slack_sdk/web/legacy_client.py b/slack_sdk/web/legacy_client.py index baea445b4..4654c1f51 100644 --- a/slack_sdk/web/legacy_client.py +++ b/slack_sdk/web/legacy_client.py @@ -110,7 +110,8 @@ def admin_analytics_getFile( metadata_only: Optional[bool] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve analytics data for a given date, presented as a compressed JSON file + """Retrieve analytics data for a given date, presented as a compressed JSON file. + https://docs.slack.dev/reference/methods/admin.analytics.getFile """ kwargs.update({"type": type}) @@ -130,6 +131,7 @@ def admin_apps_approve( **kwargs, ) -> Union[Future, SlackResponse]: """Approve an app for installation on a workspace. + Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -160,6 +162,7 @@ def admin_apps_approved_list( **kwargs, ) -> Union[Future, SlackResponse]: """List approved apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.approved.list """ kwargs.update( @@ -180,7 +183,8 @@ def admin_apps_clearResolution( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Clear an app resolution + """Clear an app resolution. + https://docs.slack.dev/reference/methods/admin.apps.clearResolution """ kwargs.update( @@ -201,6 +205,7 @@ def admin_apps_requests_cancel( **kwargs, ) -> Union[Future, SlackResponse]: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.cancel """ kwargs.update( @@ -221,6 +226,7 @@ def admin_apps_requests_list( **kwargs, ) -> Union[Future, SlackResponse]: """List app requests for a team/workspace. + https://docs.slack.dev/reference/methods/admin.apps.requests.list """ kwargs.update( @@ -242,6 +248,7 @@ def admin_apps_restrict( **kwargs, ) -> Union[Future, SlackResponse]: """Restrict an app for installation on a workspace. + Exactly one of the team_id or enterprise_id arguments is required, not both. Either app_id or request_id is required. These IDs can be obtained either directly via the app_requested event, or by the admin.apps.requests.list method. @@ -272,6 +279,7 @@ def admin_apps_restricted_list( **kwargs, ) -> Union[Future, SlackResponse]: """List restricted apps for an org or workspace. + https://docs.slack.dev/reference/methods/admin.apps.restricted.list """ kwargs.update( @@ -293,6 +301,7 @@ def admin_apps_uninstall( **kwargs, ) -> Union[Future, SlackResponse]: """Uninstall an app from one or many workspaces, or an entire enterprise organization. + With an org-level token, enterprise_id or team_ids is required. https://docs.slack.dev/reference/methods/admin.apps.uninstall """ @@ -324,7 +333,8 @@ def admin_apps_activities_list( limit: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Get logs for a specified team/org + """Get logs for a specified team/org. + https://docs.slack.dev/reference/methods/admin.apps.activities.list """ kwargs.update( @@ -352,7 +362,8 @@ def admin_apps_config_lookup( app_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Look up the app config for connectors by their IDs + """Look up the app config for connectors by their IDs. + https://docs.slack.dev/reference/methods/admin.apps.config.lookup """ if isinstance(app_ids, (list, tuple)): @@ -369,7 +380,8 @@ def admin_apps_config_set( workflow_auth_strategy: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Set the app config for a connector + """Set the app config for a connector. + https://docs.slack.dev/reference/methods/admin.apps.config.set """ kwargs.update( @@ -392,6 +404,7 @@ def admin_auth_policy_getEntities( **kwargs, ) -> Union[Future, SlackResponse]: """Fetch all the entities assigned to a particular authentication policy by name. + https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities """ kwargs.update({"policy_name": policy_name}) @@ -412,6 +425,7 @@ def admin_auth_policy_assignEntities( **kwargs, ) -> Union[Future, SlackResponse]: """Assign entities to a particular authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities """ if isinstance(entity_ids, (list, tuple)): @@ -431,6 +445,7 @@ def admin_auth_policy_removeEntities( **kwargs, ) -> Union[Future, SlackResponse]: """Remove specified entities from a specified authentication policy. + https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities """ if isinstance(entity_ids, (list, tuple)): @@ -450,6 +465,7 @@ def admin_conversations_createForObjects( **kwargs, ) -> Union[Future, SlackResponse]: """Create a Salesforce channel for the corresponding object provided. + https://docs.slack.dev/reference/methods/admin.conversations.createForObjects """ kwargs.update( @@ -466,6 +482,7 @@ def admin_conversations_linkObjects( **kwargs, ) -> Union[Future, SlackResponse]: """Link a Salesforce record to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.linkObjects """ kwargs.update( @@ -485,6 +502,7 @@ def admin_conversations_unlinkObjects( **kwargs, ) -> Union[Future, SlackResponse]: """Unlink a Salesforce record from a channel. + https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects """ kwargs.update( @@ -503,7 +521,8 @@ def admin_barriers_create( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Create an Information Barrier + """Create an Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.create """ kwargs.update({"primary_usergroup_id": primary_usergroup_id}) @@ -523,7 +542,8 @@ def admin_barriers_delete( barrier_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Delete an existing Information Barrier + """Delete an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.delete """ kwargs.update({"barrier_id": barrier_id}) @@ -538,7 +558,8 @@ def admin_barriers_update( restricted_subjects: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Update an existing Information Barrier + """Update an existing Information Barrier. + https://docs.slack.dev/reference/methods/admin.barriers.update """ kwargs.update({"barrier_id": barrier_id, "primary_usergroup_id": primary_usergroup_id}) @@ -559,8 +580,10 @@ def admin_barriers_list( limit: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Get all Information Barriers for your organization - https://docs.slack.dev/reference/methods/admin.barriers.list""" + """Get all Information Barriers for your organization. + + https://docs.slack.dev/reference/methods/admin.barriers.list + """ kwargs.update( { "cursor": cursor, @@ -580,6 +603,7 @@ def admin_conversations_create( **kwargs, ) -> Union[Future, SlackResponse]: """Create a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/admin.conversations.create """ kwargs.update( @@ -600,6 +624,7 @@ def admin_conversations_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Delete a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.delete """ kwargs.update({"channel_id": channel_id}) @@ -613,6 +638,7 @@ def admin_conversations_invite( **kwargs, ) -> Union[Future, SlackResponse]: """Invite a user to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.invite """ kwargs.update({"channel_id": channel_id}) @@ -630,6 +656,7 @@ def admin_conversations_archive( **kwargs, ) -> Union[Future, SlackResponse]: """Archive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -642,6 +669,7 @@ def admin_conversations_unarchive( **kwargs, ) -> Union[Future, SlackResponse]: """Unarchive a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.archive """ kwargs.update({"channel_id": channel_id}) @@ -655,6 +683,7 @@ def admin_conversations_rename( **kwargs, ) -> Union[Future, SlackResponse]: """Rename a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.rename """ kwargs.update({"channel_id": channel_id, "name": name}) @@ -673,6 +702,7 @@ def admin_conversations_search( **kwargs, ) -> Union[Future, SlackResponse]: """Search for public or private channels in an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.conversations.search """ kwargs.update( @@ -704,6 +734,7 @@ def admin_conversations_convertToPrivate( **kwargs, ) -> Union[Future, SlackResponse]: """Convert a public channel to a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate """ kwargs.update({"channel_id": channel_id}) @@ -716,6 +747,7 @@ def admin_conversations_convertToPublic( **kwargs, ) -> Union[Future, SlackResponse]: """Convert a privte channel to a public channel. + https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic """ kwargs.update({"channel_id": channel_id}) @@ -729,6 +761,7 @@ def admin_conversations_setConversationPrefs( **kwargs, ) -> Union[Future, SlackResponse]: """Set the posting permissions for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -745,6 +778,7 @@ def admin_conversations_getConversationPrefs( **kwargs, ) -> Union[Future, SlackResponse]: """Get conversation preferences for a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs """ kwargs.update({"channel_id": channel_id}) @@ -758,6 +792,7 @@ def admin_conversations_disconnectShared( **kwargs, ) -> Union[Future, SlackResponse]: """Disconnect a connected channel from one or more workspaces. + https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared """ kwargs.update({"channel_id": channel_id}) @@ -778,6 +813,7 @@ def admin_conversations_lookup( **kwargs, ) -> Union[Future, SlackResponse]: """Returns channels on the given team using the filters. + https://docs.slack.dev/reference/methods/admin.conversations.lookup """ kwargs.update( @@ -803,9 +839,9 @@ def admin_conversations_ekm_listOriginalConnectedChannelInfo( team_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """List all disconnected channels—i.e., - channels that were once connected to other workspaces and then disconnected—and - the corresponding original channel IDs for key revocation with EKM. + """List all disconnected channels and the corresponding original channel IDs for key revocation with EKM. + + Disconnected channels are those that were once connected to other workspaces and then disconnected. https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo """ kwargs.update( @@ -833,6 +869,7 @@ def admin_conversations_restrictAccess_addGroup( **kwargs, ) -> Union[Future, SlackResponse]: """Add an allowlist of IDP groups for accessing a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup """ kwargs.update( @@ -856,6 +893,7 @@ def admin_conversations_restrictAccess_listGroups( **kwargs, ) -> Union[Future, SlackResponse]: """List all IDP Groups linked to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups """ kwargs.update( @@ -879,6 +917,7 @@ def admin_conversations_restrictAccess_removeGroup( **kwargs, ) -> Union[Future, SlackResponse]: """Remove a linked IDP group linked from a private channel. + https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup """ kwargs.update( @@ -904,6 +943,7 @@ def admin_conversations_setTeams( **kwargs, ) -> Union[Future, SlackResponse]: """Set the workspaces in an Enterprise grid org that connect to a public or private channel. + https://docs.slack.dev/reference/methods/admin.conversations.setTeams """ kwargs.update( @@ -928,6 +968,7 @@ def admin_conversations_getTeams( **kwargs, ) -> Union[Future, SlackResponse]: """Set the workspaces in an Enterprise grid org that connect to a channel. + https://docs.slack.dev/reference/methods/admin.conversations.getTeams """ kwargs.update( @@ -945,7 +986,8 @@ def admin_conversations_getCustomRetention( channel_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Get a channel's retention policy + """Get a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -957,7 +999,8 @@ def admin_conversations_removeCustomRetention( channel_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Remove a channel's retention policy + """Remove a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention """ kwargs.update({"channel_id": channel_id}) @@ -970,7 +1013,8 @@ def admin_conversations_setCustomRetention( duration_days: int, **kwargs, ) -> Union[Future, SlackResponse]: - """Set a channel's retention policy + """Set a channel's retention policy. + https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention """ kwargs.update({"channel_id": channel_id, "duration_days": duration_days}) @@ -983,6 +1027,7 @@ def admin_conversations_bulkArchive( **kwargs, ) -> Union[Future, SlackResponse]: """Archive public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -995,6 +1040,7 @@ def admin_conversations_bulkDelete( **kwargs, ) -> Union[Future, SlackResponse]: """Delete public or private channels in bulk. + https://slack.com/api/admin.conversations.bulkDelete """ kwargs.update({"channel_ids": ",".join(channel_ids) if isinstance(channel_ids, (list, tuple)) else channel_ids}) @@ -1008,6 +1054,7 @@ def admin_conversations_bulkMove( **kwargs, ) -> Union[Future, SlackResponse]: """Move public or private channels in bulk. + https://docs.slack.dev/reference/methods/admin.conversations.bulkMove """ kwargs.update( @@ -1026,6 +1073,7 @@ def admin_emoji_add( **kwargs, ) -> Union[Future, SlackResponse]: """Add an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.add """ kwargs.update({"name": name, "url": url}) @@ -1039,6 +1087,7 @@ def admin_emoji_addAlias( **kwargs, ) -> Union[Future, SlackResponse]: """Add an emoji alias. + https://docs.slack.dev/reference/methods/admin.emoji.addAlias """ kwargs.update({"alias_for": alias_for, "name": name}) @@ -1052,6 +1101,7 @@ def admin_emoji_list( **kwargs, ) -> Union[Future, SlackResponse]: """List emoji for an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1064,6 +1114,7 @@ def admin_emoji_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Remove an emoji across an Enterprise Grid organization. + https://docs.slack.dev/reference/methods/admin.emoji.remove """ kwargs.update({"name": name}) @@ -1077,6 +1128,7 @@ def admin_emoji_rename( **kwargs, ) -> Union[Future, SlackResponse]: """Rename an emoji. + https://docs.slack.dev/reference/methods/admin.emoji.rename """ kwargs.update({"name": name, "new_name": new_name}) @@ -1091,7 +1143,8 @@ def admin_functions_list( limit: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Look up functions by a set of apps + """Look up functions by a set of apps. + https://docs.slack.dev/reference/methods/admin.functions.list """ if isinstance(app_ids, (list, tuple)): @@ -1113,8 +1166,9 @@ def admin_functions_permissions_lookup( function_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Lookup the visibility of multiple Slack functions - and include the users if it is limited to particular named entities. + """Lookup the visibility of multiple Slack functions. + + Include the users if the visibility is limited to particular named entities. https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup """ if isinstance(function_ids, (list, tuple)): @@ -1131,8 +1185,8 @@ def admin_functions_permissions_set( user_ids: Optional[Union[str, Sequence[str]]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Set the visibility of a Slack function - and define the users or workspaces if it is set to named_entities + """Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities. + https://docs.slack.dev/reference/methods/admin.functions.permissions.set """ kwargs.update( @@ -1156,7 +1210,8 @@ def admin_roles_addAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Adds members to the specified role with the specified scopes + """Adds members to the specified role with the specified scopes. + https://docs.slack.dev/reference/methods/admin.roles.addAssignments """ kwargs.update({"role_id": role_id}) @@ -1181,6 +1236,7 @@ def admin_roles_listAssignments( **kwargs, ) -> Union[Future, SlackResponse]: """Lists assignments for all roles across entities. + Options to scope results by any combination of roles or entities https://docs.slack.dev/reference/methods/admin.roles.listAssignments """ @@ -1203,7 +1259,8 @@ def admin_roles_removeAssignments( user_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Removes a set of users from a role for the given scopes and entities + """Removes a set of users from a role for the given scopes and entities. + https://docs.slack.dev/reference/methods/admin.roles.removeAssignments """ kwargs.update({"role_id": role_id}) @@ -1226,6 +1283,7 @@ def admin_users_session_reset( **kwargs, ) -> Union[Future, SlackResponse]: """Wipes all valid sessions on all devices for a given user. + https://docs.slack.dev/reference/methods/admin.users.session.reset """ kwargs.update( @@ -1245,7 +1303,8 @@ def admin_users_session_resetBulk( web_only: Optional[bool] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users + """Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users. + https://docs.slack.dev/reference/methods/admin.users.session.resetBulk """ if isinstance(user_ids, (list, tuple)): @@ -1268,6 +1327,7 @@ def admin_users_session_invalidate( **kwargs, ) -> Union[Future, SlackResponse]: """Invalidate a single session for a user by session_id. + https://docs.slack.dev/reference/methods/admin.users.session.invalidate """ kwargs.update({"session_id": session_id, "team_id": team_id}) @@ -1282,7 +1342,8 @@ def admin_users_session_list( user_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Lists all active user sessions for an organization + """Lists all active user sessions for an organization. + https://docs.slack.dev/reference/methods/admin.users.session.list """ kwargs.update( @@ -1303,6 +1364,7 @@ def admin_teams_settings_setDefaultChannels( **kwargs, ) -> Union[Future, SlackResponse]: """Set the default channels of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels """ kwargs.update({"team_id": team_id}) @@ -1318,8 +1380,9 @@ def admin_users_session_getSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Get user-specific session settings—the session duration - and what happens when the client closes—given a list of users. + """Get user-specific session settings for a given list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.getSettings """ if isinstance(user_ids, (list, tuple)): @@ -1336,8 +1399,9 @@ def admin_users_session_setSettings( duration: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Configure the user-level session settings—the session duration - and what happens when the client closes—for one or more users. + """Configure the user-level session settings for one or more users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.setSettings """ if isinstance(user_ids, (list, tuple)): @@ -1358,8 +1422,9 @@ def admin_users_session_clearSettings( user_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Clear user-specific session settings—the session duration - and what happens when the client closes—for a list of users. + """Clear user-specific session settings for a list of users. + + The settings include the session duration and what happens when the client closes. https://docs.slack.dev/reference/methods/admin.users.session.clearSettings """ if isinstance(user_ids, (list, tuple)): @@ -1375,8 +1440,9 @@ def admin_users_unsupportedVersions_export( date_sessions_started: Optional[Union[str, int]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Ask Slackbot to send you an export listing all workspace members using unsupported software, - presented as a zipped CSV file. + """Ask Slackbot to send you an export listing all workspace members using unsupported software. + + The export is presented as a zipped CSV file. https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export """ kwargs.update( @@ -1395,6 +1461,7 @@ def admin_inviteRequests_approve( **kwargs, ) -> Union[Future, SlackResponse]: """Approve a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approve """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1409,6 +1476,7 @@ def admin_inviteRequests_approved_list( **kwargs, ) -> Union[Future, SlackResponse]: """List all approved workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list """ kwargs.update( @@ -1429,6 +1497,7 @@ def admin_inviteRequests_denied_list( **kwargs, ) -> Union[Future, SlackResponse]: """List all denied workspace invite requests. + https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list """ kwargs.update( @@ -1448,6 +1517,7 @@ def admin_inviteRequests_deny( **kwargs, ) -> Union[Future, SlackResponse]: """Deny a workspace invite request. + https://docs.slack.dev/reference/methods/admin.inviteRequests.deny """ kwargs.update({"invite_request_id": invite_request_id, "team_id": team_id}) @@ -1469,6 +1539,7 @@ def admin_teams_admins_list( **kwargs, ) -> Union[Future, SlackResponse]: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.inviteRequests.list """ kwargs.update( @@ -1490,6 +1561,7 @@ def admin_teams_create( **kwargs, ) -> Union[Future, SlackResponse]: """Create an Enterprise team. + https://docs.slack.dev/reference/methods/admin.teams.create """ kwargs.update( @@ -1510,6 +1582,7 @@ def admin_teams_list( **kwargs, ) -> Union[Future, SlackResponse]: """List all teams on an Enterprise organization. + https://docs.slack.dev/reference/methods/admin.teams.list """ kwargs.update({"cursor": cursor, "limit": limit}) @@ -1524,6 +1597,7 @@ def admin_teams_owners_list( **kwargs, ) -> Union[Future, SlackResponse]: """List all of the admins on a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.owners.list """ kwargs.update({"team_id": team_id, "cursor": cursor, "limit": limit}) @@ -1535,7 +1609,8 @@ def admin_teams_settings_info( team_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Fetch information about settings in a workspace + """Fetch information about settings in a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.info """ kwargs.update({"team_id": team_id}) @@ -1549,6 +1624,7 @@ def admin_teams_settings_setDescription( **kwargs, ) -> Union[Future, SlackResponse]: """Set the description of a given workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription """ kwargs.update({"team_id": team_id, "description": description}) @@ -1562,6 +1638,7 @@ def admin_teams_settings_setDiscoverability( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability """ kwargs.update({"team_id": team_id, "discoverability": discoverability}) @@ -1575,6 +1652,7 @@ def admin_teams_settings_setIcon( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon """ kwargs.update({"team_id": team_id, "image_url": image_url}) @@ -1588,6 +1666,7 @@ def admin_teams_settings_setName( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the icon of a workspace. + https://docs.slack.dev/reference/methods/admin.teams.settings.setName """ kwargs.update({"team_id": team_id, "name": name}) @@ -1602,6 +1681,7 @@ def admin_usergroups_addChannels( **kwargs, ) -> Union[Future, SlackResponse]: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addChannels """ kwargs.update({"team_id": team_id, "usergroup_id": usergroup_id}) @@ -1620,6 +1700,7 @@ def admin_usergroups_addTeams( **kwargs, ) -> Union[Future, SlackResponse]: """Associate one or more default workspaces with an organization-wide IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.addTeams """ kwargs.update({"usergroup_id": usergroup_id, "auto_provision": auto_provision}) @@ -1638,6 +1719,7 @@ def admin_usergroups_listChannels( **kwargs, ) -> Union[Future, SlackResponse]: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.listChannels """ kwargs.update( @@ -1657,6 +1739,7 @@ def admin_usergroups_removeChannels( **kwargs, ) -> Union[Future, SlackResponse]: """Add one or more default channels to an IDP group. + https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels """ kwargs.update({"usergroup_id": usergroup_id}) @@ -1677,6 +1760,7 @@ def admin_users_assign( **kwargs, ) -> Union[Future, SlackResponse]: """Add an Enterprise user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.assign """ kwargs.update( @@ -1709,6 +1793,7 @@ def admin_users_invite( **kwargs, ) -> Union[Future, SlackResponse]: """Invite a user to a workspace. + https://docs.slack.dev/reference/methods/admin.users.invite """ kwargs.update( @@ -1740,7 +1825,8 @@ def admin_users_list( limit: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """List users on a workspace + """List users on a workspace. + https://docs.slack.dev/reference/methods/admin.users.list """ kwargs.update( @@ -1762,6 +1848,7 @@ def admin_users_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Remove a user from a workspace. + https://docs.slack.dev/reference/methods/admin.users.remove """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1775,6 +1862,7 @@ def admin_users_setAdmin( **kwargs, ) -> Union[Future, SlackResponse]: """Set an existing guest, regular user, or owner to be an admin user. + https://docs.slack.dev/reference/methods/admin.users.setAdmin """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1789,6 +1877,7 @@ def admin_users_setExpiration( **kwargs, ) -> Union[Future, SlackResponse]: """Set an expiration for a guest user. + https://docs.slack.dev/reference/methods/admin.users.setExpiration """ kwargs.update({"expiration_ts": expiration_ts, "team_id": team_id, "user_id": user_id}) @@ -1802,6 +1891,7 @@ def admin_users_setOwner( **kwargs, ) -> Union[Future, SlackResponse]: """Set an existing guest, regular user, or admin user to be a workspace owner. + https://docs.slack.dev/reference/methods/admin.users.setOwner """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1815,6 +1905,7 @@ def admin_users_setRegular( **kwargs, ) -> Union[Future, SlackResponse]: """Set an existing guest user, admin user, or owner to be a regular user. + https://docs.slack.dev/reference/methods/admin.users.setRegular """ kwargs.update({"team_id": team_id, "user_id": user_id}) @@ -1835,7 +1926,8 @@ def admin_workflows_search( source: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Search workflows within the team or enterprise + """Search workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.search """ if collaborator_ids is not None: @@ -1865,7 +1957,8 @@ def admin_workflows_permissions_lookup( max_workflow_triggers: Optional[int] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Look up the permissions for a set of workflows + """Look up the permissions for a set of workflows. + https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup """ if isinstance(workflow_ids, (list, tuple)): @@ -1886,7 +1979,8 @@ def admin_workflows_collaborators_add( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Add collaborators to workflows within the team or enterprise + """Add collaborators to workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add """ if isinstance(collaborator_ids, (list, tuple)): @@ -1906,7 +2000,8 @@ def admin_workflows_collaborators_remove( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Remove collaborators from workflows within the team or enterprise + """Remove collaborators from workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove """ if isinstance(collaborator_ids, (list, tuple)): @@ -1925,7 +2020,8 @@ def admin_workflows_unpublish( workflow_ids: Union[str, Sequence[str]], **kwargs, ) -> Union[Future, SlackResponse]: - """Unpublish workflows within the team or enterprise + """Unpublish workflows within the team or enterprise. + https://docs.slack.dev/reference/methods/admin.workflows.unpublish """ if isinstance(workflow_ids, (list, tuple)): @@ -1943,6 +2039,7 @@ def agents_sessions_rename( **kwargs, ) -> Union[Future, SlackResponse]: """Rename an agent session. + https://docs.slack.dev/reference/methods/agents.sessions.rename """ kwargs.update( @@ -1969,6 +2066,7 @@ def agents_sessions_setStatus( **kwargs, ) -> Union[Future, SlackResponse]: """Set an agent session's lifecycle status, creating the session if needed. + https://docs.slack.dev/reference/methods/agents.sessions.setStatus """ kwargs.update( @@ -1993,6 +2091,7 @@ def api_test( **kwargs, ) -> Union[Future, SlackResponse]: """Checks API calling code. + https://docs.slack.dev/reference/methods/api.test """ kwargs.update({"error": error}) @@ -2004,8 +2103,9 @@ def apps_connections_open( app_token: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Generate a temporary Socket Mode WebSocket URL that your app can connect to - in order to receive events and interactive payloads + """Generate a temporary Socket Mode WebSocket URL for your app. + + Your app connects to this URL to receive events and interactive payloads. https://docs.slack.dev/reference/methods/apps.connections.open """ kwargs.update({"token": app_token}) @@ -2020,6 +2120,7 @@ def apps_event_authorizations_list( **kwargs, ) -> Union[Future, SlackResponse]: """Get a list of authorizations for the given event context. + Each authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list """ @@ -2034,6 +2135,7 @@ def apps_uninstall( **kwargs, ) -> Union[Future, SlackResponse]: """Uninstalls your app from a workspace. + https://docs.slack.dev/reference/methods/apps.uninstall """ kwargs.update({"client_id": client_id, "client_secret": client_secret}) @@ -2045,7 +2147,8 @@ def apps_manifest_create( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> Union[Future, SlackResponse]: - """Create an app from an app manifest + """Create an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.create """ if isinstance(manifest, str): @@ -2060,7 +2163,8 @@ def apps_manifest_delete( app_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Permanently deletes an app created through app manifests + """Permanently deletes an app created through app manifests. + https://docs.slack.dev/reference/methods/apps.manifest.delete """ kwargs.update({"app_id": app_id}) @@ -2072,7 +2176,8 @@ def apps_manifest_export( app_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Export an app manifest from an existing app + """Export an app manifest from an existing app. + https://docs.slack.dev/reference/methods/apps.manifest.export """ kwargs.update({"app_id": app_id}) @@ -2085,7 +2190,8 @@ def apps_manifest_update( manifest: Union[str, Dict[str, Any]], **kwargs, ) -> Union[Future, SlackResponse]: - """Update an app from an app manifest + """Update an app from an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.update """ if isinstance(manifest, str): @@ -2102,7 +2208,8 @@ def apps_manifest_validate( app_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Validate an app manifest + """Validate an app manifest. + https://docs.slack.dev/reference/methods/apps.manifest.validate """ if isinstance(manifest, str): @@ -2120,6 +2227,7 @@ def apps_user_connection_update( **kwargs, ) -> Union[Future, SlackResponse]: """Updates the connection status between a user and an app. + https://docs.slack.dev/reference/methods/apps.user.connection.update """ kwargs.update({"user_id": user_id, "status": status}) @@ -2131,7 +2239,8 @@ def tooling_tokens_rotate( refresh_token: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Exchanges a refresh token for a new app configuration token + """Exchanges a refresh token for a new app configuration token. + https://docs.slack.dev/reference/methods/tooling.tokens.rotate """ kwargs.update({"refresh_token": refresh_token}) @@ -2150,6 +2259,7 @@ def assistant_threads_setStatus( **kwargs, ) -> Union[Future, SlackResponse]: """Set the status for an AI assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setStatus """ kwargs.update( @@ -2175,6 +2285,7 @@ def assistant_threads_setTitle( **kwargs, ) -> Union[Future, SlackResponse]: """Set the title for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setTitle """ kwargs.update({"channel_id": channel_id, "thread_ts": thread_ts, "title": title}) @@ -2190,6 +2301,7 @@ def assistant_threads_setSuggestedPrompts( **kwargs, ) -> Union[Future, SlackResponse]: """Set suggested prompts for the given assistant thread. + https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts """ kwargs.update({"channel_id": channel_id, "prompts": prompts}) @@ -2206,6 +2318,7 @@ def auth_revoke( **kwargs, ) -> Union[Future, SlackResponse]: """Revokes a token. + https://docs.slack.dev/reference/methods/auth.revoke """ kwargs.update({"test": test}) @@ -2216,6 +2329,7 @@ def auth_test( **kwargs, ) -> Union[Future, SlackResponse]: """Checks authentication & identity. + https://docs.slack.dev/reference/methods/auth.test """ return self.api_call("auth.test", params=kwargs) @@ -2228,6 +2342,7 @@ def auth_teams_list( **kwargs, ) -> Union[Future, SlackResponse]: """List the workspaces a token can access. + https://docs.slack.dev/reference/methods/auth.teams.list """ kwargs.update({"cursor": cursor, "limit": limit, "include_icon": include_icon}) @@ -2242,6 +2357,7 @@ def blocks_validate( **kwargs, ) -> Union[Future, SlackResponse]: """Validates an array of blocks, or a message or view payload. + Provide exactly one of ``blocks``, ``message``, or ``view``. https://docs.slack.dev/reference/methods/blocks.validate """ @@ -2272,6 +2388,7 @@ def bookmarks_add( **kwargs, ) -> Union[Future, SlackResponse]: """Add bookmark to a channel. + https://docs.slack.dev/reference/methods/bookmarks.add """ kwargs.update( @@ -2298,6 +2415,7 @@ def bookmarks_edit( **kwargs, ) -> Union[Future, SlackResponse]: """Edit bookmark. + https://docs.slack.dev/reference/methods/bookmarks.edit """ kwargs.update( @@ -2318,6 +2436,7 @@ def bookmarks_list( **kwargs, ) -> Union[Future, SlackResponse]: """List bookmark for the channel. + https://docs.slack.dev/reference/methods/bookmarks.list """ kwargs.update({"channel_id": channel_id}) @@ -2331,6 +2450,7 @@ def bookmarks_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Remove bookmark from the channel. + https://docs.slack.dev/reference/methods/bookmarks.remove """ kwargs.update({"bookmark_id": bookmark_id, "channel_id": channel_id}) @@ -2344,6 +2464,7 @@ def bots_info( **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about a bot user. + https://docs.slack.dev/reference/methods/bots.info """ kwargs.update({"bot": bot, "team_id": team_id}) @@ -2363,6 +2484,7 @@ def calls_add( **kwargs, ) -> Union[Future, SlackResponse]: """Registers a new Call. + https://docs.slack.dev/reference/methods/calls.add """ kwargs.update( @@ -2390,6 +2512,7 @@ def calls_end( **kwargs, ) -> Union[Future, SlackResponse]: """Ends a Call. + https://docs.slack.dev/reference/methods/calls.end """ kwargs.update({"id": id, "duration": duration}) @@ -2402,6 +2525,7 @@ def calls_info( **kwargs, ) -> Union[Future, SlackResponse]: """Returns information about a Call. + https://docs.slack.dev/reference/methods/calls.info """ kwargs.update({"id": id}) @@ -2415,6 +2539,7 @@ def calls_participants_add( **kwargs, ) -> Union[Future, SlackResponse]: """Registers new participants added to a Call. + https://docs.slack.dev/reference/methods/calls.participants.add """ kwargs.update({"id": id}) @@ -2429,6 +2554,7 @@ def calls_participants_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Registers participants removed from a Call. + https://docs.slack.dev/reference/methods/calls.participants.remove """ kwargs.update({"id": id}) @@ -2445,6 +2571,7 @@ def calls_update( **kwargs, ) -> Union[Future, SlackResponse]: """Updates information about a Call. + https://docs.slack.dev/reference/methods/calls.update """ kwargs.update( @@ -2464,7 +2591,8 @@ def canvases_create( document_content: Dict[str, str], **kwargs, ) -> Union[Future, SlackResponse]: - """Create Canvas for a user + """Create Canvas for a user. + https://docs.slack.dev/reference/methods/canvases.create """ kwargs.update({"title": title, "document_content": document_content}) @@ -2477,7 +2605,8 @@ def canvases_edit( changes: Sequence[Dict[str, Any]], **kwargs, ) -> Union[Future, SlackResponse]: - """Update an existing canvas + """Update an existing canvas. + https://docs.slack.dev/reference/methods/canvases.edit """ kwargs.update({"canvas_id": canvas_id, "changes": changes}) @@ -2489,7 +2618,8 @@ def canvases_delete( canvas_id: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Deletes a canvas + """Deletes a canvas. + https://docs.slack.dev/reference/methods/canvases.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2504,7 +2634,8 @@ def canvases_access_set( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Sets the access level to a canvas for specified entities + """Sets the access level to a canvas for specified entities. + https://docs.slack.dev/reference/methods/canvases.access.set """ kwargs.update({"canvas_id": canvas_id, "access_level": access_level}) @@ -2529,7 +2660,8 @@ def canvases_access_delete( user_ids: Optional[Union[Sequence[str], str]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/canvases.access.delete """ kwargs.update({"canvas_id": canvas_id}) @@ -2552,7 +2684,8 @@ def canvases_sections_lookup( criteria: Dict[str, Any], **kwargs, ) -> Union[Future, SlackResponse]: - """Find sections matching the provided criteria + """Find sections matching the provided criteria. + https://docs.slack.dev/reference/methods/canvases.sections.lookup """ kwargs.update({"canvas_id": canvas_id, "criteria": json.dumps(criteria)}) @@ -2690,7 +2823,7 @@ def channels_replies( thread_ts: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a thread of messages posted to a channel""" + """Retrieve a thread of messages posted to a channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("channels.replies", http_verb="GET", params=kwargs) @@ -2741,6 +2874,7 @@ def chat_appendStream( **kwargs, ) -> Union[Future, SlackResponse]: """Appends text to an existing streaming conversation. + https://docs.slack.dev/reference/methods/chat.appendStream """ kwargs.update( @@ -2764,6 +2898,7 @@ def chat_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes a message. + https://docs.slack.dev/reference/methods/chat.delete """ kwargs.update({"channel": channel, "ts": ts, "as_user": as_user}) @@ -2778,6 +2913,7 @@ def chat_deleteScheduledMessage( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes a scheduled message. + https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage """ kwargs.update( @@ -2796,7 +2932,8 @@ def chat_getPermalink( message_ts: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a permalink URL for a specific extant message + """Retrieve a permalink URL for a specific extant message. + https://docs.slack.dev/reference/methods/chat.getPermalink """ kwargs.update({"channel": channel, "message_ts": message_ts}) @@ -2810,6 +2947,7 @@ def chat_meMessage( **kwargs, ) -> Union[Future, SlackResponse]: """Share a me message into a channel. + https://docs.slack.dev/reference/methods/chat.meMessage """ kwargs.update({"channel": channel, "text": text}) @@ -2834,6 +2972,7 @@ def chat_postEphemeral( **kwargs, ) -> Union[Future, SlackResponse]: """Sends an ephemeral message to a user in a channel. + https://docs.slack.dev/reference/methods/chat.postEphemeral """ kwargs.update( @@ -2883,6 +3022,7 @@ def chat_postMessage( **kwargs, ) -> Union[Future, SlackResponse]: """Sends a message to a channel. + https://docs.slack.dev/reference/methods/chat.postMessage """ kwargs.update( @@ -2933,6 +3073,7 @@ def chat_scheduleMessage( **kwargs, ) -> Union[Future, SlackResponse]: """Schedules a message. + https://docs.slack.dev/reference/methods/chat.scheduleMessage """ kwargs.update( @@ -2971,6 +3112,7 @@ def chat_scheduledMessages_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists all scheduled messages. + https://docs.slack.dev/reference/methods/chat.scheduledMessages.list """ kwargs.update( @@ -3001,6 +3143,7 @@ def chat_startStream( **kwargs, ) -> Union[Future, SlackResponse]: """Starts a new streaming conversation. + https://docs.slack.dev/reference/methods/chat.startStream """ kwargs.update( @@ -3034,6 +3177,7 @@ def chat_stopStream( **kwargs, ) -> Union[Future, SlackResponse]: """Stops a streaming conversation. + https://docs.slack.dev/reference/methods/chat.stopStream """ kwargs.update( @@ -3067,6 +3211,7 @@ def chat_unfurl( **kwargs, ) -> Union[Future, SlackResponse]: """Provide custom unfurl behavior for user-posted URLs. + https://docs.slack.dev/reference/methods/chat.unfurl """ kwargs.update( @@ -3106,6 +3251,7 @@ def chat_update( **kwargs, ) -> Union[Future, SlackResponse]: """Updates a message in a channel. + https://docs.slack.dev/reference/methods/chat.update """ kwargs.update( @@ -3145,6 +3291,7 @@ def conversations_acceptSharedInvite( **kwargs, ) -> Union[Future, SlackResponse]: """Accepts an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite """ if channel_id is None and invite_id is None: @@ -3169,6 +3316,7 @@ def conversations_approveSharedInvite( **kwargs, ) -> Union[Future, SlackResponse]: """Approves an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.approveSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3181,6 +3329,7 @@ def conversations_archive( **kwargs, ) -> Union[Future, SlackResponse]: """Archives a conversation. + https://docs.slack.dev/reference/methods/conversations.archive """ kwargs.update({"channel": channel}) @@ -3193,6 +3342,7 @@ def conversations_close( **kwargs, ) -> Union[Future, SlackResponse]: """Closes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.close """ kwargs.update({"channel": channel}) @@ -3206,7 +3356,8 @@ def conversations_create( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Initiates a public or private channel-based conversation + """Initiates a public or private channel-based conversation. + https://docs.slack.dev/reference/methods/conversations.create """ kwargs.update({"name": name, "is_private": is_private, "team_id": team_id}) @@ -3220,6 +3371,7 @@ def conversations_declineSharedInvite( **kwargs, ) -> Union[Future, SlackResponse]: """Declines a Slack Connect channel invite. + https://docs.slack.dev/reference/methods/conversations.declineSharedInvite """ kwargs.update({"invite_id": invite_id, "target_team": target_team}) @@ -3229,6 +3381,7 @@ def conversations_externalInvitePermissions_set( self, *, action: str, channel: str, target_team: str, **kwargs ) -> Union[Future, SlackResponse]: """Sets a team in a shared External Limited channel to a shared Slack Connect channel or vice versa. + https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set """ kwargs.update( @@ -3253,6 +3406,7 @@ def conversations_history( **kwargs, ) -> Union[Future, SlackResponse]: """Fetches a conversation's history of messages and events. + https://docs.slack.dev/reference/methods/conversations.history """ kwargs.update( @@ -3277,6 +3431,7 @@ def conversations_info( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve information about a conversation. + https://docs.slack.dev/reference/methods/conversations.info """ kwargs.update( @@ -3297,6 +3452,7 @@ def conversations_invite( **kwargs, ) -> Union[Future, SlackResponse]: """Invites users to a channel. + https://docs.slack.dev/reference/methods/conversations.invite """ kwargs.update( @@ -3320,6 +3476,7 @@ def conversations_inviteShared( **kwargs, ) -> Union[Future, SlackResponse]: """Sends an invitation to a Slack Connect channel. + https://docs.slack.dev/reference/methods/conversations.inviteShared """ if emails is None and user_ids is None: @@ -3342,6 +3499,7 @@ def conversations_join( **kwargs, ) -> Union[Future, SlackResponse]: """Joins an existing conversation. + https://docs.slack.dev/reference/methods/conversations.join """ kwargs.update({"channel": channel}) @@ -3355,6 +3513,7 @@ def conversations_kick( **kwargs, ) -> Union[Future, SlackResponse]: """Removes a user from a conversation. + https://docs.slack.dev/reference/methods/conversations.kick """ kwargs.update({"channel": channel, "user": user}) @@ -3367,6 +3526,7 @@ def conversations_leave( **kwargs, ) -> Union[Future, SlackResponse]: """Leaves a conversation. + https://docs.slack.dev/reference/methods/conversations.leave """ kwargs.update({"channel": channel}) @@ -3383,6 +3543,7 @@ def conversations_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists all channels in a Slack team. + https://docs.slack.dev/reference/methods/conversations.list """ kwargs.update( @@ -3407,8 +3568,8 @@ def conversations_listConnectInvites( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """List shared channel invites that have been generated - or received but have not yet been approved by all parties. + """List shared channel invites that have been generated or received but have not yet been approved by all parties. + https://docs.slack.dev/reference/methods/conversations.listConnectInvites """ kwargs.update({"count": count, "cursor": cursor, "team_id": team_id}) @@ -3422,6 +3583,7 @@ def conversations_mark( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the read cursor in a channel. + https://docs.slack.dev/reference/methods/conversations.mark """ kwargs.update({"channel": channel, "ts": ts}) @@ -3436,6 +3598,7 @@ def conversations_members( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve members of a conversation. + https://docs.slack.dev/reference/methods/conversations.members """ kwargs.update({"channel": channel, "cursor": cursor, "limit": limit}) @@ -3450,6 +3613,7 @@ def conversations_open( **kwargs, ) -> Union[Future, SlackResponse]: """Opens or resumes a direct message or multi-person direct message. + https://docs.slack.dev/reference/methods/conversations.open """ if channel is None and users is None: @@ -3469,6 +3633,7 @@ def conversations_rename( **kwargs, ) -> Union[Future, SlackResponse]: """Renames a conversation. + https://docs.slack.dev/reference/methods/conversations.rename """ kwargs.update({"channel": channel, "name": name}) @@ -3487,7 +3652,8 @@ def conversations_replies( oldest: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a thread of messages posted to a conversation + """Retrieve a thread of messages posted to a conversation. + https://docs.slack.dev/reference/methods/conversations.replies """ kwargs.update( @@ -3514,6 +3680,7 @@ def conversations_requestSharedInvite_approve( **kwargs, ) -> Union[Future, SlackResponse]: """Approve a request to add an external user to a channel. This also sends them a Slack Connect invite. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve """ kwargs.update( @@ -3535,6 +3702,7 @@ def conversations_requestSharedInvite_deny( **kwargs, ) -> Union[Future, SlackResponse]: """Deny a request to invite an external user to a channel. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny """ kwargs.update({"invite_id": invite_id, "message": message}) @@ -3553,6 +3721,7 @@ def conversations_requestSharedInvite_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists requests to add external users to channels with ability to filter. + https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list """ kwargs.update( @@ -3580,6 +3749,7 @@ def conversations_setPurpose( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the purpose for a conversation. + https://docs.slack.dev/reference/methods/conversations.setPurpose """ kwargs.update({"channel": channel, "purpose": purpose}) @@ -3593,6 +3763,7 @@ def conversations_setTopic( **kwargs, ) -> Union[Future, SlackResponse]: """Sets the topic for a conversation. + https://docs.slack.dev/reference/methods/conversations.setTopic """ kwargs.update({"channel": channel, "topic": topic}) @@ -3605,6 +3776,7 @@ def conversations_unarchive( **kwargs, ) -> Union[Future, SlackResponse]: """Reverses conversation archival. + https://docs.slack.dev/reference/methods/conversations.unarchive """ kwargs.update({"channel": channel}) @@ -3617,7 +3789,8 @@ def conversations_canvases_create( document_content: Dict[str, str], **kwargs, ) -> Union[Future, SlackResponse]: - """Create a Channel Canvas for a channel + """Create a Channel Canvas for a channel. + https://docs.slack.dev/reference/methods/conversations.canvases.create """ kwargs.update({"channel_id": channel_id, "document_content": document_content}) @@ -3631,6 +3804,7 @@ def dialog_open( **kwargs, ) -> Union[Future, SlackResponse]: """Open a dialog with a user. + https://docs.slack.dev/reference/methods/dialog.open """ kwargs.update({"dialog": dialog, "trigger_id": trigger_id}) @@ -3643,6 +3817,7 @@ def dnd_endDnd( **kwargs, ) -> Union[Future, SlackResponse]: """Ends the current user's Do Not Disturb session immediately. + https://docs.slack.dev/reference/methods/dnd.endDnd """ return self.api_call("dnd.endDnd", params=kwargs) @@ -3652,6 +3827,7 @@ def dnd_endSnooze( **kwargs, ) -> Union[Future, SlackResponse]: """Ends the current user's snooze mode immediately. + https://docs.slack.dev/reference/methods/dnd.endSnooze """ return self.api_call("dnd.endSnooze", params=kwargs) @@ -3664,6 +3840,7 @@ def dnd_info( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieves a user's current Do Not Disturb status. + https://docs.slack.dev/reference/methods/dnd.info """ kwargs.update({"team_id": team_id, "user": user}) @@ -3676,6 +3853,7 @@ def dnd_setSnooze( **kwargs, ) -> Union[Future, SlackResponse]: """Turns on Do Not Disturb mode for the current user, or changes its duration. + https://docs.slack.dev/reference/methods/dnd.setSnooze """ kwargs.update({"num_minutes": num_minutes}) @@ -3688,6 +3866,7 @@ def dnd_teamInfo( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieves the Do Not Disturb status for users on a team. + https://docs.slack.dev/reference/methods/dnd.teamInfo """ if isinstance(users, (list, tuple)): @@ -3703,6 +3882,7 @@ def emoji_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists custom emoji for a team. + https://docs.slack.dev/reference/methods/emoji.list """ kwargs.update({"include_categories": include_categories}) @@ -3718,6 +3898,7 @@ def entity_presentDetails( **kwargs, ) -> Union[Future, SlackResponse]: """Provides entity details for the flexpane. + https://docs.slack.dev/reference/methods/entity.presentDetails/ """ kwargs.update({"trigger_id": trigger_id}) @@ -3740,6 +3921,7 @@ def files_comments_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes an existing comment on a file. + https://docs.slack.dev/reference/methods/files.comments.delete """ kwargs.update({"file": file, "id": id}) @@ -3752,6 +3934,7 @@ def files_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes a file. + https://docs.slack.dev/reference/methods/files.delete """ kwargs.update({"file": file}) @@ -3768,6 +3951,7 @@ def files_info( **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about a team file. + https://docs.slack.dev/reference/methods/files.info """ kwargs.update( @@ -3796,6 +3980,7 @@ def files_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists & filters team files. + https://docs.slack.dev/reference/methods/files.list """ kwargs.update( @@ -3824,6 +4009,7 @@ def files_remote_info( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.info """ kwargs.update({"external_id": external_id, "file": file}) @@ -3840,6 +4026,7 @@ def files_remote_list( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve information about a remote file added to Slack. + https://docs.slack.dev/reference/methods/files.remote.list """ kwargs.update( @@ -3865,6 +4052,7 @@ def files_remote_add( **kwargs, ) -> Union[Future, SlackResponse]: """Adds a file from a remote service. + https://docs.slack.dev/reference/methods/files.remote.add """ kwargs.update( @@ -3904,6 +4092,7 @@ def files_remote_update( **kwargs, ) -> Union[Future, SlackResponse]: """Updates an existing remote file. + https://docs.slack.dev/reference/methods/files.remote.update """ kwargs.update( @@ -3939,6 +4128,7 @@ def files_remote_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Remove a remote file. + https://docs.slack.dev/reference/methods/files.remote.remove """ kwargs.update({"external_id": external_id, "file": file}) @@ -3953,6 +4143,7 @@ def files_remote_share( **kwargs, ) -> Union[Future, SlackResponse]: """Share a remote file into a channel. + https://docs.slack.dev/reference/methods/files.remote.share """ if external_id is None and file is None: @@ -3970,7 +4161,8 @@ def files_revokePublicURL( file: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Revokes public/external sharing access for a file + """Revokes public/external sharing access for a file. + https://docs.slack.dev/reference/methods/files.revokePublicURL """ kwargs.update({"file": file}) @@ -3983,6 +4175,7 @@ def files_sharedPublicURL( **kwargs, ) -> Union[Future, SlackResponse]: """Enables a file for public/external sharing. + https://docs.slack.dev/reference/methods/files.sharedPublicURL """ kwargs.update({"file": file}) @@ -4002,6 +4195,7 @@ def files_upload( **kwargs, ) -> Union[Future, SlackResponse]: """Uploads or creates a file. + https://docs.slack.dev/reference/methods/files.upload """ _print_files_upload_v2_suggestion() @@ -4054,7 +4248,7 @@ def files_upload_v2( request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> Union[Future, SlackResponse]: - """This wrapper method provides an easy way to upload files using the following endpoints: + """Provide an easy way to upload files using the following endpoints. - step1: https://docs.slack.dev/reference/methods/files.getUploadURLExternal @@ -4148,6 +4342,7 @@ def files_getUploadURLExternal( **kwargs, ) -> Union[Future, SlackResponse]: """Gets a URL for an edge external upload. + https://docs.slack.dev/reference/methods/files.getUploadURLExternal """ kwargs.update( @@ -4171,6 +4366,7 @@ def files_completeUploadExternal( **kwargs, ) -> Union[Future, SlackResponse]: """Finishes an upload started with files.getUploadURLExternal. + https://docs.slack.dev/reference/methods/files.completeUploadExternal """ _files = [{k: v for k, v in f.items() if v is not None} for f in files] @@ -4193,7 +4389,8 @@ def functions_completeSuccess( outputs: Dict[str, Any], **kwargs, ) -> Union[Future, SlackResponse]: - """Signal the successful completion of a function + """Signal the successful completion of a function. + https://docs.slack.dev/reference/methods/functions.completeSuccess """ kwargs.update({"function_execution_id": function_execution_id, "outputs": json.dumps(outputs)}) @@ -4206,7 +4403,8 @@ def functions_completeError( error: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Signal the failure to execute a function + """Signal the failure to execute a function. + https://docs.slack.dev/reference/methods/functions.completeError """ kwargs.update({"function_execution_id": function_execution_id, "error": error}) @@ -4354,7 +4552,7 @@ def groups_replies( thread_ts: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a thread of messages posted to a private channel""" + """Retrieve a thread of messages posted to a private channel.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("groups.replies", http_verb="GET", params=kwargs) @@ -4457,7 +4655,7 @@ def im_replies( thread_ts: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a thread of messages posted to a direct message conversation""" + """Retrieve a thread of messages posted to a direct message conversation.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("im.replies", http_verb="GET", params=kwargs) @@ -4471,7 +4669,8 @@ def migration_exchange( to_old: Optional[bool] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """For Enterprise Grid workspaces, map local user IDs to global user IDs + """For Enterprise Grid workspaces, map local user IDs to global user IDs. + https://docs.slack.dev/reference/methods/migration.exchange """ if isinstance(users, (list, tuple)): @@ -4547,9 +4746,7 @@ def mpim_replies( thread_ts: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Retrieve a thread of messages posted to a direct message conversation from a - multiparty direct message. - """ + """Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.""" kwargs.update({"channel": channel, "thread_ts": thread_ts}) return self.api_call("mpim.replies", http_verb="GET", params=kwargs) @@ -4571,6 +4768,7 @@ def oauth_v2_access( **kwargs, ) -> Union[Future, SlackResponse]: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.v2.access """ if redirect_uri is not None: @@ -4597,6 +4795,7 @@ def oauth_access( **kwargs, ) -> Union[Future, SlackResponse]: """Exchanges a temporary OAuth verifier code for an access token. + https://docs.slack.dev/reference/methods/oauth.access """ if redirect_uri is not None: @@ -4616,7 +4815,8 @@ def oauth_v2_exchange( client_secret: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Exchanges a legacy access token for a new expiring access token and refresh token + """Exchanges a legacy access token for a new expiring access token and refresh token. + https://docs.slack.dev/reference/methods/oauth.v2.exchange """ kwargs.update({"client_id": client_id, "client_secret": client_secret, "token": token}) @@ -4633,6 +4833,7 @@ def openid_connect_token( **kwargs, ) -> Union[Future, SlackResponse]: """Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.token """ if redirect_uri is not None: @@ -4654,6 +4855,7 @@ def openid_connect_userInfo( **kwargs, ) -> Union[Future, SlackResponse]: """Get the identity of a user who has authorized Sign in with Slack. + https://docs.slack.dev/reference/methods/openid.connect.userInfo """ return self.api_call("openid.connect.userInfo", params=kwargs) @@ -4666,6 +4868,7 @@ def pins_add( **kwargs, ) -> Union[Future, SlackResponse]: """Pins an item to a channel. + https://docs.slack.dev/reference/methods/pins.add """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4678,6 +4881,7 @@ def pins_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists items pinned to a channel. + https://docs.slack.dev/reference/methods/pins.list """ kwargs.update({"channel": channel}) @@ -4691,6 +4895,7 @@ def pins_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Un-pins an item from a channel. + https://docs.slack.dev/reference/methods/pins.remove """ kwargs.update({"channel": channel, "timestamp": timestamp}) @@ -4705,6 +4910,7 @@ def reactions_add( **kwargs, ) -> Union[Future, SlackResponse]: """Adds a reaction to an item. + https://docs.slack.dev/reference/methods/reactions.add """ kwargs.update({"channel": channel, "name": name, "timestamp": timestamp}) @@ -4721,6 +4927,7 @@ def reactions_get( **kwargs, ) -> Union[Future, SlackResponse]: """Gets reactions for an item. + https://docs.slack.dev/reference/methods/reactions.get """ kwargs.update( @@ -4747,6 +4954,7 @@ def reactions_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists reactions made by a user. + https://docs.slack.dev/reference/methods/reactions.list """ kwargs.update( @@ -4773,6 +4981,7 @@ def reactions_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Removes a reaction from an item. + https://docs.slack.dev/reference/methods/reactions.remove """ kwargs.update( @@ -4797,6 +5006,7 @@ def reminders_add( **kwargs, ) -> Union[Future, SlackResponse]: """Creates a reminder. + https://docs.slack.dev/reference/methods/reminders.add """ kwargs.update( @@ -4818,6 +5028,7 @@ def reminders_complete( **kwargs, ) -> Union[Future, SlackResponse]: """Marks a reminder as complete. + https://docs.slack.dev/reference/methods/reminders.complete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4831,6 +5042,7 @@ def reminders_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes a reminder. + https://docs.slack.dev/reference/methods/reminders.delete """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4844,6 +5056,7 @@ def reminders_info( **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about a reminder. + https://docs.slack.dev/reference/methods/reminders.info """ kwargs.update({"reminder": reminder, "team_id": team_id}) @@ -4856,6 +5069,7 @@ def reminders_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists all reminders created by or for a given user. + https://docs.slack.dev/reference/methods/reminders.list """ kwargs.update({"team_id": team_id}) @@ -4869,6 +5083,7 @@ def rtm_connect( **kwargs, ) -> Union[Future, SlackResponse]: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.connect """ kwargs.update({"batch_presence_aware": batch_presence_aware, "presence_sub": presence_sub}) @@ -4887,6 +5102,7 @@ def rtm_start( **kwargs, ) -> Union[Future, SlackResponse]: """Starts a Real Time Messaging session. + https://docs.slack.dev/reference/methods/rtm.start """ kwargs.update( @@ -4915,6 +5131,7 @@ def search_all( **kwargs, ) -> Union[Future, SlackResponse]: """Searches for messages and files matching a query. + https://docs.slack.dev/reference/methods/search.all """ kwargs.update( @@ -4943,6 +5160,7 @@ def search_files( **kwargs, ) -> Union[Future, SlackResponse]: """Searches for files matching a query. + https://docs.slack.dev/reference/methods/search.files """ kwargs.update( @@ -4972,6 +5190,7 @@ def search_messages( **kwargs, ) -> Union[Future, SlackResponse]: """Searches for messages matching a query. + https://docs.slack.dev/reference/methods/search.messages """ kwargs.update( @@ -4997,6 +5216,7 @@ def slackLists_access_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Revoke access to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.delete """ kwargs.update({"list_id": list_id, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5013,6 +5233,7 @@ def slackLists_access_set( **kwargs, ) -> Union[Future, SlackResponse]: """Set the access level to a List for specified entities. + https://docs.slack.dev/reference/methods/slackLists.access.set """ kwargs.update({"list_id": list_id, "access_level": access_level, "channel_ids": channel_ids, "user_ids": user_ids}) @@ -5031,6 +5252,7 @@ def slackLists_create( **kwargs, ) -> Union[Future, SlackResponse]: """Creates a List. + https://docs.slack.dev/reference/methods/slackLists.create """ kwargs.update( @@ -5054,6 +5276,7 @@ def slackLists_download_get( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve List download URL from an export job to download List contents. + https://docs.slack.dev/reference/methods/slackLists.download.get """ kwargs.update( @@ -5073,6 +5296,7 @@ def slackLists_download_start( **kwargs, ) -> Union[Future, SlackResponse]: """Initiate a job to export List contents. + https://docs.slack.dev/reference/methods/slackLists.download.start """ kwargs.update( @@ -5094,6 +5318,7 @@ def slackLists_items_create( **kwargs, ) -> Union[Future, SlackResponse]: """Add a new item to an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.create """ kwargs.update( @@ -5115,6 +5340,7 @@ def slackLists_items_delete( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes an item from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.delete """ kwargs.update( @@ -5134,6 +5360,7 @@ def slackLists_items_deleteMultiple( **kwargs, ) -> Union[Future, SlackResponse]: """Deletes multiple items from an existing List. + https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple """ kwargs.update( @@ -5154,6 +5381,7 @@ def slackLists_items_info( **kwargs, ) -> Union[Future, SlackResponse]: """Get a row from a List. + https://docs.slack.dev/reference/methods/slackLists.items.info """ kwargs.update( @@ -5176,6 +5404,7 @@ def slackLists_items_list( **kwargs, ) -> Union[Future, SlackResponse]: """Get records from a List. + https://docs.slack.dev/reference/methods/slackLists.items.list """ kwargs.update( @@ -5197,6 +5426,7 @@ def slackLists_items_update( **kwargs, ) -> Union[Future, SlackResponse]: """Updates cells in a List. + https://docs.slack.dev/reference/methods/slackLists.items.update """ kwargs.update( @@ -5218,6 +5448,7 @@ def slackLists_update( **kwargs, ) -> Union[Future, SlackResponse]: """Update a List. + https://docs.slack.dev/reference/methods/slackLists.update """ kwargs.update( @@ -5241,6 +5472,7 @@ def stars_add( **kwargs, ) -> Union[Future, SlackResponse]: """Adds a star to an item. + https://docs.slack.dev/reference/methods/stars.add """ kwargs.update( @@ -5264,6 +5496,7 @@ def stars_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists stars for a user. + https://docs.slack.dev/reference/methods/stars.list """ kwargs.update( @@ -5287,6 +5520,7 @@ def stars_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Removes a star from an item. + https://docs.slack.dev/reference/methods/stars.remove """ kwargs.update( @@ -5311,6 +5545,7 @@ def team_accessLogs( **kwargs, ) -> Union[Future, SlackResponse]: """Gets the access logs for the current team. + https://docs.slack.dev/reference/methods/team.accessLogs """ kwargs.update( @@ -5333,6 +5568,7 @@ def team_billableInfo( **kwargs, ) -> Union[Future, SlackResponse]: """Gets billable users information for the current team. + https://docs.slack.dev/reference/methods/team.billableInfo """ kwargs.update({"team_id": team_id, "user": user}) @@ -5343,6 +5579,7 @@ def team_billing_info( **kwargs, ) -> Union[Future, SlackResponse]: """Reads a workspace's billing plan information. + https://docs.slack.dev/reference/methods/team.billing.info """ return self.api_call("team.billing.info", params=kwargs) @@ -5354,6 +5591,7 @@ def team_externalTeams_disconnect( **kwargs, ) -> Union[Future, SlackResponse]: """Disconnects an external organization. + https://docs.slack.dev/reference/methods/team.externalTeams.disconnect """ kwargs.update( @@ -5376,6 +5614,7 @@ def team_externalTeams_list( **kwargs, ) -> Union[Future, SlackResponse]: """Returns a list of all the external teams connected and details about the connection. + https://docs.slack.dev/reference/methods/team.externalTeams.list """ kwargs.update( @@ -5407,6 +5646,7 @@ def team_info( **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about the current team. + https://docs.slack.dev/reference/methods/team.info """ kwargs.update({"team": team, "domain": domain}) @@ -5425,6 +5665,7 @@ def team_integrationLogs( **kwargs, ) -> Union[Future, SlackResponse]: """Gets the integration logs for the current team. + https://docs.slack.dev/reference/methods/team.integrationLogs """ kwargs.update( @@ -5447,6 +5688,7 @@ def team_profile_get( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve a team's profile. + https://docs.slack.dev/reference/methods/team.profile.get """ kwargs.update({"visibility": visibility}) @@ -5457,6 +5699,7 @@ def team_preferences_list( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieve a list of a workspace's team preferences. + https://docs.slack.dev/reference/methods/team.preferences.list """ return self.api_call("team.preferences.list", params=kwargs) @@ -5472,7 +5715,8 @@ def usergroups_create( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Create a User Group + """Create a User Group. + https://docs.slack.dev/reference/methods/usergroups.create """ kwargs.update( @@ -5498,7 +5742,8 @@ def usergroups_disable( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Disable an existing User Group + """Disable an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.disable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5512,7 +5757,8 @@ def usergroups_enable( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Enable a User Group + """Enable a User Group. + https://docs.slack.dev/reference/methods/usergroups.enable """ kwargs.update({"usergroup": usergroup, "include_count": include_count, "team_id": team_id}) @@ -5527,7 +5773,8 @@ def usergroups_list( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """List all User Groups for a team + """List all User Groups for a team. + https://docs.slack.dev/reference/methods/usergroups.list """ kwargs.update( @@ -5552,7 +5799,8 @@ def usergroups_update( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Update an existing User Group + """Update an existing User Group. + https://docs.slack.dev/reference/methods/usergroups.update """ kwargs.update( @@ -5579,7 +5827,8 @@ def usergroups_users_list( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """List all users in a User Group + """List all users in a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.list """ kwargs.update( @@ -5600,7 +5849,8 @@ def usergroups_users_update( team_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Update the list of users for a User Group + """Update the list of users for a User Group. + https://docs.slack.dev/reference/methods/usergroups.users.update """ kwargs.update( @@ -5628,6 +5878,7 @@ def users_conversations( **kwargs, ) -> Union[Future, SlackResponse]: """List conversations the calling user may access. + https://docs.slack.dev/reference/methods/users.conversations """ kwargs.update( @@ -5649,7 +5900,8 @@ def users_deletePhoto( self, **kwargs, ) -> Union[Future, SlackResponse]: - """Delete the user profile photo + """Delete the user profile photo. + https://docs.slack.dev/reference/methods/users.deletePhoto """ return self.api_call("users.deletePhoto", http_verb="GET", params=kwargs) @@ -5661,6 +5913,7 @@ def users_getPresence( **kwargs, ) -> Union[Future, SlackResponse]: """Gets user presence information. + https://docs.slack.dev/reference/methods/users.getPresence """ kwargs.update({"user": user}) @@ -5671,6 +5924,7 @@ def users_identity( **kwargs, ) -> Union[Future, SlackResponse]: """Get a user's identity. + https://docs.slack.dev/reference/methods/users.identity """ return self.api_call("users.identity", http_verb="GET", params=kwargs) @@ -5683,6 +5937,7 @@ def users_info( **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about a user. + https://docs.slack.dev/reference/methods/users.info """ kwargs.update({"user": user, "include_locale": include_locale}) @@ -5698,6 +5953,7 @@ def users_list( **kwargs, ) -> Union[Future, SlackResponse]: """Lists all users in a Slack team. + https://docs.slack.dev/reference/methods/users.list """ kwargs.update( @@ -5717,6 +5973,7 @@ def users_lookupByEmail( **kwargs, ) -> Union[Future, SlackResponse]: """Find a user with an email address. + https://docs.slack.dev/reference/methods/users.lookupByEmail """ kwargs.update({"email": email}) @@ -5731,7 +5988,8 @@ def users_setPhoto( crop_y: Optional[Union[int, str]] = None, **kwargs, ) -> Union[Future, SlackResponse]: - """Set the user profile photo + """Set the user profile photo. + https://docs.slack.dev/reference/methods/users.setPhoto """ kwargs.update({"crop_w": crop_w, "crop_x": crop_x, "crop_y": crop_y}) @@ -5744,6 +6002,7 @@ def users_setPresence( **kwargs, ) -> Union[Future, SlackResponse]: """Manually sets user presence. + https://docs.slack.dev/reference/methods/users.setPresence """ kwargs.update({"presence": presence}) @@ -5754,7 +6013,8 @@ def users_discoverableContacts_lookup( email: str, **kwargs, ) -> Union[Future, SlackResponse]: - """Lookup an email address to see if someone is on Slack + """Lookup an email address to see if someone is on Slack. + https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup """ kwargs.update({"email": email}) @@ -5768,6 +6028,7 @@ def users_profile_get( **kwargs, ) -> Union[Future, SlackResponse]: """Retrieves a user's profile information. + https://docs.slack.dev/reference/methods/users.profile.get """ kwargs.update({"user": user, "include_labels": include_labels}) @@ -5783,6 +6044,7 @@ def users_profile_set( **kwargs, ) -> Union[Future, SlackResponse]: """Set the profile information for a user. + https://docs.slack.dev/reference/methods/users.profile.set """ kwargs.update( @@ -5806,6 +6068,7 @@ def views_open( **kwargs, ) -> Union[Future, SlackResponse]: """Open a view for a user. + https://docs.slack.dev/reference/methods/views.open See https://docs.slack.dev/surfaces/modals/ for details. """ @@ -5827,6 +6090,7 @@ def views_push( **kwargs, ) -> Union[Future, SlackResponse]: """Push a view onto the stack of a root view. + Push a new view onto the existing view stack by passing a view payload and a valid trigger_id generated from an interaction within the existing modal. @@ -5853,6 +6117,7 @@ def views_update( **kwargs, ) -> Union[Future, SlackResponse]: """Update an existing view. + Update a view by passing a new view definition along with the view_id returned in views.open or the external_id. See the modals documentation (https://docs.slack.dev/surfaces/modals/#updating_views) @@ -5883,6 +6148,7 @@ def views_publish( **kwargs, ) -> Union[Future, SlackResponse]: """Publish a static view for a User. + Create or update the view that comprises an app's Home tab (https://docs.slack.dev/surfaces/app-home/) https://docs.slack.dev/reference/methods/views.publish @@ -5904,6 +6170,7 @@ def workflows_featured_add( **kwargs, ) -> Union[Future, SlackResponse]: """Add featured workflows to a channel. + https://docs.slack.dev/reference/methods/workflows.featured.add """ kwargs.update({"channel_id": channel_id}) @@ -5920,6 +6187,7 @@ def workflows_featured_list( **kwargs, ) -> Union[Future, SlackResponse]: """List the featured workflows for specified channels. + https://docs.slack.dev/reference/methods/workflows.featured.list """ if isinstance(channel_ids, (list, tuple)): @@ -5936,6 +6204,7 @@ def workflows_featured_remove( **kwargs, ) -> Union[Future, SlackResponse]: """Remove featured workflows from a channel. + https://docs.slack.dev/reference/methods/workflows.featured.remove """ kwargs.update({"channel_id": channel_id}) @@ -5953,6 +6222,7 @@ def workflows_featured_set( **kwargs, ) -> Union[Future, SlackResponse]: """Set featured workflows for a channel. + https://docs.slack.dev/reference/methods/workflows.featured.set """ kwargs.update({"channel_id": channel_id}) @@ -5970,6 +6240,7 @@ def workflows_stepCompleted( **kwargs, ) -> Union[Future, SlackResponse]: """Indicate a successful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepCompleted """ kwargs.update({"workflow_step_execute_id": workflow_step_execute_id}) @@ -5987,6 +6258,7 @@ def workflows_stepFailed( **kwargs, ) -> Union[Future, SlackResponse]: """Indicate an unsuccessful outcome of a workflow step's execution. + https://docs.slack.dev/reference/methods/workflows.stepFailed """ kwargs.update( @@ -6008,6 +6280,7 @@ def workflows_updateStep( **kwargs, ) -> Union[Future, SlackResponse]: """Update the configuration for a workflow extension step. + https://docs.slack.dev/reference/methods/workflows.updateStep """ kwargs.update({"workflow_step_edit_id": workflow_step_edit_id}) diff --git a/slack_sdk/web/legacy_slack_response.py b/slack_sdk/web/legacy_slack_response.py index 3942389a2..90154ff48 100644 --- a/slack_sdk/web/legacy_slack_response.py +++ b/slack_sdk/web/legacy_slack_response.py @@ -102,6 +102,7 @@ def __getitem__(self, key): def __iter__(self): """Enables the ability to iterate over the response. + It's required for the iterator protocol. Note: @@ -204,8 +205,7 @@ def validate(self): @staticmethod def _next_cursor_is_present(data): - """Determine if the response contains 'next_cursor' - and 'next_cursor' is not empty. + """Determine if the response contains 'next_cursor' and 'next_cursor' is not empty. Returns: A boolean value. diff --git a/slack_sdk/web/slack_response.py b/slack_sdk/web/slack_response.py index 29413e5c6..fbdfdfbe9 100644 --- a/slack_sdk/web/slack_response.py +++ b/slack_sdk/web/slack_response.py @@ -27,17 +27,17 @@ class SlackResponse: import os import slack - client = slack.WebClient(token=os.environ['SLACK_API_TOKEN']) + client = slack.WebClient(token=os.environ["SLACK_API_TOKEN"]) - response1 = client.auth_revoke(test='true') - assert not response1['revoked'] + response1 = client.auth_revoke(test="true") + assert not response1["revoked"] response2 = client.auth_test() - assert response2.get('ok', False) + assert response2.get("ok", False) users = [] for page in client.users_list(limit=2): - users = users + page['members'] + users = users + page["members"] ``` Note: @@ -103,6 +103,7 @@ def __getitem__(self, key): def __iter__(self): """Enables the ability to iterate over the response. + It's required for the iterator protocol. Note: diff --git a/slack_sdk/webhook/__init__.py b/slack_sdk/webhook/__init__.py index 09e2292ab..db5dc98eb 100644 --- a/slack_sdk/webhook/__init__.py +++ b/slack_sdk/webhook/__init__.py @@ -1,6 +1,4 @@ -"""You can use slack_sdk.webhook.WebhookClient for Incoming Webhooks -and message responses using response_url in payloads. -""" +"""You can use slack_sdk.webhook.WebhookClient for Incoming Webhooks and message responses using response_url in payloads.""" # from .async_client import AsyncWebhookClient from .client import WebhookClient diff --git a/slack_sdk/webhook/async_client.py b/slack_sdk/webhook/async_client.py index 9e2965c1d..cfc60fd7e 100644 --- a/slack_sdk/webhook/async_client.py +++ b/slack_sdk/webhook/async_client.py @@ -51,7 +51,7 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[AsyncRetryHandler]] = None, ): - """API client for Incoming Webhooks and `response_url` + """API client for Incoming Webhooks and `response_url`. https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/ diff --git a/slack_sdk/webhook/client.py b/slack_sdk/webhook/client.py index d7f9f603d..49fd15230 100644 --- a/slack_sdk/webhook/client.py +++ b/slack_sdk/webhook/client.py @@ -46,7 +46,7 @@ def __init__( logger: Optional[logging.Logger] = None, retry_handlers: Optional[List[RetryHandler]] = None, ): - """API client for Incoming Webhooks and `response_url` + """API client for Incoming Webhooks and `response_url`. https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/