From 9722196876171ed8cfb51e771c5c41f7ccf18fff Mon Sep 17 00:00:00 2001 From: slack-ruby-ci-bot Date: Mon, 19 Oct 2026 23:24:33 +0000 Subject: [PATCH] Update API from slack-api-ref@0ae4e98 (2026-10-19) - Expose agents.conversations endpoints in the Web API client - Add error classes for additional agent, canvas, channel, invitation, validation, and resource-limit error codes --- CHANGELOG.md | 2 + bin/commands/admin_analytics_messages.rb | 4 +- bin/commands/admin_apps_permissions.rb | 2 +- bin/commands/agents_conversations.rb | 123 ++++++++++++ bin/commands/chat.rb | 2 +- lib/slack/web/api/endpoints.rb | 2 + .../api/endpoints/admin_analytics_messages.rb | 2 +- .../api/endpoints/admin_apps_permissions.rb | 2 +- .../web/api/endpoints/agents_conversations.rb | 188 ++++++++++++++++++ lib/slack/web/api/endpoints/chat.rb | 2 +- lib/slack/web/api/errors.rb | 92 +++++++++ lib/slack/web/api/slack-api-ref | 2 +- .../endpoints/agents_conversations_spec.rb | 65 ++++++ 13 files changed, 480 insertions(+), 8 deletions(-) create mode 100644 bin/commands/agents_conversations.rb create mode 100644 lib/slack/web/api/endpoints/agents_conversations.rb create mode 100644 spec/slack/web/api/endpoints/agents_conversations_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index e07f88ac..b496a953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### 3.3.1 (Next) +* [#609](https://github.com/slack-ruby/slack-ruby-client/pull/609): Expose agents.conversations endpoints in the Web API client - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#609](https://github.com/slack-ruby/slack-ruby-client/pull/609): Add error classes for additional agent, canvas, channel, invitation, validation, and resource-limit error codes - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 3.3.0 (2026/10/09) diff --git a/bin/commands/admin_analytics_messages.rb b/bin/commands/admin_analytics_messages.rb index bb572ece..99882481 100644 --- a/bin/commands/admin_analytics_messages.rb +++ b/bin/commands/admin_analytics_messages.rb @@ -6,8 +6,8 @@ module Cli class App desc 'AdminAnalyticsMessages methods.' command 'admin_analytics_messages' do |g| - g.desc 'Retrieves activity metrics for messages from a given channel.' - g.long_desc %( Retrieves activity metrics for messages from a given channel. ) + g.desc 'Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts' + g.long_desc %( Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts ) g.command 'activity' do |c| c.flag 'channel', desc: 'Channel ID for channel of the message activity to query.' c.flag 'oldest_ts', desc: 'Oldest timestamp to include in the results. Defaults to 7 days before current time. If not passed while still passing the latest_ts parameter, defaults to 7 days before latest_ts.' diff --git a/bin/commands/admin_apps_permissions.rb b/bin/commands/admin_apps_permissions.rb index 8924b044..ac79c7a5 100644 --- a/bin/commands/admin_apps_permissions.rb +++ b/bin/commands/admin_apps_permissions.rb @@ -45,7 +45,7 @@ class App c.flag 'app_id', desc: 'Encoded ID of the app.' c.flag 'permission_type', desc: 'The type of permission that defines who can access the app.' c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.' - c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.' + c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs the permission applies to. With named_entities the listed groups may access the app; with named_entities_exclude they may not.' c.flag 'channel_restriction_mode', desc: 'The mode that defines where the app can be used in channels.' c.flag 'channel_ids', desc: 'List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.' c.action do |_global_options, options, _args| diff --git a/bin/commands/agents_conversations.rb b/bin/commands/agents_conversations.rb new file mode 100644 index 00000000..de32fdaa --- /dev/null +++ b/bin/commands/agents_conversations.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AgentsConversations methods.' + command 'agents_conversations' do |g| + g.desc 'Archive a code channel.' + g.long_desc %( Archive a code channel. ) + g.command 'archive' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to archive.' + c.flag 'summary_message_ts', desc: 'Timestamp of a message in the code channel to share back as a thread reply on the origin message. Requires the channel to have an origin_link set.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_archive(options)) + end + end + + g.desc 'Create a dedicated code channel for an agent session.' + g.long_desc %( Create a dedicated code channel for an agent session. ) + g.command 'create' do |c| + c.flag 'team_id', desc: 'Encoded team id to create the channel in. Required for org tokens when origin_channel_id is not provided. When omitted, the workspace is derived from the origin channel.' + c.flag 'session_id', desc: 'An opaque identifier for the agent session. When provided, the call is idempotent: if a channel already exists for this session_id, it is returned instead of creating a new one.' + c.flag 'name', desc: 'A friendly display name for the code channel. Optional when origin_channel_id and origin_message_ts are provided — in that case the channel is named from the origin message and re-titled automatically. Required when no origin link is given.' + c.flag 'is_private', desc: "Whether the code channel is private. When omitted, the channel matches the privacy of origin_channel_id, or is public if no origin is given. An explicit value is always honored, even if it differs from the origin channel's privacy: passing false creates a public channel from a private origin." + c.flag 'origin_channel_id', desc: 'The channel ID where the agent session was initiated from. Must be provided together with origin_message_ts. The channel must be accessible to the calling user and must not be externally shared (Slack Connect). When team_id is omitted with an org token, the channel is created in the same workspace as this origin channel.' + c.flag 'origin_message_ts', desc: 'The message timestamp in the origin channel that started the agent session. Must be provided together with origin_channel_id. The author of this message is automatically invited to the newly created code channel.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_create(options)) + end + end + + g.desc 'Fetch a canvas attached to a code channel.' + g.long_desc %( Fetch a canvas attached to a code channel. ) + g.command 'getCanvas' do |c| + c.flag 'channel', desc: 'ID of the agent session channel the canvas belongs to.' + c.flag 'canvas_id', desc: 'Encoded ID of the canvas to fetch.' + c.flag 'content_format', desc: 'Format to render the canvas content in. Defaults to markdown.' + c.flag 'include_resolved', desc: 'Whether to include resolved comment threads in the response. Defaults to false.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_getCanvas(options)) + end + end + + g.desc 'List the views currently attached to a code channel.' + g.long_desc %( List the views currently attached to a code channel. ) + g.command 'listViews' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to list views for.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_listViews(options)) + end + end + + g.desc 'Remove a view from a code channel.' + g.long_desc %( Remove a view from a code channel. ) + g.command 'removeView' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to remove the view from.' + c.flag 'view_key', desc: 'Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id.' + c.flag 'view_id', desc: 'Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_removeView(options)) + end + end + + g.desc 'Replace the full markdown content of a plan canvas attached to a code channel.' + g.long_desc %( Replace the full markdown content of a plan canvas attached to a code channel. ) + g.command 'setCanvasContent' do |c| + c.flag 'channel', desc: 'ID of the agent session channel the canvas is attached to.' + c.flag 'canvas_id', desc: 'Encoded ID of the canvas whose content to replace.' + c.flag 'content', desc: 'The full new canvas content as markdown. The server diffs this against the current content and applies only the changed sections.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_setCanvasContent(options)) + end + end + + g.desc 'Register the set of agent-defined slash commands for the calling agent in a code channel.' + g.long_desc %( Register the set of agent-defined slash commands for the calling agent in a code channel. ) + g.command 'setCommands' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to register commands for.' + c.flag 'commands', desc: "Full set of commands to register for the calling agent in this channel, replacing that agent's previously registered set. Pass an empty array to clear the agent's commands. At most 10 commands may exist across all agents in the channel; names must be unique within the set and must not collide with builtin Slack commands." + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_setCommands(options)) + end + end + + g.desc 'Set properties on a code channel.' + g.long_desc %( Set properties on a code channel. ) + g.command 'setProperties' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to update.' + c.flag 'title', desc: 'New display title for the agent session.' + c.flag 'status', desc: 'New status for the agent session.' + c.flag 'code_channel', desc: 'Code channel properties to set. Only provided fields are updated.' + c.flag 'agent_resource', desc: 'Agent resource properties to set. Only provided fields are updated.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_setProperties(options)) + end + end + + g.desc 'Create or update a view in a code channel.' + g.long_desc %( Create or update a view in a code channel. ) + g.command 'setView' do |c| + c.flag 'channel_id', desc: 'ID of the code channel to render the view in.' + c.flag 'type', desc: 'The kind of view to create or update. Defaults to html. Determines which other arguments are required: html and diff require content, block_kit requires blocks, canvas requires canvas_id, pull_request requires pr_url.' + c.flag 'view_key', desc: "Agent-assigned stable identity for the view (e.g. the source file path on the agent's machine). Used as the upsert key: calls with the same view_key update the same view. Required for html, block_kit, and canvas views; ignored for diff (a diff view is a per-channel singleton)." + c.flag 'content', desc: 'View content. For html, a full self-contained HTML document; for diff, raw unified diff text. Capped at 1,000,000 bytes — larger content returns content_too_large. The cap is enforced by the handler (not schema maxLength) so the documented error code actually surfaces instead of a generic argument-validation failure. Required when type is html or diff.' + c.flag 'blocks', desc: 'Block Kit blocks to render in the view tab. Required when type is block_kit; ignored otherwise.' + c.flag 'canvas_id', desc: 'Encoded ID of the canvas to attach as the view. Required when type is canvas; ignored otherwise.' + c.flag 'access_level', desc: "For canvas views: access level granted to the channel for the canvas tab. Defaults to write. Use 'comment' to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text." + c.flag 'agent_content_hash', desc: 'For canvas views: hash of the canvas-derived markdown the agent last wrote, recorded so the agent can later detect human edits to the canvas. Opaque to the server.' + c.flag 'pr_url', desc: "For pull_request views: the pull request's URL. Required when type is pull_request; ignored otherwise." + c.flag 'base_branch', desc: 'For diff views: base branch name for display purposes.' + c.flag 'head_branch', desc: 'For diff views: head branch name for display purposes.' + c.flag 'name', desc: "Display label for the view tab. Preferred over the legacy 'label' argument (name wins if both are supplied). Defaults to the last path segment of view_key, stripped of any .html/.htm extension." + c.flag 'label', desc: "Deprecated alias for 'name'. Display label for the view tab. Defaults to the last path segment of view_key, stripped of any .html/.htm extension." + c.flag 'csp', desc: 'Content-Security-Policy domain declarations for the view. Domains are validated server-side (https-only, no private/internal hosts) and persisted. Only resource_domains is honored at render time today; connect_domains is accepted and stored for forward-compatibility but NOT honored yet.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.agents_conversations_setView(options)) + end + end + end + end + end +end diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 7e07b23d..a9115e2b 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -10,7 +10,7 @@ class App g.long_desc %( Appends text to an existing streaming conversation. ) g.command 'appendStream' do |c| c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.' - c.flag 'chunks', desc: 'Array of streaming chunks.' + c.flag 'chunks', desc: 'Array of streaming chunks that can contain either markdown text or task updates.' c.flag 'ts', desc: 'The timestamp of the streaming message.' c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far.' c.action do |_global_options, options, _args| diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index 2b7e0fff..91334308 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -37,6 +37,7 @@ require_relative 'endpoints/admin_workflows_collaborators' require_relative 'endpoints/admin_workflows_permissions' require_relative 'endpoints/admin_workflows_triggers_types_permissions' +require_relative 'endpoints/agents_conversations' require_relative 'endpoints/agents_sessions' require_relative 'endpoints/api' require_relative 'endpoints/apps' @@ -153,6 +154,7 @@ module Endpoints include AdminWorkflowsCollaborators include AdminWorkflowsPermissions include AdminWorkflowsTriggersTypesPermissions + include AgentsConversations include AgentsSessions include Api include Apps diff --git a/lib/slack/web/api/endpoints/admin_analytics_messages.rb b/lib/slack/web/api/endpoints/admin_analytics_messages.rb index f6489db4..7abb83ec 100644 --- a/lib/slack/web/api/endpoints/admin_analytics_messages.rb +++ b/lib/slack/web/api/endpoints/admin_analytics_messages.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AdminAnalyticsMessages # - # Retrieves activity metrics for messages from a given channel. + # Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts # # @option options [channel] :channel # Channel ID for channel of the message activity to query. diff --git a/lib/slack/web/api/endpoints/admin_apps_permissions.rb b/lib/slack/web/api/endpoints/admin_apps_permissions.rb index d9cb4cc4..835981fe 100644 --- a/lib/slack/web/api/endpoints/admin_apps_permissions.rb +++ b/lib/slack/web/api/endpoints/admin_apps_permissions.rb @@ -64,7 +64,7 @@ def admin_apps_permissions_remove(options = {}) # @option options [array] :user_ids # List of user IDs to allow for named_entities visibility. # @option options [array] :usergroup_ids - # List of encoded usergroup IDs. + # List of encoded usergroup IDs the permission applies to. With named_entities the listed groups may access the app; with named_entities_exclude they may not. # @option options [enum] :channel_restriction_mode # The mode that defines where the app can be used in channels. # @option options [array] :channel_ids diff --git a/lib/slack/web/api/endpoints/agents_conversations.rb b/lib/slack/web/api/endpoints/agents_conversations.rb new file mode 100644 index 00000000..b3641d76 --- /dev/null +++ b/lib/slack/web/api/endpoints/agents_conversations.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AgentsConversations + # + # Archive a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to archive. + # @option options [string] :summary_message_ts + # Timestamp of a message in the code channel to share back as a thread reply on the origin message. Requires the channel to have an origin_link set. + # @see https://api.slack.com/methods/agents.conversations.archive + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.archive.json + def agents_conversations_archive(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + post('agents.conversations.archive', options) + end + + # + # Create a dedicated code channel for an agent session. + # + # @option options [string] :team_id + # Encoded team id to create the channel in. Required for org tokens when origin_channel_id is not provided. When omitted, the workspace is derived from the origin channel. + # @option options [string] :session_id + # An opaque identifier for the agent session. When provided, the call is idempotent: if a channel already exists for this session_id, it is returned instead of creating a new one. + # @option options [string] :name + # A friendly display name for the code channel. Optional when origin_channel_id and origin_message_ts are provided — in that case the channel is named from the origin message and re-titled automatically. Required when no origin link is given. + # @option options [boolean] :is_private + # Whether the code channel is private. When omitted, the channel matches the privacy of origin_channel_id, or is public if no origin is given. An explicit value is always honored, even if it differs from the origin channel's privacy: passing false creates a public channel from a private origin. + # @option options [string] :origin_channel_id + # The channel ID where the agent session was initiated from. Must be provided together with origin_message_ts. The channel must be accessible to the calling user and must not be externally shared (Slack Connect). When team_id is omitted with an org token, the channel is created in the same workspace as this origin channel. + # @option options [string] :origin_message_ts + # The message timestamp in the origin channel that started the agent session. Must be provided together with origin_channel_id. The author of this message is automatically invited to the newly created code channel. + # @see https://api.slack.com/methods/agents.conversations.create + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.create.json + def agents_conversations_create(options = {}) + raise ArgumentError, 'Required arguments :name missing' if options[:name].nil? + post('agents.conversations.create', options) + end + + # + # Fetch a canvas attached to a code channel. + # + # @option options [channel] :channel + # ID of the agent session channel the canvas belongs to. + # @option options [Object] :canvas_id + # Encoded ID of the canvas to fetch. + # @option options [enum] :content_format + # Format to render the canvas content in. Defaults to markdown. + # @option options [boolean] :include_resolved + # Whether to include resolved comment threads in the response. Defaults to false. + # @see https://api.slack.com/methods/agents.conversations.getCanvas + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.getCanvas.json + def agents_conversations_getCanvas(options = {}) + raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? + raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil? + options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] + post('agents.conversations.getCanvas', options) + end + + # + # List the views currently attached to a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to list views for. + # @see https://api.slack.com/methods/agents.conversations.listViews + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.listViews.json + def agents_conversations_listViews(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + post('agents.conversations.listViews', options) + end + + # + # Remove a view from a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to remove the view from. + # @option options [string] :view_key + # Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id. + # @option options [string] :view_id + # Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id. + # @see https://api.slack.com/methods/agents.conversations.removeView + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.removeView.json + def agents_conversations_removeView(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + post('agents.conversations.removeView', options) + end + + # + # Replace the full markdown content of a plan canvas attached to a code channel. + # + # @option options [channel] :channel + # ID of the agent session channel the canvas is attached to. + # @option options [Object] :canvas_id + # Encoded ID of the canvas whose content to replace. + # @option options [string] :content + # The full new canvas content as markdown. The server diffs this against the current content and applies only the changed sections. + # @see https://api.slack.com/methods/agents.conversations.setCanvasContent + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.setCanvasContent.json + def agents_conversations_setCanvasContent(options = {}) + raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? + raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil? + raise ArgumentError, 'Required arguments :content missing' if options[:content].nil? + options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] + post('agents.conversations.setCanvasContent', options) + end + + # + # Register the set of agent-defined slash commands for the calling agent in a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to register commands for. + # @option options [array] :commands + # Full set of commands to register for the calling agent in this channel, replacing that agent's previously registered set. Pass an empty array to clear the agent's commands. At most 10 commands may exist across all agents in the channel; names must be unique within the set and must not collide with builtin Slack commands. + # @see https://api.slack.com/methods/agents.conversations.setCommands + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.setCommands.json + def agents_conversations_setCommands(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + raise ArgumentError, 'Required arguments :commands missing' if options[:commands].nil? + post('agents.conversations.setCommands', options) + end + + # + # Set properties on a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to update. + # @option options [string] :title + # New display title for the agent session. + # @option options [enum] :status + # New status for the agent session. + # @option options [object] :code_channel + # Code channel properties to set. Only provided fields are updated. + # @option options [object] :agent_resource + # Agent resource properties to set. Only provided fields are updated. + # @see https://api.slack.com/methods/agents.conversations.setProperties + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.setProperties.json + def agents_conversations_setProperties(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + post('agents.conversations.setProperties', options) + end + + # + # Create or update a view in a code channel. + # + # @option options [string] :channel_id + # ID of the code channel to render the view in. + # @option options [Object] :type + # The kind of view to create or update. Defaults to html. Determines which other arguments are required: html and diff require content, block_kit requires blocks, canvas requires canvas_id, pull_request requires pr_url. + # @option options [string] :view_key + # Agent-assigned stable identity for the view (e.g. the source file path on the agent's machine). Used as the upsert key: calls with the same view_key update the same view. Required for html, block_kit, and canvas views; ignored for diff (a diff view is a per-channel singleton). + # @option options [string] :content + # View content. For html, a full self-contained HTML document; for diff, raw unified diff text. Capped at 1,000,000 bytes — larger content returns content_too_large. The cap is enforced by the handler (not schema maxLength) so the documented error code actually surfaces instead of a generic argument-validation failure. Required when type is html or diff. + # @option options [Object] :blocks + # Block Kit blocks to render in the view tab. Required when type is block_kit; ignored otherwise. + # @option options [Object] :canvas_id + # Encoded ID of the canvas to attach as the view. Required when type is canvas; ignored otherwise. + # @option options [enum] :access_level + # For canvas views: access level granted to the channel for the canvas tab. Defaults to write. Use 'comment' to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. + # @option options [string] :agent_content_hash + # For canvas views: hash of the canvas-derived markdown the agent last wrote, recorded so the agent can later detect human edits to the canvas. Opaque to the server. + # @option options [string] :pr_url + # For pull_request views: the pull request's URL. Required when type is pull_request; ignored otherwise. + # @option options [string] :base_branch + # For diff views: base branch name for display purposes. + # @option options [string] :head_branch + # For diff views: head branch name for display purposes. + # @option options [string] :name + # Display label for the view tab. Preferred over the legacy 'label' argument (name wins if both are supplied). Defaults to the last path segment of view_key, stripped of any .html/.htm extension. + # @option options [string] :label + # Deprecated alias for 'name'. Display label for the view tab. Defaults to the last path segment of view_key, stripped of any .html/.htm extension. + # @option options [object] :csp + # Content-Security-Policy domain declarations for the view. Domains are validated server-side (https-only, no private/internal hosts) and persisted. Only resource_domains is honored at render time today; connect_domains is accepted and stored for forward-compatibility but NOT honored yet. + # @see https://api.slack.com/methods/agents.conversations.setView + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/agents.conversations/agents.conversations.setView.json + def agents_conversations_setView(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + post('agents.conversations.setView', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 53a47afc..2cd86f4d 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -12,7 +12,7 @@ module Chat # @option options [channel] :channel # An encoded ID that represents a channel, private group, or DM. # @option options [array] :chunks - # Array of streaming chunks. + # Array of streaming chunks that can contain either markdown text or task updates. # @option options [timestamp] :ts # The timestamp of the streaming message. # @option options [string] :markdown_text diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index 12209dae..010b8193 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -14,6 +14,7 @@ class ActionAlreadyInProgress < SlackError; end class AdminAnalyticsDisabled < SlackError; end class AdminUnauthorized < SlackError; end class AgentPromptDisplayNotAllowed < SlackError; end + class AgentRequired < SlackError; end class AlreadyApproved < SlackError; end class AlreadyArchived < SlackError; end class AlreadyInChannel < SlackError; end @@ -96,6 +97,7 @@ class CannotInstallAnOrgInstalledApp < SlackError; end class CannotInvalidatePrimaryOwner < SlackError; end class CannotKickHomeTeam < SlackError; end class CannotKickTeam < SlackError; end + class CannotModifyExternalGuest < SlackError; end class CannotModifyPrefAfterCreation < SlackError; end class CannotModifyPrimaryOwner < SlackError; end class CannotModifyRoleAdmin < SlackError; end @@ -127,6 +129,8 @@ class CantKickFromGeneral < SlackError; end class CantKickSelf < SlackError; end class CantLeaveGeneral < SlackError; end class CantUpdateMessage < SlackError; end + class CanvasContentFetchFailed < SlackError; end + class CanvasContentUpdateFailed < SlackError; end class CanvasCreationFailed < SlackError; end class CanvasDeleted < SlackError; end class CanvasDeletingDisabled < SlackError; end @@ -145,6 +149,7 @@ class ChannelCanvasAlreadyExists < SlackError; end class ChannelCanvasCreationFailed < SlackError; end class ChannelConversionInProgress < SlackError; end class ChannelConversionIncomplete < SlackError; end + class ChannelCreationFailed < SlackError; end class ChannelIdsRequired < SlackError; end class ChannelIsArchived < SlackError; end class ChannelIsLimitedAccess < SlackError; end @@ -153,6 +158,7 @@ class ChannelMentionSyncRequired < SlackError; end class ChannelNotArchived < SlackError; end class ChannelNotFound < SlackError; end class ChannelNotOrgWideShared < SlackError; end + class ChannelNotViewable < SlackError; end class ChannelOwnerRestriction < SlackError; end class ChannelRestrictionRequiresAppAccess < SlackError; end class ChannelRestrictionsNotAvailable < SlackError; end @@ -162,8 +168,10 @@ class ChannelsLimitExceeded < SlackError; end class ClientIdMismatch < SlackError; end class ClientIdTokenMismatch < SlackError; end class CodeAlreadyUsed < SlackError; end + class CollidingWithBuiltin < SlackError; end class ColumnIdNotProvided < SlackError; end class ColumnNotFound < SlackError; end + class CommentsFetchFailed < SlackError; end class ConfigNotFound < SlackError; end class ConnectedOrgDenied < SlackError; end class ConnectedTeamDenied < SlackError; end @@ -171,6 +179,7 @@ class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end class ConnectedUserDenied < SlackError; end class ConnectionLimitExceeded < SlackError; end class ConnectionLimitExceededPending < SlackError; end + class ContentTooLarge < SlackError; end class ContextChannelNotFound < SlackError; end class CouldNotArchiveChannel < SlackError; end class CouldNotConvertChannel < SlackError; end @@ -205,6 +214,7 @@ class DraftAlreadySent < SlackError; end class DraftHasConflict < SlackError; end class DraftNotFound < SlackError; end class DuplicateChannelNotFound < SlackError; end + class DuplicateCommand < SlackError; end class DuplicateExternalId < SlackError; end class DuplicateMessageNotFound < SlackError; end class DuplicatedItemNotFound < SlackError; end @@ -227,6 +237,7 @@ class EndpointUnavailable < SlackError; end class EnterpriseIsRestricted < SlackError; end class EnterpriseNotFound < SlackError; end class EnterpriseOnlyFeature < SlackError; end + class EntitiesNotSupported < SlackError; end class EntityMetadataDoesNotMatchTrigger < SlackError; end class EntityNotFound < SlackError; end class ErrorAddingCollaborators < SlackError; end @@ -298,6 +309,7 @@ class FailedToValidateTeam < SlackError; end class FailureRemovingEmoji < SlackError; end class FatalError < SlackError; end class FeatureDisabled < SlackError; end + class FeatureDisabledForLiteSandbox < SlackError; end class FeatureNotAvailable < SlackError; end class FeatureNotEnabled < SlackError; end class FetchMembersFailed < SlackError; end @@ -323,6 +335,7 @@ class FreeTeamCanvasTabAlreadyExists < SlackError; end class FreeTeamNotAllowed < SlackError; end class FreeTeamsCannotCreateStandaloneCanvases < SlackError; end class FreeTeamsCannotEditStandaloneCanvases < SlackError; end + class FrontlineMemberUsernameChangeNotAllowed < SlackError; end class FunctionExecutionNotFound < SlackError; end class FunctionNotFound < SlackError; end class GroupAlreadyLinkedToChannel < SlackError; end @@ -340,9 +353,11 @@ class InternalError < SlackError; end class InvalidAction < SlackError; end class InvalidActionToken < SlackError; end class InvalidActor < SlackError; end + class InvalidAgent < SlackError; end class InvalidApp < SlackError; end class InvalidAppActionType < SlackError; end class InvalidAppId < SlackError; end + class InvalidApprovedAcl < SlackError; end class InvalidArgName < SlackError; end class InvalidArgs < SlackError; end class InvalidArguments < SlackError; end @@ -370,8 +385,10 @@ class InvalidCode < SlackError; end class InvalidCodeVerifier < SlackError; end class InvalidColumnId < SlackError; end class InvalidColumnType < SlackError; end + class InvalidCommands < SlackError; end class InvalidCopyAndSchemaArgs < SlackError; end class InvalidCreatedBy < SlackError; end + class InvalidCspDomain < SlackError; end class InvalidCursor < SlackError; end class InvalidDatastore < SlackError; end class InvalidDate < SlackError; end @@ -410,6 +427,7 @@ class InvalidNameSpecials < SlackError; end class InvalidNamedEntities < SlackError; end class InvalidOooMessage < SlackError; end class InvalidOptionId < SlackError; end + class InvalidOriginLink < SlackError; end class InvalidParameters < SlackError; end class InvalidParentType < SlackError; end class InvalidPermission < SlackError; end @@ -418,6 +436,7 @@ class InvalidPermissionType < SlackError; end class InvalidPermissions < SlackError; end class InvalidPhoneNumber < SlackError; end class InvalidPostType < SlackError; end + class InvalidPrUrl < SlackError; end class InvalidPresence < SlackError; end class InvalidPrimaryColumn < SlackError; end class InvalidPrivacy < SlackError; end @@ -470,6 +489,7 @@ class InvalidUsergroup < SlackError; end class InvalidUsers < SlackError; end class InvalidValue < SlackError; end class InvalidView < SlackError; end + class InvalidViewType < SlackError; end class InvalidVisibility < SlackError; end class InvalidVoteValue < SlackError; end class InvalidWorkflowAuthStrategy < SlackError; end @@ -477,6 +497,7 @@ class InvalidWorkspaceFilter < SlackError; end class InviteAlreadyApproved < SlackError; end class InviteAlreadyDenied < SlackError; end class InviteExpired < SlackError; end + class InviteFailed < SlackError; end class InviteFromSameOrg < SlackError; end class InviteLookupError < SlackError; end class InviteNotFound < SlackError; end @@ -484,6 +505,7 @@ class InviteUsed < SlackError; end class InvitedUserNotCreated < SlackError; end class InvitedUserNotReactivated < SlackError; end class InviteeCantSeeChannel < SlackError; end + class InviterEmailNotVerified < SlackError; end class InvitorCannotSeeChannel < SlackError; end class IsArchived < SlackError; end class IsBot < SlackError; end @@ -548,6 +570,7 @@ class MissingQuery < SlackError; end class MissingRecipientTeamId < SlackError; end class MissingRecipientUserId < SlackError; end class MissingRecordChannelConfig < SlackError; end + class MissingRequiredArg < SlackError; end class MissingResource < SlackError; end class MissingScope < SlackError; end class MissingSource < SlackError; end @@ -571,11 +594,13 @@ class MustProvideTeamName < SlackError; end class MustRevokeAccess < SlackError; end class NameAlreadyExists < SlackError; end class NameNotAllowed < SlackError; end + class NameOrOriginRequired < SlackError; end class NameTaken < SlackError; end class NameTakenInOrg < SlackError; end class NameTooLong < SlackError; end class NamedEntitiesCannotBeEmpty < SlackError; end class NoAccess < SlackError; end + class NoActionsUrl < SlackError; end class NoActiveSessions < SlackError; end class NoAliasSelected < SlackError; end class NoAppScopesRequested < SlackError; end @@ -587,17 +612,21 @@ class NoChannelMemberships < SlackError; end class NoDomainsProvided < SlackError; end class NoDualBroadcastContentUpdate < SlackError; end class NoExternalInvitePermission < SlackError; end + class NoIdpConfigForEntityId < SlackError; end class NoImageUploaded < SlackError; end class NoItemSpecified < SlackError; end class NoLocalUserOnTeam < SlackError; end + class NoOriginLink < SlackError; end class NoPermission < SlackError; end class NoPerms < SlackError; end class NoPin < SlackError; end + class NoPropertiesProvided < SlackError; end class NoQuery < SlackError; end class NoReaction < SlackError; end class NoRefreshToken < SlackError; end class NoResolutionFound < SlackError; end class NoScopes < SlackError; end + class NoSharedWorkspace < SlackError; end class NoSuchSubteam < SlackError; end class NoTeamIdsGiven < SlackError; end class NoTeamOrEnterpriseProvided < SlackError; end @@ -614,6 +643,7 @@ class NoValidTeams < SlackError; end class NoValidUsers < SlackError; end class NotAdmin < SlackError; end class NotAgentApp < SlackError; end + class NotAgentChannel < SlackError; end class NotAllowed < SlackError; end class NotAllowedForGridWorkspace < SlackError; end class NotAllowedToCreateAutomationRule < SlackError; end @@ -641,16 +671,22 @@ class NotPinned < SlackError; end class NotReactable < SlackError; end class NotStarred < SlackError; end class NotSupported < SlackError; end + class NotViewOwner < SlackError; end class NotVisible < SlackError; end class OauthAuthorizationUrlMismatch < SlackError; end class OauthMetadataNotFound < SlackError; end class OneOrMoreInvalidChannels < SlackError; end + class OpenFailed < SlackError; end class OrgLevelEmailDisplayDisabled < SlackError; end class OrgLoginRequired < SlackError; end class OrgNotConnected < SlackError; end class OrgNotFound < SlackError; end class OrgResolutionRequired < SlackError; end class OrgUserNotInTeam < SlackError; end + class OriginChannelExternallyShared < SlackError; end + class OriginChannelIsFileChannel < SlackError; end + class OriginChannelNotFound < SlackError; end + class OriginMessageNotFound < SlackError; end class OverCellFieldsLimit < SlackError; end class OverColumnMaximum < SlackError; end class OverListFileMaximum < SlackError; end @@ -676,6 +712,7 @@ class PostingToGeneralChannelDenied < SlackError; end class PreviewFeatureNotAvailable < SlackError; end class PrimaryUsergroupNotFound < SlackError; end class ProfileSetFailed < SlackError; end + class PropertiesUpdateFailed < SlackError; end class PropertyNotAllowed < SlackError; end class ProvidersNotFound < SlackError; end class PublicFileTypeNotAllowed < SlackError; end @@ -739,6 +776,7 @@ class StreamingModeMismatch < SlackError; end class StreamingStateConflict < SlackError; end class SubteamMaxUsersExceeded < SlackError; end class SudoRequired < SlackError; end + class SummaryMessageNotFound < SlackError; end class TargetTeamMustBeSpecifiedInOrgContext < SlackError; end class TargetTeamNotFound < SlackError; end class TargetTeamNotOnOrg < SlackError; end @@ -767,9 +805,11 @@ class TokenRotationNotEnabled < SlackError; end class TokenTooLong < SlackError; end class TooLarge < SlackError; end class TooLong < SlackError; end + class TooManyAgents < SlackError; end class TooManyAttachments < SlackError; end class TooManyBookmarks < SlackError; end class TooManyChannels < SlackError; end + class TooManyCommands < SlackError; end class TooManyContactCards < SlackError; end class TooManyDomainsProvided < SlackError; end class TooManyEmails < SlackError; end @@ -785,12 +825,14 @@ class TooManyPins < SlackError; end class TooManyProperties < SlackError; end class TooManyReactions < SlackError; end class TooManyRequests < SlackError; end + class TooManySections < SlackError; end class TooManyTabs < SlackError; end class TooManyTargetTeams < SlackError; end class TooManyTeams < SlackError; end class TooManyTeamsProvided < SlackError; end class TooManyUsergroupMembersToMakeVisible < SlackError; end class TooManyUsers < SlackError; end + class TooManyViews < SlackError; end class TriggerExchanged < SlackError; end class TriggerExpired < SlackError; end class TriggerNotFound < SlackError; end @@ -846,6 +888,7 @@ class UserIsRestricted < SlackError; end class UserMustBeAdmin < SlackError; end class UserMustBeInWorkspace < SlackError; end class UserNotAuthenticated < SlackError; end + class UserNotEnabled < SlackError; end class UserNotFound < SlackError; end class UserNotInChannel < SlackError; end class UserNotVisible < SlackError; end @@ -858,6 +901,9 @@ class UsernameSame < SlackError; end class UsersListNotSupplied < SlackError; end class UsersNotFound < SlackError; end class ValidationErrors < SlackError; end + class ViewCreationFailed < SlackError; end + class ViewNotFound < SlackError; end + class ViewRemoveFailed < SlackError; end class ViewTooLarge < SlackError; end class VisibilityIsNotNamedEntities < SlackError; end class VisibleGroupNeedsHandle < SlackError; end @@ -874,6 +920,7 @@ class WorkspaceNotEligible < SlackError; end 'admin_analytics_disabled' => AdminAnalyticsDisabled, 'admin_unauthorized' => AdminUnauthorized, 'agent_prompt_display_not_allowed' => AgentPromptDisplayNotAllowed, + 'agent_required' => AgentRequired, 'already_approved' => AlreadyApproved, 'already_archived' => AlreadyArchived, 'already_in_channel' => AlreadyInChannel, @@ -956,6 +1003,7 @@ class WorkspaceNotEligible < SlackError; end 'cannot_invalidate_primary_owner' => CannotInvalidatePrimaryOwner, 'cannot_kick_home_team' => CannotKickHomeTeam, 'cannot_kick_team' => CannotKickTeam, + 'cannot_modify_external_guest' => CannotModifyExternalGuest, 'cannot_modify_pref_after_creation' => CannotModifyPrefAfterCreation, 'cannot_modify_primary_owner' => CannotModifyPrimaryOwner, 'cannot_modify_role_admin' => CannotModifyRoleAdmin, @@ -987,6 +1035,8 @@ class WorkspaceNotEligible < SlackError; end 'cant_kick_self' => CantKickSelf, 'cant_leave_general' => CantLeaveGeneral, 'cant_update_message' => CantUpdateMessage, + 'canvas_content_fetch_failed' => CanvasContentFetchFailed, + 'canvas_content_update_failed' => CanvasContentUpdateFailed, 'canvas_creation_failed' => CanvasCreationFailed, 'canvas_deleted' => CanvasDeleted, 'canvas_deleting_disabled' => CanvasDeletingDisabled, @@ -1005,6 +1055,7 @@ class WorkspaceNotEligible < SlackError; end 'channel_canvas_creation_failed' => ChannelCanvasCreationFailed, 'channel_conversion_in_progress' => ChannelConversionInProgress, 'channel_conversion_incomplete' => ChannelConversionIncomplete, + 'channel_creation_failed' => ChannelCreationFailed, 'channel_ids_required' => ChannelIdsRequired, 'channel_is_archived' => ChannelIsArchived, 'channel_is_limited_access' => ChannelIsLimitedAccess, @@ -1013,6 +1064,7 @@ class WorkspaceNotEligible < SlackError; end 'channel_not_archived' => ChannelNotArchived, 'channel_not_found' => ChannelNotFound, 'channel_not_org_wide_shared' => ChannelNotOrgWideShared, + 'channel_not_viewable' => ChannelNotViewable, 'channel_owner_restriction' => ChannelOwnerRestriction, 'channel_restriction_requires_app_access' => ChannelRestrictionRequiresAppAccess, 'channel_restrictions_not_available' => ChannelRestrictionsNotAvailable, @@ -1022,8 +1074,10 @@ class WorkspaceNotEligible < SlackError; end 'client_id_mismatch' => ClientIdMismatch, 'client_id_token_mismatch' => ClientIdTokenMismatch, 'code_already_used' => CodeAlreadyUsed, + 'colliding_with_builtin' => CollidingWithBuiltin, 'column_id_not_provided' => ColumnIdNotProvided, 'column_not_found' => ColumnNotFound, + 'comments_fetch_failed' => CommentsFetchFailed, 'config_not_found' => ConfigNotFound, 'connected_org_denied' => ConnectedOrgDenied, 'connected_team_denied' => ConnectedTeamDenied, @@ -1031,6 +1085,7 @@ class WorkspaceNotEligible < SlackError; end 'connected_user_denied' => ConnectedUserDenied, 'connection_limit_exceeded' => ConnectionLimitExceeded, 'connection_limit_exceeded_pending' => ConnectionLimitExceededPending, + 'content_too_large' => ContentTooLarge, 'context_channel_not_found' => ContextChannelNotFound, 'could_not_archive_channel' => CouldNotArchiveChannel, 'could_not_convert_channel' => CouldNotConvertChannel, @@ -1065,6 +1120,7 @@ class WorkspaceNotEligible < SlackError; end 'draft_has_conflict' => DraftHasConflict, 'draft_not_found' => DraftNotFound, 'duplicate_channel_not_found' => DuplicateChannelNotFound, + 'duplicate_command' => DuplicateCommand, 'duplicate_external_id' => DuplicateExternalId, 'duplicate_message_not_found' => DuplicateMessageNotFound, 'duplicated_item_not_found' => DuplicatedItemNotFound, @@ -1087,6 +1143,7 @@ class WorkspaceNotEligible < SlackError; end 'enterprise_is_restricted' => EnterpriseIsRestricted, 'enterprise_not_found' => EnterpriseNotFound, 'enterprise_only_feature' => EnterpriseOnlyFeature, + 'entities_not_supported' => EntitiesNotSupported, 'entity_metadata_does_not_match_trigger' => EntityMetadataDoesNotMatchTrigger, 'entity_not_found' => EntityNotFound, 'error_adding_collaborators' => ErrorAddingCollaborators, @@ -1158,6 +1215,7 @@ class WorkspaceNotEligible < SlackError; end 'failure_removing_emoji' => FailureRemovingEmoji, 'fatal_error' => FatalError, 'feature_disabled' => FeatureDisabled, + 'feature_disabled_for_lite_sandbox' => FeatureDisabledForLiteSandbox, 'feature_not_available' => FeatureNotAvailable, 'feature_not_enabled' => FeatureNotEnabled, 'fetch_members_failed' => FetchMembersFailed, @@ -1183,6 +1241,7 @@ class WorkspaceNotEligible < SlackError; end 'free_team_not_allowed' => FreeTeamNotAllowed, 'free_teams_cannot_create_standalone_canvases' => FreeTeamsCannotCreateStandaloneCanvases, 'free_teams_cannot_edit_standalone_canvases' => FreeTeamsCannotEditStandaloneCanvases, + 'frontline_member_username_change_not_allowed' => FrontlineMemberUsernameChangeNotAllowed, 'function_execution_not_found' => FunctionExecutionNotFound, 'function_not_found' => FunctionNotFound, 'group_already_linked_to_channel' => GroupAlreadyLinkedToChannel, @@ -1200,9 +1259,11 @@ class WorkspaceNotEligible < SlackError; end 'invalid_action' => InvalidAction, 'invalid_action_token' => InvalidActionToken, 'invalid_actor' => InvalidActor, + 'invalid_agent' => InvalidAgent, 'invalid_app' => InvalidApp, 'invalid_app_action_type' => InvalidAppActionType, 'invalid_app_id' => InvalidAppId, + 'invalid_approved_acl' => InvalidApprovedAcl, 'invalid_arg_name' => InvalidArgName, 'invalid_args' => InvalidArgs, 'invalid_arguments' => InvalidArguments, @@ -1230,8 +1291,10 @@ class WorkspaceNotEligible < SlackError; end 'invalid_code_verifier' => InvalidCodeVerifier, 'invalid_column_id' => InvalidColumnId, 'invalid_column_type' => InvalidColumnType, + 'invalid_commands' => InvalidCommands, 'invalid_copy_and_schema_args' => InvalidCopyAndSchemaArgs, 'invalid_created_by' => InvalidCreatedBy, + 'invalid_csp_domain' => InvalidCspDomain, 'invalid_cursor' => InvalidCursor, 'invalid_datastore' => InvalidDatastore, 'invalid_date' => InvalidDate, @@ -1270,6 +1333,7 @@ class WorkspaceNotEligible < SlackError; end 'invalid_named_entities' => InvalidNamedEntities, 'invalid_ooo_message' => InvalidOooMessage, 'invalid_option_id' => InvalidOptionId, + 'invalid_origin_link' => InvalidOriginLink, 'invalid_parameters' => InvalidParameters, 'invalid_parent_type' => InvalidParentType, 'invalid_permission' => InvalidPermission, @@ -1278,6 +1342,7 @@ class WorkspaceNotEligible < SlackError; end 'invalid_permissions' => InvalidPermissions, 'invalid_phone_number' => InvalidPhoneNumber, 'invalid_post_type' => InvalidPostType, + 'invalid_pr_url' => InvalidPrUrl, 'invalid_presence' => InvalidPresence, 'invalid_primary_column' => InvalidPrimaryColumn, 'invalid_privacy' => InvalidPrivacy, @@ -1330,6 +1395,7 @@ class WorkspaceNotEligible < SlackError; end 'invalid_users' => InvalidUsers, 'invalid_value' => InvalidValue, 'invalid_view' => InvalidView, + 'invalid_view_type' => InvalidViewType, 'invalid_visibility' => InvalidVisibility, 'invalid_vote_value' => InvalidVoteValue, 'invalid_workflow_auth_strategy' => InvalidWorkflowAuthStrategy, @@ -1337,6 +1403,7 @@ class WorkspaceNotEligible < SlackError; end 'invite_already_approved' => InviteAlreadyApproved, 'invite_already_denied' => InviteAlreadyDenied, 'invite_expired' => InviteExpired, + 'invite_failed' => InviteFailed, 'invite_from_same_org' => InviteFromSameOrg, 'invite_lookup_error' => InviteLookupError, 'invite_not_found' => InviteNotFound, @@ -1344,6 +1411,7 @@ class WorkspaceNotEligible < SlackError; end 'invited_user_not_created' => InvitedUserNotCreated, 'invited_user_not_reactivated' => InvitedUserNotReactivated, 'invitee_cant_see_channel' => InviteeCantSeeChannel, + 'inviter_email_not_verified' => InviterEmailNotVerified, 'invitor_cannot_see_channel' => InvitorCannotSeeChannel, 'is_archived' => IsArchived, 'is_bot' => IsBot, @@ -1408,6 +1476,7 @@ class WorkspaceNotEligible < SlackError; end 'missing_recipient_team_id' => MissingRecipientTeamId, 'missing_recipient_user_id' => MissingRecipientUserId, 'missing_record_channel_config' => MissingRecordChannelConfig, + 'missing_required_arg' => MissingRequiredArg, 'missing_resource' => MissingResource, 'missing_scope' => MissingScope, 'missing_source' => MissingSource, @@ -1431,11 +1500,13 @@ class WorkspaceNotEligible < SlackError; end 'must_revoke_access' => MustRevokeAccess, 'name_already_exists' => NameAlreadyExists, 'name_not_allowed' => NameNotAllowed, + 'name_or_origin_required' => NameOrOriginRequired, 'name_taken' => NameTaken, 'name_taken_in_org' => NameTakenInOrg, 'name_too_long' => NameTooLong, 'named_entities_cannot_be_empty' => NamedEntitiesCannotBeEmpty, 'no_access' => NoAccess, + 'no_actions_url' => NoActionsUrl, 'no_active_sessions' => NoActiveSessions, 'no_alias_selected' => NoAliasSelected, 'no_app_scopes_requested' => NoAppScopesRequested, @@ -1447,17 +1518,21 @@ class WorkspaceNotEligible < SlackError; end 'no_domains_provided' => NoDomainsProvided, 'no_dual_broadcast_content_update' => NoDualBroadcastContentUpdate, 'no_external_invite_permission' => NoExternalInvitePermission, + 'no_idp_config_for_entity_id' => NoIdpConfigForEntityId, 'no_image_uploaded' => NoImageUploaded, 'no_item_specified' => NoItemSpecified, 'no_local_user_on_team' => NoLocalUserOnTeam, + 'no_origin_link' => NoOriginLink, 'no_permission' => NoPermission, 'no_perms' => NoPerms, 'no_pin' => NoPin, + 'no_properties_provided' => NoPropertiesProvided, 'no_query' => NoQuery, 'no_reaction' => NoReaction, 'no_refresh_token' => NoRefreshToken, 'no_resolution_found' => NoResolutionFound, 'no_scopes' => NoScopes, + 'no_shared_workspace' => NoSharedWorkspace, 'no_such_subteam' => NoSuchSubteam, 'no_team_ids_given' => NoTeamIdsGiven, 'no_team_or_enterprise_provided' => NoTeamOrEnterpriseProvided, @@ -1474,6 +1549,7 @@ class WorkspaceNotEligible < SlackError; end 'no_valid_users' => NoValidUsers, 'not_admin' => NotAdmin, 'not_agent_app' => NotAgentApp, + 'not_agent_channel' => NotAgentChannel, 'not_allowed' => NotAllowed, 'not_allowed_for_grid_workspace' => NotAllowedForGridWorkspace, 'not_allowed_to_create_automation_rule' => NotAllowedToCreateAutomationRule, @@ -1501,16 +1577,22 @@ class WorkspaceNotEligible < SlackError; end 'not_reactable' => NotReactable, 'not_starred' => NotStarred, 'not_supported' => NotSupported, + 'not_view_owner' => NotViewOwner, 'not_visible' => NotVisible, 'oauth_authorization_url_mismatch' => OauthAuthorizationUrlMismatch, 'oauth_metadata_not_found' => OauthMetadataNotFound, 'one_or_more_invalid_channels' => OneOrMoreInvalidChannels, + 'open_failed' => OpenFailed, 'org_level_email_display_disabled' => OrgLevelEmailDisplayDisabled, 'org_login_required' => OrgLoginRequired, 'org_not_connected' => OrgNotConnected, 'org_not_found' => OrgNotFound, 'org_resolution_required' => OrgResolutionRequired, 'org_user_not_in_team' => OrgUserNotInTeam, + 'origin_channel_externally_shared' => OriginChannelExternallyShared, + 'origin_channel_is_file_channel' => OriginChannelIsFileChannel, + 'origin_channel_not_found' => OriginChannelNotFound, + 'origin_message_not_found' => OriginMessageNotFound, 'over_cell_fields_limit' => OverCellFieldsLimit, 'over_column_maximum' => OverColumnMaximum, 'over_list_file_maximum' => OverListFileMaximum, @@ -1536,6 +1618,7 @@ class WorkspaceNotEligible < SlackError; end 'preview_feature_not_available' => PreviewFeatureNotAvailable, 'primary_usergroup_not_found' => PrimaryUsergroupNotFound, 'profile_set_failed' => ProfileSetFailed, + 'properties_update_failed' => PropertiesUpdateFailed, 'property_not_allowed' => PropertyNotAllowed, 'providers_not_found' => ProvidersNotFound, 'public_file_type_not_allowed' => PublicFileTypeNotAllowed, @@ -1599,6 +1682,7 @@ class WorkspaceNotEligible < SlackError; end 'streaming_state_conflict' => StreamingStateConflict, 'subteam_max_users_exceeded' => SubteamMaxUsersExceeded, 'sudo_required' => SudoRequired, + 'summary_message_not_found' => SummaryMessageNotFound, 'target_team_must_be_specified_in_org_context' => TargetTeamMustBeSpecifiedInOrgContext, 'target_team_not_found' => TargetTeamNotFound, 'target_team_not_on_org' => TargetTeamNotOnOrg, @@ -1627,9 +1711,11 @@ class WorkspaceNotEligible < SlackError; end 'token_too_long' => TokenTooLong, 'too_large' => TooLarge, 'too_long' => TooLong, + 'too_many_agents' => TooManyAgents, 'too_many_attachments' => TooManyAttachments, 'too_many_bookmarks' => TooManyBookmarks, 'too_many_channels' => TooManyChannels, + 'too_many_commands' => TooManyCommands, 'too_many_contact_cards' => TooManyContactCards, 'too_many_domains_provided' => TooManyDomainsProvided, 'too_many_emails' => TooManyEmails, @@ -1645,12 +1731,14 @@ class WorkspaceNotEligible < SlackError; end 'too_many_properties' => TooManyProperties, 'too_many_reactions' => TooManyReactions, 'too_many_requests' => TooManyRequests, + 'too_many_sections' => TooManySections, 'too_many_tabs' => TooManyTabs, 'too_many_target_teams' => TooManyTargetTeams, 'too_many_teams' => TooManyTeams, 'too_many_teams_provided' => TooManyTeamsProvided, 'too_many_usergroup_members_to_make_visible' => TooManyUsergroupMembersToMakeVisible, 'too_many_users' => TooManyUsers, + 'too_many_views' => TooManyViews, 'trigger_exchanged' => TriggerExchanged, 'trigger_expired' => TriggerExpired, 'trigger_not_found' => TriggerNotFound, @@ -1706,6 +1794,7 @@ class WorkspaceNotEligible < SlackError; end 'user_must_be_admin' => UserMustBeAdmin, 'user_must_be_in_workspace' => UserMustBeInWorkspace, 'user_not_authenticated' => UserNotAuthenticated, + 'user_not_enabled' => UserNotEnabled, 'user_not_found' => UserNotFound, 'user_not_in_channel' => UserNotInChannel, 'user_not_visible' => UserNotVisible, @@ -1718,6 +1807,9 @@ class WorkspaceNotEligible < SlackError; end 'users_list_not_supplied' => UsersListNotSupplied, 'users_not_found' => UsersNotFound, 'validation_errors' => ValidationErrors, + 'view_creation_failed' => ViewCreationFailed, + 'view_not_found' => ViewNotFound, + 'view_remove_failed' => ViewRemoveFailed, 'view_too_large' => ViewTooLarge, 'visibility_is_not_named_entities' => VisibilityIsNotNamedEntities, 'visible_group_needs_handle' => VisibleGroupNeedsHandle, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 0ae4e986..9d12de75 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 0ae4e986fbdb824fd4af8ca175ca45142377c8c3 +Subproject commit 9d12de7552102bcacb8cb72162063a39b7b6d9b9 diff --git a/spec/slack/web/api/endpoints/agents_conversations_spec.rb b/spec/slack/web/api/endpoints/agents_conversations_spec.rb new file mode 100644 index 00000000..d1a6d7b8 --- /dev/null +++ b/spec/slack/web/api/endpoints/agents_conversations_spec.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AgentsConversations do + let(:client) { Slack::Web::Client.new } + context 'agents.conversations_archive' do + it 'requires channel_id' do + expect { client.agents_conversations_archive }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end + context 'agents.conversations_create' do + it 'requires name' do + expect { client.agents_conversations_create }.to raise_error ArgumentError, /Required arguments :name missing/ + end + end + context 'agents.conversations_getCanvas' do + it 'requires channel' do + expect { client.agents_conversations_getCanvas(canvas_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel missing/ + end + it 'requires canvas_id' do + expect { client.agents_conversations_getCanvas(channel: %q[]) }.to raise_error ArgumentError, /Required arguments :canvas_id missing/ + end + end + context 'agents.conversations_listViews' do + it 'requires channel_id' do + expect { client.agents_conversations_listViews }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end + context 'agents.conversations_removeView' do + it 'requires channel_id' do + expect { client.agents_conversations_removeView }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end + context 'agents.conversations_setCanvasContent' do + it 'requires channel' do + expect { client.agents_conversations_setCanvasContent(canvas_id: %q[], content: %q[]) }.to raise_error ArgumentError, /Required arguments :channel missing/ + end + it 'requires canvas_id' do + expect { client.agents_conversations_setCanvasContent(channel: %q[], content: %q[]) }.to raise_error ArgumentError, /Required arguments :canvas_id missing/ + end + it 'requires content' do + expect { client.agents_conversations_setCanvasContent(channel: %q[], canvas_id: %q[]) }.to raise_error ArgumentError, /Required arguments :content missing/ + end + end + context 'agents.conversations_setCommands' do + it 'requires channel_id' do + expect { client.agents_conversations_setCommands(commands: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + it 'requires commands' do + expect { client.agents_conversations_setCommands(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :commands missing/ + end + end + context 'agents.conversations_setProperties' do + it 'requires channel_id' do + expect { client.agents_conversations_setProperties }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end + context 'agents.conversations_setView' do + it 'requires channel_id' do + expect { client.agents_conversations_setView }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end +end