diff --git a/CHANGELOG.md b/CHANGELOG.md index 033257b3..7f2843b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [#494](https://github.com/slack-ruby/slack-ruby-client/pull/494): Configure Dependabot to update GitHub Actions - [@olleolleolle](https://github.com/olleolleolle). * [#508](https://github.com/slack-ruby/slack-ruby-client/pull/508): Fix `Slack::Events::Request#verify!` compatibility with Rack 3.x - [@dblock](https://github.com/dblock). * [#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) diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index a2a27ba0..71d0b28d 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -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 diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 8d50405f..6ab0daa0 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -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.' @@ -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.' diff --git a/bin/commands/conversations.rb b/bin/commands/conversations.rb index e38a6e97..37c1d484 100644 --- a/bin/commands/conversations.rb +++ b/bin/commands/conversations.rb @@ -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 diff --git a/bin/commands/functions.rb b/bin/commands/functions.rb new file mode 100644 index 00000000..c7a2a078 --- /dev/null +++ b/bin/commands/functions.rb @@ -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 diff --git a/bin/commands/pins.rb b/bin/commands/pins.rb index 05e40c5c..67e229f9 100644 --- a/bin/commands/pins.rb +++ b/bin/commands/pins.rb @@ -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)) diff --git a/bin/commands/team.rb b/bin/commands/team.rb index 6359dce5..413874be 100644 --- a/bin/commands/team.rb +++ b/bin/commands/team.rb @@ -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)) diff --git a/bin/commands/usergroups_users.rb b/bin/commands/usergroups_users.rb index 6531db00..70eaab6f 100644 --- a/bin/commands/usergroups_users.rb +++ b/bin/commands/usergroups_users.rb @@ -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)) diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index 47bf6af0..ca7dfc33 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -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' @@ -142,6 +143,7 @@ module Endpoints include Files include FilesComments include FilesRemote + include Functions include FunctionsWorkflowsSteps include FunctionsWorkflowsStepsResponses include Migration diff --git a/lib/slack/web/api/endpoints/admin_apps_activities.rb b/lib/slack/web/api/endpoints/admin_apps_activities.rb index 988c4745..eafba991 100644 --- a/lib/slack/web/api/endpoints/admin_apps_activities.rb +++ b/lib/slack/web/api/endpoints/admin_apps_activities.rb @@ -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. diff --git a/lib/slack/web/api/endpoints/admin_apps_config.rb b/lib/slack/web/api/endpoints/admin_apps_config.rb index ed9f2565..a1270c55 100644 --- a/lib/slack/web/api/endpoints/admin_apps_config.rb +++ b/lib/slack/web/api/endpoints/admin_apps_config.rb @@ -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 diff --git a/lib/slack/web/api/endpoints/admin_conversations.rb b/lib/slack/web/api/endpoints/admin_conversations.rb index 325b494f..93736bab 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -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 = {}) diff --git a/lib/slack/web/api/endpoints/admin_functions_permissions.rb b/lib/slack/web/api/endpoints/admin_functions_permissions.rb index 56a06175..ba459307 100644 --- a/lib/slack/web/api/endpoints/admin_functions_permissions.rb +++ b/lib/slack/web/api/endpoints/admin_functions_permissions.rb @@ -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. diff --git a/lib/slack/web/api/endpoints/admin_workflows.rb b/lib/slack/web/api/endpoints/admin_workflows.rb index 7ebd1338..aa89dd90 100644 --- a/lib/slack/web/api/endpoints/admin_workflows.rb +++ b/lib/slack/web/api/endpoints/admin_workflows.rb @@ -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 diff --git a/lib/slack/web/api/endpoints/apps_activities.rb b/lib/slack/web/api/endpoints/apps_activities.rb index 0f271f66..82a465f4 100644 --- a/lib/slack/web/api/endpoints/apps_activities.rb +++ b/lib/slack/web/api/endpoints/apps_activities.rb @@ -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'). diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 24b46f38..34e041dc 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -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 @@ -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 @@ -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. @@ -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. diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index 8b74d6aa..b10d5242 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -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 = {}) diff --git a/lib/slack/web/api/endpoints/functions.rb b/lib/slack/web/api/endpoints/functions.rb new file mode 100644 index 00000000..e89c0d30 --- /dev/null +++ b/lib/slack/web/api/endpoints/functions.rb @@ -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 diff --git a/lib/slack/web/api/endpoints/openid_connect.rb b/lib/slack/web/api/endpoints/openid_connect.rb index f63face5..3df2387f 100644 --- a/lib/slack/web/api/endpoints/openid_connect.rb +++ b/lib/slack/web/api/endpoints/openid_connect.rb @@ -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). diff --git a/lib/slack/web/api/endpoints/pins.rb b/lib/slack/web/api/endpoints/pins.rb index 75d0cbe2..05e43ccc 100644 --- a/lib/slack/web/api/endpoints/pins.rb +++ b/lib/slack/web/api/endpoints/pins.rb @@ -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 diff --git a/lib/slack/web/api/endpoints/search.rb b/lib/slack/web/api/endpoints/search.rb index ea47a1b3..b59bc404 100644 --- a/lib/slack/web/api/endpoints/search.rb +++ b/lib/slack/web/api/endpoints/search.rb @@ -15,7 +15,7 @@ module Search # Pass a value of true to enable query highlight markers (see below). # @option options [string] :sort # Return matches sorted by either score or timestamp. - # @option options [string] :sort_dir + # @option options [enum] :sort_dir # Change sort direction to ascending (asc) or descending (desc). # @option options [string] :team_id # encoded team id to search in, required if org token is used. @@ -35,7 +35,7 @@ def search_all(options = {}) # Pass a value of true to enable query highlight markers (see below). # @option options [string] :sort # Return matches sorted by either score or timestamp. - # @option options [string] :sort_dir + # @option options [enum] :sort_dir # Change sort direction to ascending (asc) or descending (desc). # @option options [string] :team_id # encoded team id to search in, required if org token is used. @@ -57,7 +57,7 @@ def search_files(options = {}) # Pass a value of true to enable query highlight markers (see below). # @option options [string] :sort # Return matches sorted by either score or timestamp. - # @option options [string] :sort_dir + # @option options [enum] :sort_dir # Change sort direction to ascending (asc) or descending (desc). # @option options [string] :team_id # encoded team id to search in, required if org token is used. diff --git a/lib/slack/web/api/endpoints/team.rb b/lib/slack/web/api/endpoints/team.rb index 54986bb8..edb2b8a8 100644 --- a/lib/slack/web/api/endpoints/team.rb +++ b/lib/slack/web/api/endpoints/team.rb @@ -57,7 +57,7 @@ def team_billableInfo(options = {}) # Gets information about the current team. # # @option options [string] :domain - # 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. + # 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. # @option options [string] :team # Team to get info about; if omitted, will return information about the current team. # @see https://api.slack.com/methods/team.info @@ -71,7 +71,7 @@ def team_info(options = {}) # # @option options [string] :app_id # Filter logs to this Slack app. Defaults to all logs. - # @option options [string] :change_type + # @option options [enum] :change_type # Filter logs with this change type. Possible values are added, removed, enabled, disabled, and updated. Defaults to all logs. # @option options [string] :service_id # Filter logs to this service. Defaults to all logs. diff --git a/lib/slack/web/api/endpoints/team_profile.rb b/lib/slack/web/api/endpoints/team_profile.rb index 1d1a4f39..2b23b34a 100644 --- a/lib/slack/web/api/endpoints/team_profile.rb +++ b/lib/slack/web/api/endpoints/team_profile.rb @@ -9,7 +9,7 @@ module TeamProfile # # Retrieve a team's profile. # - # @option options [string] :visibility + # @option options [enum] :visibility # Filter by visibility. # @see https://api.slack.com/methods/team.profile.get # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.profile/team.profile.get.json diff --git a/lib/slack/web/api/endpoints/usergroups_users.rb b/lib/slack/web/api/endpoints/usergroups_users.rb index 3f64bf93..8c4f4c80 100644 --- a/lib/slack/web/api/endpoints/usergroups_users.rb +++ b/lib/slack/web/api/endpoints/usergroups_users.rb @@ -23,14 +23,14 @@ def usergroups_users_list(options = {}) end # - # Update the list of users for a User Group. + # Update the list of users for a user group. # # @option options [string] :usergroup - # The encoded ID of the User Group to update. + # The encoded ID of the user group to update. # @option options [array] :users - # A comma separated string of encoded user IDs that represent the entire list of users for the User Group. + # A comma separated string of encoded user IDs that represent the entire list of users for the user group. # @option options [boolean] :include_count - # Include the number of users in the User Group. + # Include the number of users in the user group. # @option options [string] :team_id # encoded team id where the user group exists, required if org token is used. # @see https://api.slack.com/methods/usergroups.users.update diff --git a/lib/slack/web/api/endpoints/users.rb b/lib/slack/web/api/endpoints/users.rb index 302404e4..6e500d08 100644 --- a/lib/slack/web/api/endpoints/users.rb +++ b/lib/slack/web/api/endpoints/users.rb @@ -143,7 +143,7 @@ def users_setPhoto(options = {}) # # Manually sets user presence. # - # @option options [string] :presence + # @option options [enum] :presence # Either auto or away. # @see https://api.slack.com/methods/users.setPresence # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPresence.json diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index 3ea4fd1a..24aec502 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -32,6 +32,7 @@ class ApprovalInactive < SlackError; end class ApprovalNotFound < SlackError; end class AsUserNotSupported < SlackError; end class AtLeastOneSessionSettingRequired < SlackError; end + class AttachmentPayloadLimitExceeded < SlackError; end class AuthMismatch < SlackError; end class AuthorizationNotFound < SlackError; end class AutoProvisionFailure < SlackError; end @@ -174,6 +175,7 @@ class ErrorRemovingCollaborators < SlackError; end class ErrorTooBig < SlackError; end class ErrorUnpublishingWorkflows < SlackError; end class ExchangedTriggerId < SlackError; end + class ExecutionNotInRunningState < SlackError; end class ExpiredTriggerId < SlackError; end class ExternalChannelMigrating < SlackError; end class ExternalLimitedRestriction < SlackError; end @@ -231,6 +233,7 @@ class FileUploadsDisabled < SlackError; end class ForbiddenHandle < SlackError; end class ForbiddenTeam < SlackError; end class FreeTeamNotAllowed < SlackError; end + class FunctionExecutionNotFound < SlackError; end class FunctionNotFound < SlackError; end class GroupAlreadyLinkedToChannel < SlackError; end class GroupMustNotBeEmpty < SlackError; end @@ -391,6 +394,7 @@ class MissingProfileId < SlackError; end class MissingResource < SlackError; end class MissingScope < SlackError; end class MissingSource < SlackError; end + class MissingStepIds < SlackError; end class MissingSubteamName < SlackError; end class MissingTargetTeam < SlackError; end class MissingTeam < SlackError; end @@ -474,6 +478,7 @@ class OverPaginationLimit < SlackError; end class PaginationNotAvailable < SlackError; end class PaidOnly < SlackError; end class PaidTeamsOnly < SlackError; end + class ParameterValidationFailed < SlackError; end class ParentBookmarkDisabled < SlackError; end class ParentWithLink < SlackError; end class PartialProfileSetFailed < SlackError; end @@ -649,6 +654,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'approval_not_found' => ApprovalNotFound, 'as_user_not_supported' => AsUserNotSupported, 'at_least_one_session_setting_required' => AtLeastOneSessionSettingRequired, + 'attachment_payload_limit_exceeded' => AttachmentPayloadLimitExceeded, 'auth_mismatch' => AuthMismatch, 'authorization_not_found' => AuthorizationNotFound, 'auto_provision_failure' => AutoProvisionFailure, @@ -791,6 +797,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'error_too_big' => ErrorTooBig, 'error_unpublishing_workflows' => ErrorUnpublishingWorkflows, 'exchanged_trigger_id' => ExchangedTriggerId, + 'execution_not_in_running_state' => ExecutionNotInRunningState, 'expired_trigger_id' => ExpiredTriggerId, 'external_channel_migrating' => ExternalChannelMigrating, 'external_limited_restriction' => ExternalLimitedRestriction, @@ -848,6 +855,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'forbidden_handle' => ForbiddenHandle, 'forbidden_team' => ForbiddenTeam, 'free_team_not_allowed' => FreeTeamNotAllowed, + 'function_execution_not_found' => FunctionExecutionNotFound, 'function_not_found' => FunctionNotFound, 'group_already_linked_to_channel' => GroupAlreadyLinkedToChannel, 'group_must_not_be_empty' => GroupMustNotBeEmpty, @@ -1008,6 +1016,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'missing_resource' => MissingResource, 'missing_scope' => MissingScope, 'missing_source' => MissingSource, + 'missing_step_ids' => MissingStepIds, 'missing_subteam_name' => MissingSubteamName, 'missing_target_team' => MissingTargetTeam, 'missing_team' => MissingTeam, @@ -1091,6 +1100,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end 'pagination_not_available' => PaginationNotAvailable, 'paid_only' => PaidOnly, 'paid_teams_only' => PaidTeamsOnly, + 'parameter_validation_failed' => ParameterValidationFailed, 'parent_bookmark_disabled' => ParentBookmarkDisabled, 'parent_with_link' => ParentWithLink, 'partial_profile_set_failed' => PartialProfileSetFailed, diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index bc545649..8a22e575 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit bc5456491123c88cac7b2b05faa2000cd284e596 +Subproject commit 8a22e575eefeb220a5a06426ff7319e6ef46dd42 diff --git a/spec/slack/web/api/endpoints/functions_spec.rb b/spec/slack/web/api/endpoints/functions_spec.rb new file mode 100644 index 00000000..3fecc793 --- /dev/null +++ b/spec/slack/web/api/endpoints/functions_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::Functions do + let(:client) { Slack::Web::Client.new } + context 'functions_completeError' do + it 'requires error' do + expect { client.functions_completeError(function_execution_id: %q[Fx12345ABCDE]) }.to raise_error ArgumentError, /Required arguments :error missing/ + end + it 'requires function_execution_id' do + expect { client.functions_completeError(error: %q[]) }.to raise_error ArgumentError, /Required arguments :function_execution_id missing/ + end + end + context 'functions_completeSuccess' do + it 'requires function_execution_id' do + expect { client.functions_completeSuccess(outputs: %q[{"customer_id": "U0BPQUNTA"}]) }.to raise_error ArgumentError, /Required arguments :function_execution_id missing/ + end + it 'requires outputs' do + expect { client.functions_completeSuccess(function_execution_id: %q[Fx12345ABCDE]) }.to raise_error ArgumentError, /Required arguments :outputs missing/ + end + it 'encodes outputs as json' do + expect(client).to receive(:post).with('functions.completeSuccess', {function_execution_id: %q[Fx12345ABCDE], outputs: %q[{"data":["data"]}]}) + client.functions_completeSuccess(function_execution_id: %q[Fx12345ABCDE], outputs: {:data=>["data"]}) + end + end +end