Skip to content
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,5 +1,6 @@
### 3.1.1 (Next)

* [#578](https://github.com/slack-ruby/slack-ruby-client/pull/578): Update API from [slack-api-ref@3275786](https://github.com/slack-ruby/slack-api-ref/commit/3275786) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 3.1.0 (2025/11/15)
Expand Down
16 changes: 8 additions & 8 deletions bin/commands/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class App
end
end

g.desc 'Set an existing regular user or owner to be a workspace admin.'
g.long_desc %( Set an existing regular user or owner to be a workspace admin. )
g.desc 'Set an existing regular user or owner to be a workspace or org admin.'
g.long_desc %( Set an existing regular user or owner to be a workspace or org admin. )
g.command 'setAdmin' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'team_id', desc: 'The ID of the workspace or organization.'
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setAdmin(options))
Expand All @@ -92,11 +92,11 @@ class App
end
end

g.desc 'Set an existing regular user or admin to be a workspace owner.'
g.long_desc %( Set an existing regular user or admin to be a workspace owner. )
g.desc 'Set an existing regular user or admin to be a workspace or org owner.'
g.long_desc %( Set an existing regular user or admin to be a workspace or org owner. )
g.command 'setOwner' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'Id of the user to promote to owner.'
c.flag 'team_id', desc: 'The ID of the workspace or organization.'
c.flag 'user_id', desc: 'ID of the user to promote to owner.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setOwner(options))
end
Expand All @@ -105,7 +105,7 @@ class App
g.desc 'Set an existing guest user, admin user, or owner to be a regular user.'
g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. )
g.command 'setRegular' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'team_id', desc: 'The ID of the workspace or organization.'
c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setRegular(options))
Expand Down
7 changes: 4 additions & 3 deletions bin/commands/admin_workflows_triggers_types_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module Cli
class App
desc 'AdminWorkflowsTriggersTypesPermissions methods.'
command 'admin_workflows_triggers_types_permissions' do |g|
g.desc 'list the permissions for using each trigger type'
g.long_desc %( list the permissions for using each trigger type )
g.desc 'List the permissions for using each trigger type.'
g.long_desc %( List the permissions for using each trigger type. )
g.command 'lookup' do |c|
c.flag 'trigger_type_ids', desc: 'The trigger types IDs for which to get the permissions.'
c.flag 'trigger_type_ids', desc: 'The trigger type IDs for which to get the permissions.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_triggers_types_permissions_lookup(options))
end
Expand All @@ -21,6 +21,7 @@ class App
c.flag 'id', desc: 'The trigger type ID for which to set the permissions.'
c.flag 'visibility', desc: 'The function visibility.'
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
c.flag 'permissions', desc: ''
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_triggers_types_permissions_set(options))
end
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/assistant_threads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class App
g.command 'setStatus' do |c|
c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.'
c.flag 'thread_ts', desc: 'Message timestamp of the thread of where to set the status.'
c.flag 'status', desc: "Status of the specified bot user, e.g. 'is thinking...'."
c.flag 'loading_messages', desc: 'The list of messages to rotate through as a loading indicator.'
c.flag 'status', desc: "Status of the specified bot user, e.g., 'is thinking...'. A two minute timeout applies, which will cause the status to be removed if no message has been sent."
c.flag 'loading_messages', desc: 'The list of messages to rotate through as a loading indicator. Maximum of 10 messages.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.assistant_threads_setStatus(options))
end
Expand Down
6 changes: 3 additions & 3 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class App
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.'
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.'
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
c.flag 'parse', desc: 'Change how messages are treated. See below.'
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
Expand Down Expand Up @@ -142,7 +142,7 @@ class App
g.desc 'Starts a new streaming conversation.'
g.long_desc %( Starts a new streaming conversation. )
g.command 'startStream' do |c|
c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
c.flag 'channel', desc: 'An encoded ID that represents a channel thread or DM.'
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.'
c.flag 'thread_ts', desc: "Provide another message's ts value to reply to. Streamed messages should always be replies to a user request."
c.flag 'recipient_user_id', desc: 'The encoded ID of the user to receive the streaming text. Required when streaming to channels.'
Expand Down Expand Up @@ -177,7 +177,7 @@ class App
c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
c.flag 'unfurl_id', desc: 'The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.'
c.flag 'source', desc: 'The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.'
c.flag 'metadata', desc: 'JSON object with entity_type and entity_payload fields, presented as a URL-encoded string. Either unfurls or metadata must be provided.'
c.flag 'metadata', desc: 'JSON object with an entities field providing an array of Work Object entities. Either unfurls or metadata must be provided.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.chat_unfurl(options))
end
Expand Down
12 changes: 6 additions & 6 deletions lib/slack/web/api/endpoints/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ def admin_users_remove(options = {})
end

#
# Set an existing regular user or owner to be a workspace admin.
# Set an existing regular user or owner to be a workspace or org admin.
#
# @option options [Object] :team_id
# The ID (T1234) of the workspace.
# The ID of the workspace or organization.
# @option options [string] :user_id
# The ID of the user to designate as an admin.
# @see https://api.slack.com/methods/admin.users.setAdmin
Expand Down Expand Up @@ -147,12 +147,12 @@ def admin_users_setExpiration(options = {})
end

#
# Set an existing regular user or admin to be a workspace owner.
# Set an existing regular user or admin to be a workspace or org owner.
#
# @option options [Object] :team_id
# The ID (T1234) of the workspace.
# The ID of the workspace or organization.
# @option options [Object] :user_id
# Id of the user to promote to owner.
# ID of the user to promote to owner.
# @see https://api.slack.com/methods/admin.users.setOwner
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setOwner.json
def admin_users_setOwner(options = {})
Expand All @@ -165,7 +165,7 @@ def admin_users_setOwner(options = {})
# Set an existing guest user, admin user, or owner to be a regular user.
#
# @option options [Object] :team_id
# The ID (T1234) of the workspace.
# The ID of the workspace or organization.
# @option options [string] :user_id
# The ID of the user to designate as a regular user.
# @see https://api.slack.com/methods/admin.users.setRegular
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module Api
module Endpoints
module AdminWorkflowsTriggersTypesPermissions
#
# list the permissions for using each trigger type
# List the permissions for using each trigger type.
#
# @option options [array] :trigger_type_ids
# The trigger types IDs for which to get the permissions.
# The trigger type IDs for which to get the permissions.
# @see https://api.slack.com/methods/admin.workflows.triggers.types.permissions.lookup
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.triggers.types.permissions/admin.workflows.triggers.types.permissions.lookup.json
def admin_workflows_triggers_types_permissions_lookup(options = {})
Expand All @@ -27,11 +27,11 @@ def admin_workflows_triggers_types_permissions_lookup(options = {})
# The function visibility.
# @option options [array] :user_ids
# List of user IDs to allow for named_entities visibility.
# @option options [object] :permissions
# @see https://api.slack.com/methods/admin.workflows.triggers.types.permissions.set
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.triggers.types.permissions/admin.workflows.triggers.types.permissions.set.json
def admin_workflows_triggers_types_permissions_set(options = {})
raise ArgumentError, 'Required arguments :id missing' if options[:id].nil?
raise ArgumentError, 'Required arguments :visibility missing' if options[:visibility].nil?
post('admin.workflows.triggers.types.permissions.set', options)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/assistant_threads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module AssistantThreads
# @option options [string] :thread_ts
# Message timestamp of the thread of where to set the status.
# @option options [string] :status
# Status of the specified bot user, e.g. 'is thinking...'.
# Status of the specified bot user, e.g., 'is thinking...'. A two minute timeout applies, which will cause the status to be removed if no message has been sent.
# @option options [array] :loading_messages
# The list of messages to rotate through as a loading indicator.
# The list of messages to rotate through as a loading indicator. Maximum of 10 messages.
# @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 = {})
Expand Down
18 changes: 11 additions & 7 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def chat_meMessage(options = {})
def chat_postEphemeral(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
options = encode_options_as_json(options, %i[attachments blocks])
post('chat.postEphemeral', options)
Expand Down Expand Up @@ -172,7 +173,7 @@ def chat_postEphemeral(options = {})
# @option options [string] :markdown_text
# Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.
# @option options [string] :metadata
# JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
# JSON object with event_type and event_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
# @option options [boolean] :mrkdwn
# Disable Slack markup parsing by setting to false. Enabled by default.
# @option options [string] :parse
Expand All @@ -193,7 +194,8 @@ def chat_postEphemeral(options = {})
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
def chat_postMessage(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.postMessage', options)
end
Expand Down Expand Up @@ -234,7 +236,8 @@ def chat_postMessage(options = {})
def chat_scheduleMessage(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :post_at missing' if options[:post_at].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.scheduleMessage', options)
end
Expand All @@ -243,7 +246,7 @@ def chat_scheduleMessage(options = {})
# Starts a new streaming conversation.
#
# @option options [channel] :channel
# An encoded ID that represents a channel, private group, or DM.
# An encoded ID that represents a channel thread or DM.
# @option options [string] :markdown_text
# Accepts message text formatted in markdown. Limit this field to 12,000 characters.
# @option options [string] :thread_ts
Expand Down Expand Up @@ -306,7 +309,7 @@ def chat_stopStream(options = {})
# @option options [enum] :source
# The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.
# @option options [string] :metadata
# JSON object with entity_type and entity_payload fields, presented as a URL-encoded string. Either unfurls or metadata must be provided.
# JSON object with an entities field providing an array of Work Object entities. Either unfurls or metadata must be provided.
# @see https://api.slack.com/methods/chat.unfurl
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.unfurl.json
def chat_unfurl(options = {})
Expand Down Expand Up @@ -347,7 +350,8 @@ def chat_unfurl(options = {})
def chat_update(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.update', options)
Expand Down
Loading