Skip to content

Commit

Permalink
Update API from slack-api-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Apr 29, 2023
1 parent 905bd44 commit 2cb8eaa
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 26 deletions.
32 changes: 32 additions & 0 deletions bin/commands/apps_auth_external.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AppsAuthExternal methods.'
command 'apps_auth_external' do |g|
g.desc 'Delete external auth tokens only on the Slack side'
g.long_desc %( Delete external auth tokens only on the Slack side )
g.command 'delete' do |c|
c.flag 'app_id', desc: 'The id of the app whose tokens you want to delete.'
c.flag 'external_token_id', desc: 'The id of the token that you want to delete.'
c.flag 'provider_key', desc: 'The provider key of the provider whose tokens you want to delete.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_auth_external_delete(options))
end
end

g.desc 'Get the access token for the provided token ID'
g.long_desc %( Get the access token for the provided token ID )
g.command 'get' do |c|
c.flag 'external_token_id', desc: 'The id of the token you want to get the token for.'
c.flag 'force_refresh', desc: 'Always refresh existing token before returning even when the token has not expired.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_auth_external_get(options))
end
end
end
end
end
end
12 changes: 6 additions & 6 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ class App
c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
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 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship 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 channel names and usernames.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread."
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
c.flag 'username', desc: "Set your bot's user name."
c.action do |_global_options, options, _args|
puts JSON.dump(@client.chat_postEphemeral(options))
end
Expand All @@ -87,8 +87,8 @@ class App
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
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 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship 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.'
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 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
Expand All @@ -97,7 +97,7 @@ class App
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.'
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
c.flag 'username', desc: "Set your bot's user name."
c.action do |_global_options, options, _args|
puts JSON.dump(@client.chat_postMessage(options))
end
Expand Down
3 changes: 2 additions & 1 deletion bin/commands/functions_workflows_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ class App
g.desc "List the steps of a specific function of a workflow's versions"
g.long_desc %( List the steps of a specific function of a workflow's versions )
g.command 'list' do |c|
c.flag 'function_id', desc: '.'
c.flag 'function_id', desc: 'The ID of the function to query.'
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.'
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_workflows_steps_list(options))
Expand Down
3 changes: 2 additions & 1 deletion bin/commands/functions_workflows_steps_responses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ class App
g.desc 'Download form responses of a workflow'
g.long_desc %( Download form responses of a workflow )
g.command 'export' do |c|
c.flag 'step_id', desc: '.'
c.flag 'step_id', desc: 'The ID of the OpenForm step to export.'
c.flag 'workflow', desc: 'The workflow encoded ID or workflow reference.'
c.flag 'workflow_app_id', desc: 'The app tied to the workflow reference.'
c.flag 'workflow_id', desc: 'The workflow ID, starts with Wf*.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_workflows_steps_responses_export(options))
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/stars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class App
end
end

g.desc "List a user's saved items, formerly known as _stars_."
g.long_desc %( List a user's saved items, formerly known as _stars_. )
g.desc "List a user's saved items, formerly known as stars."
g.long_desc %( List a user's saved items, formerly known as stars. )
g.command 'list' do |c|
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class App
g.command 'conversations' 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. Default value fetches the first 'page' of the collection. See pagination for more detail."
c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer with a max value of 999."
c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership."
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 @@ -27,6 +27,7 @@
require_relative 'endpoints/admin_users_unsupportedVersions'
require_relative 'endpoints/api'
require_relative 'endpoints/apps'
require_relative 'endpoints/apps_auth_external'
require_relative 'endpoints/apps_connections'
require_relative 'endpoints/apps_datastore'
require_relative 'endpoints/apps_event_authorizations'
Expand Down Expand Up @@ -105,6 +106,7 @@ module Endpoints
include AdminUsersUnsupportedversions
include Api
include Apps
include AppsAuthExternal
include AppsConnections
include AppsDatastore
include AppsEventAuthorizations
Expand Down
41 changes: 41 additions & 0 deletions lib/slack/web/api/endpoints/apps_auth_external.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AppsAuthExternal
#
# Delete external auth tokens only on the Slack side
#
# @option options [string] :app_id
# The id of the app whose tokens you want to delete.
# @option options [string] :external_token_id
# The id of the token that you want to delete.
# @option options [string] :provider_key
# The provider key of the provider whose tokens you want to delete.
# @see https://api.slack.com/methods/apps.auth.external.delete
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.delete.json
def apps_auth_external_delete(options = {})
post('apps.auth.external.delete', options)
end

#
# Get the access token for the provided token ID
#
# @option options [string] :external_token_id
# The id of the token you want to get the token for.
# @option options [boolean] :force_refresh
# Always refresh existing token before returning even when the token has not expired.
# @see https://api.slack.com/methods/apps.auth.external.get
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.auth.external/apps.auth.external.get.json
def apps_auth_external_get(options = {})
raise ArgumentError, 'Required arguments :external_token_id missing' if options[:external_token_id].nil?
post('apps.auth.external.get', options)
end
end
end
end
end
end
12 changes: 6 additions & 6 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ def chat_meMessage(options = {})
# @option options [blocks[] as string] :blocks
# A JSON-based array of structured blocks, presented as a URL-encoded string.
# @option options [string] :icon_emoji
# Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# Emoji to use as the icon for this message. Overrides icon_url.
# @option options [string] :icon_url
# URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# URL to an image to use as the icon for this message.
# @option options [boolean] :link_names
# Find and link channel names and usernames.
# @option options [string] :parse
# Change how messages are treated. Defaults to none. See below.
# @option options [string] :thread_ts
# Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread.
# @option options [string] :username
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# Set your bot's user name.
# @see https://api.slack.com/methods/chat.postEphemeral
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
def chat_postEphemeral(options = {})
Expand All @@ -143,9 +143,9 @@ def chat_postEphemeral(options = {})
# @option options [boolean] :as_user
# (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.
# @option options [string] :icon_emoji
# Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# Emoji to use as the icon for this message. Overrides icon_url.
# @option options [string] :icon_url
# URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# URL to an image to use as the icon for this message.
# @option options [boolean] :link_names
# Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
# @option options [string] :metadata
Expand All @@ -163,7 +163,7 @@ def chat_postEphemeral(options = {})
# @option options [boolean] :unfurl_media
# Pass false to disable unfurling of media content.
# @option options [string] :username
# Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
# Set your bot's user name.
# @see https://api.slack.com/methods/chat.postMessage
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
def chat_postMessage(options = {})
Expand Down
4 changes: 3 additions & 1 deletion lib/slack/web/api/endpoints/functions_workflows_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ module FunctionsWorkflowsSteps
# List the steps of a specific function of a workflow's versions
#
# @option options [string] :function_id
# .
# The ID of the function to query.
# @option options [string] :workflow
# The workflow encoded ID or workflow reference.
# @option options [string] :workflow_app_id
# The app tied to the workflow reference.
# @option options [string] :workflow_id
# The workflow ID, starts with Wf*.
# @see https://api.slack.com/methods/functions.workflows.steps.list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ module FunctionsWorkflowsStepsResponses
# Download form responses of a workflow
#
# @option options [string] :step_id
# .
# The ID of the OpenForm step to export.
# @option options [string] :workflow
# The workflow encoded ID or workflow reference.
# @option options [string] :workflow_app_id
# The app tied to the workflow reference.
# @option options [string] :workflow_id
# The workflow ID, starts with Wf*.
# @see https://api.slack.com/methods/functions.workflows.steps.responses.export
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/stars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def stars_add(options = {})
end

#
# List a user's saved items, formerly known as _stars_.
# List a user's saved items, formerly known as stars.
#
# @option options [string] :cursor
# Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Users
# @option options [boolean] :exclude_archived
# Set to true to exclude archived channels from the list.
# @option options [number] :limit
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000.
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer with a max value of 999.
# @option options [string] :team_id
# encoded team id to list conversations in, required if org token is used.
# @option options [string] :types
Expand Down
Loading

0 comments on commit 2cb8eaa

Please sign in to comment.