Skip to content

Commit

Permalink
Update API from slack-api-ref@8a22e57 (2024-02-28)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Feb 28, 2024
1 parent 9e6d117 commit 95b85d6
Show file tree
Hide file tree
Showing 19 changed files with 431 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions bin/commands/admin_workflows_triggers_types_permissions.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 '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
33 changes: 33 additions & 0 deletions bin/commands/apps_datastore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@ 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.'
c.flag 'app_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.apps_datastore_bulkPut(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
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions bin/commands/oauth.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
60 changes: 60 additions & 0 deletions bin/commands/workflows_triggers_permissions.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
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 Down Expand Up @@ -81,6 +82,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 +122,7 @@ module Endpoints
include AdminWorkflows
include AdminWorkflowsCollaborators
include AdminWorkflowsPermissions
include AdminWorkflowsTriggersTypesPermissions
include Api
include Apps
include AppsActivities
Expand Down Expand Up @@ -169,6 +172,7 @@ module Endpoints
include UsersProfile
include Views
include Workflows
include WorkflowsTriggersPermissions
end
end
end
Expand Down
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 AdminWorkflowsTriggersTypesPermissions
#
# list the permissions for using each trigger type in workflow builder
#
# @option options [array] :trigger_type_ids
# The trigger types 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 = {})
raise ArgumentError, 'Required arguments :trigger_type_ids missing' if options[:trigger_type_ids].nil?
post('admin.workflows.triggers.types.permissions.lookup', options)
end

#
# Set the permissions for using a trigger type in workflow builder
#
# @option options [Object] :id
# The trigger type ID for which to set the permissions.
# @option options [enum] :visibility
# The function visibility.
# @option options [array] :user_ids
# List of user IDs to allow for named_entities visibility.
# @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
end
end
end
end
51 changes: 51 additions & 0 deletions lib/slack/web/api/endpoints/apps_datastore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,57 @@ module Web
module Api
module Endpoints
module AppsDatastore
#
# Delete items from a datastore in bulk
#
# @option options [string] :datastore
# name of the datastore.
# @option options [array] :ids
# IDs of items to be deleted.
# @option options [Object] :app_id
# .
# @see https://api.slack.com/methods/apps.datastore.bulkDelete
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkDelete.json
def apps_datastore_bulkDelete(options = {})
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
post('apps.datastore.bulkDelete', options)
end

#
# Get items from a datastore in bulk
#
# @option options [string] :datastore
# name of the datastore.
# @option options [array] :ids
# items' ids.
# @option options [Object] :app_id
# .
# @see https://api.slack.com/methods/apps.datastore.bulkGet
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkGet.json
def apps_datastore_bulkGet(options = {})
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
post('apps.datastore.bulkGet', options)
end

#
# Creates or replaces existing items in bulk
#
# @option options [string] :datastore
# name of the datastore.
# @option options [array] :items
# attribute names and values of the items.
# @option options [Object] :app_id
# .
# @see https://api.slack.com/methods/apps.datastore.bulkPut
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkPut.json
def apps_datastore_bulkPut(options = {})
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
raise ArgumentError, 'Required arguments :items missing' if options[:items].nil?
post('apps.datastore.bulkPut', options)
end

#
# Delete an item from a datastore
#
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def conversations_declineSharedInvite(options = {})
# @option options [timestamp] :latest
# Only messages before this Unix timestamp will be included in results. Default is the current time.
# @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 users list hasn't been reached.
# 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.
# @option options [timestamp] :oldest
# Only messages after this Unix timestamp will be included in results.
# @see https://api.slack.com/methods/conversations.history
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module Oauth
# Exchanges a temporary OAuth verifier code for an access token.
#
# @option options [string] :client_id
# Issued when you created your application.
# 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.
# @option options [string] :client_secret
# Issued when you created your application.
# 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.
# @option options [string] :code
# The code param returned via the OAuth callback.
# @option options [string] :redirect_uri
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/oauth_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module OauthV2
# Exchanges a temporary OAuth verifier code for an access token.
#
# @option options [string] :client_id
# Issued when you created your application.
# 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.
# @option options [string] :client_secret
# Issued when you created your application.
# 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.
# @option options [string] :code
# The code param returned via the OAuth callback.
# @option options [string] :grant_type
Expand Down
Loading

0 comments on commit 95b85d6

Please sign in to comment.