diff --git a/docs/reference/audit_logs/async_client.html b/docs/reference/audit_logs/async_client.html index 7458e5bdb..4444bb82a 100644 --- a/docs/reference/audit_logs/async_client.html +++ b/docs/reference/audit_logs/async_client.html @@ -327,7 +327,7 @@
Each authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list
+
+def apps_icon_set(self,
*,
app_id: str,
file: str | bytes | io.IOBase | None = None,
url: str | None = None,
**kwargs) ‑> SlackResponse
+def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return self.api_call("apps.icon.set", params=kwargs)
+Sets the app icon.
+https://docs.slack.dev/reference/methods/apps.icon.set
+app_idfilemultipart/form-dataurl
+def apps_managed_permissions_set(self, *, app_id: str, permissions: str, **kwargs) ‑> SlackResponse
+def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+) -> SlackResponse:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return self.api_call("apps.managed.permissions.set", params=kwargs)
+Set who can interact with a managed app.
+https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+app_idpermissions
def apps_manifest_create(self, *, manifest: str | Dict[str, Any], **kwargs) ‑> SlackResponse
Updates the connection status between a user and an app.
https://docs.slack.dev/reference/methods/apps.user.connection.update
+def assistant_search_context(self,
*,
query: str,
action_token: str | None = None,
channel_types: str | Sequence[str] | None = None,
content_types: str | Sequence[str] | None = None,
include_bots: bool | None = None,
include_deleted_users: bool | None = None,
before: int | None = None,
after: int | None = None,
include_context_messages: bool | None = None,
context_channel_id: str | None = None,
cursor: str | None = None,
limit: int | None = None,
sort: str | None = None,
sort_dir: str | None = None,
include_message_blocks: bool | None = None,
highlight: bool | None = None,
term_clauses: Sequence[str] | None = None,
modifiers: str | None = None,
include_archived_channels: bool | None = None,
disable_semantic_search: bool | None = None,
**kwargs) ‑> SlackResponse
+def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return self.api_call("assistant.search.context", params=kwargs)
+Searches messages, files, channels and users across your Slack organization.
+https://docs.slack.dev/reference/methods/assistant.search.context
+def assistant_search_info(self, **kwargs) ‑> SlackResponse
+def assistant_search_info(
+ self,
+ **kwargs,
+) -> SlackResponse:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return self.api_call("assistant.search.info", params=kwargs)
+Returns search capabilities on a given team.
+https://docs.slack.dev/reference/methods/assistant.search.info
def assistant_threads_setStatus(self,
*,
channel_id: str,
thread_ts: str,
status: str,
loading_messages: List[str] | None = None,
icon_emoji: str | None = None,
icon_url: str | None = None,
username: str | None = None,
**kwargs) ‑> SlackResponse
WebClient
api_test
apps_connections_open
apps_event_authorizations_list
+apps_icon_set
+apps_managed_permissions_set
apps_manifest_create
apps_manifest_delete
apps_manifest_export
@@ -18836,6 +19131,8 @@ WebClient
apps_user_connection_bulkUpdate
apps_user_connection_requestAuth
apps_user_connection_update
+assistant_search_context
+assistant_search_info
assistant_threads_setStatus
assistant_threads_setSuggestedPrompts
assistant_threads_setTitle
diff --git a/docs/reference/models/basic_objects.html b/docs/reference/models/basic_objects.html
index 2d848863d..d666e791a 100644
--- a/docs/reference/models/basic_objects.html
+++ b/docs/reference/models/basic_objects.html
@@ -116,10 +116,12 @@ Ancestors
Raises:
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)
- if callable(method) and hasattr(method, "validator"):
- method()
+ instance_attribute_names = (name for name in vars(self) if not name.startswith("__"))
+ candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
+ for name in sorted(candidate_names):
+ attribute: Any = getattr(self, name, None)
+ if _is_validator(attribute):
+ attribute()
def get_object_attribute(self, key: str):
return getattr(self, key, None)
@@ -376,10 +378,12 @@ Methods
Raises:
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)
- if callable(method) and hasattr(method, "validator"):
- method()
+ instance_attribute_names = (name for name in vars(self) if not name.startswith("__"))
+ candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
+ for name in sorted(candidate_names):
+ attribute: Any = getattr(self, name, None)
+ if _is_validator(attribute):
+ attribute()
Validate this object against its attribute validators.
Validate this object against its attribute validators.
class ViewStateValue
-(*,
type: str | None = None,
value: str | None = None,
selected_date: str | None = None,
selected_time: str | None = None,
selected_conversation: str | None = None,
selected_channel: str | None = None,
selected_user: str | None = None,
selected_option: dict | Option | None = None,
selected_conversations: Sequence[str] | None = None,
selected_channels: Sequence[str] | None = None,
selected_users: Sequence[str] | None = None,
selected_options: Sequence[dict | Option] | None = None)
+(*,
type: str | None = None,
value: str | None = None,
selected_date: str | None = None,
selected_time: str | None = None,
selected_conversation: str | None = None,
selected_channel: str | None = None,
selected_user: str | None = None,
selected_option: dict | Option | None = None,
selected_conversations: Sequence[str] | None = None,
selected_channels: Sequence[str] | None = None,
selected_users: Sequence[str] | None = None,
selected_options: Sequence[dict | Option] | None = None,
selected_date_time: int | None = None,
timezone: str | None = None,
rich_text_value: RichTextBlock | dict | None = None,
files: Sequence[dict] | None = None,
**kwargs)
The base class for JSON serializable class objects.
InstallationStore:
+InstallationStore:
+
+InstallationStore:
+
AsyncInstallationStore:
@@ -852,11 +872,19 @@ AsyncInstallationStore:
+AsyncInstallationStore:
+
AsyncInstallationStore:
+
+def disconnect(self) -> None:
- if self.sock is not None:
- with self.sock_send_lock:
- with self.sock_receive_lock:
- # Synchronize before closing this instance's socket
+ with self.sock_send_lock:
+ with self.sock_receive_lock:
+ if self.sock is not None:
self.sock.close()
self.sock = None
- # After this, all operations using self.sock will be skipped
self.logger.info(f"The connection has been closed (session id: {self.session_id})")
diff --git a/docs/reference/socket_mode/request.html b/docs/reference/socket_mode/request.html
index 82d019f1f..b419d0845 100644
--- a/docs/reference/socket_mode/request.html
+++ b/docs/reference/socket_mode/request.html
@@ -82,7 +82,7 @@ Each authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list
+async def apps_icon_set(self,
*,
app_id: str,
file: str | bytes | io.IOBase | None = None,
url: str | None = None,
**kwargs) ‑> AsyncSlackResponse
+async def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+) -> AsyncSlackResponse:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return await self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return await self.api_call("apps.icon.set", params=kwargs)
+Sets the app icon.
+https://docs.slack.dev/reference/methods/apps.icon.set
+app_idfilemultipart/form-dataurl
+async def apps_managed_permissions_set(self, *, app_id: str, permissions: str, **kwargs) ‑> AsyncSlackResponse
+async def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+) -> AsyncSlackResponse:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return await self.api_call("apps.managed.permissions.set", params=kwargs)
+Set who can interact with a managed app.
+https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+app_idpermissions
async def apps_manifest_create(self, *, manifest: str | Dict[str, Any], **kwargs) ‑> AsyncSlackResponse
Updates the connection status between a user and an app.
https://docs.slack.dev/reference/methods/apps.user.connection.update
+async def assistant_search_context(self,
*,
query: str,
action_token: str | None = None,
channel_types: str | Sequence[str] | None = None,
content_types: str | Sequence[str] | None = None,
include_bots: bool | None = None,
include_deleted_users: bool | None = None,
before: int | None = None,
after: int | None = None,
include_context_messages: bool | None = None,
context_channel_id: str | None = None,
cursor: str | None = None,
limit: int | None = None,
sort: str | None = None,
sort_dir: str | None = None,
include_message_blocks: bool | None = None,
highlight: bool | None = None,
term_clauses: Sequence[str] | None = None,
modifiers: str | None = None,
include_archived_channels: bool | None = None,
disable_semantic_search: bool | None = None,
**kwargs) ‑> AsyncSlackResponse
+async def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+) -> AsyncSlackResponse:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return await self.api_call("assistant.search.context", params=kwargs)
+Searches messages, files, channels and users across your Slack organization.
+https://docs.slack.dev/reference/methods/assistant.search.context
+async def assistant_search_info(self, **kwargs) ‑> AsyncSlackResponse
+async def assistant_search_info(
+ self,
+ **kwargs,
+) -> AsyncSlackResponse:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return await self.api_call("assistant.search.info", params=kwargs)
+Returns search capabilities on a given team.
+https://docs.slack.dev/reference/methods/assistant.search.info
async def assistant_threads_setStatus(self,
*,
channel_id: str,
thread_ts: str,
status: str,
loading_messages: List[str] | None = None,
icon_emoji: str | None = None,
icon_url: str | None = None,
username: str | None = None,
**kwargs) ‑> AsyncSlackResponse
api_test
apps_connections_openapps_event_authorizations_listapps_icon_setapps_managed_permissions_setapps_manifest_createapps_manifest_deleteapps_manifest_exportapps_user_connection_bulkUpdate
apps_user_connection_requestAuthapps_user_connection_updateassistant_search_contextassistant_search_infoassistant_threads_setStatusassistant_threads_setSuggestedPromptsassistant_threads_setTitleEach authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list
+def apps_icon_set(self,
*,
app_id: str,
file: str | bytes | io.IOBase | None = None,
url: str | None = None,
**kwargs) ‑> SlackResponse
+def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return self.api_call("apps.icon.set", params=kwargs)
+Sets the app icon.
+https://docs.slack.dev/reference/methods/apps.icon.set
+app_idfilemultipart/form-dataurl
+def apps_managed_permissions_set(self, *, app_id: str, permissions: str, **kwargs) ‑> SlackResponse
+def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+) -> SlackResponse:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return self.api_call("apps.managed.permissions.set", params=kwargs)
+Set who can interact with a managed app.
+https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+app_idpermissions
def apps_manifest_create(self, *, manifest: str | Dict[str, Any], **kwargs) ‑> SlackResponse
Updates the connection status between a user and an app.
https://docs.slack.dev/reference/methods/apps.user.connection.update
+def assistant_search_context(self,
*,
query: str,
action_token: str | None = None,
channel_types: str | Sequence[str] | None = None,
content_types: str | Sequence[str] | None = None,
include_bots: bool | None = None,
include_deleted_users: bool | None = None,
before: int | None = None,
after: int | None = None,
include_context_messages: bool | None = None,
context_channel_id: str | None = None,
cursor: str | None = None,
limit: int | None = None,
sort: str | None = None,
sort_dir: str | None = None,
include_message_blocks: bool | None = None,
highlight: bool | None = None,
term_clauses: Sequence[str] | None = None,
modifiers: str | None = None,
include_archived_channels: bool | None = None,
disable_semantic_search: bool | None = None,
**kwargs) ‑> SlackResponse
+def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return self.api_call("assistant.search.context", params=kwargs)
+Searches messages, files, channels and users across your Slack organization.
+https://docs.slack.dev/reference/methods/assistant.search.context
+def assistant_search_info(self, **kwargs) ‑> SlackResponse
+def assistant_search_info(
+ self,
+ **kwargs,
+) -> SlackResponse:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return self.api_call("assistant.search.info", params=kwargs)
+Returns search capabilities on a given team.
+https://docs.slack.dev/reference/methods/assistant.search.info
def assistant_threads_setStatus(self,
*,
channel_id: str,
thread_ts: str,
status: str,
loading_messages: List[str] | None = None,
icon_emoji: str | None = None,
icon_url: str | None = None,
username: str | None = None,
**kwargs) ‑> SlackResponse
api_test
apps_connections_openapps_event_authorizations_listapps_icon_setapps_managed_permissions_setapps_manifest_createapps_manifest_deleteapps_manifest_exportapps_user_connection_bulkUpdate
apps_user_connection_requestAuthapps_user_connection_updateassistant_search_contextassistant_search_infoassistant_threads_setStatusassistant_threads_setSuggestedPromptsassistant_threads_setTitleEach authorization represents an app installation that the event is visible to. https://docs.slack.dev/reference/methods/apps.event.authorizations.list
+
+def apps_icon_set(self,
*,
app_id: str,
file: str | bytes | io.IOBase | None = None,
url: str | None = None,
**kwargs) ‑> SlackResponse
+def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return self.api_call("apps.icon.set", params=kwargs)
+Sets the app icon.
+https://docs.slack.dev/reference/methods/apps.icon.set
+app_idfilemultipart/form-dataurl
+def apps_managed_permissions_set(self, *, app_id: str, permissions: str, **kwargs) ‑> SlackResponse
+def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+) -> SlackResponse:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return self.api_call("apps.managed.permissions.set", params=kwargs)
+Set who can interact with a managed app.
+https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+app_idpermissions
def apps_manifest_create(self, *, manifest: str | Dict[str, Any], **kwargs) ‑> SlackResponse
Updates the connection status between a user and an app.
https://docs.slack.dev/reference/methods/apps.user.connection.update
+def assistant_search_context(self,
*,
query: str,
action_token: str | None = None,
channel_types: str | Sequence[str] | None = None,
content_types: str | Sequence[str] | None = None,
include_bots: bool | None = None,
include_deleted_users: bool | None = None,
before: int | None = None,
after: int | None = None,
include_context_messages: bool | None = None,
context_channel_id: str | None = None,
cursor: str | None = None,
limit: int | None = None,
sort: str | None = None,
sort_dir: str | None = None,
include_message_blocks: bool | None = None,
highlight: bool | None = None,
term_clauses: Sequence[str] | None = None,
modifiers: str | None = None,
include_archived_channels: bool | None = None,
disable_semantic_search: bool | None = None,
**kwargs) ‑> SlackResponse
+def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+) -> SlackResponse:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return self.api_call("assistant.search.context", params=kwargs)
+Searches messages, files, channels and users across your Slack organization.
+https://docs.slack.dev/reference/methods/assistant.search.context
+def assistant_search_info(self, **kwargs) ‑> SlackResponse
+def assistant_search_info(
+ self,
+ **kwargs,
+) -> SlackResponse:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return self.api_call("assistant.search.info", params=kwargs)
+Returns search capabilities on a given team.
+https://docs.slack.dev/reference/methods/assistant.search.info
def assistant_threads_setStatus(self,
*,
channel_id: str,
thread_ts: str,
status: str,
loading_messages: List[str] | None = None,
icon_emoji: str | None = None,
icon_url: str | None = None,
username: str | None = None,
**kwargs) ‑> SlackResponse
Web
api_test
apps_connections_open
apps_event_authorizations_list
+apps_icon_set
+apps_managed_permissions_set
apps_manifest_create
apps_manifest_delete
apps_manifest_export
@@ -18667,6 +18962,8 @@ Web
apps_user_connection_bulkUpdate
apps_user_connection_requestAuth
apps_user_connection_update
+assistant_search_context
+assistant_search_info
assistant_threads_setStatus
assistant_threads_setSuggestedPrompts
assistant_threads_setTitle
diff --git a/docs/reference/web/legacy_base_client.html b/docs/reference/web/legacy_base_client.html
index 2bccd8998..077346a07 100644
--- a/docs/reference/web/legacy_base_client.html
+++ b/docs/reference/web/legacy_base_client.html
@@ -375,7 +375,7 @@ Classes
request_headers = self._build_urllib_request_headers(
token=token or self.token,
- has_json=json is not None,
+ has_json=json_body is not None,
has_files=files is not None,
additional_headers=additional_headers,
)
diff --git a/docs/reference/web/legacy_client.html b/docs/reference/web/legacy_client.html
index ef6529eef..d31177c16 100644
--- a/docs/reference/web/legacy_client.html
+++ b/docs/reference/web/legacy_client.html
@@ -2576,6 +2576,49 @@ Classes
kwargs.update({"event_context": event_context, "cursor": cursor, "limit": limit})
return self.api_call("apps.event.authorizations.list", params=kwargs)
+ def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+ ) -> Union[Future, SlackResponse]:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return self.api_call("apps.icon.set", params=kwargs)
+
+ def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+ ) -> Union[Future, SlackResponse]:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return self.api_call("apps.managed.permissions.set", params=kwargs)
+
def apps_uninstall(
self,
*,
@@ -2735,6 +2778,78 @@ Classes
kwargs.update({"refresh_token": refresh_token})
return self.api_call("tooling.tokens.rotate", params=kwargs)
+ def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+ ) -> Union[Future, SlackResponse]:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return self.api_call("assistant.search.context", params=kwargs)
+
+ def assistant_search_info(
+ self,
+ **kwargs,
+ ) -> Union[Future, SlackResponse]:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return self.api_call("assistant.search.info", params=kwargs)
+
def assistant_threads_setStatus(
self,
*,
@@ -10929,6 +11044,90 @@ Methods
Each authorization represents an app installation that the event is visible to.
https://docs.slack.dev/reference/methods/apps.event.authorizations.list
+
+def apps_icon_set(self,
*,
app_id: str,
file: str | bytes | io.IOBase | None = None,
url: str | None = None,
**kwargs) ‑> _asyncio.Future | LegacySlackResponse
+
+
+
+
+Expand source code
+
+def apps_icon_set(
+ self,
+ *,
+ app_id: str,
+ file: Optional[Union[str, bytes, IOBase]] = None,
+ url: Optional[str] = None,
+ **kwargs,
+) -> Union[Future, SlackResponse]:
+ """Sets the app icon.
+
+ https://docs.slack.dev/reference/methods/apps.icon.set
+
+ Args:
+ app_id: The ID of the app whose icon you want to set.
+ file: File contents via `multipart/form-data`
+ url: URL of a publicly hosted image
+ """
+ if file is None and url is None:
+ raise e.SlackRequestError("Either file or url must be provided.")
+ kwargs.update({"app_id": app_id, "url": url})
+ if file is not None:
+ return self.api_call("apps.icon.set", files={"file": file}, data=kwargs)
+ return self.api_call("apps.icon.set", params=kwargs)
+
+Sets the app icon.
+https://docs.slack.dev/reference/methods/apps.icon.set
+
+- Args
+- -----=
+app_id
+- The ID of the app whose icon you want to set.
+file
+- File contents via
multipart/form-data
+url
+- URL of a publicly hosted image
+
+
+
+def apps_managed_permissions_set(self, *, app_id: str, permissions: str, **kwargs) ‑> _asyncio.Future | LegacySlackResponse
+
+
+
+
+Expand source code
+
+def apps_managed_permissions_set(
+ self,
+ *,
+ app_id: str,
+ permissions: str,
+ **kwargs,
+) -> Union[Future, SlackResponse]:
+ """Set who can interact with a managed app.
+
+ https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+ Args:
+ app_id: Encoded ID of the managed app to configure
+ permissions: Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+ to the app's owner.
+ """
+ kwargs.update({"app_id": app_id, "permissions": permissions})
+ return self.api_call("apps.managed.permissions.set", params=kwargs)
+
+Set who can interact with a managed app.
+https://docs.slack.dev/reference/methods/apps.managed.permissions.set
+
+- Args
+- -----=
+app_id
+- Encoded ID of the managed app to configure
+permissions
+- Who can interact with the app. Use everyone to allow all members, or app_owner to restrict access
+to the app's owner.
+
+
def apps_manifest_create(self, *, manifest: str | Dict[str, Any], **kwargs) ‑> _asyncio.Future | LegacySlackResponse
@@ -11174,6 +11373,100 @@ Methods
Updates the connection status between a user and an app.
https://docs.slack.dev/reference/methods/apps.user.connection.update
+
+def assistant_search_context(self,
*,
query: str,
action_token: str | None = None,
channel_types: str | Sequence[str] | None = None,
content_types: str | Sequence[str] | None = None,
include_bots: bool | None = None,
include_deleted_users: bool | None = None,
before: int | None = None,
after: int | None = None,
include_context_messages: bool | None = None,
context_channel_id: str | None = None,
cursor: str | None = None,
limit: int | None = None,
sort: str | None = None,
sort_dir: str | None = None,
include_message_blocks: bool | None = None,
highlight: bool | None = None,
term_clauses: Sequence[str] | None = None,
modifiers: str | None = None,
include_archived_channels: bool | None = None,
disable_semantic_search: bool | None = None,
**kwargs) ‑> _asyncio.Future | LegacySlackResponse
+
+
+
+
+Expand source code
+
+def assistant_search_context(
+ self,
+ *,
+ query: str,
+ action_token: Optional[str] = None,
+ channel_types: Optional[Union[str, Sequence[str]]] = None,
+ content_types: Optional[Union[str, Sequence[str]]] = None,
+ include_bots: Optional[bool] = None,
+ include_deleted_users: Optional[bool] = None,
+ before: Optional[int] = None,
+ after: Optional[int] = None,
+ include_context_messages: Optional[bool] = None,
+ context_channel_id: Optional[str] = None,
+ cursor: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ sort_dir: Optional[str] = None,
+ include_message_blocks: Optional[bool] = None,
+ highlight: Optional[bool] = None,
+ term_clauses: Optional[Sequence[str]] = None,
+ modifiers: Optional[str] = None,
+ include_archived_channels: Optional[bool] = None,
+ disable_semantic_search: Optional[bool] = None,
+ **kwargs,
+) -> Union[Future, SlackResponse]:
+ """Searches messages, files, channels and users across your Slack organization.
+
+ https://docs.slack.dev/reference/methods/assistant.search.context
+ """
+ kwargs.update(
+ {
+ "query": query,
+ "action_token": action_token,
+ "include_bots": include_bots,
+ "include_deleted_users": include_deleted_users,
+ "before": before,
+ "after": after,
+ "include_context_messages": include_context_messages,
+ "context_channel_id": context_channel_id,
+ "cursor": cursor,
+ "limit": limit,
+ "sort": sort,
+ "sort_dir": sort_dir,
+ "include_message_blocks": include_message_blocks,
+ "highlight": highlight,
+ "modifiers": modifiers,
+ "include_archived_channels": include_archived_channels,
+ "disable_semantic_search": disable_semantic_search,
+ }
+ )
+ if isinstance(channel_types, (list, tuple)):
+ kwargs.update({"channel_types": ",".join(channel_types)})
+ else:
+ kwargs.update({"channel_types": channel_types})
+ if isinstance(content_types, (list, tuple)):
+ kwargs.update({"content_types": ",".join(content_types)})
+ else:
+ kwargs.update({"content_types": content_types})
+ if term_clauses is not None:
+ kwargs.update({"term_clauses": json.dumps(term_clauses)})
+ return self.api_call("assistant.search.context", params=kwargs)
+
+Searches messages, files, channels and users across your Slack organization.
+https://docs.slack.dev/reference/methods/assistant.search.context
+
+
+def assistant_search_info(self, **kwargs) ‑> _asyncio.Future | LegacySlackResponse
+
+
+
+
+Expand source code
+
+def assistant_search_info(
+ self,
+ **kwargs,
+) -> Union[Future, SlackResponse]:
+ """Returns search capabilities on a given team.
+
+ https://docs.slack.dev/reference/methods/assistant.search.info
+ """
+ return self.api_call("assistant.search.info", params=kwargs)
+
+Returns search capabilities on a given team.
+https://docs.slack.dev/reference/methods/assistant.search.info
+
def assistant_threads_setStatus(self,
*,
channel_id: str,
thread_ts: str,
status: str,
loading_messages: List[str] | None = None,
icon_emoji: str | None = None,
icon_url: str | None = None,
username: str | None = None,
**kwargs) ‑> _asyncio.Future | LegacySlackResponse
@@ -18040,6 +18333,8 @@ api_test
apps_connections_open
apps_event_authorizations_list
+apps_icon_set
+apps_managed_permissions_set
apps_manifest_create
apps_manifest_delete
apps_manifest_export
@@ -18049,6 +18344,8 @@ apps_user_connection_bulkUpdate
apps_user_connection_requestAuth
apps_user_connection_update
+assistant_search_context
+assistant_search_info
assistant_threads_setStatus
assistant_threads_setSuggestedPrompts
assistant_threads_setTitle
diff --git a/docs/reference/webhook/async_client.html b/docs/reference/webhook/async_client.html
index dc1e697a4..567408b14 100644
--- a/docs/reference/webhook/async_client.html
+++ b/docs/reference/webhook/async_client.html
@@ -238,7 +238,7 @@ Classes
headers=res.headers, # type: ignore[arg-type]
)
- if res.status == 429:
+ if res.status >= 400:
for handler in self.retry_handlers:
if await handler.can_retry_async(
state=retry_state,
@@ -248,7 +248,7 @@ Classes
if self.logger.level <= logging.DEBUG:
self.logger.info(
f"A retry handler found: {type(handler).__name__} "
- f"for POST {self.url} - rate_limited"
+ f"for POST {self.url} - status: {res.status}"
)
await handler.prepare_for_next_attempt_async(
state=retry_state,
diff --git a/slack_sdk/version.py b/slack_sdk/version.py
index dd522a388..1a514c7b6 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/."""
-__version__ = "3.47.0"
+__version__ = "3.48.0"