Skip to content

Commit

Permalink
Update API from slack-api-ref@3ec3c10 (2024-10-14)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Oct 14, 2024
1 parent 56995cc commit 6944ce9
Show file tree
Hide file tree
Showing 23 changed files with 365 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 2.4.1 (Next)

* [#525](https://github.com/slack-ruby/slack-ruby-client/pull/525): Exclude spec files from gem package - [@amatsuda](https://github.com/amatsuda).
* [#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)
Expand Down
1 change: 1 addition & 0 deletions bin/commands/admin_users_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
45 changes: 45 additions & 0 deletions bin/commands/assistant_threads.rb
Original file line number Diff line number Diff line change
@@ -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: '.'
c.flag 'thread_ts', desc: 'Message timestamp of the thread to set suggested prompts for.'
c.flag 'title', desc: 'Title for the prompts. For example: Suggested Prompts, Related questions. This value is currently ignored by the Slack client.'
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
8 changes: 4 additions & 4 deletions bin/commands/canvases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand All @@ -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|
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/conversations_canvases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down
48 changes: 48 additions & 0 deletions bin/commands/conversations_requestSharedInvite.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions bin/commands/usergroups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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.'
Expand Down
4 changes: 4 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_threads'
require_relative 'endpoints/auth'
require_relative 'endpoints/auth_teams'
require_relative 'endpoints/bookmarks'
Expand All @@ -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'
Expand Down Expand Up @@ -139,6 +141,7 @@ module Endpoints
include AppsDatastore
include AppsEventAuthorizations
include AppsManifest
include AssistantThreads
include Auth
include AuthTeams
include Bookmarks
Expand All @@ -153,6 +156,7 @@ module Endpoints
include Conversations
include ConversationsCanvases
include ConversationsExternalinvitepermissions
include ConversationsRequestsharedinvite
include Dialog
include Dnd
include Emoji
Expand Down
6 changes: 4 additions & 2 deletions lib/slack/web/api/endpoints/admin_users_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
68 changes: 68 additions & 0 deletions lib/slack/web/api/endpoints/assistant_threads.rb
Original file line number Diff line number Diff line change
@@ -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
# .
# @option options [string] :thread_ts
# Message timestamp of the thread to set suggested prompts for.
# @option options [string] :title
# Title for the prompts. For example: Suggested Prompts, Related questions. This value is currently ignored by the Slack client.
# @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
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/canvases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 6944ce9

Please sign in to comment.