From e1e5709777a1ea0d8bc93d0e2dc893c050bfa00e Mon Sep 17 00:00:00 2001 From: slack-ruby-ci-bot Date: Wed, 18 Dec 2024 23:22:35 +0000 Subject: [PATCH] Update API from slack-api-ref@3ec3c10 (2024-12-18) --- CHANGELOG.md | 1 + bin/commands/admin_conversations.rb | 21 ++++++ bin/commands/admin_users_session.rb | 1 + bin/commands/admin_workflows.rb | 2 +- ...in_workflows_triggers_types_permissions.rb | 8 +- bin/commands/assistant_threads.rb | 45 ++++++++++++ bin/commands/bookmarks.rb | 1 + bin/commands/canvases.rb | 8 +- bin/commands/canvases_access.rb | 2 +- bin/commands/chat.rb | 4 +- bin/commands/conversations.rb | 10 +-- bin/commands/conversations_canvases.rb | 4 +- .../conversations_requestSharedInvite.rb | 48 ++++++++++++ bin/commands/usergroups.rb | 2 + lib/slack/web/api/endpoints.rb | 4 + .../web/api/endpoints/admin_conversations.rb | 35 +++++++++ .../web/api/endpoints/admin_users_session.rb | 6 +- .../web/api/endpoints/admin_workflows.rb | 2 +- ...in_workflows_triggers_types_permissions.rb | 4 +- .../web/api/endpoints/assistant_threads.rb | 68 +++++++++++++++++ lib/slack/web/api/endpoints/bookmarks.rb | 2 + lib/slack/web/api/endpoints/canvases.rb | 4 +- .../web/api/endpoints/canvases_access.rb | 2 +- lib/slack/web/api/endpoints/chat.rb | 5 +- lib/slack/web/api/endpoints/conversations.rb | 8 +- .../api/endpoints/conversations_canvases.rb | 2 +- .../conversations_requestSharedInvite.rb | 73 +++++++++++++++++++ lib/slack/web/api/endpoints/usergroups.rb | 4 + lib/slack/web/api/errors.rb | 46 +++++++++++- lib/slack/web/api/slack-api-ref | 2 +- .../api/endpoints/admin_conversations_spec.rb | 19 +++++ .../api/endpoints/admin_users_session_spec.rb | 14 +++- .../api/endpoints/assistant_threads_spec.rb | 41 +++++++++++ .../conversations_requestSharedInvite_spec.rb | 18 +++++ 34 files changed, 474 insertions(+), 42 deletions(-) create mode 100644 bin/commands/assistant_threads.rb create mode 100644 bin/commands/conversations_requestSharedInvite.rb create mode 100644 lib/slack/web/api/endpoints/assistant_threads.rb create mode 100644 lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb create mode 100644 spec/slack/web/api/endpoints/assistant_threads_spec.rb create mode 100644 spec/slack/web/api/endpoints/conversations_requestSharedInvite_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 3399d019..f23575a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [#525](https://github.com/slack-ruby/slack-ruby-client/pull/525): Exclude spec files from gem package - [@amatsuda](https://github.com/amatsuda). * [#527](https://github.com/slack-ruby/slack-ruby-client/pull/527): Explicitly require `racc` and `ostruct` - [@dblock](https://github.com/dblock). * [#528](https://github.com/slack-ruby/slack-ruby-client/pull/528): Don't treat asterisks in list items as italic in markdown - [@rspeicher](https://github.com/rspeicher). +* [#524](https://github.com/slack-ruby-client/pulls/524): Update API from [slack-api-ref@3ec3c10](https://github.com/slack-ruby/slack-api-ref/commit/3ec3c10) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 2.4.0 (2024/07/14) diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index 71d0b28d..eeaa1575 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -133,6 +133,17 @@ class App end end + g.desc 'Link a Salesforce record to a channel' + g.long_desc %( Link a Salesforce record to a channel ) + g.command 'linkObjects' do |c| + c.flag 'channel', desc: 'Channel ID for Slack channel that will be linked to a Salesforce record.' + c.flag 'record_id', desc: 'Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID.' + c.flag 'salesforce_org_id', desc: 'Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_conversations_linkObjects(options)) + end + end + g.desc 'Returns channels on the given team using the filters.' g.long_desc %( Returns channels on the given team using the filters. ) g.command 'lookup' do |c| @@ -222,6 +233,16 @@ class App puts JSON.dump(@client.admin_conversations_unarchive(options)) end end + + g.desc 'Unlink a Salesforce record from a channel' + g.long_desc %( Unlink a Salesforce record from a channel ) + g.command 'unlinkObjects' do |c| + c.flag 'channel', desc: 'Channel ID for Slack channel that will be unlinked from the Salesforce record.' + c.flag 'new_name', desc: 'Channel name you would like to give to the channel that is being unlinked from the Salesforce record.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_conversations_unlinkObjects(options)) + end + end end end end diff --git a/bin/commands/admin_users_session.rb b/bin/commands/admin_users_session.rb index c31641c0..494b6855 100644 --- a/bin/commands/admin_users_session.rb +++ b/bin/commands/admin_users_session.rb @@ -28,6 +28,7 @@ class App g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. ) g.command 'invalidate' do |c| c.flag 'session_id', desc: 'ID of the session to invalidate.' + c.flag 'user_id', desc: 'ID of the user that the session belongs to.' c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_users_session_invalidate(options)) diff --git a/bin/commands/admin_workflows.rb b/bin/commands/admin_workflows.rb index 911824f1..142ad2bd 100644 --- a/bin/commands/admin_workflows.rb +++ b/bin/commands/admin_workflows.rb @@ -10,7 +10,7 @@ class App g.long_desc %( Search workflows within the team or enterprise ) g.command 'search' do |c| c.flag 'app_id', desc: 'The parent app ID for which to return workflows.' - c.flag 'collaborator_ids', desc: 'Only include workflows where the provided user IDs are a manager/collaborator of that workflow.' + c.flag 'collaborator_ids', desc: 'Only include workflows where all of the provided user IDs are a manager/collaborator of that workflow.' c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' c.flag 'is_sales_elevate', desc: 'Filter workflows by their Sales Elevate status.' c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation.' diff --git a/bin/commands/admin_workflows_triggers_types_permissions.rb b/bin/commands/admin_workflows_triggers_types_permissions.rb index 1fe7f0de..9c0a56da 100644 --- a/bin/commands/admin_workflows_triggers_types_permissions.rb +++ b/bin/commands/admin_workflows_triggers_types_permissions.rb @@ -6,8 +6,8 @@ module Cli class App desc 'AdminWorkflowsTriggersTypesPermissions methods.' command 'admin_workflows_triggers_types_permissions' do |g| - g.desc 'list the permissions for using each trigger type in workflow builder' - g.long_desc %( list the permissions for using each trigger type in workflow builder ) + g.desc 'list the permissions for using each trigger type' + g.long_desc %( list the permissions for using each trigger type ) g.command 'lookup' do |c| c.flag 'trigger_type_ids', desc: 'The trigger types IDs for which to get the permissions.' c.action do |_global_options, options, _args| @@ -15,8 +15,8 @@ class App end end - g.desc 'Set the permissions for using a trigger type in workflow builder' - g.long_desc %( Set the permissions for using a trigger type in workflow builder ) + g.desc 'Set the permissions for using a trigger type' + g.long_desc %( Set the permissions for using a trigger type ) g.command 'set' do |c| c.flag 'id', desc: 'The trigger type ID for which to set the permissions.' c.flag 'visibility', desc: 'The function visibility.' diff --git a/bin/commands/assistant_threads.rb b/bin/commands/assistant_threads.rb new file mode 100644 index 00000000..756c4492 --- /dev/null +++ b/bin/commands/assistant_threads.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AssistantThreads methods.' + command 'assistant_threads' do |g| + g.desc 'Set the status for an AI assistant thread.' + g.long_desc %( Set the status for an AI assistant thread. ) + g.command 'setStatus' do |c| + c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.' + c.flag 'status', desc: "Status of the specified bot user, e.g. 'is thinking...'." + c.flag 'thread_ts', desc: 'Message timestamp of the thread of where to set the status.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.assistant_threads_setStatus(options)) + end + end + + g.desc 'Set suggested prompts for the given assistant thread' + g.long_desc %( Set suggested prompts for the given assistant thread ) + g.command 'setSuggestedPrompts' do |c| + c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.' + c.flag 'prompts', desc: 'Each prompt should be supplied with its title and message attribute.' + c.flag 'thread_ts', desc: 'Message timestamp of the thread to set suggested prompts for.' + c.flag 'title', desc: 'Title for the list of provided prompts. For example: Suggested Prompts, Related Questions.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.assistant_threads_setSuggestedPrompts(options)) + end + end + + g.desc 'Set the title for the given assistant thread' + g.long_desc %( Set the title for the given assistant thread ) + g.command 'setTitle' do |c| + c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.' + c.flag 'thread_ts', desc: 'Message timestamp of the thread to set suggested prompts for.' + c.flag 'title', desc: 'The title to use for the thread.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.assistant_threads_setTitle(options)) + end + end + end + end + end +end diff --git a/bin/commands/bookmarks.rb b/bin/commands/bookmarks.rb index 6daba6e0..5a80e9c3 100644 --- a/bin/commands/bookmarks.rb +++ b/bin/commands/bookmarks.rb @@ -12,6 +12,7 @@ class App c.flag 'channel_id', desc: 'Channel to add bookmark in.' c.flag 'title', desc: 'Title for the bookmark.' c.flag 'type', desc: 'Type of the bookmark i.e link.' + c.flag 'access_level', desc: "The level that we are setting the file's permission to (read or write)." c.flag 'emoji', desc: 'Emoji tag to apply to the link.' c.flag 'entity_id', desc: 'ID of the entity being bookmarked. Only applies to message and file types.' c.flag 'link', desc: 'Link to bookmark.' diff --git a/bin/commands/canvases.rb b/bin/commands/canvases.rb index ba20cdc3..f42668c7 100644 --- a/bin/commands/canvases.rb +++ b/bin/commands/canvases.rb @@ -6,8 +6,8 @@ module Cli class App desc 'Canvases methods.' command 'canvases' do |g| - g.desc 'Create Canvas for a user.' - g.long_desc %( Create Canvas for a user. ) + g.desc 'Create canvas for a user' + g.long_desc %( Create canvas for a user ) g.command 'create' do |c| c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.' c.flag 'title', desc: 'Title of the newly created canvas.' @@ -16,8 +16,8 @@ class App end end - g.desc 'Deletes a canvas.' - g.long_desc %( Deletes a canvas. ) + g.desc 'Deletes a canvas' + g.long_desc %( Deletes a canvas ) g.command 'delete' do |c| c.flag 'canvas_id', desc: 'Encoded ID of the canvas.' c.action do |_global_options, options, _args| diff --git a/bin/commands/canvases_access.rb b/bin/commands/canvases_access.rb index b3b67c75..6edfb4e1 100644 --- a/bin/commands/canvases_access.rb +++ b/bin/commands/canvases_access.rb @@ -20,7 +20,7 @@ class App g.desc 'Sets the access level to a canvas for specified entities' g.long_desc %( Sets the access level to a canvas for specified entities ) g.command 'set' do |c| - c.flag 'access_level', desc: 'Desired level of access (e.g. read, write).' + c.flag 'access_level', desc: 'Desired level of access (e.g. read, write, owner).' c.flag 'canvas_id', desc: 'Encoded ID of the canvas.' c.flag 'channel_ids', desc: 'List of channels you wish to update access for.' c.flag 'user_ids', desc: 'List of users you wish to update access for.' diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 6ab0daa0..926bcaf1 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -82,11 +82,11 @@ class App g.desc 'Sends a message to a channel.' g.long_desc %( Sends a message to a channel. ) g.command 'postMessage' do |c| - c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.' + c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or IM channel to send the message to. See below for more details.' c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.' c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.' c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.' - c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below.' + c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See legacy as_user parameter below.' c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.' c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.' c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.' diff --git a/bin/commands/conversations.rb b/bin/commands/conversations.rb index 03cb3bc9..1a7ee394 100644 --- a/bin/commands/conversations.rb +++ b/bin/commands/conversations.rb @@ -111,7 +111,7 @@ class App g.command 'inviteShared' do |c| c.flag 'channel', desc: "ID of the channel on your team that you'd like to share." c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.' - c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.' + c.flag 'external_limited', desc: 'Optional boolean on whether invite is to an external limited member. Defaults to true.' c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.' c.action do |_global_options, options, _args| puts JSON.dump(@client.conversations_inviteShared(options)) @@ -228,11 +228,11 @@ class App end end - g.desc 'Sets the purpose for a conversation.' - g.long_desc %( Sets the purpose for a conversation. ) + g.desc 'Sets the channel description.' + g.long_desc %( Sets the channel description. ) g.command 'setPurpose' do |c| - c.flag 'channel', desc: 'Conversation to set the purpose of.' - c.flag 'purpose', desc: 'A new, specialer purpose.' + c.flag 'channel', desc: 'Channel to set the description of.' + c.flag 'purpose', desc: 'The description.' c.action do |_global_options, options, _args| puts JSON.dump(@client.conversations_setPurpose(options)) end diff --git a/bin/commands/conversations_canvases.rb b/bin/commands/conversations_canvases.rb index 09bf78c4..1b0afd13 100644 --- a/bin/commands/conversations_canvases.rb +++ b/bin/commands/conversations_canvases.rb @@ -6,8 +6,8 @@ module Cli class App desc 'ConversationsCanvases methods.' command 'conversations_canvases' do |g| - g.desc 'Create a Channel Canvas for a channel.' - g.long_desc %( Create a Channel Canvas for a channel. ) + g.desc 'Create a channel canvas for a channel' + g.long_desc %( Create a channel canvas for a channel ) g.command 'create' do |c| c.flag 'channel_id', desc: 'Channel ID of the channel we create the channel canvas for.' c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.' diff --git a/bin/commands/conversations_requestSharedInvite.rb b/bin/commands/conversations_requestSharedInvite.rb new file mode 100644 index 00000000..6370f7f0 --- /dev/null +++ b/bin/commands/conversations_requestSharedInvite.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'ConversationsRequestsharedinvite methods.' + command 'conversations_requestSharedInvite' do |g| + g.desc 'Approves a request to add an external user to a channel and sends them a Slack Connect invite' + g.long_desc %( Approves a request to add an external user to a channel and sends them a Slack Connect invite ) + g.command 'approve' do |c| + c.flag 'invite_id', desc: 'ID of the requested shared channel invite to approve.' + c.flag 'channel_id', desc: 'Optional channel_id to which external user will be invited to. Will override the value on the requested invite.' + c.flag 'is_external_limited', desc: 'Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.' + c.flag 'message', desc: 'Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.conversations_requestSharedInvite_approve(options)) + end + end + + g.desc 'Denies a request to invite an external user to a channel' + g.long_desc %( Denies a request to invite an external user to a channel ) + g.command 'deny' do |c| + c.flag 'invite_id', desc: 'ID of the requested shared channel invite to deny.' + c.flag 'message', desc: 'Optional message explaining why the request to invite was denied.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.conversations_requestSharedInvite_deny(options)) + end + end + + g.desc 'Lists requests to add external users to channels with ability to filter.' + g.long_desc %( Lists requests to add external users to channels with ability to filter. ) + g.command 'list' do |c| + c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail." + c.flag 'include_approved', desc: 'When true approved invitation requests will be returned, otherwise they will be excluded.' + c.flag 'include_denied', desc: 'When true denied invitation requests will be returned, otherwise they will be excluded.' + c.flag 'include_expired', desc: 'When true expired invitation requests will be returned, otherwise they will be excluded.' + c.flag 'invite_ids', desc: 'An optional list of invitation ids to look up.' + c.flag 'limit', desc: 'The number of items to return. Must be between 1 - 1000 (inclusive).' + c.flag 'user_id', desc: 'Optional filter to return invitation requests for the inviting user.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.conversations_requestSharedInvite_list(options)) + end + end + end + end + end +end diff --git a/bin/commands/usergroups.rb b/bin/commands/usergroups.rb index 7391c026..4b29cd83 100644 --- a/bin/commands/usergroups.rb +++ b/bin/commands/usergroups.rb @@ -12,6 +12,7 @@ class App c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.' c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.' c.flag 'description', desc: 'A short description of the User Group.' + c.flag 'enable_section', desc: 'Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.' c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.' c.flag 'include_count', desc: 'Include the number of users in each User Group.' c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.' @@ -60,6 +61,7 @@ class App c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.' c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.' c.flag 'description', desc: 'A short description of the User Group.' + c.flag 'enable_section', desc: 'Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.' c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.' c.flag 'include_count', desc: 'Include the number of users in the User Group.' c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.' diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index f0ca655b..0a782a55 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -41,6 +41,7 @@ require_relative 'endpoints/apps_datastore' require_relative 'endpoints/apps_event_authorizations' require_relative 'endpoints/apps_manifest' +require_relative 'endpoints/assistant_threads' require_relative 'endpoints/auth' require_relative 'endpoints/auth_teams' require_relative 'endpoints/bookmarks' @@ -55,6 +56,7 @@ require_relative 'endpoints/conversations' require_relative 'endpoints/conversations_canvases' require_relative 'endpoints/conversations_externalInvitePermissions' +require_relative 'endpoints/conversations_requestSharedInvite' require_relative 'endpoints/dialog' require_relative 'endpoints/dnd' require_relative 'endpoints/emoji' @@ -139,6 +141,7 @@ module Endpoints include AppsDatastore include AppsEventAuthorizations include AppsManifest + include AssistantThreads include Auth include AuthTeams include Bookmarks @@ -153,6 +156,7 @@ module Endpoints include Conversations include ConversationsCanvases include ConversationsExternalinvitepermissions + include ConversationsRequestsharedinvite include Dialog include Dnd include Emoji diff --git a/lib/slack/web/api/endpoints/admin_conversations.rb b/lib/slack/web/api/endpoints/admin_conversations.rb index 93736bab..a9478eae 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -191,6 +191,25 @@ def admin_conversations_invite(options = {}) post('admin.conversations.invite', options) end + # + # Link a Salesforce record to a channel + # + # @option options [channel] :channel + # Channel ID for Slack channel that will be linked to a Salesforce record. + # @option options [string] :record_id + # Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID. + # @option options [string] :salesforce_org_id + # Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID. + # @see https://api.slack.com/methods/admin.conversations.linkObjects + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.linkObjects.json + def admin_conversations_linkObjects(options = {}) + raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? + raise ArgumentError, 'Required arguments :record_id missing' if options[:record_id].nil? + raise ArgumentError, 'Required arguments :salesforce_org_id missing' if options[:salesforce_org_id].nil? + options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] + post('admin.conversations.linkObjects', options) + end + # # Returns channels on the given team using the filters. # @@ -338,6 +357,22 @@ def admin_conversations_unarchive(options = {}) raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? post('admin.conversations.unarchive', options) end + + # + # Unlink a Salesforce record from a channel + # + # @option options [channel] :channel + # Channel ID for Slack channel that will be unlinked from the Salesforce record. + # @option options [string] :new_name + # Channel name you would like to give to the channel that is being unlinked from the Salesforce record. + # @see https://api.slack.com/methods/admin.conversations.unlinkObjects + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.unlinkObjects.json + def admin_conversations_unlinkObjects(options = {}) + raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? + raise ArgumentError, 'Required arguments :new_name missing' if options[:new_name].nil? + options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] + post('admin.conversations.unlinkObjects', options) + end end end end diff --git a/lib/slack/web/api/endpoints/admin_users_session.rb b/lib/slack/web/api/endpoints/admin_users_session.rb index 7dff9b28..3213c1e8 100644 --- a/lib/slack/web/api/endpoints/admin_users_session.rb +++ b/lib/slack/web/api/endpoints/admin_users_session.rb @@ -35,13 +35,15 @@ def admin_users_session_getSettings(options = {}) # # @option options [integer] :session_id # ID of the session to invalidate. - # @option options [string] :team_id + # @option options [Object] :user_id + # ID of the user that the session belongs to. + # @option options [Object] :team_id # ID of the workspace that the session belongs to. # @see https://api.slack.com/methods/admin.users.session.invalidate # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.invalidate.json def admin_users_session_invalidate(options = {}) raise ArgumentError, 'Required arguments :session_id missing' if options[:session_id].nil? - raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil? + raise ArgumentError, 'Exactly one of :user_id, :team_id is required' unless options[:user_id].nil? ^ options[:team_id].nil? post('admin.users.session.invalidate', options) end diff --git a/lib/slack/web/api/endpoints/admin_workflows.rb b/lib/slack/web/api/endpoints/admin_workflows.rb index 7798ef82..80282974 100644 --- a/lib/slack/web/api/endpoints/admin_workflows.rb +++ b/lib/slack/web/api/endpoints/admin_workflows.rb @@ -12,7 +12,7 @@ module AdminWorkflows # @option options [Object] :app_id # The parent app ID for which to return workflows. # @option options [array] :collaborator_ids - # Only include workflows where the provided user IDs are a manager/collaborator of that workflow. + # Only include workflows where all of the provided user IDs are a manager/collaborator of that workflow. # @option options [string] :cursor # Set cursor to next_cursor returned by the previous call to list items in the next page. # @option options [boolean] :is_sales_elevate diff --git a/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb b/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb index e613d05b..5bf8cd80 100644 --- a/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +++ b/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AdminWorkflowsTriggersTypesPermissions # - # list the permissions for using each trigger type in workflow builder + # list the permissions for using each trigger type # # @option options [array] :trigger_type_ids # The trigger types IDs for which to get the permissions. @@ -19,7 +19,7 @@ def admin_workflows_triggers_types_permissions_lookup(options = {}) end # - # Set the permissions for using a trigger type in workflow builder + # Set the permissions for using a trigger type # # @option options [Object] :id # The trigger type ID for which to set the permissions. diff --git a/lib/slack/web/api/endpoints/assistant_threads.rb b/lib/slack/web/api/endpoints/assistant_threads.rb new file mode 100644 index 00000000..66a68779 --- /dev/null +++ b/lib/slack/web/api/endpoints/assistant_threads.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AssistantThreads + # + # Set the status for an AI assistant thread. + # + # @option options [Object] :channel_id + # Channel ID containing the assistant thread. + # @option options [string] :status + # Status of the specified bot user, e.g. 'is thinking...'. + # @option options [string] :thread_ts + # Message timestamp of the thread of where to set the status. + # @see https://api.slack.com/methods/assistant.threads.setStatus + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setStatus.json + def assistant_threads_setStatus(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + raise ArgumentError, 'Required arguments :status missing' if options[:status].nil? + raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil? + post('assistant.threads.setStatus', options) + end + + # + # Set suggested prompts for the given assistant thread + # + # @option options [Object] :channel_id + # Channel ID containing the assistant thread. + # @option options [Object] :prompts + # Each prompt should be supplied with its title and message attribute. + # @option options [string] :thread_ts + # Message timestamp of the thread to set suggested prompts for. + # @option options [string] :title + # Title for the list of provided prompts. For example: Suggested Prompts, Related Questions. + # @see https://api.slack.com/methods/assistant.threads.setSuggestedPrompts + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setSuggestedPrompts.json + def assistant_threads_setSuggestedPrompts(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + raise ArgumentError, 'Required arguments :prompts missing' if options[:prompts].nil? + raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil? + post('assistant.threads.setSuggestedPrompts', options) + end + + # + # Set the title for the given assistant thread + # + # @option options [Object] :channel_id + # Channel ID containing the assistant thread. + # @option options [string] :thread_ts + # Message timestamp of the thread to set suggested prompts for. + # @option options [string] :title + # The title to use for the thread. + # @see https://api.slack.com/methods/assistant.threads.setTitle + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setTitle.json + def assistant_threads_setTitle(options = {}) + raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil? + raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil? + raise ArgumentError, 'Required arguments :title missing' if options[:title].nil? + post('assistant.threads.setTitle', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/bookmarks.rb b/lib/slack/web/api/endpoints/bookmarks.rb index 35475093..cdc98ea2 100644 --- a/lib/slack/web/api/endpoints/bookmarks.rb +++ b/lib/slack/web/api/endpoints/bookmarks.rb @@ -15,6 +15,8 @@ module Bookmarks # Title for the bookmark. # @option options [string] :type # Type of the bookmark i.e link. + # @option options [enum] :access_level + # The level that we are setting the file's permission to (read or write). # @option options [string] :emoji # Emoji tag to apply to the link. # @option options [string] :entity_id diff --git a/lib/slack/web/api/endpoints/canvases.rb b/lib/slack/web/api/endpoints/canvases.rb index 489f351b..be2d1c2e 100644 --- a/lib/slack/web/api/endpoints/canvases.rb +++ b/lib/slack/web/api/endpoints/canvases.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Canvases # - # Create Canvas for a user. + # Create canvas for a user # # @option options [Object] :document_content # Structure describing the type and value of the content to create. @@ -20,7 +20,7 @@ def canvases_create(options = {}) end # - # Deletes a canvas. + # Deletes a canvas # # @option options [Object] :canvas_id # Encoded ID of the canvas. diff --git a/lib/slack/web/api/endpoints/canvases_access.rb b/lib/slack/web/api/endpoints/canvases_access.rb index 073820c8..9177ac27 100644 --- a/lib/slack/web/api/endpoints/canvases_access.rb +++ b/lib/slack/web/api/endpoints/canvases_access.rb @@ -26,7 +26,7 @@ def canvases_access_delete(options = {}) # Sets the access level to a canvas for specified entities # # @option options [Object] :access_level - # Desired level of access (e.g. read, write). + # Desired level of access (e.g. read, write, owner). # @option options [Object] :canvas_id # Encoded ID of the canvas. # @option options [array] :channel_ids diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 34e041dc..40e33d73 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -133,7 +133,7 @@ def chat_postEphemeral(options = {}) # Sends a message to a channel. # # @option options [channel] :channel - # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details. + # An encoded ID that represents a channel, private group, or IM channel to send the message to. See below for more details. # @option options [string] :attachments # A JSON-based array of structured attachments, presented as a URL-encoded string. # @option options [blocks[] as string] :blocks @@ -141,7 +141,7 @@ def chat_postEphemeral(options = {}) # @option options [string] :text # How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. # @option options [boolean] :as_user - # (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below. + # (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See legacy as_user parameter below. # @option options [string] :icon_emoji # Emoji to use as the icon for this message. Overrides icon_url. # @option options [string] :icon_url @@ -169,6 +169,7 @@ def chat_postEphemeral(options = {}) def chat_postMessage(options = {}) raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? + options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] options = encode_options_as_json(options, %i[attachments blocks metadata]) post('chat.postMessage', options) end diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index 9dab6fe2..a0e93095 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -172,7 +172,7 @@ def conversations_invite(options = {}) # @option options [array] :emails # Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time. # @option options [boolean] :external_limited - # Optional boolean on whether invite is to a external limited member. Defaults to true. + # Optional boolean on whether invite is to an external limited member. Defaults to true. # @option options [array] :user_ids # Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time. # @see https://api.slack.com/methods/conversations.inviteShared @@ -378,12 +378,12 @@ def conversations_replies(options = {}) end # - # Sets the purpose for a conversation. + # Sets the channel description. # # @option options [channel] :channel - # Conversation to set the purpose of. + # Channel to set the description of. # @option options [string] :purpose - # A new, specialer purpose. + # The description. # @see https://api.slack.com/methods/conversations.setPurpose # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json def conversations_setPurpose(options = {}) diff --git a/lib/slack/web/api/endpoints/conversations_canvases.rb b/lib/slack/web/api/endpoints/conversations_canvases.rb index 3248bdb5..675b7f63 100644 --- a/lib/slack/web/api/endpoints/conversations_canvases.rb +++ b/lib/slack/web/api/endpoints/conversations_canvases.rb @@ -7,7 +7,7 @@ module Api module Endpoints module ConversationsCanvases # - # Create a Channel Canvas for a channel. + # Create a channel canvas for a channel # # @option options [string] :channel_id # Channel ID of the channel we create the channel canvas for. diff --git a/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb b/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb new file mode 100644 index 00000000..fdd05b02 --- /dev/null +++ b/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module ConversationsRequestsharedinvite + # + # Approves a request to add an external user to a channel and sends them a Slack Connect invite + # + # @option options [Object] :invite_id + # ID of the requested shared channel invite to approve. + # @option options [string] :channel_id + # Optional channel_id to which external user will be invited to. Will override the value on the requested invite. + # @option options [boolean] :is_external_limited + # Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite. + # @option options [object] :message + # Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters. + # @see https://api.slack.com/methods/conversations.requestSharedInvite.approve + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.approve.json + def conversations_requestSharedInvite_approve(options = {}) + raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil? + post('conversations.requestSharedInvite.approve', options) + end + + # + # Denies a request to invite an external user to a channel + # + # @option options [Object] :invite_id + # ID of the requested shared channel invite to deny. + # @option options [string] :message + # Optional message explaining why the request to invite was denied. + # @see https://api.slack.com/methods/conversations.requestSharedInvite.deny + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.deny.json + def conversations_requestSharedInvite_deny(options = {}) + raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil? + post('conversations.requestSharedInvite.deny', options) + end + + # + # Lists requests to add external users to channels with ability to filter. + # + # @option options [string] :cursor + # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail. + # @option options [boolean] :include_approved + # When true approved invitation requests will be returned, otherwise they will be excluded. + # @option options [boolean] :include_denied + # When true denied invitation requests will be returned, otherwise they will be excluded. + # @option options [boolean] :include_expired + # When true expired invitation requests will be returned, otherwise they will be excluded. + # @option options [array] :invite_ids + # An optional list of invitation ids to look up. + # @option options [integer] :limit + # The number of items to return. Must be between 1 - 1000 (inclusive). + # @option options [Object] :user_id + # Optional filter to return invitation requests for the inviting user. + # @see https://api.slack.com/methods/conversations.requestSharedInvite.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.list.json + def conversations_requestSharedInvite_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :conversations_requestSharedInvite_list, options).each do |page| + yield page + end + else + post('conversations.requestSharedInvite.list', options) + end + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/usergroups.rb b/lib/slack/web/api/endpoints/usergroups.rb index 600a00e7..aa11987f 100644 --- a/lib/slack/web/api/endpoints/usergroups.rb +++ b/lib/slack/web/api/endpoints/usergroups.rb @@ -15,6 +15,8 @@ module Usergroups # A comma separated string of encoded channel IDs for which the User Group uses as a default. # @option options [string] :description # A short description of the User Group. + # @option options [boolean] :enable_section + # Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. # @option options [string] :handle # A mention handle. Must be unique among channels, users and User Groups. # @option options [boolean] :include_count @@ -86,6 +88,8 @@ def usergroups_list(options = {}) # A comma separated string of encoded channel IDs for which the User Group uses as a default. # @option options [string] :description # A short description of the User Group. + # @option options [boolean] :enable_section + # Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. # @option options [string] :handle # A mention handle. Must be unique among channels, users and User Groups. # @option options [boolean] :include_count diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index aa5325db..c5fbc84c 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -111,17 +111,22 @@ class CanvasDisabledUserTeam < SlackError; end class CanvasEditingFailed < SlackError; end class CanvasGloballyDisabled < SlackError; end class CanvasNotFound < SlackError; end + class CanvasTabCreationFailed < SlackError; end class ChannelArchived < SlackError; end class ChannelCannotBeUnshared < SlackError; end class ChannelCanvasAlreadyExists < SlackError; end class ChannelCanvasCreationFailed < SlackError; end class ChannelCanvasDeleted < SlackError; end class ChannelConversionInProgress < SlackError; end + class ChannelConversionIncomplete < SlackError; end + class ChannelIsArchived < SlackError; end class ChannelIsNotPrivate < SlackError; end class ChannelMentionSyncRequired < SlackError; end class ChannelNotArchived < SlackError; end class ChannelNotFound < SlackError; end + class ChannelNotOrgWideShared < SlackError; end class ChannelOwnerRestriction < SlackError; end + class ChannelSharedWithNonapprovedTeam < SlackError; end class ChannelTypeNotSupported < SlackError; end class ClientIdTokenMismatch < SlackError; end class CodeAlreadyUsed < SlackError; end @@ -178,6 +183,7 @@ class ErrorBadUpload < SlackError; end class ErrorBadWide < SlackError; end class ErrorInvalidAlias < SlackError; end class ErrorInvalidEmojiToRename < SlackError; end + class ErrorLowerCaseNamesOnly < SlackError; end class ErrorMissingName < SlackError; end class ErrorNameTaken < SlackError; end class ErrorNameTakenI18n < SlackError; end @@ -207,6 +213,7 @@ class FailedToAddEmoji < SlackError; end class FailedToAliasEmoji < SlackError; end class FailedToFetchActiveTeam < SlackError; end class FailedToFetchInfo < SlackError; end + class FailedToRemoveEmoji < SlackError; end class FailedToRemoveGroupUsers < SlackError; end class FailedToRemoveUserFromWorkspace < SlackError; end class FailedToRenameEmoji < SlackError; end @@ -223,6 +230,7 @@ class FailedToSetUserToRegular < SlackError; end class FailedToStartTrial < SlackError; end class FailedToUnlinkChannel < SlackError; end class FailedToUnshare < SlackError; end + class FailedToUpdateUserIds < SlackError; end class FailedToValidateCaller < SlackError; end class FailedToValidateChannels < SlackError; end class FailedToValidateCustomMessage < SlackError; end @@ -245,6 +253,7 @@ class FileUploadSizeRestricted < SlackError; end class FileUploadsDisabled < SlackError; end class ForbiddenHandle < SlackError; end class ForbiddenTeam < SlackError; end + class FreeTeamCanvasTabAlreadyExists < SlackError; end class FreeTeamNotAllowed < SlackError; end class FreeTeamsCannotCreateStandaloneCanvases < SlackError; end class FreeTeamsCannotEditStandaloneCanvases < SlackError; end @@ -336,6 +345,7 @@ class InvalidScheduledMessageId < SlackError; end class InvalidScopes < SlackError; end class InvalidSearchChannelType < SlackError; end class InvalidSetting < SlackError; end + class InvalidShortcutType < SlackError; end class InvalidSort < SlackError; end class InvalidSortDir < SlackError; end class InvalidSource < SlackError; end @@ -367,6 +377,9 @@ class InvalidValue < SlackError; end class InvalidVisibility < SlackError; end class InvalidWorkflowAuthStrategy < SlackError; end class InvalidWorkspaceFilter < SlackError; end + class InviteAlreadyApproved < SlackError; end + class InviteAlreadyDenied < SlackError; end + class InviteExpired < SlackError; end class InviteFromSameOrg < SlackError; end class InviteLookupError < SlackError; end class InviteNotFound < SlackError; end @@ -454,6 +467,7 @@ class NoResolutionFound < SlackError; end class NoScopes < SlackError; end class NoSuchSubteam < SlackError; end class NoTeamIdsGiven < SlackError; end + class NoTeamOrEnterpriseProvided < SlackError; end class NoTeamsToDisconnect < SlackError; end class NoText < SlackError; end class NoTokensFound < SlackError; end @@ -482,6 +496,7 @@ class NotFound < SlackError; end class NotImplemented < SlackError; end class NotInChannel < SlackError; end class NotInDnd < SlackError; end + class NotInTeam < SlackError; end class NotOwner < SlackError; end class NotPaid < SlackError; end class NotPinnable < SlackError; end @@ -500,7 +515,6 @@ class OrgResolutionRequired < SlackError; end class OrgUserNotInTeam < SlackError; end class OverMaxEntityLimit < SlackError; end class OverPaginationLimit < SlackError; end - class PaginationNotAvailable < SlackError; end class PaidOnly < SlackError; end class PaidTeamsOnly < SlackError; end class ParameterValidationFailed < SlackError; end @@ -526,6 +540,8 @@ class RateLimited < SlackError; end class Ratelimit < SlackError; end class Ratelimited < SlackError; end class RecipientsNotSpecified < SlackError; end + class RecordChannelAlreadyExists < SlackError; end + class RecordNotFound < SlackError; end class RequestAlreadyResolved < SlackError; end class RequestIdOrAppIdIsRequired < SlackError; end class RequestIdRequiredForCustomIntegrations < SlackError; end @@ -537,11 +553,11 @@ class RestrictedActionNonThreadableChannel < SlackError; end class RestrictedActionReadOnlyChannel < SlackError; end class RestrictedActionThreadLocked < SlackError; end class RestrictedActionThreadOnlyChannel < SlackError; end + class RestrictedPlanLevel < SlackError; end class RestrictedTooMany < SlackError; end class RetentionOverrideNotAllowed < SlackError; end class SentRecently < SlackError; end class ServiceUnavailable < SlackError; end - class SessionExpired < SlackError; end class SessionInvalidationFailed < SlackError; end class SessionNotFound < SlackError; end class SessionResetNotAllowed < SlackError; end @@ -570,6 +586,7 @@ class TeamNotConnected < SlackError; end class TeamNotFound < SlackError; end class TeamNotOnEnterprise < SlackError; end class TeamQuotaExceeded < SlackError; end + class TeamTierCannotCreateChannelCanvases < SlackError; end class TeamsNotFound < SlackError; end class TemplateNotVisible < SlackError; end class ThreadLocked < SlackError; end @@ -634,9 +651,11 @@ class UrlRestrictionNotSupported < SlackError; end class UserAlreadyDeleted < SlackError; end class UserAlreadyTeamMember < SlackError; end class UserCannotCreateChannel < SlackError; end + class UserCannotManagePublicChannels < SlackError; end class UserCannotManageWorkspace < SlackError; end class UserDisabled < SlackError; end class UserDoesNotOwnChannel < SlackError; end + class UserEmailUnverified < SlackError; end class UserIsAlreadyDeleted < SlackError; end class UserIsBot < SlackError; end class UserIsNotAGuest < SlackError; end @@ -766,17 +785,22 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'canvas_editing_failed' => CanvasEditingFailed, 'canvas_globally_disabled' => CanvasGloballyDisabled, 'canvas_not_found' => CanvasNotFound, + 'canvas_tab_creation_failed' => CanvasTabCreationFailed, 'channel_archived' => ChannelArchived, 'channel_cannot_be_unshared' => ChannelCannotBeUnshared, 'channel_canvas_already_exists' => ChannelCanvasAlreadyExists, 'channel_canvas_creation_failed' => ChannelCanvasCreationFailed, 'channel_canvas_deleted' => ChannelCanvasDeleted, 'channel_conversion_in_progress' => ChannelConversionInProgress, + 'channel_conversion_incomplete' => ChannelConversionIncomplete, + 'channel_is_archived' => ChannelIsArchived, 'channel_is_not_private' => ChannelIsNotPrivate, 'channel_mention_sync_required' => ChannelMentionSyncRequired, 'channel_not_archived' => ChannelNotArchived, 'channel_not_found' => ChannelNotFound, + 'channel_not_org_wide_shared' => ChannelNotOrgWideShared, 'channel_owner_restriction' => ChannelOwnerRestriction, + 'channel_shared_with_nonapproved_team' => ChannelSharedWithNonapprovedTeam, 'channel_type_not_supported' => ChannelTypeNotSupported, 'client_id_token_mismatch' => ClientIdTokenMismatch, 'code_already_used' => CodeAlreadyUsed, @@ -833,6 +857,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'error_bad_wide' => ErrorBadWide, 'error_invalid_alias' => ErrorInvalidAlias, 'error_invalid_emoji_to_rename' => ErrorInvalidEmojiToRename, + 'error_lower_case_names_only' => ErrorLowerCaseNamesOnly, 'error_missing_name' => ErrorMissingName, 'error_name_taken' => ErrorNameTaken, 'error_name_taken_i18n' => ErrorNameTakenI18n, @@ -862,6 +887,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'failed_to_alias_emoji' => FailedToAliasEmoji, 'failed_to_fetch_active_team' => FailedToFetchActiveTeam, 'failed_to_fetch_info' => FailedToFetchInfo, + 'failed_to_remove_emoji' => FailedToRemoveEmoji, 'failed_to_remove_group_users' => FailedToRemoveGroupUsers, 'failed_to_remove_user_from_workspace' => FailedToRemoveUserFromWorkspace, 'failed_to_rename_emoji' => FailedToRenameEmoji, @@ -878,6 +904,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'failed_to_start_trial' => FailedToStartTrial, 'failed_to_unlink_channel' => FailedToUnlinkChannel, 'failed_to_unshare' => FailedToUnshare, + 'failed_to_update_user_ids' => FailedToUpdateUserIds, 'failed_to_validate_caller' => FailedToValidateCaller, 'failed_to_validate_channels' => FailedToValidateChannels, 'failed_to_validate_custom_message' => FailedToValidateCustomMessage, @@ -900,6 +927,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'file_uploads_disabled' => FileUploadsDisabled, 'forbidden_handle' => ForbiddenHandle, 'forbidden_team' => ForbiddenTeam, + 'free_team_canvas_tab_already_exists' => FreeTeamCanvasTabAlreadyExists, 'free_team_not_allowed' => FreeTeamNotAllowed, 'free_teams_cannot_create_standalone_canvases' => FreeTeamsCannotCreateStandaloneCanvases, 'free_teams_cannot_edit_standalone_canvases' => FreeTeamsCannotEditStandaloneCanvases, @@ -991,6 +1019,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_scopes' => InvalidScopes, 'invalid_search_channel_type' => InvalidSearchChannelType, 'invalid_setting' => InvalidSetting, + 'invalid_shortcut_type' => InvalidShortcutType, 'invalid_sort' => InvalidSort, 'invalid_sort_dir' => InvalidSortDir, 'invalid_source' => InvalidSource, @@ -1022,6 +1051,9 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_visibility' => InvalidVisibility, 'invalid_workflow_auth_strategy' => InvalidWorkflowAuthStrategy, 'invalid_workspace_filter' => InvalidWorkspaceFilter, + 'invite_already_approved' => InviteAlreadyApproved, + 'invite_already_denied' => InviteAlreadyDenied, + 'invite_expired' => InviteExpired, 'invite_from_same_org' => InviteFromSameOrg, 'invite_lookup_error' => InviteLookupError, 'invite_not_found' => InviteNotFound, @@ -1109,6 +1141,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'no_scopes' => NoScopes, 'no_such_subteam' => NoSuchSubteam, 'no_team_ids_given' => NoTeamIdsGiven, + 'no_team_or_enterprise_provided' => NoTeamOrEnterpriseProvided, 'no_teams_to_disconnect' => NoTeamsToDisconnect, 'no_text' => NoText, 'no_tokens_found' => NoTokensFound, @@ -1137,6 +1170,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'not_implemented' => NotImplemented, 'not_in_channel' => NotInChannel, 'not_in_dnd' => NotInDnd, + 'not_in_team' => NotInTeam, 'not_owner' => NotOwner, 'not_paid' => NotPaid, 'not_pinnable' => NotPinnable, @@ -1155,7 +1189,6 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'org_user_not_in_team' => OrgUserNotInTeam, 'over_max_entity_limit' => OverMaxEntityLimit, 'over_pagination_limit' => OverPaginationLimit, - 'pagination_not_available' => PaginationNotAvailable, 'paid_only' => PaidOnly, 'paid_teams_only' => PaidTeamsOnly, 'parameter_validation_failed' => ParameterValidationFailed, @@ -1181,6 +1214,8 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'ratelimit' => Ratelimit, 'ratelimited' => Ratelimited, 'recipients_not_specified' => RecipientsNotSpecified, + 'record_channel_already_exists' => RecordChannelAlreadyExists, + 'record_not_found' => RecordNotFound, 'request_already_resolved' => RequestAlreadyResolved, 'request_id_or_app_id_is_required' => RequestIdOrAppIdIsRequired, 'request_id_required_for_custom_integrations' => RequestIdRequiredForCustomIntegrations, @@ -1192,11 +1227,11 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'restricted_action_read_only_channel' => RestrictedActionReadOnlyChannel, 'restricted_action_thread_locked' => RestrictedActionThreadLocked, 'restricted_action_thread_only_channel' => RestrictedActionThreadOnlyChannel, + 'restricted_plan_level' => RestrictedPlanLevel, 'restricted_too_many' => RestrictedTooMany, 'retention_override_not_allowed' => RetentionOverrideNotAllowed, 'sent_recently' => SentRecently, 'service_unavailable' => ServiceUnavailable, - 'session_expired' => SessionExpired, 'session_invalidation_failed' => SessionInvalidationFailed, 'session_not_found' => SessionNotFound, 'session_reset_not_allowed' => SessionResetNotAllowed, @@ -1225,6 +1260,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'team_not_found' => TeamNotFound, 'team_not_on_enterprise' => TeamNotOnEnterprise, 'team_quota_exceeded' => TeamQuotaExceeded, + 'team_tier_cannot_create_channel_canvases' => TeamTierCannotCreateChannelCanvases, 'teams_not_found' => TeamsNotFound, 'template_not_visible' => TemplateNotVisible, 'thread_locked' => ThreadLocked, @@ -1289,9 +1325,11 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'user_already_deleted' => UserAlreadyDeleted, 'user_already_team_member' => UserAlreadyTeamMember, 'user_cannot_create_channel' => UserCannotCreateChannel, + 'user_cannot_manage_public_channels' => UserCannotManagePublicChannels, 'user_cannot_manage_workspace' => UserCannotManageWorkspace, 'user_disabled' => UserDisabled, 'user_does_not_own_channel' => UserDoesNotOwnChannel, + 'user_email_unverified' => UserEmailUnverified, 'user_is_already_deleted' => UserIsAlreadyDeleted, 'user_is_bot' => UserIsBot, 'user_is_not_a_guest' => UserIsNotAGuest, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 3ec3c101..f232791f 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 3ec3c101d99cb5ab8af3694e57d883f04cfd5e2f +Subproject commit f232791fb0eac399437f895284d49b870d0a857b diff --git a/spec/slack/web/api/endpoints/admin_conversations_spec.rb b/spec/slack/web/api/endpoints/admin_conversations_spec.rb index ade073b2..181c6114 100644 --- a/spec/slack/web/api/endpoints/admin_conversations_spec.rb +++ b/spec/slack/web/api/endpoints/admin_conversations_spec.rb @@ -79,6 +79,17 @@ expect { client.admin_conversations_invite(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/ end end + context 'admin.conversations_linkObjects' do + it 'requires channel' do + expect { client.admin_conversations_linkObjects(record_id: %q[0019000000DmehKAAR], salesforce_org_id: %q[00DGC00000024hsuWY]) }.to raise_error ArgumentError, /Required arguments :channel missing/ + end + it 'requires record_id' do + expect { client.admin_conversations_linkObjects(channel: %q[C1234567890], salesforce_org_id: %q[00DGC00000024hsuWY]) }.to raise_error ArgumentError, /Required arguments :record_id missing/ + end + it 'requires salesforce_org_id' do + expect { client.admin_conversations_linkObjects(channel: %q[C1234567890], record_id: %q[0019000000DmehKAAR]) }.to raise_error ArgumentError, /Required arguments :salesforce_org_id missing/ + end + end context 'admin.conversations_lookup' do it 'requires last_message_activity_before' do expect { client.admin_conversations_lookup(team_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :last_message_activity_before missing/ @@ -130,4 +141,12 @@ expect { client.admin_conversations_unarchive }.to raise_error ArgumentError, /Required arguments :channel_id missing/ end end + context 'admin.conversations_unlinkObjects' do + it 'requires channel' do + expect { client.admin_conversations_unlinkObjects(new_name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel missing/ + end + it 'requires new_name' do + expect { client.admin_conversations_unlinkObjects(channel: %q[C1234567890]) }.to raise_error ArgumentError, /Required arguments :new_name missing/ + end + end end diff --git a/spec/slack/web/api/endpoints/admin_users_session_spec.rb b/spec/slack/web/api/endpoints/admin_users_session_spec.rb index 035c6e1e..1a031abc 100644 --- a/spec/slack/web/api/endpoints/admin_users_session_spec.rb +++ b/spec/slack/web/api/endpoints/admin_users_session_spec.rb @@ -17,10 +17,18 @@ end context 'admin.users.session_invalidate' do it 'requires session_id' do - expect { client.admin_users_session_invalidate(team_id: %q[T1234]) }.to raise_error ArgumentError, /Required arguments :session_id missing/ + expect { client.admin_users_session_invalidate(user_id: %q[U12345]) }.to raise_error ArgumentError, /Required arguments :session_id missing/ end - it 'requires team_id' do - expect { client.admin_users_session_invalidate(session_id: %q[12345]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ + it 'requires one of user_id, team_id' do + expect { client.admin_users_session_invalidate(session_id: %q[12345]) }.to raise_error ArgumentError, /Exactly one of/ + + expect(client).to receive(:post).with('admin.users.session.invalidate', {user_id: %q[U12345], session_id: %q[12345]}) + client.admin_users_session_invalidate(user_id: %q[U12345], session_id: %q[12345]) + + expect(client).to receive(:post).with('admin.users.session.invalidate', {team_id: %q[T1234], session_id: %q[12345]}) + client.admin_users_session_invalidate(team_id: %q[T1234], session_id: %q[12345]) + + expect { client.admin_users_session_invalidate(user_id: %q[U12345], team_id: %q[T1234], session_id: %q[12345]) }.to raise_error ArgumentError, /Exactly one of/ end end context 'admin.users.session_reset' do diff --git a/spec/slack/web/api/endpoints/assistant_threads_spec.rb b/spec/slack/web/api/endpoints/assistant_threads_spec.rb new file mode 100644 index 00000000..b69894c5 --- /dev/null +++ b/spec/slack/web/api/endpoints/assistant_threads_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AssistantThreads do + let(:client) { Slack::Web::Client.new } + context 'assistant.threads_setStatus' do + it 'requires channel_id' do + expect { client.assistant_threads_setStatus(status: %q[], thread_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + it 'requires status' do + expect { client.assistant_threads_setStatus(channel_id: %q[C1234567890], thread_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :status missing/ + end + it 'requires thread_ts' do + expect { client.assistant_threads_setStatus(channel_id: %q[C1234567890], status: %q[]) }.to raise_error ArgumentError, /Required arguments :thread_ts missing/ + end + end + context 'assistant.threads_setSuggestedPrompts' do + it 'requires channel_id' do + expect { client.assistant_threads_setSuggestedPrompts(prompts: %q[], thread_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + it 'requires prompts' do + expect { client.assistant_threads_setSuggestedPrompts(channel_id: %q[C1234567890], thread_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :prompts missing/ + end + it 'requires thread_ts' do + expect { client.assistant_threads_setSuggestedPrompts(channel_id: %q[C1234567890], prompts: %q[]) }.to raise_error ArgumentError, /Required arguments :thread_ts missing/ + end + end + context 'assistant.threads_setTitle' do + it 'requires channel_id' do + expect { client.assistant_threads_setTitle(thread_ts: %q[], title: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + it 'requires thread_ts' do + expect { client.assistant_threads_setTitle(channel_id: %q[C1234567890], title: %q[]) }.to raise_error ArgumentError, /Required arguments :thread_ts missing/ + end + it 'requires title' do + expect { client.assistant_threads_setTitle(channel_id: %q[C1234567890], thread_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :title missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/conversations_requestSharedInvite_spec.rb b/spec/slack/web/api/endpoints/conversations_requestSharedInvite_spec.rb new file mode 100644 index 00000000..e0e69214 --- /dev/null +++ b/spec/slack/web/api/endpoints/conversations_requestSharedInvite_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::ConversationsRequestsharedinvite do + let(:client) { Slack::Web::Client.new } + context 'conversations.requestSharedInvite_approve' do + it 'requires invite_id' do + expect { client.conversations_requestSharedInvite_approve }.to raise_error ArgumentError, /Required arguments :invite_id missing/ + end + end + context 'conversations.requestSharedInvite_deny' do + it 'requires invite_id' do + expect { client.conversations_requestSharedInvite_deny }.to raise_error ArgumentError, /Required arguments :invite_id missing/ + end + end +end