diff --git a/docs/reference/index.html b/docs/reference/index.html index 6bbf6a721..7c0ba09fe 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1937,6 +1937,20 @@

Classes

kwargs.update({"channel_ids": channel_ids}) return self.api_call("admin.users.invite", params=kwargs) + def admin_users_getExpiration( + self, + *, + user_id: str, + target_team: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Fetches the expiration timestamp for a guest. + + https://docs.slack.dev/reference/methods/admin.users.getExpiration + """ + kwargs.update({"user_id": user_id, "target_team": target_team}) + return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs) + def admin_users_list( self, *, @@ -2152,6 +2166,220 @@

Classes

kwargs.update({"workflow_ids": workflow_ids}) return self.api_call("admin.workflows.unpublish", params=kwargs) + def agents_conversations_archive( + self, + *, + channel_id: str, + summary_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Archive a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.archive + """ + kwargs.update( + { + "channel_id": channel_id, + "summary_message_ts": summary_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.archive", json=kwargs) + + def agents_conversations_create( + self, + *, + name: str, + team_id: Optional[str] = None, + session_id: Optional[str] = None, + is_private: Optional[bool] = None, + origin_channel_id: Optional[str] = None, + origin_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Create a dedicated code channel for an agent session. + + https://docs.slack.dev/reference/methods/agents.conversations.create + """ + kwargs.update( + { + "team_id": team_id, + "session_id": session_id, + "name": name, + "is_private": is_private, + "origin_channel_id": origin_channel_id, + "origin_message_ts": origin_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.create", json=kwargs) + + def agents_conversations_getCanvas( + self, + *, + channel: str, + canvas_id: str, + content_format: Optional[str] = None, + include_resolved: Optional[bool] = None, + **kwargs, + ) -> SlackResponse: + """Fetch a canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.getCanvas + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content_format": content_format, + "include_resolved": include_resolved, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.getCanvas", json=kwargs) + + def agents_conversations_listViews( + self, + *, + channel_id: str, + **kwargs, + ) -> SlackResponse: + """List the views currently attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.listViews + """ + kwargs.update({"channel_id": channel_id}) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.listViews", json=kwargs) + + def agents_conversations_removeView( + self, + *, + channel_id: str, + view_key: Optional[str] = None, + view_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Remove a view from a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.removeView + """ + kwargs.update( + { + "channel_id": channel_id, + "view_key": view_key, + "view_id": view_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.removeView", json=kwargs) + + def agents_conversations_setCanvasContent( + self, + *, + channel: str, + canvas_id: str, + content: str, + **kwargs, + ) -> SlackResponse: + """Replace the full markdown content of a plan canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content": content, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCanvasContent", json=kwargs) + + def agents_conversations_setCommands( + self, + *, + channel_id: str, + commands: Sequence[Dict], + **kwargs, + ) -> SlackResponse: + """Register the set of agent-defined slash commands for the calling agent in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCommands + """ + kwargs.update( + { + "commands": commands, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCommands", json=kwargs) + + def agents_conversations_setProperties( + self, + *, + channel_id: str, + code_channel: Optional[Dict] = None, + agent_resource: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Set properties on a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setProperties + """ + kwargs.update( + { + "channel_id": channel_id, + "code_channel": code_channel, + "agent_resource": agent_resource, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setProperties", json=kwargs) + + def agents_conversations_setView( + self, + *, + channel_id: str, + type: Optional[str] = None, + view_key: Optional[str] = None, + content: Optional[str] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + canvas_id: Optional[str] = None, + access_level: Optional[str] = None, + agent_content_hash: Optional[str] = None, + pr_url: Optional[str] = None, + base_branch: Optional[str] = None, + head_branch: Optional[str] = None, + name: Optional[str] = None, + csp: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Create or update a view in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setView + """ + kwargs.update( + { + "channel_id": channel_id, + "type": type, + "view_key": view_key, + "content": content, + "blocks": blocks, + "canvas_id": canvas_id, + "access_level": access_level, + "agent_content_hash": agent_content_hash, + "pr_url": pr_url, + "base_branch": base_branch, + "head_branch": head_branch, + "name": name, + "csp": csp, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setView", json=kwargs) + def agents_sessions_rename( self, *, @@ -2355,6 +2583,46 @@

Classes

kwargs.update({"user_id": user_id, "status": status}) return self.api_call("apps.user.connection.update", params=kwargs) + def apps_user_connection_bulkUpdate( + self, + *, + connected_user_ids: Optional[Union[str, Sequence[str]]] = None, + disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None, + **kwargs, + ) -> SlackResponse: + """Updates the connection status between an app and many users in one call, for backfilling an existing user base. + + https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate + """ + if isinstance(connected_user_ids, (list, tuple)): + kwargs.update({"connected_user_ids": ",".join(connected_user_ids)}) + else: + kwargs.update({"connected_user_ids": connected_user_ids}) + if isinstance(disconnected_user_ids, (list, tuple)): + kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)}) + else: + kwargs.update({"disconnected_user_ids": disconnected_user_ids}) + return self.api_call("apps.user.connection.bulkUpdate", params=kwargs) + + def apps_user_connection_requestAuth( + self, + *, + primary_provider: Union[str, Dict[str, Any]], + trigger_id: Optional[str] = None, + user_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Opens or updates a standardized authentication modal for the calling app. + + https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth + """ + kwargs.update({"trigger_id": trigger_id, "user_id": user_id}) + if isinstance(primary_provider, str): + kwargs.update({"primary_provider": primary_provider}) + else: + kwargs.update({"primary_provider": json.dumps(primary_provider)}) + return self.api_call("apps.user.connection.requestAuth", params=kwargs) + def tooling_tokens_rotate( self, *, @@ -2710,14 +2978,22 @@

Classes

self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs) def canvases_edit( @@ -2747,6 +3023,20 @@

Classes

kwargs.update({"canvas_id": canvas_id}) return self.api_call("canvases.delete", params=kwargs) + def canvases_getContent( + self, + *, + canvas_id: str, + content_type: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Get the content of a canvas as markdown (default) or HTML. + + https://docs.slack.dev/reference/methods/canvases.getContent + """ + kwargs.update({"canvas_id": canvas_id, "content_type": content_type}) + return self.api_call("canvases.getContent", params=kwargs) + def canvases_access_set( self, *, @@ -5841,13 +6131,14 @@

Classes

*, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs) def team_integrationLogs( @@ -8939,6 +9230,31 @@

Methods

Add an Enterprise user to a workspace.

https://docs.slack.dev/reference/methods/admin.users.assign

+
+def admin_users_getExpiration(self, *, user_id: str, target_team: str | None = None, **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def admin_users_getExpiration(
+    self,
+    *,
+    user_id: str,
+    target_team: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Fetches the expiration timestamp for a guest.
+
+    https://docs.slack.dev/reference/methods/admin.users.getExpiration
+    """
+    kwargs.update({"user_id": user_id, "target_team": target_team})
+    return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs)
+
+

Fetches the expiration timestamp for a guest.

+

https://docs.slack.dev/reference/methods/admin.users.getExpiration

+
def admin_users_invite(self,
*,
team_id: str,
email: str,
channel_ids: str | Sequence[str],
custom_message: str | None = None,
email_password_policy_enabled: bool | None = None,
guest_expiration_ts: str | float | None = None,
is_restricted: bool | None = None,
is_ultra_restricted: bool | None = None,
real_name: str | None = None,
resend: bool | None = None,
**kwargs) ‑> SlackResponse
@@ -9577,6 +9893,319 @@

Methods

Unpublish workflows within the team or enterprise.

https://docs.slack.dev/reference/methods/admin.workflows.unpublish

+
+def agents_conversations_archive(self, *, channel_id: str, summary_message_ts: str | None = None, **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def agents_conversations_archive(
+    self,
+    *,
+    channel_id: str,
+    summary_message_ts: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Archive a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.archive
+    """
+    kwargs.update(
+        {
+            "channel_id": channel_id,
+            "summary_message_ts": summary_message_ts,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.archive", json=kwargs)
+
+

Archive a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.archive

+
+
+def agents_conversations_create(self,
*,
name: str,
team_id: str | None = None,
session_id: str | None = None,
is_private: bool | None = None,
origin_channel_id: str | None = None,
origin_message_ts: str | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def agents_conversations_create(
+    self,
+    *,
+    name: str,
+    team_id: Optional[str] = None,
+    session_id: Optional[str] = None,
+    is_private: Optional[bool] = None,
+    origin_channel_id: Optional[str] = None,
+    origin_message_ts: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Create a dedicated code channel for an agent session.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.create
+    """
+    kwargs.update(
+        {
+            "team_id": team_id,
+            "session_id": session_id,
+            "name": name,
+            "is_private": is_private,
+            "origin_channel_id": origin_channel_id,
+            "origin_message_ts": origin_message_ts,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.create", json=kwargs)
+
+

Create a dedicated code channel for an agent session.

+

https://docs.slack.dev/reference/methods/agents.conversations.create

+
+
+def agents_conversations_getCanvas(self,
*,
channel: str,
canvas_id: str,
content_format: str | None = None,
include_resolved: bool | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def agents_conversations_getCanvas(
+    self,
+    *,
+    channel: str,
+    canvas_id: str,
+    content_format: Optional[str] = None,
+    include_resolved: Optional[bool] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Fetch a canvas attached to a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.getCanvas
+    """
+    kwargs.update(
+        {
+            "channel": channel,
+            "canvas_id": canvas_id,
+            "content_format": content_format,
+            "include_resolved": include_resolved,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.getCanvas", json=kwargs)
+
+

Fetch a canvas attached to a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.getCanvas

+
+
+def agents_conversations_listViews(self, *, channel_id: str, **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def agents_conversations_listViews(
+    self,
+    *,
+    channel_id: str,
+    **kwargs,
+) -> SlackResponse:
+    """List the views currently attached to a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.listViews
+    """
+    kwargs.update({"channel_id": channel_id})
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.listViews", json=kwargs)
+
+

List the views currently attached to a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.listViews

+
+
+def agents_conversations_removeView(self,
*,
channel_id: str,
view_key: str | None = None,
view_id: str | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def agents_conversations_removeView(
+    self,
+    *,
+    channel_id: str,
+    view_key: Optional[str] = None,
+    view_id: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Remove a view from a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.removeView
+    """
+    kwargs.update(
+        {
+            "channel_id": channel_id,
+            "view_key": view_key,
+            "view_id": view_id,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.removeView", json=kwargs)
+
+

Remove a view from a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.removeView

+
+
+def agents_conversations_setCanvasContent(self, *, channel: str, canvas_id: str, content: str, **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def agents_conversations_setCanvasContent(
+    self,
+    *,
+    channel: str,
+    canvas_id: str,
+    content: str,
+    **kwargs,
+) -> SlackResponse:
+    """Replace the full markdown content of a plan canvas attached to a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent
+    """
+    kwargs.update(
+        {
+            "channel": channel,
+            "canvas_id": canvas_id,
+            "content": content,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.setCanvasContent", json=kwargs)
+
+

Replace the full markdown content of a plan canvas attached to a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent

+
+
+def agents_conversations_setCommands(self, *, channel_id: str, commands: Sequence[Dict], **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def agents_conversations_setCommands(
+    self,
+    *,
+    channel_id: str,
+    commands: Sequence[Dict],
+    **kwargs,
+) -> SlackResponse:
+    """Register the set of agent-defined slash commands for the calling agent in a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.setCommands
+    """
+    kwargs.update(
+        {
+            "commands": commands,
+            "channel_id": channel_id,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.setCommands", json=kwargs)
+
+

Register the set of agent-defined slash commands for the calling agent in a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.setCommands

+
+
+def agents_conversations_setProperties(self,
*,
channel_id: str,
code_channel: Dict | None = None,
agent_resource: Dict | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def agents_conversations_setProperties(
+    self,
+    *,
+    channel_id: str,
+    code_channel: Optional[Dict] = None,
+    agent_resource: Optional[Dict] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Set properties on a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.setProperties
+    """
+    kwargs.update(
+        {
+            "channel_id": channel_id,
+            "code_channel": code_channel,
+            "agent_resource": agent_resource,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.setProperties", json=kwargs)
+
+

Set properties on a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.setProperties

+
+
+def agents_conversations_setView(self,
*,
channel_id: str,
type: str | None = None,
view_key: str | None = None,
content: str | None = None,
blocks: Sequence[Dict | Block] | None = None,
canvas_id: str | None = None,
access_level: str | None = None,
agent_content_hash: str | None = None,
pr_url: str | None = None,
base_branch: str | None = None,
head_branch: str | None = None,
name: str | None = None,
csp: Dict | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def agents_conversations_setView(
+    self,
+    *,
+    channel_id: str,
+    type: Optional[str] = None,
+    view_key: Optional[str] = None,
+    content: Optional[str] = None,
+    blocks: Optional[Sequence[Union[Dict, Block]]] = None,
+    canvas_id: Optional[str] = None,
+    access_level: Optional[str] = None,
+    agent_content_hash: Optional[str] = None,
+    pr_url: Optional[str] = None,
+    base_branch: Optional[str] = None,
+    head_branch: Optional[str] = None,
+    name: Optional[str] = None,
+    csp: Optional[Dict] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Create or update a view in a code channel.
+
+    https://docs.slack.dev/reference/methods/agents.conversations.setView
+    """
+    kwargs.update(
+        {
+            "channel_id": channel_id,
+            "type": type,
+            "view_key": view_key,
+            "content": content,
+            "blocks": blocks,
+            "canvas_id": canvas_id,
+            "access_level": access_level,
+            "agent_content_hash": agent_content_hash,
+            "pr_url": pr_url,
+            "base_branch": base_branch,
+            "head_branch": head_branch,
+            "name": name,
+            "csp": csp,
+        }
+    )
+    kwargs = _remove_none_values(kwargs)
+    return self.api_call("agents.conversations.setView", json=kwargs)
+
+

Create or update a view in a code channel.

+

https://docs.slack.dev/reference/methods/agents.conversations.setView

+
def agents_sessions_rename(self, *, channel_id: str, title: str, thread_ts: str | None = None, **kwargs) ‑> SlackResponse
@@ -9889,6 +10518,68 @@

Methods

Uninstalls your app from a workspace.

https://docs.slack.dev/reference/methods/apps.uninstall

+
+def apps_user_connection_bulkUpdate(self,
*,
connected_user_ids: str | Sequence[str] | None = None,
disconnected_user_ids: str | Sequence[str] | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def apps_user_connection_bulkUpdate(
+    self,
+    *,
+    connected_user_ids: Optional[Union[str, Sequence[str]]] = None,
+    disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Updates the connection status between an app and many users in one call, for backfilling an existing user base.
+
+    https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate
+    """
+    if isinstance(connected_user_ids, (list, tuple)):
+        kwargs.update({"connected_user_ids": ",".join(connected_user_ids)})
+    else:
+        kwargs.update({"connected_user_ids": connected_user_ids})
+    if isinstance(disconnected_user_ids, (list, tuple)):
+        kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)})
+    else:
+        kwargs.update({"disconnected_user_ids": disconnected_user_ids})
+    return self.api_call("apps.user.connection.bulkUpdate", params=kwargs)
+
+

Updates the connection status between an app and many users in one call, for backfilling an existing user base.

+

https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate

+
+
+def apps_user_connection_requestAuth(self,
*,
primary_provider: str | Dict[str, Any],
trigger_id: str | None = None,
user_id: str | None = None,
**kwargs) ‑> SlackResponse
+
+
+
+ +Expand source code + +
def apps_user_connection_requestAuth(
+    self,
+    *,
+    primary_provider: Union[str, Dict[str, Any]],
+    trigger_id: Optional[str] = None,
+    user_id: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Opens or updates a standardized authentication modal for the calling app.
+
+    https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth
+    """
+    kwargs.update({"trigger_id": trigger_id, "user_id": user_id})
+    if isinstance(primary_provider, str):
+        kwargs.update({"primary_provider": primary_provider})
+    else:
+        kwargs.update({"primary_provider": json.dumps(primary_provider)})
+    return self.api_call("apps.user.connection.requestAuth", params=kwargs)
+
+

Opens or updates a standardized authentication modal for the calling app.

+

https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth

+
def apps_user_connection_update(self, *, user_id: str, status: str, **kwargs) ‑> SlackResponse
@@ -10526,7 +11217,7 @@

Methods

https://docs.slack.dev/reference/methods/canvases.access.set

-def canvases_create(self, *, title: str | None = None, document_content: Dict[str, str], **kwargs) ‑> SlackResponse +def canvases_create(self,
*,
title: str | None = None,
document_content: Dict[str, str] | None = None,
channel_id: str | None = None,
**kwargs) ‑> SlackResponse
@@ -10537,14 +11228,22 @@

Methods

self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs)

Create Canvas for a user.

@@ -10599,6 +11298,31 @@

Methods

+
+def canvases_getContent(self, *, canvas_id: str, content_type: str | None = None, **kwargs) ‑> SlackResponse +
+
+
+ +Expand source code + +
def canvases_getContent(
+    self,
+    *,
+    canvas_id: str,
+    content_type: Optional[str] = None,
+    **kwargs,
+) -> SlackResponse:
+    """Get the content of a canvas as markdown (default) or HTML.
+
+    https://docs.slack.dev/reference/methods/canvases.getContent
+    """
+    kwargs.update({"canvas_id": canvas_id, "content_type": content_type})
+    return self.api_call("canvases.getContent", params=kwargs)
+
+

Get the content of a canvas as markdown (default) or HTML.

+

https://docs.slack.dev/reference/methods/canvases.getContent

+
def canvases_sections_lookup(self, *, canvas_id: str, criteria: Dict[str, Any], **kwargs) ‑> SlackResponse
@@ -15334,7 +16058,7 @@

Methods

https://docs.slack.dev/reference/methods/team.externalTeams.list

-def team_info(self, *, team: str | None = None, domain: str | None = None, **kwargs) ‑> SlackResponse +def team_info(self,
*,
team: str | None = None,
domain: str | None = None,
include_slackbot_availability: bool | None = None,
**kwargs) ‑> SlackResponse
@@ -15346,13 +16070,14 @@

Methods

*, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs)

Gets information about the current team.

@@ -16978,6 +17703,7 @@

WebClientadmin_usergroups_listChannels
  • admin_usergroups_removeChannels
  • admin_users_assign
  • +
  • admin_users_getExpiration
  • admin_users_invite
  • admin_users_list
  • admin_users_remove
  • @@ -16998,6 +17724,15 @@

    WebClientadmin_workflows_permissions_lookup
  • admin_workflows_search
  • admin_workflows_unpublish
  • +
  • agents_conversations_archive
  • +
  • agents_conversations_create
  • +
  • agents_conversations_getCanvas
  • +
  • agents_conversations_listViews
  • +
  • agents_conversations_removeView
  • +
  • agents_conversations_setCanvasContent
  • +
  • agents_conversations_setCommands
  • +
  • agents_conversations_setProperties
  • +
  • agents_conversations_setView
  • agents_sessions_rename
  • agents_sessions_setStatus
  • api_test
  • @@ -17009,6 +17744,8 @@

    WebClientapps_manifest_update
  • apps_manifest_validate
  • apps_uninstall
  • +
  • apps_user_connection_bulkUpdate
  • +
  • apps_user_connection_requestAuth
  • apps_user_connection_update
  • assistant_threads_setStatus
  • assistant_threads_setSuggestedPrompts
  • @@ -17033,6 +17770,7 @@

    WebClientcanvases_create
  • canvases_delete
  • canvases_edit
  • +
  • canvases_getContent
  • canvases_sections_lookup
  • channels_archive
  • channels_create
  • diff --git a/docs/reference/models/basic_objects.html b/docs/reference/models/basic_objects.html index 5b9babd58..2d848863d 100644 --- a/docs/reference/models/basic_objects.html +++ b/docs/reference/models/basic_objects.html @@ -200,6 +200,7 @@

    Subclasses

  • FeedbackButtonObject
  • Option
  • OptionGroup
  • +
  • RawNumberObject
  • SlackFile
  • TableBlockColumnSettings
  • TextObject
  • diff --git a/docs/reference/models/blocks/basic_components.html b/docs/reference/models/blocks/basic_components.html index deb15cb45..2d7e5d431 100644 --- a/docs/reference/models/blocks/basic_components.html +++ b/docs/reference/models/blocks/basic_components.html @@ -1238,6 +1238,77 @@

    Inherited members

    +
    +class RawNumberObject +(*, value: int | float, text: str) +
    +
    +
    + +Expand source code + +
    class RawNumberObject(JsonObject):
    +    """raw_number typed object."""
    +
    +    type = "raw_number"
    +    attributes = {"value", "text", "type"}
    +    logger = logging.getLogger(__name__)
    +
    +    def __init__(self, *, value: Union[int, float], text: str):
    +        """Defines an object containing a numeric value.
    +
    +        Args:
    +            value (required): The numeric value.
    +            text (required): The text used to display the value. The minimum length is 1 character.
    +        """
    +        self.value = value
    +        self.text = text
    +
    +    @JsonValidator("text attribute must have at least 1 character")
    +    def _validate_text_min_length(self):
    +        return len(self.text) >= 1
    +
    +

    raw_number typed object.

    +

    Defines an object containing a numeric value.

    +
    +
    Args
    +
    -----=
    +
    value : required
    +
    The numeric value.
    +
    text : required
    +
    The text used to display the value. The minimum length is 1 character.
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var attributes
    +
    +

    The type of the None singleton.

    +
    +
    var logger
    +
    +

    The type of the None singleton.

    +
    +
    var type
    +
    +

    The type of the None singleton.

    +
    +
    +

    Inherited members

    + +
    class RawTextObject (*, text: str) @@ -1840,6 +1911,14 @@

  • +

    RawNumberObject

    + +
  • +
  • RawTextObject

    • attributes
    • diff --git a/docs/reference/models/blocks/block_elements.html b/docs/reference/models/blocks/block_elements.html index fa9be6437..594aed8e6 100644 --- a/docs/reference/models/blocks/block_elements.html +++ b/docs/reference/models/blocks/block_elements.html @@ -187,7 +187,7 @@

      Inherited members

      class ButtonElement -(*,
      text: str | dict | TextObject,
      action_id: str | None = None,
      url: str | None = None,
      value: str | None = None,
      style: str | None = None,
      confirm: dict | ConfirmObject | None = None,
      accessibility_label: str | None = None,
      **others: dict)
      +(*,
      text: str | dict | TextObject,
      action_id: str | None = None,
      url: str | None = None,
      value: str | None = None,
      style: str | None = None,
      confirm: dict | ConfirmObject | None = None,
      accessibility_label: str | None = None,
      agent_prompt: str | None = None,
      agent_prompt_display: str | None = None,
      visible_to_user_ids: List[str] | None = None,
      **others: dict)
      @@ -199,10 +199,23 @@

      Inherited members

      text_max_length = 75 url_max_length = 3000 value_max_length = 2000 + agent_prompt_max_length = 4000 @property def attributes(self) -> Set[str]: # type: ignore[override] - return super().attributes.union({"text", "url", "value", "style", "confirm", "accessibility_label"}) + return super().attributes.union( + { + "text", + "url", + "value", + "style", + "confirm", + "accessibility_label", + "agent_prompt", + "agent_prompt_display", + "visible_to_user_ids", + } + ) def __init__( self, @@ -214,6 +227,9 @@

      Inherited members

      style: Optional[str] = None, # primary, danger confirm: Optional[Union[dict, ConfirmObject]] = None, accessibility_label: Optional[str] = None, + agent_prompt: Optional[str] = None, + agent_prompt_display: Optional[str] = None, + visible_to_user_ids: Optional[List[str]] = None, **others: dict, ): """An interactive element that inserts a button. @@ -245,6 +261,12 @@

      Inherited members

      accessibility_label: A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters. + agent_prompt: A prompt sent to Slackbot when the button is clicked, if Slackbot AI is available to the user. + Maximum length for this field is 4000 characters. + agent_prompt_display: Short text shown instead of the full agent_prompt in the user's Slackbot message. + Only takes effect alongside agent_prompt and defaults to the button's text. + visible_to_user_ids: User IDs for which the button appears. + If not provided, the button is visible to all users. """ super().__init__(action_id=action_id, type=self.type) show_unknown_key_warning(self, others) @@ -256,6 +278,9 @@

      Inherited members

      self.style = style self.confirm = ConfirmObject.parse(confirm) # type: ignore[arg-type] self.accessibility_label = accessibility_label + self.agent_prompt = agent_prompt + self.agent_prompt_display = agent_prompt_display + self.visible_to_user_ids = visible_to_user_ids @JsonValidator(f"text attribute cannot exceed {text_max_length} characters") def _validate_text_length(self) -> bool: @@ -275,7 +300,11 @@

      Inherited members

      @JsonValidator(f"accessibility_label attribute cannot exceed {text_max_length} characters") def _validate_accessibility_label_length(self) -> bool: - return self.accessibility_label is None or len(self.accessibility_label) <= self.text_max_length
      + return self.accessibility_label is None or len(self.accessibility_label) <= self.text_max_length + + @JsonValidator(f"agent_prompt attribute cannot exceed {agent_prompt_max_length} characters") + def _validate_agent_prompt_length(self) -> bool: + return self.agent_prompt is None or len(self.agent_prompt) <= self.agent_prompt_max_length

      Block Elements are things that exists inside of your Blocks.

      https://docs.slack.dev/reference/block-kit/block-elements/

      @@ -315,6 +344,15 @@

      Inherited members

      A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters.
      +
      agent_prompt
      +
      A prompt sent to Slackbot when the button is clicked, if Slackbot AI is available to the user. +Maximum length for this field is 4000 characters.
      +
      agent_prompt_display
      +
      Short text shown instead of the full agent_prompt in the user's Slackbot message. +Only takes effect alongside agent_prompt and defaults to the button's text.
      +
      visible_to_user_ids
      +
      User IDs for which the button appears. +If not provided, the button is visible to all users.

      Ancestors

        @@ -329,6 +367,10 @@

        Subclasses

      Class variables

      +
      var agent_prompt_max_length
      +
      +

      The type of the None singleton.

      +
      var text_max_length

      The type of the None singleton.

      @@ -2611,6 +2653,7 @@

      Inherited members

    • ButtonElement:
    • +
      +class AuthProviderBlock +(*,
      value: str,
      name: str | dict | PlainTextObject,
      is_connected: bool,
      description: str | dict | PlainTextObject | None = None,
      icon_url: str | None = None,
      auth_url: str | None = None,
      disconnect_url: str | None = None,
      connected_identity: str | dict | PlainTextObject | None = None,
      connected_context: str | dict | PlainTextObject | None = None,
      accessory: dict | OverflowMenuElement | None = None,
      fallback: Sequence[dict | Block] | None = None,
      block_id: str | None = None,
      **others: dict)
      +
      +
      +
      + +Expand source code + +
      class AuthProviderBlock(Block):
      +    type = "auth_provider"
      +    value_max_length = 150
      +    name_max_length = 75
      +    description_max_length = 150
      +    connected_identity_max_length = 75
      +    connected_context_max_length = 75
      +    url_max_length = 3000
      +
      +    @property
      +    def attributes(self) -> Set[str]:  # type: ignore[override]
      +        return super().attributes.union(
      +            {
      +                "value",
      +                "name",
      +                "is_connected",
      +                "description",
      +                "icon_url",
      +                "auth_url",
      +                "disconnect_url",
      +                "connected_identity",
      +                "connected_context",
      +                "accessory",
      +                "fallback",
      +            }
      +        )
      +
      +    def __init__(
      +        self,
      +        *,
      +        value: str,
      +        name: Union[str, dict, PlainTextObject],
      +        is_connected: bool,
      +        description: Optional[Union[str, dict, PlainTextObject]] = None,
      +        icon_url: Optional[str] = None,
      +        auth_url: Optional[str] = None,
      +        disconnect_url: Optional[str] = None,
      +        connected_identity: Optional[Union[str, dict, PlainTextObject]] = None,
      +        connected_context: Optional[Union[str, dict, PlainTextObject]] = None,
      +        accessory: Optional[Union[dict, OverflowMenuElement]] = None,
      +        fallback: Optional[Sequence[Union[dict, Block]]] = None,
      +        block_id: Optional[str] = None,
      +        **others: dict,
      +    ):
      +        """Displays authentication provider information, including its icon, name, and connection state.
      +
      +        https://docs.slack.dev/reference/block-kit/blocks/auth-provider-block
      +
      +        Args:
      +            value (required): A unique identifier for this provider within the app. Included in interaction
      +                payloads and used to derive the connect button's action_id as auth_provider_connect_<value>.
      +                Maximum length for this field is 150 characters.
      +            name (required): The provider's display name, in the form of a plain_text text object.
      +                Maximum length for the text in this field is 75 characters.
      +            is_connected (required): Whether the user is connected to this provider. Slack stores this value
      +                for the user, so it must be set explicitly.
      +            description: A description of the provider, in the form of a plain_text text object.
      +                Maximum length for the text in this field is 150 characters.
      +            icon_url: An HTTPS URL for the provider's icon. Defaults to the app's avatar if omitted.
      +                Maximum length for this field is 3000 characters.
      +            auth_url: The HTTPS URL opened when the user clicks Connect. Its host must be listed in the
      +                app manifest's features.user_connections.auth_hosts, or be a subdomain of one.
      +                Maximum length for this field is 3000 characters.
      +            disconnect_url: The HTTPS URL opened when the user clicks Disconnect. Its host must be listed in
      +                the app manifest's features.user_connections.auth_hosts, or be a subdomain of one.
      +                Maximum length for this field is 3000 characters.
      +            connected_identity: The display name of the connected account, in the form of a plain_text text object.
      +                Shown when is_connected is true.
      +                Maximum length for the text in this field is 75 characters.
      +            connected_context: Additional context about the connection, such as an organization or workspace name,
      +                in the form of a plain_text text object.
      +                Maximum length for the text in this field is 75 characters.
      +            accessory: An overflow menu element shown when the user is connected.
      +            fallback: A list of blocks rendered in place of this block by clients that don't support it.
      +            block_id: A unique identifier for a block. If not specified, a block_id will be generated.
      +        """
      +        super().__init__(type=self.type, block_id=block_id)
      +        show_unknown_key_warning(self, others)
      +
      +        self.value = value
      +        self.name = TextObject.parse(name, default_type=PlainTextObject.type)
      +        self.is_connected = is_connected
      +        self.description = TextObject.parse(description, default_type=PlainTextObject.type)  # type: ignore[arg-type]
      +        self.icon_url = icon_url
      +        self.auth_url = auth_url
      +        self.disconnect_url = disconnect_url
      +        self.connected_identity = TextObject.parse(connected_identity, default_type=PlainTextObject.type)  # type: ignore[arg-type]
      +        self.connected_context = TextObject.parse(connected_context, default_type=PlainTextObject.type)  # type: ignore[arg-type]
      +        self.accessory = BlockElement.parse(accessory)  # type: ignore[arg-type]
      +        self.fallback = Block.parse_all(fallback) if fallback is not None else None
      +
      +    @JsonValidator("value attribute must be specified")
      +    def _validate_value(self):
      +        return self.value is not None and len(self.value) >= 1
      +
      +    @JsonValidator(f"value attribute cannot exceed {value_max_length} characters")
      +    def _validate_value_length(self):
      +        return self.value is None or len(self.value) <= self.value_max_length
      +
      +    @JsonValidator("name attribute must be specified")
      +    def _validate_name(self):
      +        return self.name is not None
      +
      +    @JsonValidator(f"name attribute cannot exceed {name_max_length} characters")
      +    def _validate_name_length(self):
      +        return self.name is None or len(self.name.text) <= self.name_max_length
      +
      +    @JsonValidator("is_connected attribute must be specified")
      +    def _validate_is_connected(self):
      +        return self.is_connected is not None
      +
      +    @JsonValidator(f"description attribute cannot exceed {description_max_length} characters")
      +    def _validate_description_length(self):
      +        return self.description is None or len(self.description.text) <= self.description_max_length
      +
      +    @JsonValidator(f"connected_identity attribute cannot exceed {connected_identity_max_length} characters")
      +    def _validate_connected_identity_length(self):
      +        return self.connected_identity is None or len(self.connected_identity.text) <= self.connected_identity_max_length
      +
      +    @JsonValidator(f"connected_context attribute cannot exceed {connected_context_max_length} characters")
      +    def _validate_connected_context_length(self):
      +        return self.connected_context is None or len(self.connected_context.text) <= self.connected_context_max_length
      +
      +    @JsonValidator(f"icon_url attribute cannot exceed {url_max_length} characters")
      +    def _validate_icon_url_length(self):
      +        return self.icon_url is None or len(self.icon_url) <= self.url_max_length
      +
      +    @JsonValidator(f"auth_url attribute cannot exceed {url_max_length} characters")
      +    def _validate_auth_url_length(self):
      +        return self.auth_url is None or len(self.auth_url) <= self.url_max_length
      +
      +    @JsonValidator(f"disconnect_url attribute cannot exceed {url_max_length} characters")
      +    def _validate_disconnect_url_length(self):
      +        return self.disconnect_url is None or len(self.disconnect_url) <= self.url_max_length
      +
      +    @JsonValidator("accessory attribute must be an overflow menu element")
      +    def _validate_accessory(self):
      +        return self.accessory is None or isinstance(self.accessory, OverflowMenuElement)
      +
      +

      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

      +

      Displays authentication provider information, including its icon, name, and connection state.

      +

      https://docs.slack.dev/reference/block-kit/blocks/auth-provider-block

      +
      +
      Args
      +
      -----=
      +
      value : required
      +
      A unique identifier for this provider within the app. Included in interaction +payloads and used to derive the connect button's action_id as auth_provider_connect_. +Maximum length for this field is 150 characters.
      +
      name : required
      +
      The provider's display name, in the form of a plain_text text object. +Maximum length for the text in this field is 75 characters.
      +
      is_connected : required
      +
      Whether the user is connected to this provider. Slack stores this value +for the user, so it must be set explicitly.
      +
      description
      +
      A description of the provider, in the form of a plain_text text object. +Maximum length for the text in this field is 150 characters.
      +
      icon_url
      +
      An HTTPS URL for the provider's icon. Defaults to the app's avatar if omitted. +Maximum length for this field is 3000 characters.
      +
      auth_url
      +
      The HTTPS URL opened when the user clicks Connect. Its host must be listed in the +app manifest's features.user_connections.auth_hosts, or be a subdomain of one. +Maximum length for this field is 3000 characters.
      +
      disconnect_url
      +
      The HTTPS URL opened when the user clicks Disconnect. Its host must be listed in +the app manifest's features.user_connections.auth_hosts, or be a subdomain of one. +Maximum length for this field is 3000 characters.
      +
      connected_identity
      +
      The display name of the connected account, in the form of a plain_text text object. +Shown when is_connected is true. +Maximum length for the text in this field is 75 characters.
      +
      connected_context
      +
      Additional context about the connection, such as an organization or workspace name, +in the form of a plain_text text object. +Maximum length for the text in this field is 75 characters.
      +
      accessory
      +
      An overflow menu element shown when the user is connected.
      +
      fallback
      +
      A list of blocks rendered in place of this block by clients that don't support it.
      +
      block_id
      +
      A unique identifier for a block. If not specified, a block_id will be generated.
      +
      +

      Ancestors

      + +

      Class variables

      +
      +
      var connected_context_max_length
      +
      +

      The type of the None singleton.

      +
      +
      var connected_identity_max_length
      +
      +

      The type of the None singleton.

      +
      +
      var description_max_length
      +
      +

      The type of the None singleton.

      +
      +
      var name_max_length
      +
      +

      The type of the None singleton.

      +
      +
      var type
      +
      +

      The type of the None singleton.

      +
      +
      var url_max_length
      +
      +

      The type of the None singleton.

      +
      +
      var value_max_length
      +
      +

      The type of the None singleton.

      +
      +
      +

      Instance variables

      +
      +
      prop attributes : Set[str]
      +
      +
      + +Expand source code + +
      @property
      +def attributes(self) -> Set[str]:  # type: ignore[override]
      +    return super().attributes.union(
      +        {
      +            "value",
      +            "name",
      +            "is_connected",
      +            "description",
      +            "icon_url",
      +            "auth_url",
      +            "disconnect_url",
      +            "connected_identity",
      +            "connected_context",
      +            "accessory",
      +            "fallback",
      +        }
      +    )
      +
      +

      Build an unordered collection of unique elements.

      +
      +
      +

      Inherited members

      + +
      class Block (*,
      type: str | None = None,
      subtype: str | None = None,
      block_id: str | None = None)
      @@ -360,6 +633,8 @@

      Inherited members

      return ContainerBlock(**block) elif type == CarouselBlock.type: return CarouselBlock(**block) + elif type == AuthProviderBlock.type: + return AuthProviderBlock(**block) else: cls.logger.warning(f"Unknown block detected and skipped ({block})") return None @@ -382,6 +657,7 @@

      Subclasses

      • ActionsBlock
      • AlertBlock
      • +
      • AuthProviderBlock
      • CallBlock
      • CardBlock
      • CarouselBlock
      • @@ -2302,7 +2578,7 @@

        Inherited members

        class TableBlock -(*,
        rows: Sequence[Sequence[Dict[str, Any] | RawTextObject | RichTextBlock]],
        column_settings: Sequence[Dict[str, Any] | TableBlockColumnSettings | None] | None = None,
        block_id: str | None = None,
        **others: dict)
        +(*,
        rows: Sequence[Sequence[Dict[str, Any] | RawTextObject | RawNumberObject | RichTextBlock]],
        column_settings: Sequence[Dict[str, Any] | TableBlockColumnSettings | None] | None = None,
        block_id: str | None = None,
        **others: dict)
        @@ -2319,7 +2595,7 @@

        Inherited members

        def __init__( self, *, - rows: Sequence[Sequence[Union[Dict[str, Any], "RawTextObject", "RichTextBlock"]]], + rows: Sequence[Sequence[Union[Dict[str, Any], "RawTextObject", "RawNumberObject", "RichTextBlock"]]], column_settings: Optional[Sequence[Optional[Union[Dict[str, Any], "TableBlockColumnSettings"]]]] = None, block_id: Optional[str] = None, **others: dict, @@ -2331,7 +2607,7 @@

        Inherited members

        Args: rows (required): An array consisting of table rows. Maximum 100 rows. Each row object is an array with a max of 20 table cells. - Table cells can have a type of raw_text or rich_text. + Table cells can have a type of rich_text, raw_text, or raw_number. column_settings: An array describing column behavior. If there are fewer items in the column_settings array than there are columns in the table, then the items in the the column_settings array will describe the same number of columns in the table as there are in the array itself. @@ -2363,7 +2639,7 @@

        Inherited members

        rows : required
        An array consisting of table rows. Maximum 100 rows. Each row object is an array with a max of 20 table cells. -Table cells can have a type of raw_text or rich_text.
        +Table cells can have a type of rich_text, raw_text, or raw_number.
        column_settings
        An array describing column behavior. If there are fewer items in the column_settings array than there are columns in the table, then the items in the the column_settings array will describe @@ -2795,6 +3071,19 @@

        AuthProviderBlock

        + + +
      • Block

        • attributes
        • diff --git a/docs/reference/models/blocks/index.html b/docs/reference/models/blocks/index.html index 975a5dae0..d91a82a66 100644 --- a/docs/reference/models/blocks/index.html +++ b/docs/reference/models/blocks/index.html @@ -287,6 +287,279 @@

          Inherited members

      • +
        +class AuthProviderBlock +(*,
        value: str,
        name: str | dict | PlainTextObject,
        is_connected: bool,
        description: str | dict | PlainTextObject | None = None,
        icon_url: str | None = None,
        auth_url: str | None = None,
        disconnect_url: str | None = None,
        connected_identity: str | dict | PlainTextObject | None = None,
        connected_context: str | dict | PlainTextObject | None = None,
        accessory: dict | OverflowMenuElement | None = None,
        fallback: Sequence[dict | Block] | None = None,
        block_id: str | None = None,
        **others: dict)
        +
        +
        +
        + +Expand source code + +
        class AuthProviderBlock(Block):
        +    type = "auth_provider"
        +    value_max_length = 150
        +    name_max_length = 75
        +    description_max_length = 150
        +    connected_identity_max_length = 75
        +    connected_context_max_length = 75
        +    url_max_length = 3000
        +
        +    @property
        +    def attributes(self) -> Set[str]:  # type: ignore[override]
        +        return super().attributes.union(
        +            {
        +                "value",
        +                "name",
        +                "is_connected",
        +                "description",
        +                "icon_url",
        +                "auth_url",
        +                "disconnect_url",
        +                "connected_identity",
        +                "connected_context",
        +                "accessory",
        +                "fallback",
        +            }
        +        )
        +
        +    def __init__(
        +        self,
        +        *,
        +        value: str,
        +        name: Union[str, dict, PlainTextObject],
        +        is_connected: bool,
        +        description: Optional[Union[str, dict, PlainTextObject]] = None,
        +        icon_url: Optional[str] = None,
        +        auth_url: Optional[str] = None,
        +        disconnect_url: Optional[str] = None,
        +        connected_identity: Optional[Union[str, dict, PlainTextObject]] = None,
        +        connected_context: Optional[Union[str, dict, PlainTextObject]] = None,
        +        accessory: Optional[Union[dict, OverflowMenuElement]] = None,
        +        fallback: Optional[Sequence[Union[dict, Block]]] = None,
        +        block_id: Optional[str] = None,
        +        **others: dict,
        +    ):
        +        """Displays authentication provider information, including its icon, name, and connection state.
        +
        +        https://docs.slack.dev/reference/block-kit/blocks/auth-provider-block
        +
        +        Args:
        +            value (required): A unique identifier for this provider within the app. Included in interaction
        +                payloads and used to derive the connect button's action_id as auth_provider_connect_<value>.
        +                Maximum length for this field is 150 characters.
        +            name (required): The provider's display name, in the form of a plain_text text object.
        +                Maximum length for the text in this field is 75 characters.
        +            is_connected (required): Whether the user is connected to this provider. Slack stores this value
        +                for the user, so it must be set explicitly.
        +            description: A description of the provider, in the form of a plain_text text object.
        +                Maximum length for the text in this field is 150 characters.
        +            icon_url: An HTTPS URL for the provider's icon. Defaults to the app's avatar if omitted.
        +                Maximum length for this field is 3000 characters.
        +            auth_url: The HTTPS URL opened when the user clicks Connect. Its host must be listed in the
        +                app manifest's features.user_connections.auth_hosts, or be a subdomain of one.
        +                Maximum length for this field is 3000 characters.
        +            disconnect_url: The HTTPS URL opened when the user clicks Disconnect. Its host must be listed in
        +                the app manifest's features.user_connections.auth_hosts, or be a subdomain of one.
        +                Maximum length for this field is 3000 characters.
        +            connected_identity: The display name of the connected account, in the form of a plain_text text object.
        +                Shown when is_connected is true.
        +                Maximum length for the text in this field is 75 characters.
        +            connected_context: Additional context about the connection, such as an organization or workspace name,
        +                in the form of a plain_text text object.
        +                Maximum length for the text in this field is 75 characters.
        +            accessory: An overflow menu element shown when the user is connected.
        +            fallback: A list of blocks rendered in place of this block by clients that don't support it.
        +            block_id: A unique identifier for a block. If not specified, a block_id will be generated.
        +        """
        +        super().__init__(type=self.type, block_id=block_id)
        +        show_unknown_key_warning(self, others)
        +
        +        self.value = value
        +        self.name = TextObject.parse(name, default_type=PlainTextObject.type)
        +        self.is_connected = is_connected
        +        self.description = TextObject.parse(description, default_type=PlainTextObject.type)  # type: ignore[arg-type]
        +        self.icon_url = icon_url
        +        self.auth_url = auth_url
        +        self.disconnect_url = disconnect_url
        +        self.connected_identity = TextObject.parse(connected_identity, default_type=PlainTextObject.type)  # type: ignore[arg-type]
        +        self.connected_context = TextObject.parse(connected_context, default_type=PlainTextObject.type)  # type: ignore[arg-type]
        +        self.accessory = BlockElement.parse(accessory)  # type: ignore[arg-type]
        +        self.fallback = Block.parse_all(fallback) if fallback is not None else None
        +
        +    @JsonValidator("value attribute must be specified")
        +    def _validate_value(self):
        +        return self.value is not None and len(self.value) >= 1
        +
        +    @JsonValidator(f"value attribute cannot exceed {value_max_length} characters")
        +    def _validate_value_length(self):
        +        return self.value is None or len(self.value) <= self.value_max_length
        +
        +    @JsonValidator("name attribute must be specified")
        +    def _validate_name(self):
        +        return self.name is not None
        +
        +    @JsonValidator(f"name attribute cannot exceed {name_max_length} characters")
        +    def _validate_name_length(self):
        +        return self.name is None or len(self.name.text) <= self.name_max_length
        +
        +    @JsonValidator("is_connected attribute must be specified")
        +    def _validate_is_connected(self):
        +        return self.is_connected is not None
        +
        +    @JsonValidator(f"description attribute cannot exceed {description_max_length} characters")
        +    def _validate_description_length(self):
        +        return self.description is None or len(self.description.text) <= self.description_max_length
        +
        +    @JsonValidator(f"connected_identity attribute cannot exceed {connected_identity_max_length} characters")
        +    def _validate_connected_identity_length(self):
        +        return self.connected_identity is None or len(self.connected_identity.text) <= self.connected_identity_max_length
        +
        +    @JsonValidator(f"connected_context attribute cannot exceed {connected_context_max_length} characters")
        +    def _validate_connected_context_length(self):
        +        return self.connected_context is None or len(self.connected_context.text) <= self.connected_context_max_length
        +
        +    @JsonValidator(f"icon_url attribute cannot exceed {url_max_length} characters")
        +    def _validate_icon_url_length(self):
        +        return self.icon_url is None or len(self.icon_url) <= self.url_max_length
        +
        +    @JsonValidator(f"auth_url attribute cannot exceed {url_max_length} characters")
        +    def _validate_auth_url_length(self):
        +        return self.auth_url is None or len(self.auth_url) <= self.url_max_length
        +
        +    @JsonValidator(f"disconnect_url attribute cannot exceed {url_max_length} characters")
        +    def _validate_disconnect_url_length(self):
        +        return self.disconnect_url is None or len(self.disconnect_url) <= self.url_max_length
        +
        +    @JsonValidator("accessory attribute must be an overflow menu element")
        +    def _validate_accessory(self):
        +        return self.accessory is None or isinstance(self.accessory, OverflowMenuElement)
        +
        +

        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

        +

        Displays authentication provider information, including its icon, name, and connection state.

        +

        https://docs.slack.dev/reference/block-kit/blocks/auth-provider-block

        +
        +
        Args
        +
        -----=
        +
        value : required
        +
        A unique identifier for this provider within the app. Included in interaction +payloads and used to derive the connect button's action_id as auth_provider_connect_. +Maximum length for this field is 150 characters.
        +
        name : required
        +
        The provider's display name, in the form of a plain_text text object. +Maximum length for the text in this field is 75 characters.
        +
        is_connected : required
        +
        Whether the user is connected to this provider. Slack stores this value +for the user, so it must be set explicitly.
        +
        description
        +
        A description of the provider, in the form of a plain_text text object. +Maximum length for the text in this field is 150 characters.
        +
        icon_url
        +
        An HTTPS URL for the provider's icon. Defaults to the app's avatar if omitted. +Maximum length for this field is 3000 characters.
        +
        auth_url
        +
        The HTTPS URL opened when the user clicks Connect. Its host must be listed in the +app manifest's features.user_connections.auth_hosts, or be a subdomain of one. +Maximum length for this field is 3000 characters.
        +
        disconnect_url
        +
        The HTTPS URL opened when the user clicks Disconnect. Its host must be listed in +the app manifest's features.user_connections.auth_hosts, or be a subdomain of one. +Maximum length for this field is 3000 characters.
        +
        connected_identity
        +
        The display name of the connected account, in the form of a plain_text text object. +Shown when is_connected is true. +Maximum length for the text in this field is 75 characters.
        +
        connected_context
        +
        Additional context about the connection, such as an organization or workspace name, +in the form of a plain_text text object. +Maximum length for the text in this field is 75 characters.
        +
        accessory
        +
        An overflow menu element shown when the user is connected.
        +
        fallback
        +
        A list of blocks rendered in place of this block by clients that don't support it.
        +
        block_id
        +
        A unique identifier for a block. If not specified, a block_id will be generated.
        +
        +

        Ancestors

        + +

        Class variables

        +
        +
        var connected_context_max_length
        +
        +

        The type of the None singleton.

        +
        +
        var connected_identity_max_length
        +
        +

        The type of the None singleton.

        +
        +
        var description_max_length
        +
        +

        The type of the None singleton.

        +
        +
        var name_max_length
        +
        +

        The type of the None singleton.

        +
        +
        var type
        +
        +

        The type of the None singleton.

        +
        +
        var url_max_length
        +
        +

        The type of the None singleton.

        +
        +
        var value_max_length
        +
        +

        The type of the None singleton.

        +
        +
        +

        Instance variables

        +
        +
        prop attributes : Set[str]
        +
        +
        + +Expand source code + +
        @property
        +def attributes(self) -> Set[str]:  # type: ignore[override]
        +    return super().attributes.union(
        +        {
        +            "value",
        +            "name",
        +            "is_connected",
        +            "description",
        +            "icon_url",
        +            "auth_url",
        +            "disconnect_url",
        +            "connected_identity",
        +            "connected_context",
        +            "accessory",
        +            "fallback",
        +        }
        +    )
        +
        +

        Build an unordered collection of unique elements.

        +
        +
        +

        Inherited members

        + +
        class Block (*,
        type: str | None = None,
        subtype: str | None = None,
        block_id: str | None = None)
        @@ -382,6 +655,8 @@

        Inherited members

        return ContainerBlock(**block) elif type == CarouselBlock.type: return CarouselBlock(**block) + elif type == AuthProviderBlock.type: + return AuthProviderBlock(**block) else: cls.logger.warning(f"Unknown block detected and skipped ({block})") return None @@ -404,6 +679,7 @@

        Subclasses

        • ActionsBlock
        • AlertBlock
        • +
        • AuthProviderBlock
        • CallBlock
        • CardBlock
        • CarouselBlock
        • @@ -620,7 +896,7 @@

          Inherited members

          class ButtonElement -(*,
          text: str | dict | TextObject,
          action_id: str | None = None,
          url: str | None = None,
          value: str | None = None,
          style: str | None = None,
          confirm: dict | ConfirmObject | None = None,
          accessibility_label: str | None = None,
          **others: dict)
          +(*,
          text: str | dict | TextObject,
          action_id: str | None = None,
          url: str | None = None,
          value: str | None = None,
          style: str | None = None,
          confirm: dict | ConfirmObject | None = None,
          accessibility_label: str | None = None,
          agent_prompt: str | None = None,
          agent_prompt_display: str | None = None,
          visible_to_user_ids: List[str] | None = None,
          **others: dict)
          @@ -632,10 +908,23 @@

          Inherited members

          text_max_length = 75 url_max_length = 3000 value_max_length = 2000 + agent_prompt_max_length = 4000 @property def attributes(self) -> Set[str]: # type: ignore[override] - return super().attributes.union({"text", "url", "value", "style", "confirm", "accessibility_label"}) + return super().attributes.union( + { + "text", + "url", + "value", + "style", + "confirm", + "accessibility_label", + "agent_prompt", + "agent_prompt_display", + "visible_to_user_ids", + } + ) def __init__( self, @@ -647,6 +936,9 @@

          Inherited members

          style: Optional[str] = None, # primary, danger confirm: Optional[Union[dict, ConfirmObject]] = None, accessibility_label: Optional[str] = None, + agent_prompt: Optional[str] = None, + agent_prompt_display: Optional[str] = None, + visible_to_user_ids: Optional[List[str]] = None, **others: dict, ): """An interactive element that inserts a button. @@ -678,6 +970,12 @@

          Inherited members

          accessibility_label: A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters. + agent_prompt: A prompt sent to Slackbot when the button is clicked, if Slackbot AI is available to the user. + Maximum length for this field is 4000 characters. + agent_prompt_display: Short text shown instead of the full agent_prompt in the user's Slackbot message. + Only takes effect alongside agent_prompt and defaults to the button's text. + visible_to_user_ids: User IDs for which the button appears. + If not provided, the button is visible to all users. """ super().__init__(action_id=action_id, type=self.type) show_unknown_key_warning(self, others) @@ -689,6 +987,9 @@

          Inherited members

          self.style = style self.confirm = ConfirmObject.parse(confirm) # type: ignore[arg-type] self.accessibility_label = accessibility_label + self.agent_prompt = agent_prompt + self.agent_prompt_display = agent_prompt_display + self.visible_to_user_ids = visible_to_user_ids @JsonValidator(f"text attribute cannot exceed {text_max_length} characters") def _validate_text_length(self) -> bool: @@ -708,7 +1009,11 @@

          Inherited members

          @JsonValidator(f"accessibility_label attribute cannot exceed {text_max_length} characters") def _validate_accessibility_label_length(self) -> bool: - return self.accessibility_label is None or len(self.accessibility_label) <= self.text_max_length
          + return self.accessibility_label is None or len(self.accessibility_label) <= self.text_max_length + + @JsonValidator(f"agent_prompt attribute cannot exceed {agent_prompt_max_length} characters") + def _validate_agent_prompt_length(self) -> bool: + return self.agent_prompt is None or len(self.agent_prompt) <= self.agent_prompt_max_length

          Block Elements are things that exists inside of your Blocks.

          https://docs.slack.dev/reference/block-kit/block-elements/

          @@ -748,6 +1053,15 @@

          Inherited members

          A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters.
          +
          agent_prompt
          +
          A prompt sent to Slackbot when the button is clicked, if Slackbot AI is available to the user. +Maximum length for this field is 4000 characters.
          +
          agent_prompt_display
          +
          Short text shown instead of the full agent_prompt in the user's Slackbot message. +Only takes effect alongside agent_prompt and defaults to the button's text.
          +
          visible_to_user_ids
          +
          User IDs for which the button appears. +If not provided, the button is visible to all users.

      Ancestors

        @@ -762,6 +1076,10 @@

        Subclasses

      Class variables

      +
      var agent_prompt_max_length
      +
      +

      The type of the None singleton.

      +
      var text_max_length

      The type of the None singleton.

      @@ -4658,6 +4976,7 @@

      Inherited members

    • ButtonElement:
    • +
      +class RawNumberObject +(*, value: int | float, text: str) +
      +
      +
      + +Expand source code + +
      class RawNumberObject(JsonObject):
      +    """raw_number typed object."""
      +
      +    type = "raw_number"
      +    attributes = {"value", "text", "type"}
      +    logger = logging.getLogger(__name__)
      +
      +    def __init__(self, *, value: Union[int, float], text: str):
      +        """Defines an object containing a numeric value.
      +
      +        Args:
      +            value (required): The numeric value.
      +            text (required): The text used to display the value. The minimum length is 1 character.
      +        """
      +        self.value = value
      +        self.text = text
      +
      +    @JsonValidator("text attribute must have at least 1 character")
      +    def _validate_text_min_length(self):
      +        return len(self.text) >= 1
      +
      +

      raw_number typed object.

      +

      Defines an object containing a numeric value.

      +
      +
      Args
      +
      -----=
      +
      value : required
      +
      The numeric value.
      +
      text : required
      +
      The text used to display the value. The minimum length is 1 character.
      +
      +

      Ancestors

      + +

      Class variables

      +
      +
      var attributes
      +
      +

      The type of the None singleton.

      +
      +
      var logger
      +
      +

      The type of the None singleton.

      +
      +
      var type
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      class RawTextObject (*, text: str) @@ -7833,7 +8223,7 @@

      Inherited members

      class TableBlock -(*,
      rows: Sequence[Sequence[Dict[str, Any] | RawTextObject | RichTextBlock]],
      column_settings: Sequence[Dict[str, Any] | TableBlockColumnSettings | None] | None = None,
      block_id: str | None = None,
      **others: dict)
      +(*,
      rows: Sequence[Sequence[Dict[str, Any] | RawTextObject | RawNumberObject | RichTextBlock]],
      column_settings: Sequence[Dict[str, Any] | TableBlockColumnSettings | None] | None = None,
      block_id: str | None = None,
      **others: dict)
      @@ -7850,7 +8240,7 @@

      Inherited members

      def __init__( self, *, - rows: Sequence[Sequence[Union[Dict[str, Any], "RawTextObject", "RichTextBlock"]]], + rows: Sequence[Sequence[Union[Dict[str, Any], "RawTextObject", "RawNumberObject", "RichTextBlock"]]], column_settings: Optional[Sequence[Optional[Union[Dict[str, Any], "TableBlockColumnSettings"]]]] = None, block_id: Optional[str] = None, **others: dict, @@ -7862,7 +8252,7 @@

      Inherited members

      Args: rows (required): An array consisting of table rows. Maximum 100 rows. Each row object is an array with a max of 20 table cells. - Table cells can have a type of raw_text or rich_text. + Table cells can have a type of rich_text, raw_text, or raw_number. column_settings: An array describing column behavior. If there are fewer items in the column_settings array than there are columns in the table, then the items in the the column_settings array will describe the same number of columns in the table as there are in the array itself. @@ -7894,7 +8284,7 @@

      Inherited members

      rows : required
      An array consisting of table rows. Maximum 100 rows. Each row object is an array with a max of 20 table cells. -Table cells can have a type of raw_text or rich_text.
      +Table cells can have a type of rich_text, raw_text, or raw_number.
      column_settings
      An array describing column behavior. If there are fewer items in the column_settings array than there are columns in the table, then the items in the the column_settings array will describe @@ -9175,6 +9565,19 @@

      AuthProviderBlock

      + + +
    • Block

      • attributes
      • @@ -9198,6 +9601,7 @@

        ButtonElement

          +
        • agent_prompt_max_length
        • text_max_length
        • type
        • url_max_length
        • @@ -9526,6 +9930,14 @@

          RawNumberObject

          + + +
        • RawTextObject

          • attributes
          • diff --git a/docs/reference/models/index.html b/docs/reference/models/index.html index f9fced221..b28d431f4 100644 --- a/docs/reference/models/index.html +++ b/docs/reference/models/index.html @@ -305,6 +305,7 @@

            Subclasses

          • FeedbackButtonObject
          • Option
          • OptionGroup
          • +
          • RawNumberObject
          • SlackFile
          • TableBlockColumnSettings
          • TextObject
          • diff --git a/docs/reference/socket_mode/aiohttp/index.html b/docs/reference/socket_mode/aiohttp/index.html index a5764d02b..21d4ffea0 100644 --- a/docs/reference/socket_mode/aiohttp/index.html +++ b/docs/reference/socket_mode/aiohttp/index.html @@ -176,7 +176,7 @@

            Classes

            session: ClientWebSocketResponse = self.current_session # type: ignore[assignment] session_id: str = self.build_session_id(session) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() execution loop for {session_id} started") try: logging_interval = 100 @@ -184,11 +184,11 @@

            Classes

            while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") break try: - if self.trace_enabled and self.logger.level <= logging.DEBUG: + if self.trace_enabled and self.logger.isEnabledFor(logging.DEBUG): # The logging here is for detailed investigation on potential issues in this client. # If you don't see this log for a while, it means that # this receive_messages execution is no longer working for some reason. @@ -240,7 +240,7 @@

            Classes

            f"(error: {type(e).__name__}, message: {e})" ) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") raise @@ -250,7 +250,7 @@

            Classes

            # To avoid such, we access only the session that is active when this loop starts. session = self.current_session session_id = self.build_session_id(session) # type: ignore[arg-type] - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() execution loop with {session_id} started") try: consecutive_error_count = 0 @@ -259,14 +259,14 @@

            Classes

            while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") break try: message: WSMessage = await session.receive() # type: ignore[union-attr] # just in case, checking if the value is not None if message is not None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): # The following logging prints every single received message # except empty message data ones. m_type = WSMsgType(message.type) @@ -341,7 +341,7 @@

            Classes

            else: await asyncio.sleep(consecutive_error_count) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") raise @@ -359,7 +359,7 @@

            Classes

            and not self.current_session.closed and not await self.is_ping_pong_failing() ) - if self.logger.level <= logging.DEBUG and connected is False: + if self.logger.isEnabledFor(logging.DEBUG) and connected is False: # Prints more detailed information about the inactive connection is_ping_pong_failing = await self.is_ping_pong_failing() session_id = await self.session_id() @@ -402,6 +402,10 @@

            Classes

            except Exception as e: self.logger.exception(f"Failed to close the old session : {e}") + if self.aiohttp_client_session.closed and not self.closed: + self.logger.info("The aiohttp client session is closed; creating a new one") + self.aiohttp_client_session = aiohttp.ClientSession() + if self.wss_uri is None: # If the underlying WSS URL does not exist, # acquiring a new active WSS URL from the server-side first @@ -420,7 +424,7 @@

            Classes

            self.logger.info(f"A new session ({session_id}) has been established") # The first ping from the new connection - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a ping message with the newly established connection ({session_id})...") t = time.time() await self.current_session.ping(f"sdk-ping-pong:{t}".encode("utf-8")) @@ -428,18 +432,18 @@

            Classes

            if self.current_session_monitor is not None: self.current_session_monitor.cancel() self.current_session_monitor = asyncio.ensure_future(self.monitor_current_session()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() executor has been recreated for {session_id}") if self.message_receiver is not None: self.message_receiver.cancel() self.message_receiver = asyncio.ensure_future(self.receive_messages()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() executor has been recreated for {session_id}") break except Exception as e: if self.closed: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Stopped connecting because the client is closed (error: {e})") return self.logger.exception(f"Failed to connect (error: {e}); Retrying...") @@ -453,14 +457,14 @@

            Classes

            async def send_message(self, message: str): session_id = await self.session_id() - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message: {message} from session: {session_id}") try: await self.current_session.send_str(message) # type: ignore[union-attr] except ConnectionError as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (error: {e}, message: {message}, session: {session_id})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -646,6 +650,10 @@

            Methods

            except Exception as e: self.logger.exception(f"Failed to close the old session : {e}") + if self.aiohttp_client_session.closed and not self.closed: + self.logger.info("The aiohttp client session is closed; creating a new one") + self.aiohttp_client_session = aiohttp.ClientSession() + if self.wss_uri is None: # If the underlying WSS URL does not exist, # acquiring a new active WSS URL from the server-side first @@ -664,7 +672,7 @@

            Methods

            self.logger.info(f"A new session ({session_id}) has been established") # The first ping from the new connection - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a ping message with the newly established connection ({session_id})...") t = time.time() await self.current_session.ping(f"sdk-ping-pong:{t}".encode("utf-8")) @@ -672,18 +680,18 @@

            Methods

            if self.current_session_monitor is not None: self.current_session_monitor.cancel() self.current_session_monitor = asyncio.ensure_future(self.monitor_current_session()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() executor has been recreated for {session_id}") if self.message_receiver is not None: self.message_receiver.cancel() self.message_receiver = asyncio.ensure_future(self.receive_messages()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() executor has been recreated for {session_id}") break except Exception as e: if self.closed: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Stopped connecting because the client is closed (error: {e})") return self.logger.exception(f"Failed to connect (error: {e}); Retrying...") @@ -723,7 +731,7 @@

            Methods

            and not self.current_session.closed and not await self.is_ping_pong_failing() ) - if self.logger.level <= logging.DEBUG and connected is False: + if self.logger.isEnabledFor(logging.DEBUG) and connected is False: # Prints more detailed information about the inactive connection is_ping_pong_failing = await self.is_ping_pong_failing() session_id = await self.session_id() @@ -771,7 +779,7 @@

            Methods

            session: ClientWebSocketResponse = self.current_session # type: ignore[assignment] session_id: str = self.build_session_id(session) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() execution loop for {session_id} started") try: logging_interval = 100 @@ -779,11 +787,11 @@

            Methods

            while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") break try: - if self.trace_enabled and self.logger.level <= logging.DEBUG: + if self.trace_enabled and self.logger.isEnabledFor(logging.DEBUG): # The logging here is for detailed investigation on potential issues in this client. # If you don't see this log for a while, it means that # this receive_messages execution is no longer working for some reason. @@ -835,7 +843,7 @@

            Methods

            f"(error: {type(e).__name__}, message: {e})" ) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") raise
            @@ -855,7 +863,7 @@

            Methods

            # To avoid such, we access only the session that is active when this loop starts. session = self.current_session session_id = self.build_session_id(session) # type: ignore[arg-type] - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() execution loop with {session_id} started") try: consecutive_error_count = 0 @@ -864,14 +872,14 @@

            Methods

            while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") break try: message: WSMessage = await session.receive() # type: ignore[union-attr] # just in case, checking if the value is not None if message is not None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): # The following logging prints every single received message # except empty message data ones. m_type = WSMsgType(message.type) @@ -946,7 +954,7 @@

            Methods

            else: await asyncio.sleep(consecutive_error_count) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") raise @@ -962,14 +970,14 @@

            Methods

            async def send_message(self, message: str):
                 session_id = await self.session_id()
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message: {message} from session: {session_id}")
                 try:
                     await self.current_session.send_str(message)  # type: ignore[union-attr]
                 except ConnectionError as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (error: {e}, message: {message}, session: {session_id})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/socket_mode/async_client.html b/docs/reference/socket_mode/async_client.html
            index e8f70035d..37f0d6c79 100644
            --- a/docs/reference/socket_mode/async_client.html
            +++ b/docs/reference/socket_mode/async_client.html
            @@ -144,7 +144,7 @@ 

            Classes

            async def enqueue_message(self, message: str): await self.message_queue.put(message) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): queue_size = self.message_queue.qsize() session_id = await self.session_id() self.logger.debug(f"A new message enqueued (current queue size: {queue_size}, session: {session_id})") @@ -178,7 +178,7 @@

            Classes

            async def run_message_listeners(self, message: dict, raw_message: str) -> None: session_id = await self.session_id() type, envelope_id = message.get("type"), message.get("envelope_id") - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Message processing started (type: {type}, envelope_id: {envelope_id}, session: {session_id})" ) @@ -204,7 +204,7 @@

            Classes

            except Exception as e: self.logger.exception(f"Failed to run message listeners: {e}, session: {session_id}") finally: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Message processing completed (type: {type}, envelope_id: {envelope_id}, session: {session_id})" )
            @@ -346,7 +346,7 @@

            Methods

            async def enqueue_message(self, message: str):
                 await self.message_queue.put(message)
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     queue_size = self.message_queue.qsize()
                     session_id = await self.session_id()
                     self.logger.debug(f"A new message enqueued (current queue size: {queue_size}, session: {session_id})")
            @@ -450,7 +450,7 @@

            Methods

            async def run_message_listeners(self, message: dict, raw_message: str) -> None:
                 session_id = await self.session_id()
                 type, envelope_id = message.get("type"), message.get("envelope_id")
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(
                         f"Message processing started (type: {type}, envelope_id: {envelope_id}, session: {session_id})"
                     )
            @@ -476,7 +476,7 @@ 

            Methods

            except Exception as e: self.logger.exception(f"Failed to run message listeners: {e}, session: {session_id}") finally: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Message processing completed (type: {type}, envelope_id: {envelope_id}, session: {session_id})" )
            diff --git a/docs/reference/socket_mode/builtin/client.html b/docs/reference/socket_mode/builtin/client.html index 39b45d400..68401623a 100644 --- a/docs/reference/socket_mode/builtin/client.html +++ b/docs/reference/socket_mode/builtin/client.html @@ -231,14 +231,14 @@

            Classes

            self.current_session.close() def send_message(self, message: str) -> None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})") try: self.current_session.send(message) # type: ignore[union-attr] except SlackClientNotConnectedError as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -255,10 +255,13 @@

            Classes

            ) raise e - def close(self): + def close(self) -> None: self.closed = True self.auto_reconnect_enabled = False + self.current_session_state.terminated = True self.disconnect() + if self.current_session_runner.is_alive(): + self.current_session_runner.shutdown() if self.current_app_monitor.is_alive(): self.current_app_monitor.shutdown() if self.message_processor.is_alive(): @@ -266,7 +269,7 @@

            Classes

            self.message_workers.shutdown() def _on_message(self, message: str): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_message invoked: (message: {debug_redacted_message_string(message)})") self.enqueue_message(message) for listener in self.on_message_listeners: @@ -285,7 +288,7 @@

            Classes

            listener(error) def _on_close(self, code: int, reason: Optional[str] = None): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_close invoked (session id: {self.session_id()})") if self.auto_reconnect_enabled: self.logger.info(f"Received CLOSE event. Reconnecting... (session id: {self.session_id()})") @@ -417,17 +420,20 @@

            Class variables

            Methods

            -def close(self) +def close(self) ‑> None
            Expand source code -
            def close(self):
            +
            def close(self) -> None:
                 self.closed = True
                 self.auto_reconnect_enabled = False
            +    self.current_session_state.terminated = True
                 self.disconnect()
            +    if self.current_session_runner.is_alive():
            +        self.current_session_runner.shutdown()
                 if self.current_app_monitor.is_alive():
                     self.current_app_monitor.shutdown()
                 if self.message_processor.is_alive():
            @@ -521,14 +527,14 @@ 

            Methods

            Expand source code
            def send_message(self, message: str) -> None:
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})")
                 try:
                     self.current_session.send(message)  # type: ignore[union-attr]
                 except SlackClientNotConnectedError as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/socket_mode/builtin/index.html b/docs/reference/socket_mode/builtin/index.html
            index bc95f8729..f44ddc541 100644
            --- a/docs/reference/socket_mode/builtin/index.html
            +++ b/docs/reference/socket_mode/builtin/index.html
            @@ -245,14 +245,14 @@ 

            Classes

            self.current_session.close() def send_message(self, message: str) -> None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})") try: self.current_session.send(message) # type: ignore[union-attr] except SlackClientNotConnectedError as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -269,10 +269,13 @@

            Classes

            ) raise e - def close(self): + def close(self) -> None: self.closed = True self.auto_reconnect_enabled = False + self.current_session_state.terminated = True self.disconnect() + if self.current_session_runner.is_alive(): + self.current_session_runner.shutdown() if self.current_app_monitor.is_alive(): self.current_app_monitor.shutdown() if self.message_processor.is_alive(): @@ -280,7 +283,7 @@

            Classes

            self.message_workers.shutdown() def _on_message(self, message: str): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_message invoked: (message: {debug_redacted_message_string(message)})") self.enqueue_message(message) for listener in self.on_message_listeners: @@ -299,7 +302,7 @@

            Classes

            listener(error) def _on_close(self, code: int, reason: Optional[str] = None): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_close invoked (session id: {self.session_id()})") if self.auto_reconnect_enabled: self.logger.info(f"Received CLOSE event. Reconnecting... (session id: {self.session_id()})") @@ -431,17 +434,20 @@

            Class variables

            Methods

            -def close(self) +def close(self) ‑> None
            Expand source code -
            def close(self):
            +
            def close(self) -> None:
                 self.closed = True
                 self.auto_reconnect_enabled = False
            +    self.current_session_state.terminated = True
                 self.disconnect()
            +    if self.current_session_runner.is_alive():
            +        self.current_session_runner.shutdown()
                 if self.current_app_monitor.is_alive():
                     self.current_app_monitor.shutdown()
                 if self.message_processor.is_alive():
            @@ -535,14 +541,14 @@ 

            Methods

            Expand source code
            def send_message(self, message: str) -> None:
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})")
                 try:
                     self.current_session.send(message)  # type: ignore[union-attr]
                 except SlackClientNotConnectedError as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/socket_mode/client.html b/docs/reference/socket_mode/client.html
            index f7807a985..a56b8bb13 100644
            --- a/docs/reference/socket_mode/client.html
            +++ b/docs/reference/socket_mode/client.html
            @@ -133,13 +133,13 @@ 

            Classes

            def enqueue_message(self, message: str): self.message_queue.put(message) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new message enqueued (current queue size: {self.message_queue.qsize()})") def process_message(self): try: raw_message = self.message_queue.get(timeout=1) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A message dequeued (current queue size: {self.message_queue.qsize()})") if raw_message is not None: @@ -159,7 +159,7 @@

            Classes

            def run_message_listeners(self, message: dict, raw_message: str) -> None: type, envelope_id = message.get("type"), message.get("envelope_id") - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Message processing started (type: {type}, envelope_id: {envelope_id})") try: # just in case, adding the same logic to reconnect here @@ -184,7 +184,7 @@

            Classes

            except Exception as e: self.logger.exception(f"Failed to run message listeners: {e}") finally: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Message processing completed (type: {type}, envelope_id: {envelope_id})") def process_messages(self) -> None: @@ -322,7 +322,7 @@

            Methods

            def enqueue_message(self, message: str):
                 self.message_queue.put(message)
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"A new message enqueued (current queue size: {self.message_queue.qsize()})")
            @@ -378,7 +378,7 @@

            Methods

            def process_message(self):
                 try:
                     raw_message = self.message_queue.get(timeout=1)
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(f"A message dequeued (current queue size: {self.message_queue.qsize()})")
             
                     if raw_message is not None:
            @@ -425,7 +425,7 @@ 

            Methods

            def run_message_listeners(self, message: dict, raw_message: str) -> None:
                 type, envelope_id = message.get("type"), message.get("envelope_id")
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Message processing started (type: {type}, envelope_id: {envelope_id})")
                 try:
                     # just in case, adding the same logic to reconnect here
            @@ -450,7 +450,7 @@ 

            Methods

            except Exception as e: self.logger.exception(f"Failed to run message listeners: {e}") finally: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Message processing completed (type: {type}, envelope_id: {envelope_id})")
            diff --git a/docs/reference/socket_mode/index.html b/docs/reference/socket_mode/index.html index 16c62c4c5..7635d07de 100644 --- a/docs/reference/socket_mode/index.html +++ b/docs/reference/socket_mode/index.html @@ -281,14 +281,14 @@

            Classes

            self.current_session.close() def send_message(self, message: str) -> None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})") try: self.current_session.send(message) # type: ignore[union-attr] except SlackClientNotConnectedError as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -305,10 +305,13 @@

            Classes

            ) raise e - def close(self): + def close(self) -> None: self.closed = True self.auto_reconnect_enabled = False + self.current_session_state.terminated = True self.disconnect() + if self.current_session_runner.is_alive(): + self.current_session_runner.shutdown() if self.current_app_monitor.is_alive(): self.current_app_monitor.shutdown() if self.message_processor.is_alive(): @@ -316,7 +319,7 @@

            Classes

            self.message_workers.shutdown() def _on_message(self, message: str): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_message invoked: (message: {debug_redacted_message_string(message)})") self.enqueue_message(message) for listener in self.on_message_listeners: @@ -335,7 +338,7 @@

            Classes

            listener(error) def _on_close(self, code: int, reason: Optional[str] = None): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_close invoked (session id: {self.session_id()})") if self.auto_reconnect_enabled: self.logger.info(f"Received CLOSE event. Reconnecting... (session id: {self.session_id()})") @@ -467,17 +470,20 @@

            Class variables

            Methods

            -def close(self) +def close(self) ‑> None
            Expand source code -
            def close(self):
            +
            def close(self) -> None:
                 self.closed = True
                 self.auto_reconnect_enabled = False
            +    self.current_session_state.terminated = True
                 self.disconnect()
            +    if self.current_session_runner.is_alive():
            +        self.current_session_runner.shutdown()
                 if self.current_app_monitor.is_alive():
                     self.current_app_monitor.shutdown()
                 if self.message_processor.is_alive():
            @@ -571,14 +577,14 @@ 

            Methods

            Expand source code
            def send_message(self, message: str) -> None:
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message (session id: {self.session_id()}, message: {message})")
                 try:
                     self.current_session.send(message)  # type: ignore[union-attr]
                 except SlackClientNotConnectedError as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (session id: {self.session_id()}, error: {e}, message: {message})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/socket_mode/websocket_client/index.html b/docs/reference/socket_mode/websocket_client/index.html
            index e8abb751b..07ec6ea1b 100644
            --- a/docs/reference/socket_mode/websocket_client/index.html
            +++ b/docs/reference/socket_mode/websocket_client/index.html
            @@ -176,13 +176,13 @@ 

            Classes

            def connect(self) -> None: def on_open(ws: WebSocketApp): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug("on_open invoked") for listener in self.on_open_listeners: listener(ws) def on_message(ws: WebSocketApp, message: str): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_message invoked: (message: {debug_redacted_message_string(message)})") self.enqueue_message(message) for listener in self.on_message_listeners: @@ -198,7 +198,7 @@

            Classes

            close_status_code: Optional[int] = None, close_msg: Optional[str] = None, ): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_close invoked: (code: {close_status_code}, message: {close_msg})") if self.auto_reconnect_enabled: self.logger.info("Received CLOSE event. Reconnecting...") @@ -234,14 +234,14 @@

            Classes

            self.current_session.close() def send_message(self, message: str) -> None: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message: {message}") try: self.current_session.send(message) # type: ignore[union-attr] except WebSocketException as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (error: {e}, message: {message})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -408,13 +408,13 @@

            Methods

            def connect(self) -> None:
                 def on_open(ws: WebSocketApp):
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug("on_open invoked")
                     for listener in self.on_open_listeners:
                         listener(ws)
             
                 def on_message(ws: WebSocketApp, message: str):
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(f"on_message invoked: (message: {debug_redacted_message_string(message)})")
                     self.enqueue_message(message)
                     for listener in self.on_message_listeners:
            @@ -430,7 +430,7 @@ 

            Methods

            close_status_code: Optional[int] = None, close_msg: Optional[str] = None, ): - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"on_close invoked: (code: {close_status_code}, message: {close_msg})") if self.auto_reconnect_enabled: self.logger.info("Received CLOSE event. Reconnecting...") @@ -499,14 +499,14 @@

            Methods

            Expand source code
            def send_message(self, message: str) -> None:
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message: {message}")
                 try:
                     self.current_session.send(message)  # type: ignore[union-attr]
                 except WebSocketException as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (error: {e}, message: {message})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/socket_mode/websockets/index.html b/docs/reference/socket_mode/websockets/index.html
            index aae11341f..fc49b3e70 100644
            --- a/docs/reference/socket_mode/websockets/index.html
            +++ b/docs/reference/socket_mode/websockets/index.html
            @@ -138,12 +138,12 @@ 

            Classes

            # To avoid such, we access only the session that is active when this loop starts. session: ClientConnection = self.current_session # type: ignore[assignment] session_id: str = await self.session_id() - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() execution loop for {session_id} started") try: while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") break await asyncio.sleep(self.ping_interval) @@ -157,7 +157,7 @@

            Classes

            f"(error: {type(e).__name__}, message: {e}, session: {session_id})" ) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") raise @@ -168,12 +168,12 @@

            Classes

            session: ClientConnection = self.current_session # type: ignore[assignment] session_id: str = await self.session_id() consecutive_error_count = 0 - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() execution loop with {session_id} started") try: while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") break try: @@ -181,7 +181,7 @@

            Classes

            if message is not None: if isinstance(message, bytes): message = message.decode("utf-8") - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Received message: {debug_redacted_message_string(message)}, session: {session_id}" ) @@ -197,7 +197,7 @@

            Classes

            else: await asyncio.sleep(consecutive_error_count) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") raise @@ -224,14 +224,14 @@

            Classes

            self.current_session_monitor.cancel() self.current_session_monitor = asyncio.ensure_future(self.monitor_current_session()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() executor has been recreated for {session_id}") if self.message_receiver is not None: self.message_receiver.cancel() self.message_receiver = asyncio.ensure_future(self.receive_messages()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() executor has been recreated for {session_id}") if old_session is not None: @@ -246,14 +246,14 @@

            Classes

            async def send_message(self, message: str): session = self.current_session session_id = self.build_session_id(session) # type: ignore[arg-type] - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"Sending a message: {message}, session: {session_id}") try: await session.send(message) # type: ignore[union-attr] except WebSocketException as e: # We rarely get this exception while replacing the underlying WebSocket connections. # We can do one more try here as the self.current_session should be ready now. - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Failed to send a message (error: {e}, message: {message}, session: {session_id})" " as the underlying connection was replaced. Retrying the same request only one time..." @@ -390,14 +390,14 @@

            Methods

            self.current_session_monitor.cancel() self.current_session_monitor = asyncio.ensure_future(self.monitor_current_session()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() executor has been recreated for {session_id}") if self.message_receiver is not None: self.message_receiver.cancel() self.message_receiver = asyncio.ensure_future(self.receive_messages()) - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() executor has been recreated for {session_id}") if old_session is not None: @@ -448,12 +448,12 @@

            Methods

            # To avoid such, we access only the session that is active when this loop starts. session: ClientConnection = self.current_session # type: ignore[assignment] session_id: str = await self.session_id() - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new monitor_current_session() execution loop for {session_id} started") try: while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") break await asyncio.sleep(self.ping_interval) @@ -467,7 +467,7 @@

            Methods

            f"(error: {type(e).__name__}, message: {e}, session: {session_id})" ) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The monitor_current_session task for {session_id} is now cancelled") raise
            @@ -488,12 +488,12 @@

            Methods

            session: ClientConnection = self.current_session # type: ignore[assignment] session_id: str = await self.session_id() consecutive_error_count = 0 - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"A new receive_messages() execution loop with {session_id} started") try: while not self.closed: if session != self.current_session: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") break try: @@ -501,7 +501,7 @@

            Methods

            if message is not None: if isinstance(message, bytes): message = message.decode("utf-8") - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug( f"Received message: {debug_redacted_message_string(message)}, session: {session_id}" ) @@ -517,7 +517,7 @@

            Methods

            else: await asyncio.sleep(consecutive_error_count) except asyncio.CancelledError: - if self.logger.level <= logging.DEBUG: + if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug(f"The running receive_messages task for {session_id} is now cancelled") raise
            @@ -534,14 +534,14 @@

            Methods

            async def send_message(self, message: str):
                 session = self.current_session
                 session_id = self.build_session_id(session)  # type: ignore[arg-type]
            -    if self.logger.level <= logging.DEBUG:
            +    if self.logger.isEnabledFor(logging.DEBUG):
                     self.logger.debug(f"Sending a message: {message}, session: {session_id}")
                 try:
                     await session.send(message)  # type: ignore[union-attr]
                 except WebSocketException as e:
                     # We rarely get this exception while replacing the underlying WebSocket connections.
                     # We can do one more try here as the self.current_session should be ready now.
            -        if self.logger.level <= logging.DEBUG:
            +        if self.logger.isEnabledFor(logging.DEBUG):
                         self.logger.debug(
                             f"Failed to send a message (error: {e}, message: {message}, session: {session_id})"
                             " as the underlying connection was replaced. Retrying the same request only one time..."
            diff --git a/docs/reference/web/async_client.html b/docs/reference/web/async_client.html
            index 0ff43678f..b8f7a8c3f 100644
            --- a/docs/reference/web/async_client.html
            +++ b/docs/reference/web/async_client.html
            @@ -1834,6 +1834,20 @@ 

            Classes

            kwargs.update({"channel_ids": channel_ids}) return await self.api_call("admin.users.invite", params=kwargs) + async def admin_users_getExpiration( + self, + *, + user_id: str, + target_team: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Fetches the expiration timestamp for a guest. + + https://docs.slack.dev/reference/methods/admin.users.getExpiration + """ + kwargs.update({"user_id": user_id, "target_team": target_team}) + return await self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs) + async def admin_users_list( self, *, @@ -2049,6 +2063,220 @@

            Classes

            kwargs.update({"workflow_ids": workflow_ids}) return await self.api_call("admin.workflows.unpublish", params=kwargs) + async def agents_conversations_archive( + self, + *, + channel_id: str, + summary_message_ts: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Archive a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.archive + """ + kwargs.update( + { + "channel_id": channel_id, + "summary_message_ts": summary_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.archive", json=kwargs) + + async def agents_conversations_create( + self, + *, + name: str, + team_id: Optional[str] = None, + session_id: Optional[str] = None, + is_private: Optional[bool] = None, + origin_channel_id: Optional[str] = None, + origin_message_ts: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Create a dedicated code channel for an agent session. + + https://docs.slack.dev/reference/methods/agents.conversations.create + """ + kwargs.update( + { + "team_id": team_id, + "session_id": session_id, + "name": name, + "is_private": is_private, + "origin_channel_id": origin_channel_id, + "origin_message_ts": origin_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.create", json=kwargs) + + async def agents_conversations_getCanvas( + self, + *, + channel: str, + canvas_id: str, + content_format: Optional[str] = None, + include_resolved: Optional[bool] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Fetch a canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.getCanvas + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content_format": content_format, + "include_resolved": include_resolved, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.getCanvas", json=kwargs) + + async def agents_conversations_listViews( + self, + *, + channel_id: str, + **kwargs, + ) -> AsyncSlackResponse: + """List the views currently attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.listViews + """ + kwargs.update({"channel_id": channel_id}) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.listViews", json=kwargs) + + async def agents_conversations_removeView( + self, + *, + channel_id: str, + view_key: Optional[str] = None, + view_id: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Remove a view from a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.removeView + """ + kwargs.update( + { + "channel_id": channel_id, + "view_key": view_key, + "view_id": view_id, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.removeView", json=kwargs) + + async def agents_conversations_setCanvasContent( + self, + *, + channel: str, + canvas_id: str, + content: str, + **kwargs, + ) -> AsyncSlackResponse: + """Replace the full markdown content of a plan canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content": content, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.setCanvasContent", json=kwargs) + + async def agents_conversations_setCommands( + self, + *, + channel_id: str, + commands: Sequence[Dict], + **kwargs, + ) -> AsyncSlackResponse: + """Register the set of agent-defined slash commands for the calling agent in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCommands + """ + kwargs.update( + { + "commands": commands, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.setCommands", json=kwargs) + + async def agents_conversations_setProperties( + self, + *, + channel_id: str, + code_channel: Optional[Dict] = None, + agent_resource: Optional[Dict] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Set properties on a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setProperties + """ + kwargs.update( + { + "channel_id": channel_id, + "code_channel": code_channel, + "agent_resource": agent_resource, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.setProperties", json=kwargs) + + async def agents_conversations_setView( + self, + *, + channel_id: str, + type: Optional[str] = None, + view_key: Optional[str] = None, + content: Optional[str] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + canvas_id: Optional[str] = None, + access_level: Optional[str] = None, + agent_content_hash: Optional[str] = None, + pr_url: Optional[str] = None, + base_branch: Optional[str] = None, + head_branch: Optional[str] = None, + name: Optional[str] = None, + csp: Optional[Dict] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Create or update a view in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setView + """ + kwargs.update( + { + "channel_id": channel_id, + "type": type, + "view_key": view_key, + "content": content, + "blocks": blocks, + "canvas_id": canvas_id, + "access_level": access_level, + "agent_content_hash": agent_content_hash, + "pr_url": pr_url, + "base_branch": base_branch, + "head_branch": head_branch, + "name": name, + "csp": csp, + } + ) + kwargs = _remove_none_values(kwargs) + return await self.api_call("agents.conversations.setView", json=kwargs) + async def agents_sessions_rename( self, *, @@ -2252,6 +2480,46 @@

            Classes

            kwargs.update({"user_id": user_id, "status": status}) return await self.api_call("apps.user.connection.update", params=kwargs) + async def apps_user_connection_bulkUpdate( + self, + *, + connected_user_ids: Optional[Union[str, Sequence[str]]] = None, + disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Updates the connection status between an app and many users in one call, for backfilling an existing user base. + + https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate + """ + if isinstance(connected_user_ids, (list, tuple)): + kwargs.update({"connected_user_ids": ",".join(connected_user_ids)}) + else: + kwargs.update({"connected_user_ids": connected_user_ids}) + if isinstance(disconnected_user_ids, (list, tuple)): + kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)}) + else: + kwargs.update({"disconnected_user_ids": disconnected_user_ids}) + return await self.api_call("apps.user.connection.bulkUpdate", params=kwargs) + + async def apps_user_connection_requestAuth( + self, + *, + primary_provider: Union[str, Dict[str, Any]], + trigger_id: Optional[str] = None, + user_id: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Opens or updates a standardized authentication modal for the calling app. + + https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth + """ + kwargs.update({"trigger_id": trigger_id, "user_id": user_id}) + if isinstance(primary_provider, str): + kwargs.update({"primary_provider": primary_provider}) + else: + kwargs.update({"primary_provider": json.dumps(primary_provider)}) + return await self.api_call("apps.user.connection.requestAuth", params=kwargs) + async def tooling_tokens_rotate( self, *, @@ -2607,14 +2875,22 @@

            Classes

            self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return await self.api_call("canvases.create", json=kwargs) async def canvases_edit( @@ -2644,6 +2920,20 @@

            Classes

            kwargs.update({"canvas_id": canvas_id}) return await self.api_call("canvases.delete", params=kwargs) + async def canvases_getContent( + self, + *, + canvas_id: str, + content_type: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Get the content of a canvas as markdown (default) or HTML. + + https://docs.slack.dev/reference/methods/canvases.getContent + """ + kwargs.update({"canvas_id": canvas_id, "content_type": content_type}) + return await self.api_call("canvases.getContent", params=kwargs) + async def canvases_access_set( self, *, @@ -5738,13 +6028,14 @@

            Classes

            *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return await self.api_call("team.info", http_verb="GET", params=kwargs) async def team_integrationLogs( @@ -8836,6 +9127,31 @@

            Methods

            +
            +async def admin_users_getExpiration(self, *, user_id: str, target_team: str | None = None, **kwargs) ‑> AsyncSlackResponse +
            +
            +
            + +Expand source code + +
            async def admin_users_getExpiration(
            +    self,
            +    *,
            +    user_id: str,
            +    target_team: Optional[str] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Fetches the expiration timestamp for a guest.
            +
            +    https://docs.slack.dev/reference/methods/admin.users.getExpiration
            +    """
            +    kwargs.update({"user_id": user_id, "target_team": target_team})
            +    return await self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs)
            +
            +

            Fetches the expiration timestamp for a guest.

            +

            https://docs.slack.dev/reference/methods/admin.users.getExpiration

            +
            async def admin_users_invite(self,
            *,
            team_id: str,
            email: str,
            channel_ids: str | Sequence[str],
            custom_message: str | None = None,
            email_password_policy_enabled: bool | None = None,
            guest_expiration_ts: str | float | None = None,
            is_restricted: bool | None = None,
            is_ultra_restricted: bool | None = None,
            real_name: str | None = None,
            resend: bool | None = None,
            **kwargs) ‑> AsyncSlackResponse
            @@ -9474,6 +9790,319 @@

            Methods

            Unpublish workflows within the team or enterprise.

            https://docs.slack.dev/reference/methods/admin.workflows.unpublish

            +
            +async def agents_conversations_archive(self, *, channel_id: str, summary_message_ts: str | None = None, **kwargs) ‑> AsyncSlackResponse +
            +
            +
            + +Expand source code + +
            async def agents_conversations_archive(
            +    self,
            +    *,
            +    channel_id: str,
            +    summary_message_ts: Optional[str] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Archive a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.archive
            +    """
            +    kwargs.update(
            +        {
            +            "channel_id": channel_id,
            +            "summary_message_ts": summary_message_ts,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.archive", json=kwargs)
            +
            + +
            +
            +async def agents_conversations_create(self,
            *,
            name: str,
            team_id: str | None = None,
            session_id: str | None = None,
            is_private: bool | None = None,
            origin_channel_id: str | None = None,
            origin_message_ts: str | None = None,
            **kwargs) ‑> AsyncSlackResponse
            +
            +
            +
            + +Expand source code + +
            async def agents_conversations_create(
            +    self,
            +    *,
            +    name: str,
            +    team_id: Optional[str] = None,
            +    session_id: Optional[str] = None,
            +    is_private: Optional[bool] = None,
            +    origin_channel_id: Optional[str] = None,
            +    origin_message_ts: Optional[str] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Create a dedicated code channel for an agent session.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.create
            +    """
            +    kwargs.update(
            +        {
            +            "team_id": team_id,
            +            "session_id": session_id,
            +            "name": name,
            +            "is_private": is_private,
            +            "origin_channel_id": origin_channel_id,
            +            "origin_message_ts": origin_message_ts,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.create", json=kwargs)
            +
            +

            Create a dedicated code channel for an agent session.

            +

            https://docs.slack.dev/reference/methods/agents.conversations.create

            +
            +
            +async def agents_conversations_getCanvas(self,
            *,
            channel: str,
            canvas_id: str,
            content_format: str | None = None,
            include_resolved: bool | None = None,
            **kwargs) ‑> AsyncSlackResponse
            +
            +
            +
            + +Expand source code + +
            async def agents_conversations_getCanvas(
            +    self,
            +    *,
            +    channel: str,
            +    canvas_id: str,
            +    content_format: Optional[str] = None,
            +    include_resolved: Optional[bool] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Fetch a canvas attached to a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.getCanvas
            +    """
            +    kwargs.update(
            +        {
            +            "channel": channel,
            +            "canvas_id": canvas_id,
            +            "content_format": content_format,
            +            "include_resolved": include_resolved,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.getCanvas", json=kwargs)
            +
            + +
            +
            +async def agents_conversations_listViews(self, *, channel_id: str, **kwargs) ‑> AsyncSlackResponse +
            +
            +
            + +Expand source code + +
            async def agents_conversations_listViews(
            +    self,
            +    *,
            +    channel_id: str,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """List the views currently attached to a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.listViews
            +    """
            +    kwargs.update({"channel_id": channel_id})
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.listViews", json=kwargs)
            +
            +

            List the views currently attached to a code channel.

            +

            https://docs.slack.dev/reference/methods/agents.conversations.listViews

            +
            +
            +async def agents_conversations_removeView(self,
            *,
            channel_id: str,
            view_key: str | None = None,
            view_id: str | None = None,
            **kwargs) ‑> AsyncSlackResponse
            +
            +
            +
            + +Expand source code + +
            async def agents_conversations_removeView(
            +    self,
            +    *,
            +    channel_id: str,
            +    view_key: Optional[str] = None,
            +    view_id: Optional[str] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Remove a view from a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.removeView
            +    """
            +    kwargs.update(
            +        {
            +            "channel_id": channel_id,
            +            "view_key": view_key,
            +            "view_id": view_id,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.removeView", json=kwargs)
            +
            + +
            +
            +async def agents_conversations_setCanvasContent(self, *, channel: str, canvas_id: str, content: str, **kwargs) ‑> AsyncSlackResponse +
            +
            +
            + +Expand source code + +
            async def agents_conversations_setCanvasContent(
            +    self,
            +    *,
            +    channel: str,
            +    canvas_id: str,
            +    content: str,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Replace the full markdown content of a plan canvas attached to a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent
            +    """
            +    kwargs.update(
            +        {
            +            "channel": channel,
            +            "canvas_id": canvas_id,
            +            "content": content,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.setCanvasContent", json=kwargs)
            +
            +

            Replace the full markdown content of a plan canvas attached to a code channel.

            +

            https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent

            +
            +
            +async def agents_conversations_setCommands(self, *, channel_id: str, commands: Sequence[Dict], **kwargs) ‑> AsyncSlackResponse +
            +
            +
            + +Expand source code + +
            async def agents_conversations_setCommands(
            +    self,
            +    *,
            +    channel_id: str,
            +    commands: Sequence[Dict],
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Register the set of agent-defined slash commands for the calling agent in a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.setCommands
            +    """
            +    kwargs.update(
            +        {
            +            "commands": commands,
            +            "channel_id": channel_id,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.setCommands", json=kwargs)
            +
            +

            Register the set of agent-defined slash commands for the calling agent in a code channel.

            +

            https://docs.slack.dev/reference/methods/agents.conversations.setCommands

            +
            +
            +async def agents_conversations_setProperties(self,
            *,
            channel_id: str,
            code_channel: Dict | None = None,
            agent_resource: Dict | None = None,
            **kwargs) ‑> AsyncSlackResponse
            +
            +
            +
            + +Expand source code + +
            async def agents_conversations_setProperties(
            +    self,
            +    *,
            +    channel_id: str,
            +    code_channel: Optional[Dict] = None,
            +    agent_resource: Optional[Dict] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Set properties on a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.setProperties
            +    """
            +    kwargs.update(
            +        {
            +            "channel_id": channel_id,
            +            "code_channel": code_channel,
            +            "agent_resource": agent_resource,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.setProperties", json=kwargs)
            +
            + +
            +
            +async def agents_conversations_setView(self,
            *,
            channel_id: str,
            type: str | None = None,
            view_key: str | None = None,
            content: str | None = None,
            blocks: Sequence[Dict | Block] | None = None,
            canvas_id: str | None = None,
            access_level: str | None = None,
            agent_content_hash: str | None = None,
            pr_url: str | None = None,
            base_branch: str | None = None,
            head_branch: str | None = None,
            name: str | None = None,
            csp: Dict | None = None,
            **kwargs) ‑> AsyncSlackResponse
            +
            +
            +
            + +Expand source code + +
            async def agents_conversations_setView(
            +    self,
            +    *,
            +    channel_id: str,
            +    type: Optional[str] = None,
            +    view_key: Optional[str] = None,
            +    content: Optional[str] = None,
            +    blocks: Optional[Sequence[Union[Dict, Block]]] = None,
            +    canvas_id: Optional[str] = None,
            +    access_level: Optional[str] = None,
            +    agent_content_hash: Optional[str] = None,
            +    pr_url: Optional[str] = None,
            +    base_branch: Optional[str] = None,
            +    head_branch: Optional[str] = None,
            +    name: Optional[str] = None,
            +    csp: Optional[Dict] = None,
            +    **kwargs,
            +) -> AsyncSlackResponse:
            +    """Create or update a view in a code channel.
            +
            +    https://docs.slack.dev/reference/methods/agents.conversations.setView
            +    """
            +    kwargs.update(
            +        {
            +            "channel_id": channel_id,
            +            "type": type,
            +            "view_key": view_key,
            +            "content": content,
            +            "blocks": blocks,
            +            "canvas_id": canvas_id,
            +            "access_level": access_level,
            +            "agent_content_hash": agent_content_hash,
            +            "pr_url": pr_url,
            +            "base_branch": base_branch,
            +            "head_branch": head_branch,
            +            "name": name,
            +            "csp": csp,
            +        }
            +    )
            +    kwargs = _remove_none_values(kwargs)
            +    return await self.api_call("agents.conversations.setView", json=kwargs)
            +
            + +
            async def agents_sessions_rename(self, *, channel_id: str, title: str, thread_ts: str | None = None, **kwargs) ‑> AsyncSlackResponse
            @@ -9786,6 +10415,68 @@

            Methods

            Uninstalls your app from a workspace.

            https://docs.slack.dev/reference/methods/apps.uninstall

    • +
      +async def apps_user_connection_bulkUpdate(self,
      *,
      connected_user_ids: str | Sequence[str] | None = None,
      disconnected_user_ids: str | Sequence[str] | None = None,
      **kwargs) ‑> AsyncSlackResponse
      +
      +
      +
      + +Expand source code + +
      async def apps_user_connection_bulkUpdate(
      +    self,
      +    *,
      +    connected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    **kwargs,
      +) -> AsyncSlackResponse:
      +    """Updates the connection status between an app and many users in one call, for backfilling an existing user base.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate
      +    """
      +    if isinstance(connected_user_ids, (list, tuple)):
      +        kwargs.update({"connected_user_ids": ",".join(connected_user_ids)})
      +    else:
      +        kwargs.update({"connected_user_ids": connected_user_ids})
      +    if isinstance(disconnected_user_ids, (list, tuple)):
      +        kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)})
      +    else:
      +        kwargs.update({"disconnected_user_ids": disconnected_user_ids})
      +    return await self.api_call("apps.user.connection.bulkUpdate", params=kwargs)
      +
      +

      Updates the connection status between an app and many users in one call, for backfilling an existing user base.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate

      +
      +
      +async def apps_user_connection_requestAuth(self,
      *,
      primary_provider: str | Dict[str, Any],
      trigger_id: str | None = None,
      user_id: str | None = None,
      **kwargs) ‑> AsyncSlackResponse
      +
      +
      +
      + +Expand source code + +
      async def apps_user_connection_requestAuth(
      +    self,
      +    *,
      +    primary_provider: Union[str, Dict[str, Any]],
      +    trigger_id: Optional[str] = None,
      +    user_id: Optional[str] = None,
      +    **kwargs,
      +) -> AsyncSlackResponse:
      +    """Opens or updates a standardized authentication modal for the calling app.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth
      +    """
      +    kwargs.update({"trigger_id": trigger_id, "user_id": user_id})
      +    if isinstance(primary_provider, str):
      +        kwargs.update({"primary_provider": primary_provider})
      +    else:
      +        kwargs.update({"primary_provider": json.dumps(primary_provider)})
      +    return await self.api_call("apps.user.connection.requestAuth", params=kwargs)
      +
      +

      Opens or updates a standardized authentication modal for the calling app.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth

      +
      async def apps_user_connection_update(self, *, user_id: str, status: str, **kwargs) ‑> AsyncSlackResponse
      @@ -10423,7 +11114,7 @@

      Methods

      https://docs.slack.dev/reference/methods/canvases.access.set

      -async def canvases_create(self, *, title: str | None = None, document_content: Dict[str, str], **kwargs) ‑> AsyncSlackResponse +async def canvases_create(self,
      *,
      title: str | None = None,
      document_content: Dict[str, str] | None = None,
      channel_id: str | None = None,
      **kwargs) ‑> AsyncSlackResponse
      @@ -10434,14 +11125,22 @@

      Methods

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return await self.api_call("canvases.create", json=kwargs)

      Create Canvas for a user.

      @@ -10496,6 +11195,31 @@

      Methods

      +
      +async def canvases_getContent(self, *, canvas_id: str, content_type: str | None = None, **kwargs) ‑> AsyncSlackResponse +
      +
      +
      + +Expand source code + +
      async def canvases_getContent(
      +    self,
      +    *,
      +    canvas_id: str,
      +    content_type: Optional[str] = None,
      +    **kwargs,
      +) -> AsyncSlackResponse:
      +    """Get the content of a canvas as markdown (default) or HTML.
      +
      +    https://docs.slack.dev/reference/methods/canvases.getContent
      +    """
      +    kwargs.update({"canvas_id": canvas_id, "content_type": content_type})
      +    return await self.api_call("canvases.getContent", params=kwargs)
      +
      +

      Get the content of a canvas as markdown (default) or HTML.

      +

      https://docs.slack.dev/reference/methods/canvases.getContent

      +
      async def canvases_sections_lookup(self, *, canvas_id: str, criteria: Dict[str, Any], **kwargs) ‑> AsyncSlackResponse
      @@ -15231,7 +15955,7 @@

      Methods

      https://docs.slack.dev/reference/methods/team.externalTeams.list

      -async def team_info(self, *, team: str | None = None, domain: str | None = None, **kwargs) ‑> AsyncSlackResponse +async def team_info(self,
      *,
      team: str | None = None,
      domain: str | None = None,
      include_slackbot_availability: bool | None = None,
      **kwargs) ‑> AsyncSlackResponse
      @@ -15243,13 +15967,14 @@

      Methods

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return await self.api_call("team.info", http_verb="GET", params=kwargs)

      Gets information about the current team.

      @@ -16410,6 +17135,7 @@

      admin_usergroups_listChannels
    • admin_usergroups_removeChannels
    • admin_users_assign
    • +
    • admin_users_getExpiration
    • admin_users_invite
    • admin_users_list
    • admin_users_remove
    • @@ -16430,6 +17156,15 @@

      admin_workflows_permissions_lookup
    • admin_workflows_search
    • admin_workflows_unpublish
    • +
    • agents_conversations_archive
    • +
    • agents_conversations_create
    • +
    • agents_conversations_getCanvas
    • +
    • agents_conversations_listViews
    • +
    • agents_conversations_removeView
    • +
    • agents_conversations_setCanvasContent
    • +
    • agents_conversations_setCommands
    • +
    • agents_conversations_setProperties
    • +
    • agents_conversations_setView
    • agents_sessions_rename
    • agents_sessions_setStatus
    • api_test
    • @@ -16441,6 +17176,8 @@

      apps_manifest_update
    • apps_manifest_validate
    • apps_uninstall
    • +
    • apps_user_connection_bulkUpdate
    • +
    • apps_user_connection_requestAuth
    • apps_user_connection_update
    • assistant_threads_setStatus
    • assistant_threads_setSuggestedPrompts
    • @@ -16465,6 +17202,7 @@

      canvases_create
    • canvases_delete
    • canvases_edit
    • +
    • canvases_getContent
    • canvases_sections_lookup
    • channels_archive
    • channels_create
    • diff --git a/docs/reference/web/client.html b/docs/reference/web/client.html index 48a1ab19f..64c129b23 100644 --- a/docs/reference/web/client.html +++ b/docs/reference/web/client.html @@ -1834,6 +1834,20 @@

      Classes

      kwargs.update({"channel_ids": channel_ids}) return self.api_call("admin.users.invite", params=kwargs) + def admin_users_getExpiration( + self, + *, + user_id: str, + target_team: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Fetches the expiration timestamp for a guest. + + https://docs.slack.dev/reference/methods/admin.users.getExpiration + """ + kwargs.update({"user_id": user_id, "target_team": target_team}) + return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs) + def admin_users_list( self, *, @@ -2049,6 +2063,220 @@

      Classes

      kwargs.update({"workflow_ids": workflow_ids}) return self.api_call("admin.workflows.unpublish", params=kwargs) + def agents_conversations_archive( + self, + *, + channel_id: str, + summary_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Archive a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.archive + """ + kwargs.update( + { + "channel_id": channel_id, + "summary_message_ts": summary_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.archive", json=kwargs) + + def agents_conversations_create( + self, + *, + name: str, + team_id: Optional[str] = None, + session_id: Optional[str] = None, + is_private: Optional[bool] = None, + origin_channel_id: Optional[str] = None, + origin_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Create a dedicated code channel for an agent session. + + https://docs.slack.dev/reference/methods/agents.conversations.create + """ + kwargs.update( + { + "team_id": team_id, + "session_id": session_id, + "name": name, + "is_private": is_private, + "origin_channel_id": origin_channel_id, + "origin_message_ts": origin_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.create", json=kwargs) + + def agents_conversations_getCanvas( + self, + *, + channel: str, + canvas_id: str, + content_format: Optional[str] = None, + include_resolved: Optional[bool] = None, + **kwargs, + ) -> SlackResponse: + """Fetch a canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.getCanvas + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content_format": content_format, + "include_resolved": include_resolved, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.getCanvas", json=kwargs) + + def agents_conversations_listViews( + self, + *, + channel_id: str, + **kwargs, + ) -> SlackResponse: + """List the views currently attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.listViews + """ + kwargs.update({"channel_id": channel_id}) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.listViews", json=kwargs) + + def agents_conversations_removeView( + self, + *, + channel_id: str, + view_key: Optional[str] = None, + view_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Remove a view from a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.removeView + """ + kwargs.update( + { + "channel_id": channel_id, + "view_key": view_key, + "view_id": view_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.removeView", json=kwargs) + + def agents_conversations_setCanvasContent( + self, + *, + channel: str, + canvas_id: str, + content: str, + **kwargs, + ) -> SlackResponse: + """Replace the full markdown content of a plan canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content": content, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCanvasContent", json=kwargs) + + def agents_conversations_setCommands( + self, + *, + channel_id: str, + commands: Sequence[Dict], + **kwargs, + ) -> SlackResponse: + """Register the set of agent-defined slash commands for the calling agent in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCommands + """ + kwargs.update( + { + "commands": commands, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCommands", json=kwargs) + + def agents_conversations_setProperties( + self, + *, + channel_id: str, + code_channel: Optional[Dict] = None, + agent_resource: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Set properties on a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setProperties + """ + kwargs.update( + { + "channel_id": channel_id, + "code_channel": code_channel, + "agent_resource": agent_resource, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setProperties", json=kwargs) + + def agents_conversations_setView( + self, + *, + channel_id: str, + type: Optional[str] = None, + view_key: Optional[str] = None, + content: Optional[str] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + canvas_id: Optional[str] = None, + access_level: Optional[str] = None, + agent_content_hash: Optional[str] = None, + pr_url: Optional[str] = None, + base_branch: Optional[str] = None, + head_branch: Optional[str] = None, + name: Optional[str] = None, + csp: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Create or update a view in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setView + """ + kwargs.update( + { + "channel_id": channel_id, + "type": type, + "view_key": view_key, + "content": content, + "blocks": blocks, + "canvas_id": canvas_id, + "access_level": access_level, + "agent_content_hash": agent_content_hash, + "pr_url": pr_url, + "base_branch": base_branch, + "head_branch": head_branch, + "name": name, + "csp": csp, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setView", json=kwargs) + def agents_sessions_rename( self, *, @@ -2252,6 +2480,46 @@

      Classes

      kwargs.update({"user_id": user_id, "status": status}) return self.api_call("apps.user.connection.update", params=kwargs) + def apps_user_connection_bulkUpdate( + self, + *, + connected_user_ids: Optional[Union[str, Sequence[str]]] = None, + disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None, + **kwargs, + ) -> SlackResponse: + """Updates the connection status between an app and many users in one call, for backfilling an existing user base. + + https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate + """ + if isinstance(connected_user_ids, (list, tuple)): + kwargs.update({"connected_user_ids": ",".join(connected_user_ids)}) + else: + kwargs.update({"connected_user_ids": connected_user_ids}) + if isinstance(disconnected_user_ids, (list, tuple)): + kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)}) + else: + kwargs.update({"disconnected_user_ids": disconnected_user_ids}) + return self.api_call("apps.user.connection.bulkUpdate", params=kwargs) + + def apps_user_connection_requestAuth( + self, + *, + primary_provider: Union[str, Dict[str, Any]], + trigger_id: Optional[str] = None, + user_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Opens or updates a standardized authentication modal for the calling app. + + https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth + """ + kwargs.update({"trigger_id": trigger_id, "user_id": user_id}) + if isinstance(primary_provider, str): + kwargs.update({"primary_provider": primary_provider}) + else: + kwargs.update({"primary_provider": json.dumps(primary_provider)}) + return self.api_call("apps.user.connection.requestAuth", params=kwargs) + def tooling_tokens_rotate( self, *, @@ -2607,14 +2875,22 @@

      Classes

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs) def canvases_edit( @@ -2644,6 +2920,20 @@

      Classes

      kwargs.update({"canvas_id": canvas_id}) return self.api_call("canvases.delete", params=kwargs) + def canvases_getContent( + self, + *, + canvas_id: str, + content_type: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Get the content of a canvas as markdown (default) or HTML. + + https://docs.slack.dev/reference/methods/canvases.getContent + """ + kwargs.update({"canvas_id": canvas_id, "content_type": content_type}) + return self.api_call("canvases.getContent", params=kwargs) + def canvases_access_set( self, *, @@ -5738,13 +6028,14 @@

      Classes

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs) def team_integrationLogs( @@ -8836,6 +9127,31 @@

      Methods

      +
      +def admin_users_getExpiration(self, *, user_id: str, target_team: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def admin_users_getExpiration(
      +    self,
      +    *,
      +    user_id: str,
      +    target_team: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Fetches the expiration timestamp for a guest.
      +
      +    https://docs.slack.dev/reference/methods/admin.users.getExpiration
      +    """
      +    kwargs.update({"user_id": user_id, "target_team": target_team})
      +    return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs)
      +
      +

      Fetches the expiration timestamp for a guest.

      +

      https://docs.slack.dev/reference/methods/admin.users.getExpiration

      +
      def admin_users_invite(self,
      *,
      team_id: str,
      email: str,
      channel_ids: str | Sequence[str],
      custom_message: str | None = None,
      email_password_policy_enabled: bool | None = None,
      guest_expiration_ts: str | float | None = None,
      is_restricted: bool | None = None,
      is_ultra_restricted: bool | None = None,
      real_name: str | None = None,
      resend: bool | None = None,
      **kwargs) ‑> SlackResponse
      @@ -9474,6 +9790,319 @@

      Methods

      Unpublish workflows within the team or enterprise.

      https://docs.slack.dev/reference/methods/admin.workflows.unpublish

      +
      +def agents_conversations_archive(self, *, channel_id: str, summary_message_ts: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_archive(
      +    self,
      +    *,
      +    channel_id: str,
      +    summary_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Archive a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.archive
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "summary_message_ts": summary_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.archive", json=kwargs)
      +
      + +
      +
      +def agents_conversations_create(self,
      *,
      name: str,
      team_id: str | None = None,
      session_id: str | None = None,
      is_private: bool | None = None,
      origin_channel_id: str | None = None,
      origin_message_ts: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_create(
      +    self,
      +    *,
      +    name: str,
      +    team_id: Optional[str] = None,
      +    session_id: Optional[str] = None,
      +    is_private: Optional[bool] = None,
      +    origin_channel_id: Optional[str] = None,
      +    origin_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Create a dedicated code channel for an agent session.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.create
      +    """
      +    kwargs.update(
      +        {
      +            "team_id": team_id,
      +            "session_id": session_id,
      +            "name": name,
      +            "is_private": is_private,
      +            "origin_channel_id": origin_channel_id,
      +            "origin_message_ts": origin_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.create", json=kwargs)
      +
      +

      Create a dedicated code channel for an agent session.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.create

      +
      +
      +def agents_conversations_getCanvas(self,
      *,
      channel: str,
      canvas_id: str,
      content_format: str | None = None,
      include_resolved: bool | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_getCanvas(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content_format: Optional[str] = None,
      +    include_resolved: Optional[bool] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Fetch a canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.getCanvas
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content_format": content_format,
      +            "include_resolved": include_resolved,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.getCanvas", json=kwargs)
      +
      + +
      +
      +def agents_conversations_listViews(self, *, channel_id: str, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_listViews(
      +    self,
      +    *,
      +    channel_id: str,
      +    **kwargs,
      +) -> SlackResponse:
      +    """List the views currently attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.listViews
      +    """
      +    kwargs.update({"channel_id": channel_id})
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.listViews", json=kwargs)
      +
      +

      List the views currently attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.listViews

      +
      +
      +def agents_conversations_removeView(self,
      *,
      channel_id: str,
      view_key: str | None = None,
      view_id: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_removeView(
      +    self,
      +    *,
      +    channel_id: str,
      +    view_key: Optional[str] = None,
      +    view_id: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Remove a view from a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.removeView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "view_key": view_key,
      +            "view_id": view_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.removeView", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setCanvasContent(self, *, channel: str, canvas_id: str, content: str, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCanvasContent(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content: str,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Replace the full markdown content of a plan canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content": content,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCanvasContent", json=kwargs)
      +
      +

      Replace the full markdown content of a plan canvas attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent

      +
      +
      +def agents_conversations_setCommands(self, *, channel_id: str, commands: Sequence[Dict], **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCommands(
      +    self,
      +    *,
      +    channel_id: str,
      +    commands: Sequence[Dict],
      +    **kwargs,
      +) -> SlackResponse:
      +    """Register the set of agent-defined slash commands for the calling agent in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCommands
      +    """
      +    kwargs.update(
      +        {
      +            "commands": commands,
      +            "channel_id": channel_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCommands", json=kwargs)
      +
      +

      Register the set of agent-defined slash commands for the calling agent in a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCommands

      +
      +
      +def agents_conversations_setProperties(self,
      *,
      channel_id: str,
      code_channel: Dict | None = None,
      agent_resource: Dict | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setProperties(
      +    self,
      +    *,
      +    channel_id: str,
      +    code_channel: Optional[Dict] = None,
      +    agent_resource: Optional[Dict] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Set properties on a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setProperties
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "code_channel": code_channel,
      +            "agent_resource": agent_resource,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setProperties", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setView(self,
      *,
      channel_id: str,
      type: str | None = None,
      view_key: str | None = None,
      content: str | None = None,
      blocks: Sequence[Dict | Block] | None = None,
      canvas_id: str | None = None,
      access_level: str | None = None,
      agent_content_hash: str | None = None,
      pr_url: str | None = None,
      base_branch: str | None = None,
      head_branch: str | None = None,
      name: str | None = None,
      csp: Dict | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setView(
      +    self,
      +    *,
      +    channel_id: str,
      +    type: Optional[str] = None,
      +    view_key: Optional[str] = None,
      +    content: Optional[str] = None,
      +    blocks: Optional[Sequence[Union[Dict, Block]]] = None,
      +    canvas_id: Optional[str] = None,
      +    access_level: Optional[str] = None,
      +    agent_content_hash: Optional[str] = None,
      +    pr_url: Optional[str] = None,
      +    base_branch: Optional[str] = None,
      +    head_branch: Optional[str] = None,
      +    name: Optional[str] = None,
      +    csp: Optional[Dict] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Create or update a view in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "type": type,
      +            "view_key": view_key,
      +            "content": content,
      +            "blocks": blocks,
      +            "canvas_id": canvas_id,
      +            "access_level": access_level,
      +            "agent_content_hash": agent_content_hash,
      +            "pr_url": pr_url,
      +            "base_branch": base_branch,
      +            "head_branch": head_branch,
      +            "name": name,
      +            "csp": csp,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setView", json=kwargs)
      +
      + +
      def agents_sessions_rename(self, *, channel_id: str, title: str, thread_ts: str | None = None, **kwargs) ‑> SlackResponse
      @@ -9786,6 +10415,68 @@

      Methods

      Uninstalls your app from a workspace.

      https://docs.slack.dev/reference/methods/apps.uninstall

      +
      +def apps_user_connection_bulkUpdate(self,
      *,
      connected_user_ids: str | Sequence[str] | None = None,
      disconnected_user_ids: str | Sequence[str] | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_bulkUpdate(
      +    self,
      +    *,
      +    connected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Updates the connection status between an app and many users in one call, for backfilling an existing user base.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate
      +    """
      +    if isinstance(connected_user_ids, (list, tuple)):
      +        kwargs.update({"connected_user_ids": ",".join(connected_user_ids)})
      +    else:
      +        kwargs.update({"connected_user_ids": connected_user_ids})
      +    if isinstance(disconnected_user_ids, (list, tuple)):
      +        kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)})
      +    else:
      +        kwargs.update({"disconnected_user_ids": disconnected_user_ids})
      +    return self.api_call("apps.user.connection.bulkUpdate", params=kwargs)
      +
      +

      Updates the connection status between an app and many users in one call, for backfilling an existing user base.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate

      +
      +
      +def apps_user_connection_requestAuth(self,
      *,
      primary_provider: str | Dict[str, Any],
      trigger_id: str | None = None,
      user_id: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_requestAuth(
      +    self,
      +    *,
      +    primary_provider: Union[str, Dict[str, Any]],
      +    trigger_id: Optional[str] = None,
      +    user_id: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Opens or updates a standardized authentication modal for the calling app.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth
      +    """
      +    kwargs.update({"trigger_id": trigger_id, "user_id": user_id})
      +    if isinstance(primary_provider, str):
      +        kwargs.update({"primary_provider": primary_provider})
      +    else:
      +        kwargs.update({"primary_provider": json.dumps(primary_provider)})
      +    return self.api_call("apps.user.connection.requestAuth", params=kwargs)
      +
      +

      Opens or updates a standardized authentication modal for the calling app.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth

      +
      def apps_user_connection_update(self, *, user_id: str, status: str, **kwargs) ‑> SlackResponse
      @@ -10423,7 +11114,7 @@

      Methods

      https://docs.slack.dev/reference/methods/canvases.access.set

      -def canvases_create(self, *, title: str | None = None, document_content: Dict[str, str], **kwargs) ‑> SlackResponse +def canvases_create(self,
      *,
      title: str | None = None,
      document_content: Dict[str, str] | None = None,
      channel_id: str | None = None,
      **kwargs) ‑> SlackResponse
      @@ -10434,14 +11125,22 @@

      Methods

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs)

      Create Canvas for a user.

      @@ -10496,6 +11195,31 @@

      Methods

      +
      +def canvases_getContent(self, *, canvas_id: str, content_type: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def canvases_getContent(
      +    self,
      +    *,
      +    canvas_id: str,
      +    content_type: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Get the content of a canvas as markdown (default) or HTML.
      +
      +    https://docs.slack.dev/reference/methods/canvases.getContent
      +    """
      +    kwargs.update({"canvas_id": canvas_id, "content_type": content_type})
      +    return self.api_call("canvases.getContent", params=kwargs)
      +
      +

      Get the content of a canvas as markdown (default) or HTML.

      +

      https://docs.slack.dev/reference/methods/canvases.getContent

      +
      def canvases_sections_lookup(self, *, canvas_id: str, criteria: Dict[str, Any], **kwargs) ‑> SlackResponse
      @@ -15231,7 +15955,7 @@

      Methods

      https://docs.slack.dev/reference/methods/team.externalTeams.list

      -def team_info(self, *, team: str | None = None, domain: str | None = None, **kwargs) ‑> SlackResponse +def team_info(self,
      *,
      team: str | None = None,
      domain: str | None = None,
      include_slackbot_availability: bool | None = None,
      **kwargs) ‑> SlackResponse
      @@ -15243,13 +15967,14 @@

      Methods

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs)

      Gets information about the current team.

      @@ -16409,6 +17134,7 @@

      admin_usergroups_listChannels
    • admin_usergroups_removeChannels
    • admin_users_assign
    • +
    • admin_users_getExpiration
    • admin_users_invite
    • admin_users_list
    • admin_users_remove
    • @@ -16429,6 +17155,15 @@

      admin_workflows_permissions_lookup
    • admin_workflows_search
    • admin_workflows_unpublish
    • +
    • agents_conversations_archive
    • +
    • agents_conversations_create
    • +
    • agents_conversations_getCanvas
    • +
    • agents_conversations_listViews
    • +
    • agents_conversations_removeView
    • +
    • agents_conversations_setCanvasContent
    • +
    • agents_conversations_setCommands
    • +
    • agents_conversations_setProperties
    • +
    • agents_conversations_setView
    • agents_sessions_rename
    • agents_sessions_setStatus
    • api_test
    • @@ -16440,6 +17175,8 @@

      apps_manifest_update
    • apps_manifest_validate
    • apps_uninstall
    • +
    • apps_user_connection_bulkUpdate
    • +
    • apps_user_connection_requestAuth
    • apps_user_connection_update
    • assistant_threads_setStatus
    • assistant_threads_setSuggestedPrompts
    • @@ -16464,6 +17201,7 @@

      canvases_create
    • canvases_delete
    • canvases_edit
    • +
    • canvases_getContent
    • canvases_sections_lookup
    • channels_archive
    • channels_create
    • diff --git a/docs/reference/web/index.html b/docs/reference/web/index.html index a853b1d15..0eb15074e 100644 --- a/docs/reference/web/index.html +++ b/docs/reference/web/index.html @@ -2208,6 +2208,20 @@

      Methods

      kwargs.update({"channel_ids": channel_ids}) return self.api_call("admin.users.invite", params=kwargs) + def admin_users_getExpiration( + self, + *, + user_id: str, + target_team: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Fetches the expiration timestamp for a guest. + + https://docs.slack.dev/reference/methods/admin.users.getExpiration + """ + kwargs.update({"user_id": user_id, "target_team": target_team}) + return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs) + def admin_users_list( self, *, @@ -2423,6 +2437,220 @@

      Methods

      kwargs.update({"workflow_ids": workflow_ids}) return self.api_call("admin.workflows.unpublish", params=kwargs) + def agents_conversations_archive( + self, + *, + channel_id: str, + summary_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Archive a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.archive + """ + kwargs.update( + { + "channel_id": channel_id, + "summary_message_ts": summary_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.archive", json=kwargs) + + def agents_conversations_create( + self, + *, + name: str, + team_id: Optional[str] = None, + session_id: Optional[str] = None, + is_private: Optional[bool] = None, + origin_channel_id: Optional[str] = None, + origin_message_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Create a dedicated code channel for an agent session. + + https://docs.slack.dev/reference/methods/agents.conversations.create + """ + kwargs.update( + { + "team_id": team_id, + "session_id": session_id, + "name": name, + "is_private": is_private, + "origin_channel_id": origin_channel_id, + "origin_message_ts": origin_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.create", json=kwargs) + + def agents_conversations_getCanvas( + self, + *, + channel: str, + canvas_id: str, + content_format: Optional[str] = None, + include_resolved: Optional[bool] = None, + **kwargs, + ) -> SlackResponse: + """Fetch a canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.getCanvas + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content_format": content_format, + "include_resolved": include_resolved, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.getCanvas", json=kwargs) + + def agents_conversations_listViews( + self, + *, + channel_id: str, + **kwargs, + ) -> SlackResponse: + """List the views currently attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.listViews + """ + kwargs.update({"channel_id": channel_id}) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.listViews", json=kwargs) + + def agents_conversations_removeView( + self, + *, + channel_id: str, + view_key: Optional[str] = None, + view_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Remove a view from a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.removeView + """ + kwargs.update( + { + "channel_id": channel_id, + "view_key": view_key, + "view_id": view_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.removeView", json=kwargs) + + def agents_conversations_setCanvasContent( + self, + *, + channel: str, + canvas_id: str, + content: str, + **kwargs, + ) -> SlackResponse: + """Replace the full markdown content of a plan canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content": content, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCanvasContent", json=kwargs) + + def agents_conversations_setCommands( + self, + *, + channel_id: str, + commands: Sequence[Dict], + **kwargs, + ) -> SlackResponse: + """Register the set of agent-defined slash commands for the calling agent in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCommands + """ + kwargs.update( + { + "commands": commands, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCommands", json=kwargs) + + def agents_conversations_setProperties( + self, + *, + channel_id: str, + code_channel: Optional[Dict] = None, + agent_resource: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Set properties on a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setProperties + """ + kwargs.update( + { + "channel_id": channel_id, + "code_channel": code_channel, + "agent_resource": agent_resource, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setProperties", json=kwargs) + + def agents_conversations_setView( + self, + *, + channel_id: str, + type: Optional[str] = None, + view_key: Optional[str] = None, + content: Optional[str] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + canvas_id: Optional[str] = None, + access_level: Optional[str] = None, + agent_content_hash: Optional[str] = None, + pr_url: Optional[str] = None, + base_branch: Optional[str] = None, + head_branch: Optional[str] = None, + name: Optional[str] = None, + csp: Optional[Dict] = None, + **kwargs, + ) -> SlackResponse: + """Create or update a view in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setView + """ + kwargs.update( + { + "channel_id": channel_id, + "type": type, + "view_key": view_key, + "content": content, + "blocks": blocks, + "canvas_id": canvas_id, + "access_level": access_level, + "agent_content_hash": agent_content_hash, + "pr_url": pr_url, + "base_branch": base_branch, + "head_branch": head_branch, + "name": name, + "csp": csp, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setView", json=kwargs) + def agents_sessions_rename( self, *, @@ -2626,6 +2854,46 @@

      Methods

      kwargs.update({"user_id": user_id, "status": status}) return self.api_call("apps.user.connection.update", params=kwargs) + def apps_user_connection_bulkUpdate( + self, + *, + connected_user_ids: Optional[Union[str, Sequence[str]]] = None, + disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None, + **kwargs, + ) -> SlackResponse: + """Updates the connection status between an app and many users in one call, for backfilling an existing user base. + + https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate + """ + if isinstance(connected_user_ids, (list, tuple)): + kwargs.update({"connected_user_ids": ",".join(connected_user_ids)}) + else: + kwargs.update({"connected_user_ids": connected_user_ids}) + if isinstance(disconnected_user_ids, (list, tuple)): + kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)}) + else: + kwargs.update({"disconnected_user_ids": disconnected_user_ids}) + return self.api_call("apps.user.connection.bulkUpdate", params=kwargs) + + def apps_user_connection_requestAuth( + self, + *, + primary_provider: Union[str, Dict[str, Any]], + trigger_id: Optional[str] = None, + user_id: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Opens or updates a standardized authentication modal for the calling app. + + https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth + """ + kwargs.update({"trigger_id": trigger_id, "user_id": user_id}) + if isinstance(primary_provider, str): + kwargs.update({"primary_provider": primary_provider}) + else: + kwargs.update({"primary_provider": json.dumps(primary_provider)}) + return self.api_call("apps.user.connection.requestAuth", params=kwargs) + def tooling_tokens_rotate( self, *, @@ -2981,14 +3249,22 @@

      Methods

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs) def canvases_edit( @@ -3018,6 +3294,20 @@

      Methods

      kwargs.update({"canvas_id": canvas_id}) return self.api_call("canvases.delete", params=kwargs) + def canvases_getContent( + self, + *, + canvas_id: str, + content_type: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Get the content of a canvas as markdown (default) or HTML. + + https://docs.slack.dev/reference/methods/canvases.getContent + """ + kwargs.update({"canvas_id": canvas_id, "content_type": content_type}) + return self.api_call("canvases.getContent", params=kwargs) + def canvases_access_set( self, *, @@ -6112,13 +6402,14 @@

      Methods

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs) def team_integrationLogs( @@ -9210,6 +9501,31 @@

      Methods

      +
      +def admin_users_getExpiration(self, *, user_id: str, target_team: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def admin_users_getExpiration(
      +    self,
      +    *,
      +    user_id: str,
      +    target_team: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Fetches the expiration timestamp for a guest.
      +
      +    https://docs.slack.dev/reference/methods/admin.users.getExpiration
      +    """
      +    kwargs.update({"user_id": user_id, "target_team": target_team})
      +    return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs)
      +
      +

      Fetches the expiration timestamp for a guest.

      +

      https://docs.slack.dev/reference/methods/admin.users.getExpiration

      +
      def admin_users_invite(self,
      *,
      team_id: str,
      email: str,
      channel_ids: str | Sequence[str],
      custom_message: str | None = None,
      email_password_policy_enabled: bool | None = None,
      guest_expiration_ts: str | float | None = None,
      is_restricted: bool | None = None,
      is_ultra_restricted: bool | None = None,
      real_name: str | None = None,
      resend: bool | None = None,
      **kwargs) ‑> SlackResponse
      @@ -9848,6 +10164,319 @@

      Methods

      Unpublish workflows within the team or enterprise.

      https://docs.slack.dev/reference/methods/admin.workflows.unpublish

      +
      +def agents_conversations_archive(self, *, channel_id: str, summary_message_ts: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_archive(
      +    self,
      +    *,
      +    channel_id: str,
      +    summary_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Archive a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.archive
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "summary_message_ts": summary_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.archive", json=kwargs)
      +
      + +
      +
      +def agents_conversations_create(self,
      *,
      name: str,
      team_id: str | None = None,
      session_id: str | None = None,
      is_private: bool | None = None,
      origin_channel_id: str | None = None,
      origin_message_ts: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_create(
      +    self,
      +    *,
      +    name: str,
      +    team_id: Optional[str] = None,
      +    session_id: Optional[str] = None,
      +    is_private: Optional[bool] = None,
      +    origin_channel_id: Optional[str] = None,
      +    origin_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Create a dedicated code channel for an agent session.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.create
      +    """
      +    kwargs.update(
      +        {
      +            "team_id": team_id,
      +            "session_id": session_id,
      +            "name": name,
      +            "is_private": is_private,
      +            "origin_channel_id": origin_channel_id,
      +            "origin_message_ts": origin_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.create", json=kwargs)
      +
      +

      Create a dedicated code channel for an agent session.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.create

      +
      +
      +def agents_conversations_getCanvas(self,
      *,
      channel: str,
      canvas_id: str,
      content_format: str | None = None,
      include_resolved: bool | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_getCanvas(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content_format: Optional[str] = None,
      +    include_resolved: Optional[bool] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Fetch a canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.getCanvas
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content_format": content_format,
      +            "include_resolved": include_resolved,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.getCanvas", json=kwargs)
      +
      + +
      +
      +def agents_conversations_listViews(self, *, channel_id: str, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_listViews(
      +    self,
      +    *,
      +    channel_id: str,
      +    **kwargs,
      +) -> SlackResponse:
      +    """List the views currently attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.listViews
      +    """
      +    kwargs.update({"channel_id": channel_id})
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.listViews", json=kwargs)
      +
      +

      List the views currently attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.listViews

      +
      +
      +def agents_conversations_removeView(self,
      *,
      channel_id: str,
      view_key: str | None = None,
      view_id: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_removeView(
      +    self,
      +    *,
      +    channel_id: str,
      +    view_key: Optional[str] = None,
      +    view_id: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Remove a view from a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.removeView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "view_key": view_key,
      +            "view_id": view_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.removeView", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setCanvasContent(self, *, channel: str, canvas_id: str, content: str, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCanvasContent(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content: str,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Replace the full markdown content of a plan canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content": content,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCanvasContent", json=kwargs)
      +
      +

      Replace the full markdown content of a plan canvas attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent

      +
      +
      +def agents_conversations_setCommands(self, *, channel_id: str, commands: Sequence[Dict], **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCommands(
      +    self,
      +    *,
      +    channel_id: str,
      +    commands: Sequence[Dict],
      +    **kwargs,
      +) -> SlackResponse:
      +    """Register the set of agent-defined slash commands for the calling agent in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCommands
      +    """
      +    kwargs.update(
      +        {
      +            "commands": commands,
      +            "channel_id": channel_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCommands", json=kwargs)
      +
      +

      Register the set of agent-defined slash commands for the calling agent in a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCommands

      +
      +
      +def agents_conversations_setProperties(self,
      *,
      channel_id: str,
      code_channel: Dict | None = None,
      agent_resource: Dict | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setProperties(
      +    self,
      +    *,
      +    channel_id: str,
      +    code_channel: Optional[Dict] = None,
      +    agent_resource: Optional[Dict] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Set properties on a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setProperties
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "code_channel": code_channel,
      +            "agent_resource": agent_resource,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setProperties", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setView(self,
      *,
      channel_id: str,
      type: str | None = None,
      view_key: str | None = None,
      content: str | None = None,
      blocks: Sequence[Dict | Block] | None = None,
      canvas_id: str | None = None,
      access_level: str | None = None,
      agent_content_hash: str | None = None,
      pr_url: str | None = None,
      base_branch: str | None = None,
      head_branch: str | None = None,
      name: str | None = None,
      csp: Dict | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setView(
      +    self,
      +    *,
      +    channel_id: str,
      +    type: Optional[str] = None,
      +    view_key: Optional[str] = None,
      +    content: Optional[str] = None,
      +    blocks: Optional[Sequence[Union[Dict, Block]]] = None,
      +    canvas_id: Optional[str] = None,
      +    access_level: Optional[str] = None,
      +    agent_content_hash: Optional[str] = None,
      +    pr_url: Optional[str] = None,
      +    base_branch: Optional[str] = None,
      +    head_branch: Optional[str] = None,
      +    name: Optional[str] = None,
      +    csp: Optional[Dict] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Create or update a view in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "type": type,
      +            "view_key": view_key,
      +            "content": content,
      +            "blocks": blocks,
      +            "canvas_id": canvas_id,
      +            "access_level": access_level,
      +            "agent_content_hash": agent_content_hash,
      +            "pr_url": pr_url,
      +            "base_branch": base_branch,
      +            "head_branch": head_branch,
      +            "name": name,
      +            "csp": csp,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setView", json=kwargs)
      +
      + +
      def agents_sessions_rename(self, *, channel_id: str, title: str, thread_ts: str | None = None, **kwargs) ‑> SlackResponse
      @@ -10160,6 +10789,68 @@

      Methods

      Uninstalls your app from a workspace.

      https://docs.slack.dev/reference/methods/apps.uninstall

      +
      +def apps_user_connection_bulkUpdate(self,
      *,
      connected_user_ids: str | Sequence[str] | None = None,
      disconnected_user_ids: str | Sequence[str] | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_bulkUpdate(
      +    self,
      +    *,
      +    connected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Updates the connection status between an app and many users in one call, for backfilling an existing user base.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate
      +    """
      +    if isinstance(connected_user_ids, (list, tuple)):
      +        kwargs.update({"connected_user_ids": ",".join(connected_user_ids)})
      +    else:
      +        kwargs.update({"connected_user_ids": connected_user_ids})
      +    if isinstance(disconnected_user_ids, (list, tuple)):
      +        kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)})
      +    else:
      +        kwargs.update({"disconnected_user_ids": disconnected_user_ids})
      +    return self.api_call("apps.user.connection.bulkUpdate", params=kwargs)
      +
      +

      Updates the connection status between an app and many users in one call, for backfilling an existing user base.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate

      +
      +
      +def apps_user_connection_requestAuth(self,
      *,
      primary_provider: str | Dict[str, Any],
      trigger_id: str | None = None,
      user_id: str | None = None,
      **kwargs) ‑> SlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_requestAuth(
      +    self,
      +    *,
      +    primary_provider: Union[str, Dict[str, Any]],
      +    trigger_id: Optional[str] = None,
      +    user_id: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Opens or updates a standardized authentication modal for the calling app.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth
      +    """
      +    kwargs.update({"trigger_id": trigger_id, "user_id": user_id})
      +    if isinstance(primary_provider, str):
      +        kwargs.update({"primary_provider": primary_provider})
      +    else:
      +        kwargs.update({"primary_provider": json.dumps(primary_provider)})
      +    return self.api_call("apps.user.connection.requestAuth", params=kwargs)
      +
      +

      Opens or updates a standardized authentication modal for the calling app.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth

      +
      def apps_user_connection_update(self, *, user_id: str, status: str, **kwargs) ‑> SlackResponse
      @@ -10797,7 +11488,7 @@

      Methods

      https://docs.slack.dev/reference/methods/canvases.access.set

      -def canvases_create(self, *, title: str | None = None, document_content: Dict[str, str], **kwargs) ‑> SlackResponse +def canvases_create(self,
      *,
      title: str | None = None,
      document_content: Dict[str, str] | None = None,
      channel_id: str | None = None,
      **kwargs) ‑> SlackResponse
      @@ -10808,14 +11499,22 @@

      Methods

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> SlackResponse: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs)

      Create Canvas for a user.

      @@ -10870,6 +11569,31 @@

      Methods

      +
      +def canvases_getContent(self, *, canvas_id: str, content_type: str | None = None, **kwargs) ‑> SlackResponse +
      +
      +
      + +Expand source code + +
      def canvases_getContent(
      +    self,
      +    *,
      +    canvas_id: str,
      +    content_type: Optional[str] = None,
      +    **kwargs,
      +) -> SlackResponse:
      +    """Get the content of a canvas as markdown (default) or HTML.
      +
      +    https://docs.slack.dev/reference/methods/canvases.getContent
      +    """
      +    kwargs.update({"canvas_id": canvas_id, "content_type": content_type})
      +    return self.api_call("canvases.getContent", params=kwargs)
      +
      +

      Get the content of a canvas as markdown (default) or HTML.

      +

      https://docs.slack.dev/reference/methods/canvases.getContent

      +
      def canvases_sections_lookup(self, *, canvas_id: str, criteria: Dict[str, Any], **kwargs) ‑> SlackResponse
      @@ -15605,7 +16329,7 @@

      Methods

      https://docs.slack.dev/reference/methods/team.externalTeams.list

      -def team_info(self, *, team: str | None = None, domain: str | None = None, **kwargs) ‑> SlackResponse +def team_info(self,
      *,
      team: str | None = None,
      domain: str | None = None,
      include_slackbot_availability: bool | None = None,
      **kwargs) ‑> SlackResponse
      @@ -15617,13 +16341,14 @@

      Methods

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> SlackResponse: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs)

      Gets information about the current team.

      @@ -16809,6 +17534,7 @@

      Web
    • admin_usergroups_listChannels
    • admin_usergroups_removeChannels
    • admin_users_assign
    • +
    • admin_users_getExpiration
    • admin_users_invite
    • admin_users_list
    • admin_users_remove
    • @@ -16829,6 +17555,15 @@

      Web
    • admin_workflows_permissions_lookup
    • admin_workflows_search
    • admin_workflows_unpublish
    • +
    • agents_conversations_archive
    • +
    • agents_conversations_create
    • +
    • agents_conversations_getCanvas
    • +
    • agents_conversations_listViews
    • +
    • agents_conversations_removeView
    • +
    • agents_conversations_setCanvasContent
    • +
    • agents_conversations_setCommands
    • +
    • agents_conversations_setProperties
    • +
    • agents_conversations_setView
    • agents_sessions_rename
    • agents_sessions_setStatus
    • api_test
    • @@ -16840,6 +17575,8 @@

      Web
    • apps_manifest_update
    • apps_manifest_validate
    • apps_uninstall
    • +
    • apps_user_connection_bulkUpdate
    • +
    • apps_user_connection_requestAuth
    • apps_user_connection_update
    • assistant_threads_setStatus
    • assistant_threads_setSuggestedPrompts
    • @@ -16864,6 +17601,7 @@

      Web
    • canvases_create
    • canvases_delete
    • canvases_edit
    • +
    • canvases_getContent
    • canvases_sections_lookup
    • channels_archive
    • channels_create
    • diff --git a/docs/reference/web/legacy_client.html b/docs/reference/web/legacy_client.html index 6b3c1fc0c..f2fae4841 100644 --- a/docs/reference/web/legacy_client.html +++ b/docs/reference/web/legacy_client.html @@ -1834,6 +1834,20 @@

      Classes

      kwargs.update({"channel_ids": channel_ids}) return self.api_call("admin.users.invite", params=kwargs) + def admin_users_getExpiration( + self, + *, + user_id: str, + target_team: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Fetches the expiration timestamp for a guest. + + https://docs.slack.dev/reference/methods/admin.users.getExpiration + """ + kwargs.update({"user_id": user_id, "target_team": target_team}) + return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs) + def admin_users_list( self, *, @@ -2049,6 +2063,220 @@

      Classes

      kwargs.update({"workflow_ids": workflow_ids}) return self.api_call("admin.workflows.unpublish", params=kwargs) + def agents_conversations_archive( + self, + *, + channel_id: str, + summary_message_ts: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Archive a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.archive + """ + kwargs.update( + { + "channel_id": channel_id, + "summary_message_ts": summary_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.archive", json=kwargs) + + def agents_conversations_create( + self, + *, + name: str, + team_id: Optional[str] = None, + session_id: Optional[str] = None, + is_private: Optional[bool] = None, + origin_channel_id: Optional[str] = None, + origin_message_ts: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Create a dedicated code channel for an agent session. + + https://docs.slack.dev/reference/methods/agents.conversations.create + """ + kwargs.update( + { + "team_id": team_id, + "session_id": session_id, + "name": name, + "is_private": is_private, + "origin_channel_id": origin_channel_id, + "origin_message_ts": origin_message_ts, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.create", json=kwargs) + + def agents_conversations_getCanvas( + self, + *, + channel: str, + canvas_id: str, + content_format: Optional[str] = None, + include_resolved: Optional[bool] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Fetch a canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.getCanvas + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content_format": content_format, + "include_resolved": include_resolved, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.getCanvas", json=kwargs) + + def agents_conversations_listViews( + self, + *, + channel_id: str, + **kwargs, + ) -> Union[Future, SlackResponse]: + """List the views currently attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.listViews + """ + kwargs.update({"channel_id": channel_id}) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.listViews", json=kwargs) + + def agents_conversations_removeView( + self, + *, + channel_id: str, + view_key: Optional[str] = None, + view_id: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Remove a view from a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.removeView + """ + kwargs.update( + { + "channel_id": channel_id, + "view_key": view_key, + "view_id": view_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.removeView", json=kwargs) + + def agents_conversations_setCanvasContent( + self, + *, + channel: str, + canvas_id: str, + content: str, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Replace the full markdown content of a plan canvas attached to a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent + """ + kwargs.update( + { + "channel": channel, + "canvas_id": canvas_id, + "content": content, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCanvasContent", json=kwargs) + + def agents_conversations_setCommands( + self, + *, + channel_id: str, + commands: Sequence[Dict], + **kwargs, + ) -> Union[Future, SlackResponse]: + """Register the set of agent-defined slash commands for the calling agent in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setCommands + """ + kwargs.update( + { + "commands": commands, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setCommands", json=kwargs) + + def agents_conversations_setProperties( + self, + *, + channel_id: str, + code_channel: Optional[Dict] = None, + agent_resource: Optional[Dict] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Set properties on a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setProperties + """ + kwargs.update( + { + "channel_id": channel_id, + "code_channel": code_channel, + "agent_resource": agent_resource, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setProperties", json=kwargs) + + def agents_conversations_setView( + self, + *, + channel_id: str, + type: Optional[str] = None, + view_key: Optional[str] = None, + content: Optional[str] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + canvas_id: Optional[str] = None, + access_level: Optional[str] = None, + agent_content_hash: Optional[str] = None, + pr_url: Optional[str] = None, + base_branch: Optional[str] = None, + head_branch: Optional[str] = None, + name: Optional[str] = None, + csp: Optional[Dict] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Create or update a view in a code channel. + + https://docs.slack.dev/reference/methods/agents.conversations.setView + """ + kwargs.update( + { + "channel_id": channel_id, + "type": type, + "view_key": view_key, + "content": content, + "blocks": blocks, + "canvas_id": canvas_id, + "access_level": access_level, + "agent_content_hash": agent_content_hash, + "pr_url": pr_url, + "base_branch": base_branch, + "head_branch": head_branch, + "name": name, + "csp": csp, + } + ) + kwargs = _remove_none_values(kwargs) + return self.api_call("agents.conversations.setView", json=kwargs) + def agents_sessions_rename( self, *, @@ -2252,6 +2480,46 @@

      Classes

      kwargs.update({"user_id": user_id, "status": status}) return self.api_call("apps.user.connection.update", params=kwargs) + def apps_user_connection_bulkUpdate( + self, + *, + connected_user_ids: Optional[Union[str, Sequence[str]]] = None, + disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Updates the connection status between an app and many users in one call, for backfilling an existing user base. + + https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate + """ + if isinstance(connected_user_ids, (list, tuple)): + kwargs.update({"connected_user_ids": ",".join(connected_user_ids)}) + else: + kwargs.update({"connected_user_ids": connected_user_ids}) + if isinstance(disconnected_user_ids, (list, tuple)): + kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)}) + else: + kwargs.update({"disconnected_user_ids": disconnected_user_ids}) + return self.api_call("apps.user.connection.bulkUpdate", params=kwargs) + + def apps_user_connection_requestAuth( + self, + *, + primary_provider: Union[str, Dict[str, Any]], + trigger_id: Optional[str] = None, + user_id: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Opens or updates a standardized authentication modal for the calling app. + + https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth + """ + kwargs.update({"trigger_id": trigger_id, "user_id": user_id}) + if isinstance(primary_provider, str): + kwargs.update({"primary_provider": primary_provider}) + else: + kwargs.update({"primary_provider": json.dumps(primary_provider)}) + return self.api_call("apps.user.connection.requestAuth", params=kwargs) + def tooling_tokens_rotate( self, *, @@ -2607,14 +2875,22 @@

      Classes

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs) def canvases_edit( @@ -2644,6 +2920,20 @@

      Classes

      kwargs.update({"canvas_id": canvas_id}) return self.api_call("canvases.delete", params=kwargs) + def canvases_getContent( + self, + *, + canvas_id: str, + content_type: Optional[str] = None, + **kwargs, + ) -> Union[Future, SlackResponse]: + """Get the content of a canvas as markdown (default) or HTML. + + https://docs.slack.dev/reference/methods/canvases.getContent + """ + kwargs.update({"canvas_id": canvas_id, "content_type": content_type}) + return self.api_call("canvases.getContent", params=kwargs) + def canvases_access_set( self, *, @@ -5662,13 +5952,14 @@

      Classes

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs) def team_integrationLogs( @@ -8760,6 +9051,31 @@

      Methods

      +
      +def admin_users_getExpiration(self, *, user_id: str, target_team: str | None = None, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def admin_users_getExpiration(
      +    self,
      +    *,
      +    user_id: str,
      +    target_team: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Fetches the expiration timestamp for a guest.
      +
      +    https://docs.slack.dev/reference/methods/admin.users.getExpiration
      +    """
      +    kwargs.update({"user_id": user_id, "target_team": target_team})
      +    return self.api_call("admin.users.getExpiration", http_verb="GET", params=kwargs)
      +
      +

      Fetches the expiration timestamp for a guest.

      +

      https://docs.slack.dev/reference/methods/admin.users.getExpiration

      +
      def admin_users_invite(self,
      *,
      team_id: str,
      email: str,
      channel_ids: str | Sequence[str],
      custom_message: str | None = None,
      email_password_policy_enabled: bool | None = None,
      guest_expiration_ts: str | float | None = None,
      is_restricted: bool | None = None,
      is_ultra_restricted: bool | None = None,
      real_name: str | None = None,
      resend: bool | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -9398,6 +9714,319 @@

      Methods

      Unpublish workflows within the team or enterprise.

      https://docs.slack.dev/reference/methods/admin.workflows.unpublish

      +
      +def agents_conversations_archive(self, *, channel_id: str, summary_message_ts: str | None = None, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_archive(
      +    self,
      +    *,
      +    channel_id: str,
      +    summary_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Archive a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.archive
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "summary_message_ts": summary_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.archive", json=kwargs)
      +
      + +
      +
      +def agents_conversations_create(self,
      *,
      name: str,
      team_id: str | None = None,
      session_id: str | None = None,
      is_private: bool | None = None,
      origin_channel_id: str | None = None,
      origin_message_ts: str | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_create(
      +    self,
      +    *,
      +    name: str,
      +    team_id: Optional[str] = None,
      +    session_id: Optional[str] = None,
      +    is_private: Optional[bool] = None,
      +    origin_channel_id: Optional[str] = None,
      +    origin_message_ts: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Create a dedicated code channel for an agent session.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.create
      +    """
      +    kwargs.update(
      +        {
      +            "team_id": team_id,
      +            "session_id": session_id,
      +            "name": name,
      +            "is_private": is_private,
      +            "origin_channel_id": origin_channel_id,
      +            "origin_message_ts": origin_message_ts,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.create", json=kwargs)
      +
      +

      Create a dedicated code channel for an agent session.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.create

      +
      +
      +def agents_conversations_getCanvas(self,
      *,
      channel: str,
      canvas_id: str,
      content_format: str | None = None,
      include_resolved: bool | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_getCanvas(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content_format: Optional[str] = None,
      +    include_resolved: Optional[bool] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Fetch a canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.getCanvas
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content_format": content_format,
      +            "include_resolved": include_resolved,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.getCanvas", json=kwargs)
      +
      + +
      +
      +def agents_conversations_listViews(self, *, channel_id: str, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_listViews(
      +    self,
      +    *,
      +    channel_id: str,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """List the views currently attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.listViews
      +    """
      +    kwargs.update({"channel_id": channel_id})
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.listViews", json=kwargs)
      +
      +

      List the views currently attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.listViews

      +
      +
      +def agents_conversations_removeView(self,
      *,
      channel_id: str,
      view_key: str | None = None,
      view_id: str | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_removeView(
      +    self,
      +    *,
      +    channel_id: str,
      +    view_key: Optional[str] = None,
      +    view_id: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Remove a view from a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.removeView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "view_key": view_key,
      +            "view_id": view_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.removeView", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setCanvasContent(self, *, channel: str, canvas_id: str, content: str, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCanvasContent(
      +    self,
      +    *,
      +    channel: str,
      +    canvas_id: str,
      +    content: str,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Replace the full markdown content of a plan canvas attached to a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent
      +    """
      +    kwargs.update(
      +        {
      +            "channel": channel,
      +            "canvas_id": canvas_id,
      +            "content": content,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCanvasContent", json=kwargs)
      +
      +

      Replace the full markdown content of a plan canvas attached to a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent

      +
      +
      +def agents_conversations_setCommands(self, *, channel_id: str, commands: Sequence[Dict], **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def agents_conversations_setCommands(
      +    self,
      +    *,
      +    channel_id: str,
      +    commands: Sequence[Dict],
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Register the set of agent-defined slash commands for the calling agent in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setCommands
      +    """
      +    kwargs.update(
      +        {
      +            "commands": commands,
      +            "channel_id": channel_id,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setCommands", json=kwargs)
      +
      +

      Register the set of agent-defined slash commands for the calling agent in a code channel.

      +

      https://docs.slack.dev/reference/methods/agents.conversations.setCommands

      +
      +
      +def agents_conversations_setProperties(self,
      *,
      channel_id: str,
      code_channel: Dict | None = None,
      agent_resource: Dict | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setProperties(
      +    self,
      +    *,
      +    channel_id: str,
      +    code_channel: Optional[Dict] = None,
      +    agent_resource: Optional[Dict] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Set properties on a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setProperties
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "code_channel": code_channel,
      +            "agent_resource": agent_resource,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setProperties", json=kwargs)
      +
      + +
      +
      +def agents_conversations_setView(self,
      *,
      channel_id: str,
      type: str | None = None,
      view_key: str | None = None,
      content: str | None = None,
      blocks: Sequence[Dict | Block] | None = None,
      canvas_id: str | None = None,
      access_level: str | None = None,
      agent_content_hash: str | None = None,
      pr_url: str | None = None,
      base_branch: str | None = None,
      head_branch: str | None = None,
      name: str | None = None,
      csp: Dict | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def agents_conversations_setView(
      +    self,
      +    *,
      +    channel_id: str,
      +    type: Optional[str] = None,
      +    view_key: Optional[str] = None,
      +    content: Optional[str] = None,
      +    blocks: Optional[Sequence[Union[Dict, Block]]] = None,
      +    canvas_id: Optional[str] = None,
      +    access_level: Optional[str] = None,
      +    agent_content_hash: Optional[str] = None,
      +    pr_url: Optional[str] = None,
      +    base_branch: Optional[str] = None,
      +    head_branch: Optional[str] = None,
      +    name: Optional[str] = None,
      +    csp: Optional[Dict] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Create or update a view in a code channel.
      +
      +    https://docs.slack.dev/reference/methods/agents.conversations.setView
      +    """
      +    kwargs.update(
      +        {
      +            "channel_id": channel_id,
      +            "type": type,
      +            "view_key": view_key,
      +            "content": content,
      +            "blocks": blocks,
      +            "canvas_id": canvas_id,
      +            "access_level": access_level,
      +            "agent_content_hash": agent_content_hash,
      +            "pr_url": pr_url,
      +            "base_branch": base_branch,
      +            "head_branch": head_branch,
      +            "name": name,
      +            "csp": csp,
      +        }
      +    )
      +    kwargs = _remove_none_values(kwargs)
      +    return self.api_call("agents.conversations.setView", json=kwargs)
      +
      + +
      def agents_sessions_rename(self, *, channel_id: str, title: str, thread_ts: str | None = None, **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -9710,6 +10339,68 @@

      Methods

      Uninstalls your app from a workspace.

      https://docs.slack.dev/reference/methods/apps.uninstall

      +
      +def apps_user_connection_bulkUpdate(self,
      *,
      connected_user_ids: str | Sequence[str] | None = None,
      disconnected_user_ids: str | Sequence[str] | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_bulkUpdate(
      +    self,
      +    *,
      +    connected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    disconnected_user_ids: Optional[Union[str, Sequence[str]]] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Updates the connection status between an app and many users in one call, for backfilling an existing user base.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate
      +    """
      +    if isinstance(connected_user_ids, (list, tuple)):
      +        kwargs.update({"connected_user_ids": ",".join(connected_user_ids)})
      +    else:
      +        kwargs.update({"connected_user_ids": connected_user_ids})
      +    if isinstance(disconnected_user_ids, (list, tuple)):
      +        kwargs.update({"disconnected_user_ids": ",".join(disconnected_user_ids)})
      +    else:
      +        kwargs.update({"disconnected_user_ids": disconnected_user_ids})
      +    return self.api_call("apps.user.connection.bulkUpdate", params=kwargs)
      +
      +

      Updates the connection status between an app and many users in one call, for backfilling an existing user base.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.bulkUpdate

      +
      +
      +def apps_user_connection_requestAuth(self,
      *,
      primary_provider: str | Dict[str, Any],
      trigger_id: str | None = None,
      user_id: str | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      +
      +
      +
      + +Expand source code + +
      def apps_user_connection_requestAuth(
      +    self,
      +    *,
      +    primary_provider: Union[str, Dict[str, Any]],
      +    trigger_id: Optional[str] = None,
      +    user_id: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Opens or updates a standardized authentication modal for the calling app.
      +
      +    https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth
      +    """
      +    kwargs.update({"trigger_id": trigger_id, "user_id": user_id})
      +    if isinstance(primary_provider, str):
      +        kwargs.update({"primary_provider": primary_provider})
      +    else:
      +        kwargs.update({"primary_provider": json.dumps(primary_provider)})
      +    return self.api_call("apps.user.connection.requestAuth", params=kwargs)
      +
      +

      Opens or updates a standardized authentication modal for the calling app.

      +

      https://docs.slack.dev/reference/methods/apps.user.connection.requestAuth

      +
      def apps_user_connection_update(self, *, user_id: str, status: str, **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -10347,7 +11038,7 @@

      Methods

      https://docs.slack.dev/reference/methods/canvases.access.set

      -def canvases_create(self, *, title: str | None = None, document_content: Dict[str, str], **kwargs) ‑> _asyncio.Future | LegacySlackResponse +def canvases_create(self,
      *,
      title: str | None = None,
      document_content: Dict[str, str] | None = None,
      channel_id: str | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -10358,14 +11049,22 @@

      Methods

      self, *, title: Optional[str] = None, - document_content: Dict[str, str], + document_content: Optional[Dict[str, str]] = None, + channel_id: Optional[str] = None, **kwargs, ) -> Union[Future, SlackResponse]: """Create Canvas for a user. https://docs.slack.dev/reference/methods/canvases.create """ - kwargs.update({"title": title, "document_content": document_content}) + kwargs.update( + { + "title": title, + "document_content": document_content, + "channel_id": channel_id, + } + ) + kwargs = _remove_none_values(kwargs) return self.api_call("canvases.create", json=kwargs)

      Create Canvas for a user.

      @@ -10420,6 +11119,31 @@

      Methods

      +
      +def canvases_getContent(self, *, canvas_id: str, content_type: str | None = None, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +
      +
      +
      + +Expand source code + +
      def canvases_getContent(
      +    self,
      +    *,
      +    canvas_id: str,
      +    content_type: Optional[str] = None,
      +    **kwargs,
      +) -> Union[Future, SlackResponse]:
      +    """Get the content of a canvas as markdown (default) or HTML.
      +
      +    https://docs.slack.dev/reference/methods/canvases.getContent
      +    """
      +    kwargs.update({"canvas_id": canvas_id, "content_type": content_type})
      +    return self.api_call("canvases.getContent", params=kwargs)
      +
      +

      Get the content of a canvas as markdown (default) or HTML.

      +

      https://docs.slack.dev/reference/methods/canvases.getContent

      +
      def canvases_sections_lookup(self, *, canvas_id: str, criteria: Dict[str, Any], **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -15014,7 +15738,7 @@

      Methods

      https://docs.slack.dev/reference/methods/team.externalTeams.list

      -def team_info(self, *, team: str | None = None, domain: str | None = None, **kwargs) ‑> _asyncio.Future | LegacySlackResponse +def team_info(self,
      *,
      team: str | None = None,
      domain: str | None = None,
      include_slackbot_availability: bool | None = None,
      **kwargs) ‑> _asyncio.Future | LegacySlackResponse
      @@ -15026,13 +15750,14 @@

      Methods

      *, team: Optional[str] = None, domain: Optional[str] = None, + include_slackbot_availability: Optional[bool] = None, **kwargs, ) -> Union[Future, SlackResponse]: """Gets information about the current team. https://docs.slack.dev/reference/methods/team.info """ - kwargs.update({"team": team, "domain": domain}) + kwargs.update({"team": team, "domain": domain, "include_slackbot_availability": include_slackbot_availability}) return self.api_call("team.info", http_verb="GET", params=kwargs)