Skip to content

Commit ea8e6a7

Browse files
committed
Update API from slack-api-ref@1ee282e (2025-02-26)
1 parent f2423d4 commit ea8e6a7

13 files changed

+110
-12
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### 2.5.3 (Next)
22

33
* [#549](https://github.com/slack-ruby/slack-ruby-client/pull/549): Add group ID formatting support for message mentions - [@n0h0](https://github.com/n0h0).
4+
* [#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).
45
* Your contribution here.
56

67
### 2.5.2 (2025/02/19)

bin/commands/admin_conversations.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class App
219219
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
220220
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
221221
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.'
222-
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
222+
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.'
223223
c.action do |_global_options, options, _args|
224224
puts JSON.dump(@client.admin_conversations_setTeams(options))
225225
end

bin/commands/assistant_search.rb

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
module Slack
5+
module Cli
6+
class App
7+
desc 'AssistantSearch methods.'
8+
command 'assistant_search' do |g|
9+
g.desc 'Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.'
10+
g.long_desc %( Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval. )
11+
g.command 'context' do |c|
12+
c.flag 'query', desc: 'User prompt or search query.'
13+
c.flag 'action_token', desc: 'Send action_token as received in a message event.'
14+
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.'
15+
c.flag 'content_types', desc: 'Content types to include, a comma-separated list of any combination of messages, files.'
16+
c.flag 'context_channel_id', desc: 'Context channel ID to support scoping the search when applicable.'
17+
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.'
18+
c.flag 'include_bots', desc: 'If you want the results to include bots.'
19+
c.flag 'limit', desc: 'Number of results to return, up to a max of 20. Defaults to 20.'
20+
c.action do |_global_options, options, _args|
21+
puts JSON.dump(@client.assistant_search_context(options))
22+
end
23+
end
24+
end
25+
end
26+
end
27+
end

bin/commands/functions_distributions_permissions.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class App
1818
end
1919
end
2020

21-
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'
22-
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 )
21+
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'
22+
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 )
2323
g.command 'list' do |c|
2424
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
2525
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
@@ -41,13 +41,15 @@ class App
4141
end
4242
end
4343

44-
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'
45-
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 )
44+
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'
45+
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 )
4646
g.command 'set' do |c|
4747
c.flag 'permission_type', desc: 'The type of permission that defines how the function can be distributed.'
4848
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
4949
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
5050
c.flag 'function_id', desc: 'The encoded ID of the function.'
51+
c.flag 'org_ids', desc: 'List of org IDs to allow for named_entities permission.'
52+
c.flag 'team_ids', desc: 'List of team IDs to allow for named_entities permission.'
5153
c.flag 'user_ids', desc: 'List of encoded user IDs.'
5254
c.action do |_global_options, options, _args|
5355
puts JSON.dump(@client.functions_distributions_permissions_set(options))

bin/commands/usergroups.rb

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class App
5151
c.flag 'include_disabled', desc: 'Include disabled User Groups.'
5252
c.flag 'include_users', desc: 'Include the list of users for each User Group.'
5353
c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
54-
c.flag 'usergroup_id', desc: 'The id of the usergroup you would like to filter the results down to.'
5554
c.action do |_global_options, options, _args|
5655
puts JSON.dump(@client.usergroups_list(options))
5756
end

lib/slack/web/api/endpoints.rb

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
require_relative 'endpoints/apps_datastore'
4242
require_relative 'endpoints/apps_event_authorizations'
4343
require_relative 'endpoints/apps_manifest'
44+
require_relative 'endpoints/assistant_search'
4445
require_relative 'endpoints/assistant_threads'
4546
require_relative 'endpoints/auth'
4647
require_relative 'endpoints/auth_teams'
@@ -141,6 +142,7 @@ module Endpoints
141142
include AppsDatastore
142143
include AppsEventAuthorizations
143144
include AppsManifest
145+
include AssistantSearch
144146
include AssistantThreads
145147
include Auth
146148
include AuthTeams

lib/slack/web/api/endpoints/admin_conversations.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def admin_conversations_setCustomRetention(options = {})
338338
# @option options [array] :target_team_ids
339339
# A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
340340
# @option options [Object] :team_id
341-
# The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
341+
# 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.
342342
# @see https://api.slack.com/methods/admin.conversations.setTeams
343343
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json
344344
def admin_conversations_setTeams(options = {})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
module Slack
5+
module Web
6+
module Api
7+
module Endpoints
8+
module AssistantSearch
9+
#
10+
# Searches messages across your Slack organization—perfect for broad, specific, and real-time data retrieval.
11+
#
12+
# @option options [string] :query
13+
# User prompt or search query.
14+
# @option options [string] :action_token
15+
# Send action_token as received in a message event.
16+
# @option options [array] :channel_types
17+
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
18+
# @option options [array] :content_types
19+
# Content types to include, a comma-separated list of any combination of messages, files.
20+
# @option options [Object] :context_channel_id
21+
# Context channel ID to support scoping the search when applicable.
22+
# @option options [string] :cursor
23+
# The cursor returned by the API. Leave this blank for the first request, and use this to get the next page of results.
24+
# @option options [boolean] :include_bots
25+
# If you want the results to include bots.
26+
# @option options [integer] :limit
27+
# Number of results to return, up to a max of 20. Defaults to 20.
28+
# @see https://api.slack.com/methods/assistant.search.context
29+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.search/assistant.search.context.json
30+
def assistant_search_context(options = {})
31+
raise ArgumentError, 'Required arguments :query missing' if options[:query].nil?
32+
if block_given?
33+
Pagination::Cursor.new(self, :assistant_search_context, options).each do |page|
34+
yield page
35+
end
36+
else
37+
post('assistant.search.context', options)
38+
end
39+
end
40+
end
41+
end
42+
end
43+
end
44+
end

lib/slack/web/api/endpoints/functions_distributions_permissions.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def functions_distributions_permissions_add(options = {})
2424
end
2525

2626
#
27-
# List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities
27+
# 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
2828
#
2929
# @option options [string] :function_app_id
3030
# The encoded ID of the app.
@@ -56,7 +56,7 @@ def functions_distributions_permissions_remove(options = {})
5656
end
5757

5858
#
59-
# 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
59+
# 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
6060
#
6161
# @option options [enum] :permission_type
6262
# The type of permission that defines how the function can be distributed.
@@ -66,6 +66,10 @@ def functions_distributions_permissions_remove(options = {})
6666
# The callback ID defined in the function's definition file.
6767
# @option options [string] :function_id
6868
# The encoded ID of the function.
69+
# @option options [array] :org_ids
70+
# List of org IDs to allow for named_entities permission.
71+
# @option options [array] :team_ids
72+
# List of team IDs to allow for named_entities permission.
6973
# @option options [array] :user_ids
7074
# List of encoded user IDs.
7175
# @see https://api.slack.com/methods/functions.distributions.permissions.set

lib/slack/web/api/endpoints/usergroups.rb

-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ def usergroups_enable(options = {})
7575
# Include the list of users for each User Group.
7676
# @option options [string] :team_id
7777
# encoded team id to list user groups in, required if org token is used.
78-
# @option options [Object] :usergroup_id
79-
# The id of the usergroup you would like to filter the results down to.
8078
# @see https://api.slack.com/methods/usergroups.list
8179
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
8280
def usergroups_list(options = {})

lib/slack/web/api/errors.rb

+8
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end
137137
class ConnectedUserDenied < SlackError; end
138138
class ConnectionLimitExceeded < SlackError; end
139139
class ConnectionLimitExceededPending < SlackError; end
140+
class ContextChannelNotFound < SlackError; end
140141
class CouldNotArchiveChannel < SlackError; end
141142
class CouldNotConvertChannel < SlackError; end
142143
class CouldNotCreateChannel < SlackError; end
@@ -272,6 +273,7 @@ class IncludeDeactivatedUserWorkspacesInvalid < SlackError; end
272273
class InsecureRequest < SlackError; end
273274
class InternalError < SlackError; end
274275
class InvalidAction < SlackError; end
276+
class InvalidActionToken < SlackError; end
275277
class InvalidActor < SlackError; end
276278
class InvalidApp < SlackError; end
277279
class InvalidAppActionType < SlackError; end
@@ -427,6 +429,7 @@ class MissingDuration < SlackError; end
427429
class MissingFileData < SlackError; end
428430
class MissingPostType < SlackError; end
429431
class MissingProfileId < SlackError; end
432+
class MissingQuery < SlackError; end
430433
class MissingResource < SlackError; end
431434
class MissingScope < SlackError; end
432435
class MissingSource < SlackError; end
@@ -539,6 +542,7 @@ class ProvidersNotFound < SlackError; end
539542
class PublicVideoNotAllowed < SlackError; end
540543
class PublishedAppOnly < SlackError; end
541544
class PushLimitReached < SlackError; end
545+
class QueryTooLong < SlackError; end
542546
class RateLimited < SlackError; end
543547
class Ratelimit < SlackError; end
544548
class Ratelimited < SlackError; end
@@ -814,6 +818,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
814818
'connected_user_denied' => ConnectedUserDenied,
815819
'connection_limit_exceeded' => ConnectionLimitExceeded,
816820
'connection_limit_exceeded_pending' => ConnectionLimitExceededPending,
821+
'context_channel_not_found' => ContextChannelNotFound,
817822
'could_not_archive_channel' => CouldNotArchiveChannel,
818823
'could_not_convert_channel' => CouldNotConvertChannel,
819824
'could_not_create_channel' => CouldNotCreateChannel,
@@ -949,6 +954,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
949954
'insecure_request' => InsecureRequest,
950955
'internal_error' => InternalError,
951956
'invalid_action' => InvalidAction,
957+
'invalid_action_token' => InvalidActionToken,
952958
'invalid_actor' => InvalidActor,
953959
'invalid_app' => InvalidApp,
954960
'invalid_app_action_type' => InvalidAppActionType,
@@ -1104,6 +1110,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
11041110
'missing_file_data' => MissingFileData,
11051111
'missing_post_type' => MissingPostType,
11061112
'missing_profile_id' => MissingProfileId,
1113+
'missing_query' => MissingQuery,
11071114
'missing_resource' => MissingResource,
11081115
'missing_scope' => MissingScope,
11091116
'missing_source' => MissingSource,
@@ -1216,6 +1223,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
12161223
'public_video_not_allowed' => PublicVideoNotAllowed,
12171224
'published_app_only' => PublishedAppOnly,
12181225
'push_limit_reached' => PushLimitReached,
1226+
'query_too_long' => QueryTooLong,
12191227
'rate_limited' => RateLimited,
12201228
'ratelimit' => Ratelimit,
12211229
'ratelimited' => Ratelimited,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
require 'spec_helper'
5+
6+
RSpec.describe Slack::Web::Api::Endpoints::AssistantSearch do
7+
let(:client) { Slack::Web::Client.new }
8+
context 'assistant.search_context' do
9+
it 'requires query' do
10+
expect { client.assistant_search_context }.to raise_error ArgumentError, /Required arguments :query missing/
11+
end
12+
end
13+
end

0 commit comments

Comments
 (0)