Skip to content

Commit

Permalink
Update API from slack-api-ref@8a22e57 (2024-04-11)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Apr 11, 2024
1 parent 9e6d117 commit 7c2f2e6
Show file tree
Hide file tree
Showing 28 changed files with 644 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
### 2.3.1 (Next)

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

### 2.3.0 (2024/01/31)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_emoji.rb
Expand Up @@ -9,7 +9,7 @@ class App
g.desc 'Add an emoji.'
g.long_desc %( Add an emoji. )
g.command 'add' do |c|
c.flag 'name', desc: 'The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.'
c.flag 'name', desc: 'The name of the emoji to be added (using lower-case letters only). Colons (:myemoji:) around the value are not required, although they may be included.'
c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_emoji_add(options))
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/admin_users.rb
Expand Up @@ -60,8 +60,8 @@ class App
end
end

g.desc 'Set an existing guest, regular user, or owner to be an admin user.'
g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. )
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.command 'setAdmin' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
Expand All @@ -81,8 +81,8 @@ class App
end
end

g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
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.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.'
Expand Down
31 changes: 31 additions & 0 deletions bin/commands/admin_workflows_triggers_types_permissions.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 'AdminWorkflowsTriggersTypesPermissions methods.'
command 'admin_workflows_triggers_types_permissions' do |g|
g.desc 'list the permissions for using each trigger type in workflow builder'
g.long_desc %( list the permissions for using each trigger type in workflow builder )
g.command 'lookup' do |c|
c.flag 'trigger_type_ids', desc: 'The trigger types 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
end

g.desc 'Set the permissions for using a trigger type in workflow builder'
g.long_desc %( Set the permissions for using a trigger type in workflow builder )
g.command 'set' do |c|
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.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_triggers_types_permissions_set(options))
end
end
end
end
end
end
46 changes: 46 additions & 0 deletions bin/commands/apps_datastore.rb
Expand Up @@ -6,6 +6,52 @@ module Cli
class App
desc 'AppsDatastore methods.'
command 'apps_datastore' do |g|
g.desc 'Delete items from a datastore in bulk'
g.long_desc %( Delete items from a datastore in bulk )
g.command 'bulkDelete' do |c|
c.flag 'datastore', desc: 'name of the datastore.'
c.flag 'ids', desc: 'IDs of items to be deleted.'
c.flag 'app_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_datastore_bulkDelete(options))
end
end

g.desc 'Get items from a datastore in bulk'
g.long_desc %( Get items from a datastore in bulk )
g.command 'bulkGet' do |c|
c.flag 'datastore', desc: 'name of the datastore.'
c.flag 'ids', desc: "items' ids."
c.flag 'app_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_datastore_bulkGet(options))
end
end

g.desc 'Creates or replaces existing items in bulk'
g.long_desc %( Creates or replaces existing items in bulk )
g.command 'bulkPut' do |c|
c.flag 'datastore', desc: 'name of the datastore.'
c.flag 'items', desc: 'attribute names and values of the items; limit of 25.'
c.flag 'app_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_datastore_bulkPut(options))
end
end

g.desc 'Count the number of items in a datastore that match a query'
g.long_desc %( Count the number of items in a datastore that match a query )
g.command 'count' do |c|
c.flag 'datastore', desc: 'Name of the datastore.'
c.flag 'app_id', desc: 'Required if calling with user token.'
c.flag 'expression', desc: 'A query filter expression https://api.slack.com/future/datastores.'
c.flag 'expression_attributes', desc: 'A map of attributes referenced in expression.'
c.flag 'expression_values', desc: 'A map of values referenced in expression.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_datastore_count(options))
end
end

g.desc 'Delete an item from a datastore'
g.long_desc %( Delete an item from a datastore )
g.command 'delete' do |c|
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/conversations.rb
Expand Up @@ -77,7 +77,7 @@ class App
c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results. Default is the current time.'
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 users list hasn't been reached."
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 conversation history hasn't been reached. Maximum of 999."
c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.conversations_history(options))
Expand Down
59 changes: 59 additions & 0 deletions bin/commands/functions_distributions_permissions.rb
@@ -0,0 +1,59 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'FunctionsDistributionsPermissions methods.'
command 'functions_distributions_permissions' do |g|
g.desc 'Grant users access to a custom slack function that has its permission type set to named_entitiess'
g.long_desc %( Grant users access to a custom slack function that has its permission type set to named_entitiess )
g.command 'add' do |c|
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
c.flag 'function_id', desc: 'The encoded ID of the function.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_distributions_permissions_add(options))
end
end

g.desc 'List the visibility of a custom slack function and include the users with access if its permission type is set to named_entities'
g.long_desc %( List the visibility of a custom slack function and include the users with access if its permission type is set to named_entities )
g.command 'list' do |c|
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
c.flag 'function_id', desc: 'The encoded ID of the function.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_distributions_permissions_list(options))
end
end

g.desc "Revoke users' access to a custom slack function that has its permission type set to named_entities"
g.long_desc %( Revoke users' access to a custom slack function that has its permission type set to named_entities )
g.command 'remove' do |c|
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
c.flag 'function_id', desc: 'The encoded ID of the function.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_distributions_permissions_remove(options))
end
end

g.desc 'Set the remixability of a slack function and define the users to be granted access if permission_type is set to named_entities'
g.long_desc %( Set the remixability of a slack function and define the users to be granted access if permission_type is set to named_entities )
g.command 'set' do |c|
c.flag 'permission_type', desc: 'The type of permission that defines how the function can be distributed.'
c.flag 'function_app_id', desc: 'The encoded ID of the app.'
c.flag 'function_callback_id', desc: "The callback ID defined in the function's definition file."
c.flag 'function_id', desc: 'The encoded ID of the function.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.functions_distributions_permissions_set(options))
end
end
end
end
end
end
4 changes: 2 additions & 2 deletions bin/commands/oauth.rb
Expand Up @@ -9,8 +9,8 @@ class App
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
g.command 'access' do |c|
c.flag 'client_id', desc: 'Issued when you created your application.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
c.flag 'client_id', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
c.flag 'client_secret', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/oauth_v2.rb
Expand Up @@ -9,8 +9,8 @@ class App
g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
g.command 'access' do |c|
c.flag 'client_id', desc: 'Issued when you created your application.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
c.flag 'client_id', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
c.flag 'client_secret', desc: 'Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.'
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/reminders.rb
Expand Up @@ -10,7 +10,7 @@ class App
g.long_desc %( Creates a reminder. )
g.command 'add' do |c|
c.flag 'text', desc: 'The content of the reminder.'
c.flag 'time', desc: 'When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
c.flag 'time', desc: 'Can also take a type of integer. When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
c.flag 'recurrence', desc: 'Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.'
c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
c.flag 'user', desc: 'No longer supported - reminders cannot be set for other users. Previously, was the user who would receive the reminder.'
Expand Down
60 changes: 60 additions & 0 deletions bin/commands/workflows_triggers_permissions.rb
@@ -0,0 +1,60 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'WorkflowsTriggersPermissions methods.'
command 'workflows_triggers_permissions' do |g|
g.desc 'Allows users to run a trigger that has its permission type set to named_entities'
g.long_desc %( Allows users to run a trigger that has its permission type set to named_entities )
g.command 'add' do |c|
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.workflows_triggers_permissions_add(options))
end
end

g.desc 'Returns the permission type of a trigger and if applicable, includes the entities that have been granted access'
g.long_desc %( Returns the permission type of a trigger and if applicable, includes the entities that have been granted access )
g.command 'list' do |c|
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.workflows_triggers_permissions_list(options))
end
end

g.desc "Revoke an entity's access to a trigger that has its permission type set to named_entities"
g.long_desc %( Revoke an entity's access to a trigger that has its permission type set to named_entities )
g.command 'remove' do |c|
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.workflows_triggers_permissions_remove(options))
end
end

g.desc 'Set the permission type for who can run a trigger'
g.long_desc %( Set the permission type for who can run a trigger )
g.command 'set' do |c|
c.flag 'permission_type', desc: 'The type of permission that defines who can run a trigger.'
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
c.flag 'user_ids', desc: 'List of encoded user IDs.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.workflows_triggers_permissions_set(options))
end
end
end
end
end
end
6 changes: 6 additions & 0 deletions lib/slack/web/api/endpoints.rb
Expand Up @@ -32,6 +32,7 @@
require_relative 'endpoints/admin_workflows'
require_relative 'endpoints/admin_workflows_collaborators'
require_relative 'endpoints/admin_workflows_permissions'
require_relative 'endpoints/admin_workflows_triggers_types_permissions'
require_relative 'endpoints/api'
require_relative 'endpoints/apps'
require_relative 'endpoints/apps_activities'
Expand All @@ -56,6 +57,7 @@
require_relative 'endpoints/files_comments'
require_relative 'endpoints/files_remote'
require_relative 'endpoints/functions'
require_relative 'endpoints/functions_distributions_permissions'
require_relative 'endpoints/functions_workflows_steps'
require_relative 'endpoints/functions_workflows_steps_responses'
require_relative 'endpoints/migration'
Expand All @@ -81,6 +83,7 @@
require_relative 'endpoints/users_profile'
require_relative 'endpoints/views'
require_relative 'endpoints/workflows'
require_relative 'endpoints/workflows_triggers_permissions'

module Slack
module Web
Expand Down Expand Up @@ -120,6 +123,7 @@ module Endpoints
include AdminWorkflows
include AdminWorkflowsCollaborators
include AdminWorkflowsPermissions
include AdminWorkflowsTriggersTypesPermissions
include Api
include Apps
include AppsActivities
Expand All @@ -144,6 +148,7 @@ module Endpoints
include FilesComments
include FilesRemote
include Functions
include FunctionsDistributionsPermissions
include FunctionsWorkflowsSteps
include FunctionsWorkflowsStepsResponses
include Migration
Expand All @@ -169,6 +174,7 @@ module Endpoints
include UsersProfile
include Views
include Workflows
include WorkflowsTriggersPermissions
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_emoji.rb
Expand Up @@ -10,7 +10,7 @@ module AdminEmoji
# Add an emoji.
#
# @option options [string] :name
# The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.
# The name of the emoji to be added (using lower-case letters only). Colons (:myemoji:) around the value are not required, although they may be included.
# @option options [string] :url
# The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.
# @see https://api.slack.com/methods/admin.emoji.add
Expand Down

0 comments on commit 7c2f2e6

Please sign in to comment.