diff --git a/CHANGELOG.md b/CHANGELOG.md index 33913754..af6c84ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [#549](https://github.com/slack-ruby/slack-ruby-client/pull/549): Add group ID formatting support for message mentions - [@n0h0](https://github.com/n0h0). * [#553](https://github.com/slack-ruby/slack-ruby-client/pull/553): Use `secure_compare` during signature verification - [@hieuk09](https://github.com/hieuk09). * [#555](https://github.com/slack-ruby/slack-ruby-client/pull/555): Make page size in resolving IDs configurable - [@eizengan](https://github.com/eizengan). +* [#547](https://github.com/slack-ruby/slack-ruby-client/pull/547): Update API from [slack-api-ref@1ee282e](https://github.com/slack-ruby/slack-api-ref/commit/1ee282e) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 2.5.2 (2025/02/19) diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index eeaa1575..5bb5da25 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -75,6 +75,17 @@ class App end end + g.desc 'Create a Salesforce channel for the corresponding object provided.' + g.long_desc %( Create a Salesforce channel for the corresponding object provided. ) + g.command 'createForObjects' do |c| + c.flag 'object_id', desc: 'Object / Record ID (15 or 18 digit accepted). See here for how to look up an 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.flag 'invite_object_team', desc: 'Optional flag to add all team members related to the object to the newly created Salesforce channel. When true, adds a maximum of 100 team members to the channel.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_conversations_createForObjects(options)) + end + end + g.desc 'Delete a public or private channel.' g.long_desc %( Delete a public or private channel. ) g.command 'delete' do |c| @@ -219,7 +230,7 @@ class App c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.' c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.' c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.' - c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.' + c.flag 'team_id', desc: 'The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_conversations_setTeams(options)) end diff --git a/bin/commands/admin_users.rb b/bin/commands/admin_users.rb index b349b767..3633a8e1 100644 --- a/bin/commands/admin_users.rb +++ b/bin/commands/admin_users.rb @@ -44,7 +44,7 @@ class App c.flag 'include_deactivated_user_workspaces', desc: 'Only applies with org token and no team_id. If true, return workspaces for a user even if they may be deactivated on them. If false, return workspaces for a user only when user is active on them. Default is false.' c.flag 'is_active', desc: 'If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.' c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.' - c.flag 'team_id', desc: 'The ID (T1234) of the workspace. The team_id is required if you use an org-level token.' + c.flag 'team_id', desc: 'The ID (T1234) of a workspace. Filters results to just the specified workspace.' c.action do |_global_options, options, _args| puts JSON.dump(@client.admin_users_list(options)) end diff --git a/bin/commands/assistant_search.rb b/bin/commands/assistant_search.rb new file mode 100644 index 00000000..b8a933fd --- /dev/null +++ b/bin/commands/assistant_search.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Cli + class App + desc 'AssistantSearch methods.' + command 'assistant_search' do |g| + g.desc 'Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.' + g.long_desc %( Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval. ) + g.command 'context' do |c| + c.flag 'query', desc: 'User prompt or search query.' + c.flag 'action_token', desc: 'Send action_token as received in a message event.' + c.flag 'channel_types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.' + c.flag 'content_types', desc: 'Content types to include, a comma-separated list of any combination of messages, files.' + c.flag 'context_channel_id', desc: 'Context channel ID to support scoping the search when applicable.' + c.flag 'cursor', desc: 'The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results.' + c.flag 'include_bots', desc: 'If you want the results to include bots.' + c.flag 'limit', desc: 'Number of results to return, up to a max of 20. Defaults to 20.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.assistant_search_context(options)) + end + end + end + end + end +end diff --git a/bin/commands/canvases.rb b/bin/commands/canvases.rb index f42668c7..1158f9bf 100644 --- a/bin/commands/canvases.rb +++ b/bin/commands/canvases.rb @@ -9,6 +9,7 @@ class App g.desc 'Create canvas for a user' g.long_desc %( Create canvas for a user ) g.command 'create' do |c| + c.flag 'channel_id', desc: 'Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams.' 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.' c.action do |_global_options, options, _args| diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 841a10e3..628bdc45 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -87,6 +87,7 @@ class App 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 'agent_message_source_type', desc: 'Identify how the message was posted for agentforce BE logging.' 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.' diff --git a/bin/commands/conversations_canvases.rb b/bin/commands/conversations_canvases.rb index 1b0afd13..dae9671a 100644 --- a/bin/commands/conversations_canvases.rb +++ b/bin/commands/conversations_canvases.rb @@ -11,6 +11,7 @@ class App 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.' + c.flag 'title', desc: 'Title of the newly created canvas.' c.action do |_global_options, options, _args| puts JSON.dump(@client.conversations_canvases_create(options)) end diff --git a/bin/commands/files.rb b/bin/commands/files.rb index 6f5f75b3..3c99b6b2 100644 --- a/bin/commands/files.rb +++ b/bin/commands/files.rb @@ -10,6 +10,7 @@ class App g.long_desc %( Finishes an upload started with files.getUploadURLExternal ) g.command 'completeUploadExternal' do |c| c.flag 'files', desc: 'Array of file ids and their corresponding (optional) titles.' + c.flag 'blocks', desc: 'A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the initial_comment field is provided, the blocks field is ignored.' c.flag 'channel_id', desc: 'Channel ID where the file will be shared. If not specified the file will be private.' c.flag 'channels', desc: 'Comma-separated string of channel IDs where the file will be shared.' c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.' diff --git a/bin/commands/functions_distributions_permissions.rb b/bin/commands/functions_distributions_permissions.rb index a13e1c40..1bde98f8 100644 --- a/bin/commands/functions_distributions_permissions.rb +++ b/bin/commands/functions_distributions_permissions.rb @@ -18,8 +18,8 @@ class App end end - g.desc 'List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities' - g.long_desc %( List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities ) + g.desc 'List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities' + g.long_desc %( List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities ) g.command 'list' do |c| c.flag 'function_app_id', desc: 'The encoded ID of the app.' c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file." @@ -41,13 +41,15 @@ class App end end - g.desc 'Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities' - g.long_desc %( Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities ) + g.desc 'Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities' + g.long_desc %( Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities ) g.command 'set' do |c| c.flag 'permission_type', desc: 'The type of permission that defines how the function can be distributed.' c.flag 'function_app_id', desc: 'The encoded ID of the app.' c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file." c.flag 'function_id', desc: 'The encoded ID of the function.' + c.flag 'org_ids', desc: 'List of org IDs to allow for named_entities permission.' + c.flag 'team_ids', desc: 'List of team IDs to allow for named_entities permission.' c.flag 'user_ids', desc: 'List of encoded user IDs.' c.action do |_global_options, options, _args| puts JSON.dump(@client.functions_distributions_permissions_set(options)) diff --git a/bin/commands/usergroups.rb b/bin/commands/usergroups.rb index 0c0c838a..4da2f5b2 100644 --- a/bin/commands/usergroups.rb +++ b/bin/commands/usergroups.rb @@ -51,7 +51,6 @@ class App c.flag 'include_disabled', desc: 'Include disabled User Groups.' c.flag 'include_users', desc: 'Include the list of users for each User Group.' c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.' - c.flag 'usergroup_id', desc: 'The id of the usergroup you would like to filter the results down to.' c.action do |_global_options, options, _args| puts JSON.dump(@client.usergroups_list(options)) end diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index 0a782a55..10ed467b 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_search' require_relative 'endpoints/assistant_threads' require_relative 'endpoints/auth' require_relative 'endpoints/auth_teams' @@ -141,6 +142,7 @@ module Endpoints include AppsDatastore include AppsEventAuthorizations include AppsManifest + include AssistantSearch include AssistantThreads include Auth include AuthTeams diff --git a/lib/slack/web/api/endpoints/admin_conversations.rb b/lib/slack/web/api/endpoints/admin_conversations.rb index a9478eae..ce4d18c3 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -104,6 +104,23 @@ def admin_conversations_create(options = {}) post('admin.conversations.create', options) end + # + # Create a Salesforce channel for the corresponding object provided. + # + # @option options [string] :object_id + # Object / Record ID (15 or 18 digit accepted). See here for how to look up an 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. + # @option options [boolean] :invite_object_team + # Optional flag to add all team members related to the object to the newly created Salesforce channel. When true, adds a maximum of 100 team members to the channel. + # @see https://api.slack.com/methods/admin.conversations.createForObjects + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.createForObjects.json + def admin_conversations_createForObjects(options = {}) + raise ArgumentError, 'Required arguments :object_id missing' if options[:object_id].nil? + raise ArgumentError, 'Required arguments :salesforce_org_id missing' if options[:salesforce_org_id].nil? + post('admin.conversations.createForObjects', options) + end + # # Delete a public or private channel. # @@ -338,7 +355,7 @@ def admin_conversations_setCustomRetention(options = {}) # @option options [array] :target_team_ids # A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide. # @option options [Object] :team_id - # The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel. + # The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel. # @see https://api.slack.com/methods/admin.conversations.setTeams # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json def admin_conversations_setTeams(options = {}) diff --git a/lib/slack/web/api/endpoints/admin_users.rb b/lib/slack/web/api/endpoints/admin_users.rb index dd9f9c31..26c610d6 100644 --- a/lib/slack/web/api/endpoints/admin_users.rb +++ b/lib/slack/web/api/endpoints/admin_users.rb @@ -71,7 +71,7 @@ def admin_users_invite(options = {}) # @option options [integer] :limit # Limit for how many users to be retrieved per page. # @option options [Object] :team_id - # The ID (T1234) of the workspace. The team_id is required if you use an org-level token. + # The ID (T1234) of a workspace. Filters results to just the specified workspace. # @see https://api.slack.com/methods/admin.users.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.list.json def admin_users_list(options = {}) diff --git a/lib/slack/web/api/endpoints/assistant_search.rb b/lib/slack/web/api/endpoints/assistant_search.rb new file mode 100644 index 00000000..3bc33dce --- /dev/null +++ b/lib/slack/web/api/endpoints/assistant_search.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AssistantSearch + # + # Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval. + # + # @option options [string] :query + # User prompt or search query. + # @option options [string] :action_token + # Send action_token as received in a message event. + # @option options [array] :channel_types + # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im. + # @option options [array] :content_types + # Content types to include, a comma-separated list of any combination of messages, files. + # @option options [Object] :context_channel_id + # Context channel ID to support scoping the search when applicable. + # @option options [string] :cursor + # The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results. + # @option options [boolean] :include_bots + # If you want the results to include bots. + # @option options [integer] :limit + # Number of results to return, up to a max of 20. Defaults to 20. + # @see https://api.slack.com/methods/assistant.search.context + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.search/assistant.search.context.json + def assistant_search_context(options = {}) + raise ArgumentError, 'Required arguments :query missing' if options[:query].nil? + if block_given? + Pagination::Cursor.new(self, :assistant_search_context, options).each do |page| + yield page + end + else + post('assistant.search.context', options) + end + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/canvases.rb b/lib/slack/web/api/endpoints/canvases.rb index be2d1c2e..fe274962 100644 --- a/lib/slack/web/api/endpoints/canvases.rb +++ b/lib/slack/web/api/endpoints/canvases.rb @@ -9,6 +9,8 @@ module Canvases # # Create canvas for a user # + # @option options [string] :channel_id + # Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams. # @option options [Object] :document_content # Structure describing the type and value of the content to create. # @option options [string] :title diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 8d964152..b02d4b81 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -142,6 +142,8 @@ def chat_postEphemeral(options = {}) # A JSON-based array of structured blocks, presented as a URL-encoded string. # @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 [Object] :agent_message_source_type + # Identify how the message was posted for agentforce BE logging. # @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 apps. See legacy as_user parameter below. # @option options [string] :icon_emoji diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index a0e93095..a7d346a0 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -207,7 +207,6 @@ def conversations_join(options = {}) # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.kick.json def conversations_kick(options = {}) raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? - raise ArgumentError, 'Required arguments :user missing' if options[:user].nil? options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] options = options.merge(user: users_id(options)['user']['id']) if options[:user] post('conversations.kick', options) diff --git a/lib/slack/web/api/endpoints/conversations_canvases.rb b/lib/slack/web/api/endpoints/conversations_canvases.rb index 675b7f63..7eaa59cf 100644 --- a/lib/slack/web/api/endpoints/conversations_canvases.rb +++ b/lib/slack/web/api/endpoints/conversations_canvases.rb @@ -13,6 +13,8 @@ module ConversationsCanvases # Channel ID of the channel we create the channel canvas for. # @option options [Object] :document_content # Structure describing the type and value of the content to create. + # @option options [string] :title + # Title of the newly created canvas. # @see https://api.slack.com/methods/conversations.canvases.create # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.canvases/conversations.canvases.create.json def conversations_canvases_create(options = {}) diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb index 3b8d822f..d68a19cc 100644 --- a/lib/slack/web/api/endpoints/files.rb +++ b/lib/slack/web/api/endpoints/files.rb @@ -11,6 +11,8 @@ module Files # # @option options [array] :files # Array of file ids and their corresponding (optional) titles. + # @option options [blocks[] as string] :blocks + # A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the initial_comment field is provided, the blocks field is ignored. # @option options [Object] :channel_id # Channel ID where the file will be shared. If not specified the file will be private. # @option options [string] :channels @@ -23,6 +25,7 @@ module Files # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.completeUploadExternal.json def files_completeUploadExternal(options = {}) raise ArgumentError, 'Required arguments :files missing' if options[:files].nil? + options = encode_options_as_json(options, %i[blocks]) post('files.completeUploadExternal', options) end diff --git a/lib/slack/web/api/endpoints/functions_distributions_permissions.rb b/lib/slack/web/api/endpoints/functions_distributions_permissions.rb index 0436e599..028181b2 100644 --- a/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +++ b/lib/slack/web/api/endpoints/functions_distributions_permissions.rb @@ -24,7 +24,7 @@ def functions_distributions_permissions_add(options = {}) end # - # List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities + # List the access type of a custom slack function and include the users or team or org ids with access if its permission_type is set to named_entities # # @option options [string] :function_app_id # The encoded ID of the app. @@ -56,7 +56,7 @@ def functions_distributions_permissions_remove(options = {}) end # - # Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities + # Set the access type of a custom slack function and define the users or team or org ids to be granted access if permission_type is set to named_entities # # @option options [enum] :permission_type # The type of permission that defines how the function can be distributed. @@ -66,6 +66,10 @@ def functions_distributions_permissions_remove(options = {}) # The callback ID defined in the function's definition file. # @option options [string] :function_id # The encoded ID of the function. + # @option options [array] :org_ids + # List of org IDs to allow for named_entities permission. + # @option options [array] :team_ids + # List of team IDs to allow for named_entities permission. # @option options [array] :user_ids # List of encoded user IDs. # @see https://api.slack.com/methods/functions.distributions.permissions.set diff --git a/lib/slack/web/api/endpoints/usergroups.rb b/lib/slack/web/api/endpoints/usergroups.rb index 90cfc6b8..5521408a 100644 --- a/lib/slack/web/api/endpoints/usergroups.rb +++ b/lib/slack/web/api/endpoints/usergroups.rb @@ -75,8 +75,6 @@ def usergroups_enable(options = {}) # Include the list of users for each User Group. # @option options [string] :team_id # encoded team id to list user groups in, required if org token is used. - # @option options [Object] :usergroup_id - # The id of the usergroup you would like to filter the results down to. # @see https://api.slack.com/methods/usergroups.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json def usergroups_list(options = {}) diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index ae9267d9..27a2bcfc 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -112,6 +112,7 @@ class CanvasEditingFailed < SlackError; end class CanvasGloballyDisabled < SlackError; end class CanvasNotFound < SlackError; end class CanvasTabCreationFailed < SlackError; end + class ChannelAlreadyExists < SlackError; end class ChannelArchived < SlackError; end class ChannelCannotBeUnshared < SlackError; end class ChannelCanvasAlreadyExists < SlackError; end @@ -137,6 +138,7 @@ class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end class ConnectedUserDenied < SlackError; end class ConnectionLimitExceeded < SlackError; end class ConnectionLimitExceededPending < SlackError; end + class ContextChannelNotFound < SlackError; end class CouldNotArchiveChannel < SlackError; end class CouldNotConvertChannel < SlackError; end class CouldNotCreateChannel < SlackError; end @@ -242,6 +244,7 @@ class FatalError < SlackError; end class FeatureNotAvailable < SlackError; end class FeatureNotEnabled < SlackError; end class FetchMembersFailed < SlackError; end + class FileAlreadyAdded < SlackError; end class FileCommentNotFound < SlackError; end class FileDeleted < SlackError; end class FileDeletingDisabled < SlackError; end @@ -256,7 +259,7 @@ class ForbiddenHandle < SlackError; end class ForbiddenTeam < SlackError; end class FreeTeamCanvasTabAlreadyExists < SlackError; end class FreeTeamNotAllowed < SlackError; end - class FreeTeamsCannotCreateStandaloneCanvases < SlackError; end + class FreeTeamsCannotCreateNonTabbedCanvases < SlackError; end class FreeTeamsCannotEditStandaloneCanvases < SlackError; end class FunctionExecutionNotFound < SlackError; end class FunctionNotFound < SlackError; end @@ -272,6 +275,7 @@ class IncludeDeactivatedUserWorkspacesInvalid < SlackError; end class InsecureRequest < SlackError; end class InternalError < SlackError; end class InvalidAction < SlackError; end + class InvalidActionToken < SlackError; end class InvalidActor < SlackError; end class InvalidApp < SlackError; end class InvalidAppActionType < SlackError; end @@ -326,6 +330,8 @@ class InvalidNamePunctuation < SlackError; end class InvalidNameRequired < SlackError; end class InvalidNameSpecials < SlackError; end class InvalidNamedEntities < SlackError; end + class InvalidOooMessage < SlackError; end + class InvalidOrgId < SlackError; end class InvalidOutputs < SlackError; end class InvalidParameters < SlackError; end class InvalidParentType < SlackError; end @@ -352,6 +358,7 @@ class InvalidSort < SlackError; end class InvalidSortDir < SlackError; end class InvalidSource < SlackError; end class InvalidStartTime < SlackError; end + class InvalidStartsWithAt < SlackError; end class InvalidStepStatus < SlackError; end class InvalidTargetTeam < SlackError; end class InvalidTeam < SlackError; end @@ -402,6 +409,7 @@ class LegacyConnectionInvalidOrg < SlackError; end class LegacyConnectionLimitExceeded < SlackError; end class LimitRequired < SlackError; end class LinkNotFound < SlackError; end + class ListRecordCommentFetchFailed < SlackError; end class MalwareDetected < SlackError; end class ManagedChannelNotSupported < SlackError; end class MarkdownTextConflict < SlackError; end @@ -427,6 +435,8 @@ class MissingDuration < SlackError; end class MissingFileData < SlackError; end class MissingPostType < SlackError; end class MissingProfileId < SlackError; end + class MissingQuery < SlackError; end + class MissingRecordChannelConfig < SlackError; end class MissingResource < SlackError; end class MissingScope < SlackError; end class MissingSource < SlackError; end @@ -451,6 +461,7 @@ class NameTaken < SlackError; end class NameTakenInOrg < SlackError; end class NameTooLong < SlackError; end class NamedEntitiesCannotBeEmpty < SlackError; end + class NoAccess < SlackError; end class NoActiveSessions < SlackError; end class NoAliasSelected < SlackError; end class NoBotUserForApp < SlackError; end @@ -502,6 +513,7 @@ class NotInDnd < SlackError; end class NotInTeam < SlackError; end class NotOwner < SlackError; end class NotPaid < SlackError; end + class NotPermitted < SlackError; end class NotPinnable < SlackError; end class NotPinned < SlackError; end class NotReactable < SlackError; end @@ -536,9 +548,11 @@ class PreviewFeatureNotAvailable < SlackError; end class PrimaryUsergroupNotFound < SlackError; end class ProfileSetFailed < SlackError; end class ProvidersNotFound < SlackError; end + class PublicFileTypeNotAllowed < SlackError; end class PublicVideoNotAllowed < SlackError; end class PublishedAppOnly < SlackError; end class PushLimitReached < SlackError; end + class QueryTooLong < SlackError; end class RateLimited < SlackError; end class Ratelimit < SlackError; end class Ratelimited < SlackError; end @@ -618,6 +632,7 @@ class TooManyMembers < SlackError; end class TooManyNamedEntities < SlackError; end class TooManyPins < SlackError; end class TooManyReactions < SlackError; end + class TooManyTabs < SlackError; end class TooManyTargetTeams < SlackError; end class TooManyTeams < SlackError; end class TooManyTeamsProvided < SlackError; end @@ -674,6 +689,7 @@ class UserSessionResetFailed < SlackError; end class UsergroupNotFound < SlackError; end class UsergroupNotLinkedToTeam < SlackError; end class UsergroupTeamNotProvisioned < SlackError; end + class UsernameSame < SlackError; end class UsersListNotSupplied < SlackError; end class UsersNotFound < SlackError; end class ValidationErrors < SlackError; end @@ -789,6 +805,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'canvas_globally_disabled' => CanvasGloballyDisabled, 'canvas_not_found' => CanvasNotFound, 'canvas_tab_creation_failed' => CanvasTabCreationFailed, + 'channel_already_exists' => ChannelAlreadyExists, 'channel_archived' => ChannelArchived, 'channel_cannot_be_unshared' => ChannelCannotBeUnshared, 'channel_canvas_already_exists' => ChannelCanvasAlreadyExists, @@ -814,6 +831,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'connected_user_denied' => ConnectedUserDenied, 'connection_limit_exceeded' => ConnectionLimitExceeded, 'connection_limit_exceeded_pending' => ConnectionLimitExceededPending, + 'context_channel_not_found' => ContextChannelNotFound, 'could_not_archive_channel' => CouldNotArchiveChannel, 'could_not_convert_channel' => CouldNotConvertChannel, 'could_not_create_channel' => CouldNotCreateChannel, @@ -919,6 +937,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'feature_not_available' => FeatureNotAvailable, 'feature_not_enabled' => FeatureNotEnabled, 'fetch_members_failed' => FetchMembersFailed, + 'file_already_added' => FileAlreadyAdded, 'file_comment_not_found' => FileCommentNotFound, 'file_deleted' => FileDeleted, 'file_deleting_disabled' => FileDeletingDisabled, @@ -933,7 +952,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end '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_create_non_tabbed_canvases' => FreeTeamsCannotCreateNonTabbedCanvases, 'free_teams_cannot_edit_standalone_canvases' => FreeTeamsCannotEditStandaloneCanvases, 'function_execution_not_found' => FunctionExecutionNotFound, 'function_not_found' => FunctionNotFound, @@ -949,6 +968,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'insecure_request' => InsecureRequest, 'internal_error' => InternalError, 'invalid_action' => InvalidAction, + 'invalid_action_token' => InvalidActionToken, 'invalid_actor' => InvalidActor, 'invalid_app' => InvalidApp, 'invalid_app_action_type' => InvalidAppActionType, @@ -1003,6 +1023,8 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_name_required' => InvalidNameRequired, 'invalid_name_specials' => InvalidNameSpecials, 'invalid_named_entities' => InvalidNamedEntities, + 'invalid_ooo_message' => InvalidOooMessage, + 'invalid_org_id' => InvalidOrgId, 'invalid_outputs' => InvalidOutputs, 'invalid_parameters' => InvalidParameters, 'invalid_parent_type' => InvalidParentType, @@ -1029,6 +1051,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'invalid_sort_dir' => InvalidSortDir, 'invalid_source' => InvalidSource, 'invalid_start_time' => InvalidStartTime, + 'invalid_starts_with_at' => InvalidStartsWithAt, 'invalid_step_status' => InvalidStepStatus, 'invalid_target_team' => InvalidTargetTeam, 'invalid_team' => InvalidTeam, @@ -1079,6 +1102,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'legacy_connection_limit_exceeded' => LegacyConnectionLimitExceeded, 'limit_required' => LimitRequired, 'link_not_found' => LinkNotFound, + 'list_record_comment_fetch_failed' => ListRecordCommentFetchFailed, 'malware_detected' => MalwareDetected, 'managed_channel_not_supported' => ManagedChannelNotSupported, 'markdown_text_conflict' => MarkdownTextConflict, @@ -1104,6 +1128,8 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'missing_file_data' => MissingFileData, 'missing_post_type' => MissingPostType, 'missing_profile_id' => MissingProfileId, + 'missing_query' => MissingQuery, + 'missing_record_channel_config' => MissingRecordChannelConfig, 'missing_resource' => MissingResource, 'missing_scope' => MissingScope, 'missing_source' => MissingSource, @@ -1128,6 +1154,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'name_taken_in_org' => NameTakenInOrg, 'name_too_long' => NameTooLong, 'named_entities_cannot_be_empty' => NamedEntitiesCannotBeEmpty, + 'no_access' => NoAccess, 'no_active_sessions' => NoActiveSessions, 'no_alias_selected' => NoAliasSelected, 'no_bot_user_for_app' => NoBotUserForApp, @@ -1179,6 +1206,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'not_in_team' => NotInTeam, 'not_owner' => NotOwner, 'not_paid' => NotPaid, + 'not_permitted' => NotPermitted, 'not_pinnable' => NotPinnable, 'not_pinned' => NotPinned, 'not_reactable' => NotReactable, @@ -1213,9 +1241,11 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'primary_usergroup_not_found' => PrimaryUsergroupNotFound, 'profile_set_failed' => ProfileSetFailed, 'providers_not_found' => ProvidersNotFound, + 'public_file_type_not_allowed' => PublicFileTypeNotAllowed, 'public_video_not_allowed' => PublicVideoNotAllowed, 'published_app_only' => PublishedAppOnly, 'push_limit_reached' => PushLimitReached, + 'query_too_long' => QueryTooLong, 'rate_limited' => RateLimited, 'ratelimit' => Ratelimit, 'ratelimited' => Ratelimited, @@ -1295,6 +1325,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'too_many_named_entities' => TooManyNamedEntities, 'too_many_pins' => TooManyPins, 'too_many_reactions' => TooManyReactions, + 'too_many_tabs' => TooManyTabs, 'too_many_target_teams' => TooManyTargetTeams, 'too_many_teams' => TooManyTeams, 'too_many_teams_provided' => TooManyTeamsProvided, @@ -1351,6 +1382,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'usergroup_not_found' => UsergroupNotFound, 'usergroup_not_linked_to_team' => UsergroupNotLinkedToTeam, 'usergroup_team_not_provisioned' => UsergroupTeamNotProvisioned, + 'username_same' => UsernameSame, 'users_list_not_supplied' => UsersListNotSupplied, 'users_not_found' => UsersNotFound, 'validation_errors' => ValidationErrors, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 1ee282e7..c4089352 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 1ee282e7152690f8b138ad1f7b0bffe22f677cf7 +Subproject commit c4089352af821172f163c02c7843f810c73564b4 diff --git a/spec/slack/web/api/endpoints/admin_conversations_spec.rb b/spec/slack/web/api/endpoints/admin_conversations_spec.rb index 181c6114..b4797fac 100644 --- a/spec/slack/web/api/endpoints/admin_conversations_spec.rb +++ b/spec/slack/web/api/endpoints/admin_conversations_spec.rb @@ -46,6 +46,14 @@ expect { client.admin_conversations_create(is_private: %q[true]) }.to raise_error ArgumentError, /Required arguments :name missing/ end end + context 'admin.conversations_createForObjects' do + it 'requires object_id' do + expect { client.admin_conversations_createForObjects(salesforce_org_id: %q[00DGC00000024hsuWY]) }.to raise_error ArgumentError, /Required arguments :object_id missing/ + end + it 'requires salesforce_org_id' do + expect { client.admin_conversations_createForObjects(object_id: %q[0019000000DmehKAAR]) }.to raise_error ArgumentError, /Required arguments :salesforce_org_id missing/ + end + end context 'admin.conversations_delete' do it 'requires channel_id' do expect { client.admin_conversations_delete }.to raise_error ArgumentError, /Required arguments :channel_id missing/ diff --git a/spec/slack/web/api/endpoints/assistant_search_spec.rb b/spec/slack/web/api/endpoints/assistant_search_spec.rb new file mode 100644 index 00000000..732925b8 --- /dev/null +++ b/spec/slack/web/api/endpoints/assistant_search_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AssistantSearch do + let(:client) { Slack::Web::Client.new } + context 'assistant.search_context' do + it 'requires query' do + expect { client.assistant_search_context }.to raise_error ArgumentError, /Required arguments :query missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/conversations_spec.rb b/spec/slack/web/api/endpoints/conversations_spec.rb index 609bdce7..09935596 100644 --- a/spec/slack/web/api/endpoints/conversations_spec.rb +++ b/spec/slack/web/api/endpoints/conversations_spec.rb @@ -65,10 +65,7 @@ end context 'conversations_kick' do it 'requires channel' do - expect { client.conversations_kick(user: %q[W1234567890]) }.to raise_error ArgumentError, /Required arguments :channel missing/ - end - it 'requires user' do - expect { client.conversations_kick(channel: %q[C1234567890]) }.to raise_error ArgumentError, /Required arguments :user missing/ + expect { client.conversations_kick }.to raise_error ArgumentError, /Required arguments :channel missing/ end end context 'conversations_leave' do diff --git a/spec/slack/web/api/endpoints/files_spec.rb b/spec/slack/web/api/endpoints/files_spec.rb index 773c13b0..af18c76b 100644 --- a/spec/slack/web/api/endpoints/files_spec.rb +++ b/spec/slack/web/api/endpoints/files_spec.rb @@ -9,6 +9,10 @@ it 'requires files' do expect { client.files_completeUploadExternal }.to raise_error ArgumentError, /Required arguments :files missing/ end + it 'encodes blocks as json' do + expect(client).to receive(:post).with('files.completeUploadExternal', {files: %q[[{"id":"F044GKUHN9Z", "title":"slack-test"}]], blocks: %q[{"data":["data"]}]}) + client.files_completeUploadExternal(files: %q[[{"id":"F044GKUHN9Z", "title":"slack-test"}]], blocks: {:data=>["data"]}) + end end context 'files_delete' do it 'requires file' do