Skip to content

Commit

Permalink
Update API from slack-api-ref@3ec3c10 (2024-10-26)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Oct 26, 2024
1 parent 56995cc commit 0a8f60b
Show file tree
Hide file tree
Showing 26 changed files with 437 additions and 32 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
21 changes: 21 additions & 0 deletions bin/commands/admin_recordChannels.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AdminRecordchannels methods.'
command 'admin_recordChannels' do |g|
g.desc 'Unlink a Salesforce Record from channel'
g.long_desc %( Unlink a Salesforce Record from channel )
g.command 'unlink' do |c|
c.flag 'channel', desc: 'Salesforce Chanel ID to be unlinked from Salesforce Record.'
c.flag 'new_name', desc: 'The new name of the channel.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_recordChannels_unlink(options))
end
end
end
end
end
end
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
46 changes: 46 additions & 0 deletions bin/commands/assistant_threads.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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.flag 'is_send_allowed', desc: 'Whether or not the user is allowed to send a message while the status is being displayed.'
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.'
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
10 changes: 5 additions & 5 deletions bin/commands/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down 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
6 changes: 6 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
require_relative 'endpoints/admin_inviteRequests'
require_relative 'endpoints/admin_inviteRequests_approved'
require_relative 'endpoints/admin_inviteRequests_denied'
require_relative 'endpoints/admin_recordChannels'
require_relative 'endpoints/admin_roles'
require_relative 'endpoints/admin_teams'
require_relative 'endpoints/admin_teams_admins'
Expand All @@ -41,6 +42,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 +57,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 @@ -118,6 +121,7 @@ module Endpoints
include AdminInviterequests
include AdminInviterequestsApproved
include AdminInviterequestsDenied
include AdminRecordchannels
include AdminRoles
include AdminTeams
include AdminTeamsAdmins
Expand All @@ -139,6 +143,7 @@ module Endpoints
include AppsDatastore
include AppsEventAuthorizations
include AppsManifest
include AssistantThreads
include Auth
include AuthTeams
include Bookmarks
Expand All @@ -153,6 +158,7 @@ module Endpoints
include Conversations
include ConversationsCanvases
include ConversationsExternalinvitepermissions
include ConversationsRequestsharedinvite
include Dialog
include Dnd
include Emoji
Expand Down
28 changes: 28 additions & 0 deletions lib/slack/web/api/endpoints/admin_recordChannels.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AdminRecordchannels
#
# Unlink a Salesforce Record from channel
#
# @option options [channel] :channel
# Salesforce Chanel ID to be unlinked from Salesforce Record.
# @option options [string] :new_name
# The new name of the channel.
# @see https://api.slack.com/methods/admin.recordChannels.unlink
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.recordChannels/admin.recordChannels.unlink.json
def admin_recordChannels_unlink(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.recordChannels.unlink', options)
end
end
end
end
end
end
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
Loading

0 comments on commit 0a8f60b

Please sign in to comment.