Skip to content

Commit

Permalink
Update API from slack-api-ref@bc54564 (2024-01-30)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Jan 30, 2024
1 parent 015f615 commit 6c0a641
Show file tree
Hide file tree
Showing 28 changed files with 150 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle).
* [#503](https://github.com/slack-ruby/slack-ruby-client/pull/503): Update Slack API Update API from [slack-api-ref@bc545649](https://github.com/slack-ruby/slack-api-ref/commit/bc545649) - [@dblock](https://github.com/dblock).
* [#504](https://github.com/slack-ruby-client/pulls/504): Update API from [slack-api-ref@bc54564](https://github.com/slack-ruby/slack-api-ref/commit/bc54564) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 2.2.0 (2023/09/17)
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 @@ -18,7 +18,7 @@ class App
g.desc 'Archive public or private channels in bulk.'
g.long_desc %( Archive public or private channels in bulk. )
g.command 'bulkArchive' do |c|
c.flag 'channel_ids', desc: 'An array of channel IDs to archive.'
c.flag 'channel_ids', desc: 'An array of channel IDs to archive. No more than 100 items are allowed.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_conversations_bulkArchive(options))
end
Expand Down
3 changes: 1 addition & 2 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class App
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.'
c.flag 'service_team_id', desc: 'For a message posted in App Home, Team ID corresponding to the selected app installation.'
c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
Expand All @@ -108,7 +107,7 @@ class App
g.long_desc %( Schedules a message to be sent to a channel. )
g.command 'scheduleMessage' do |c|
c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
c.flag 'post_at', desc: 'Unix timestamp representing the future time the message should post to Slack.'
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.'
Expand Down
1 change: 1 addition & 0 deletions bin/commands/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class App
g.command 'invite' do |c|
c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
c.flag 'force', desc: 'When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.conversations_invite(options))
end
Expand Down
31 changes: 31 additions & 0 deletions bin/commands/functions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'Functions methods.'
command 'functions' do |g|
g.desc 'Signal that a function failed to complete'
g.long_desc %( Signal that a function failed to complete )
g.command 'completeError' do |c|
c.flag 'error', desc: 'A human-readable error message that contains information about why the function failed to complete.'
c.flag 'function_execution_id', desc: 'Context identifier that maps to the executed function.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_completeError(options))
end
end

g.desc 'Signal the successful completion of a function'
g.long_desc %( Signal the successful completion of a function )
g.command 'completeSuccess' do |c|
c.flag 'function_execution_id', desc: 'Context identifier that maps to the executed function.'
c.flag 'outputs', desc: 'A JSON-based object that conforms to the output parameters schema for the custom function defined in the manifest.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_completeSuccess(options))
end
end
end
end
end
end
1 change: 0 additions & 1 deletion bin/commands/pins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class App
g.long_desc %( Pins an item to a channel. )
g.command 'add' do |c|
c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
c.flag 'quip_component_id', desc: 'Component ID for the pins component that was inserted into the channel canvas, if any.'
c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.pins_add(options))
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class App
g.desc 'Gets information about the current team.'
g.long_desc %( Gets information about the current team. )
g.command 'info' do |c|
c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
c.flag 'domain', desc: "Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself. This is the value set up for the 'Joining This Workspace' workspace setting. If it contains more than one domain, the field will contain multiple comma-separated domain values. If no domain is set, the field is empty."
c.flag 'team', desc: 'Team to get info about; if omitted, will return information about the current team.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.team_info(options))
Expand Down
10 changes: 5 additions & 5 deletions bin/commands/usergroups_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class App
end
end

g.desc 'Update the list of users for a User Group.'
g.long_desc %( Update the list of users for a User Group. )
g.desc 'Update the list of users for a user group.'
g.long_desc %( Update the list of users for a user group. )
g.command 'update' do |c|
c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.'
c.flag 'include_count', desc: 'Include the number of users in the User Group.'
c.flag 'usergroup', desc: 'The encoded ID of the user group to update.'
c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the user group.'
c.flag 'include_count', desc: 'Include the number of users in the user group.'
c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.usergroups_users_update(options))
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 @@ -55,6 +55,7 @@
require_relative 'endpoints/files'
require_relative 'endpoints/files_comments'
require_relative 'endpoints/files_remote'
require_relative 'endpoints/functions'
require_relative 'endpoints/functions_workflows_steps'
require_relative 'endpoints/functions_workflows_steps_responses'
require_relative 'endpoints/migration'
Expand Down Expand Up @@ -142,6 +143,7 @@ module Endpoints
include Files
include FilesComments
include FilesRemote
include Functions
include FunctionsWorkflowsSteps
include FunctionsWorkflowsStepsResponses
include Migration
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_apps_activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module AdminAppsActivities
# The earliest timestamp of the log to retrieve (epoch microseconds).
# @option options [string] :min_log_level
# The minimum log level of the log events to be returned. Defaults to info. Acceptable values (in order of relative importance from smallest to largest) are trace, debug, info, warn, error and fatal.
# @option options [string] :sort_direction
# @option options [enum] :sort_direction
# The direction you want the data sorted by (always by timestamp).
# @option options [string] :source
# The source of log events to be returned. Acceptable values are slack and developer.
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_apps_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def admin_apps_config_lookup(options = {})
# The encoded app ID to set the app config for.
# @option options [object] :domain_restrictions
# Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively.
# @option options [string] :workflow_auth_strategy
# @option options [enum] :workflow_auth_strategy
# The workflow auth permission. Can be one of builder_choice or end_user_only.
# @see https://api.slack.com/methods/admin.apps.config.set
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.set.json
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 @@ -22,7 +22,7 @@ def admin_conversations_archive(options = {})
# Archive public or private channels in bulk.
#
# @option options [array] :channel_ids
# An array of channel IDs to archive.
# An array of channel IDs to archive. No more than 100 items are allowed.
# @see https://api.slack.com/methods/admin.conversations.bulkArchive
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.bulkArchive.json
def admin_conversations_bulkArchive(options = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_functions_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def admin_functions_permissions_lookup(options = {})
#
# @option options [string] :function_id
# The function ID to set permissions for.
# @option options [string] :visibility
# @option options [enum] :visibility
# The function visibility.
# @option options [array] :user_ids
# List of user IDs to allow for named_entities visibility.
Expand Down
6 changes: 3 additions & 3 deletions lib/slack/web/api/endpoints/admin_workflows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ module AdminWorkflows
# Number of trigger IDs to fetch for each workflow; default is 0.
# @option options [string] :query
# A search query to filter for workflow name or description.
# @option options [string] :sort
# @option options [enum] :sort
# The field used to sort the returned workflows.
# @option options [string] :sort_dir
# @option options [enum] :sort_dir
# Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).
# @option options [string] :source
# @option options [enum] :source
# Source of workflow creation, either from code or workflow builder.
# @see https://api.slack.com/methods/admin.workflows.search
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows/admin.workflows.search.json
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/apps_activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module AppsActivities
# The earliest timestamp of the log to retrieve (epoch microseconds).
# @option options [string] :min_log_level
# The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal').
# @option options [string] :sort_direction
# @option options [enum] :sort_direction
# The direction you want the data sorted by (always by timestamp).
# @option options [string] :source
# The source of log events to be returned. Acceptable values are ('slack', 'developer').
Expand Down
8 changes: 3 additions & 5 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ def chat_postEphemeral(options = {})
# Change how messages are treated. See below.
# @option options [boolean] :reply_broadcast
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
# @option options [string] :service_team_id
# For a message posted in App Home, Team ID corresponding to the selected app installation.
# @option options [string] :thread_ts
# Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
# @option options [boolean] :unfurl_links
Expand All @@ -181,7 +179,7 @@ def chat_postMessage(options = {})
# @option options [channel] :channel
# Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
# @option options [integer] :post_at
# Unix EPOCH timestamp of time in future to send the message.
# Unix timestamp representing the future time the message should post to Slack.
# @option options [string] :attachments
# A JSON-based array of structured attachments, presented as a URL-encoded string.
# @option options [blocks[] as string] :blocks
Expand All @@ -194,7 +192,7 @@ def chat_postMessage(options = {})
# Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
# @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.
# @option options [string] :parse
# @option options [enum] :parse
# Change how messages are treated. See chat.postMessage.
# @option options [boolean] :reply_broadcast
# 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 @@ -223,7 +221,7 @@ def chat_scheduleMessage(options = {})
# Timestamp of the message to add unfurl behavior to.
# @option options [string] :unfurls
# URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.
# @option options [string] :source
# @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] :unfurl_id
# The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.
Expand Down
2 changes: 2 additions & 0 deletions lib/slack/web/api/endpoints/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def conversations_info(options = {})
# The ID of the public or private channel to invite user(s) to.
# @option options [string] :users
# A comma separated list of user IDs. Up to 1000 users may be listed.
# @option options [boolean] :force
# When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.
# @see https://api.slack.com/methods/conversations.invite
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
def conversations_invite(options = {})
Expand Down
43 changes: 43 additions & 0 deletions lib/slack/web/api/endpoints/functions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module Functions
#
# Signal that a function failed to complete
#
# @option options [string] :error
# A human-readable error message that contains information about why the function failed to complete.
# @option options [string] :function_execution_id
# Context identifier that maps to the executed function.
# @see https://api.slack.com/methods/functions.completeError
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions/functions.completeError.json
def functions_completeError(options = {})
raise ArgumentError, 'Required arguments :error missing' if options[:error].nil?
raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
post('functions.completeError', options)
end

#
# Signal the successful completion of a function
#
# @option options [string] :function_execution_id
# Context identifier that maps to the executed function.
# @option options [object] :outputs
# A JSON-based object that conforms to the output parameters schema for the custom function defined in the manifest.
# @see https://api.slack.com/methods/functions.completeSuccess
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions/functions.completeSuccess.json
def functions_completeSuccess(options = {})
raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
raise ArgumentError, 'Required arguments :outputs missing' if options[:outputs].nil?
options = encode_options_as_json(options, %i[outputs])
post('functions.completeSuccess', options)
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/openid_connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module OpenidConnect
# Issued when you created your application.
# @option options [string] :code
# The code param returned via the OAuth callback.
# @option options [string] :grant_type
# @option options [enum] :grant_type
# The grant_type param as described in the OAuth spec.
# @option options [string] :redirect_uri
# This must match the originally submitted URI (if one was sent).
Expand Down
2 changes: 0 additions & 2 deletions lib/slack/web/api/endpoints/pins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module Pins
#
# @option options [channel] :channel
# Channel to pin the messsage to. You must also include a timestamp when pinning messages.
# @option options [string] :quip_component_id
# Component ID for the pins component that was inserted into the channel canvas, if any.
# @option options [string] :timestamp
# Timestamp of the message to pin. You must also include the channel.
# @see https://api.slack.com/methods/pins.add
Expand Down
Loading

0 comments on commit 6c0a641

Please sign in to comment.