Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API from slack-api-ref@1ee282e #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 2.5.3 (Next)

* [#549](https://github.com/slack-ruby/slack-ruby-client/pull/549): Add group ID formatting support for message mentions - [@n0h0](https://github.com/n0h0).
* [#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)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions bin/commands/assistant_search.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions bin/commands/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.'
Expand Down
10 changes: 6 additions & 4 deletions bin/commands/functions_distributions_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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))
Expand Down
1 change: 0 additions & 1 deletion bin/commands/usergroups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -141,6 +142,7 @@ module Endpoints
include AppsDatastore
include AppsEventAuthorizations
include AppsManifest
include AssistantSearch
include AssistantThreads
include Auth
include AuthTeams
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,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 = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
44 changes: 44 additions & 0 deletions lib/slack/web/api/endpoints/assistant_search.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion lib/slack/web/api/endpoints/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions lib/slack/web/api/endpoints/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions lib/slack/web/api/endpoints/usergroups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
Loading