Skip to content

Commit

Permalink
Update API from slack-api-ref@f2e768a (2023-09-07)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Sep 7, 2023
1 parent 506376c commit d8d1567
Show file tree
Hide file tree
Showing 30 changed files with 567 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* [#491](https://github.com/slack-ruby/slack-ruby-client/pull/491): Added code coverage - [@dblock](https://github.com/dblock).
* [#486](https://github.com/slack-ruby/slack-ruby-client/pull/486): Async handler support for Slack::RealTime::Config and Client - [@milestruecar](https://github.com/milestruecar).
* [#489](https://github.com/slack-ruby-client/pulls/489): Update API from [slack-api-ref@0d3f0b6](https://github.com/slack-ruby/slack-api-ref/commit/0d3f0b6) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#493](https://github.com/slack-ruby-client/pulls/493): Update API from [slack-api-ref@f2e768a](https://github.com/slack-ruby/slack-api-ref/commit/f2e768a) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 2.1.0 (2023/03/17)
Expand Down
6 changes: 3 additions & 3 deletions bin/commands/admin_apps_activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class App
g.desc 'Get logs for a specified team/org'
g.long_desc %( Get logs for a specified team/org )
g.command 'list' do |c|
c.flag 'app_id', desc: 'The id of the app to get activities from.'
c.flag 'component_id', desc: "The component id of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows."
c.flag 'app_id', desc: 'The ID of the app to get activities from.'
c.flag 'component_id', desc: "The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows."
c.flag 'component_type', desc: "The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables')."
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. See pagination for more detail."
c.flag 'limit', desc: 'The maximum number of items to return.'
Expand All @@ -21,7 +21,7 @@ class App
c.flag 'sort_direction', desc: 'The direction you want the data sorted by (always by timestamp).'
c.flag 'source', desc: "The source of log events to be returned. Acceptable values are ('slack', 'developer')."
c.flag 'team_id', desc: 'The team who owns this log.'
c.flag 'trace_id', desc: 'The trace id of log events to be returned.'
c.flag 'trace_id', desc: 'The trace ID of log events to be returned.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_activities_list(options))
end
Expand Down
31 changes: 31 additions & 0 deletions bin/commands/admin_apps_config.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 'AdminAppsConfig methods.'
command 'admin_apps_config' do |g|
g.desc 'Look up the app config for connectors by their IDs'
g.long_desc %( Look up the app config for connectors by their IDs )
g.command 'lookup' do |c|
c.flag 'app_ids', desc: 'An array of app IDs to get app configs for.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_config_lookup(options))
end
end

g.desc 'Set the app config for a connector'
g.long_desc %( Set the app config for a connector )
g.command 'set' do |c|
c.flag 'app_id', desc: 'The encoded app ID to set the app config for.'
c.flag 'domain_restrictions', desc: 'Domain restrictions for the app.'
c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_config_set(options))
end
end
end
end
end
end
23 changes: 23 additions & 0 deletions bin/commands/admin_functions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AdminFunctions methods.'
command 'admin_functions' do |g|
g.desc 'Look up functions by a set of apps'
g.long_desc %( Look up functions by a set of apps )
g.command 'list' do |c|
c.flag 'app_ids', desc: 'Comma-separated array of app IDs to get functions for; max 50.'
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation. Must be between 1 and 1000, both inclusive.'
c.flag 'team_id', desc: 'The team context to retrieve functions from.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_functions_list(options))
end
end
end
end
end
end
31 changes: 31 additions & 0 deletions bin/commands/admin_functions_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 'AdminFunctionsPermissions methods.'
command 'admin_functions_permissions' do |g|
g.desc 'Lookup the visibility of multiple Slack functions and include the users if it is limited to particular named entities.'
g.long_desc %( Lookup the visibility of multiple Slack functions and include the users if it is limited to particular named entities. )
g.command 'lookup' do |c|
c.flag 'function_ids', desc: 'An array of function IDs to get permissions for.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_functions_permissions_lookup(options))
end
end

g.desc 'Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities'
g.long_desc %( Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities )
g.command 'set' do |c|
c.flag 'function_id', desc: 'The function ID to set permissions for.'
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_functions_permissions_set(options))
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion bin/commands/admin_teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class App
g.long_desc %( List all teams on an Enterprise organization )
g.command 'list' do |c|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 100 both inclusive.'
c.flag 'limit', desc: 'The maximum number of items to return. Must be a positive integer no larger than 1000.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_teams_list(options))
end
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class App
g.desc 'Set an expiration for a guest user'
g.long_desc %( Set an expiration for a guest user )
g.command 'setExpiration' do |c|
c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.'
c.flag 'expiration_ts', desc: 'Epoch timestamp in seconds when guest account should be disabled.'
c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.action do |_global_options, options, _args|
Expand Down
38 changes: 38 additions & 0 deletions bin/commands/admin_workflows.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AdminWorkflows methods.'
command 'admin_workflows' do |g|
g.desc 'Search workflows within the team or enterprise'
g.long_desc %( Search workflows within the team or enterprise )
g.command 'search' do |c|
c.flag 'app_id', desc: 'The parent app ID for which to return workflows.'
c.flag 'collaborator_ids', desc: 'Only include workflows by the collaborators inputted.'
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation.'
c.flag 'no_collaborators', desc: 'Only include workflows with no collaborators in the result; default is false.'
c.flag 'num_trigger_ids', desc: 'Number of trigger IDs to fetch for each workflow; default is 0.'
c.flag 'query', desc: 'A search query to filter for workflow name or description.'
c.flag 'sort', desc: 'The field used to sort the returned workflows.'
c.flag 'sort_dir', desc: '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).'
c.flag 'source', desc: 'Source of workflow creation, either from code or workflow builder.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_search(options))
end
end

g.desc 'Unpublish workflows within the team or enterprise'
g.long_desc %( Unpublish workflows within the team or enterprise )
g.command 'unpublish' do |c|
c.flag 'workflow_ids', desc: 'Array of workflow IDs to unpublish.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_unpublish(options))
end
end
end
end
end
end
31 changes: 31 additions & 0 deletions bin/commands/admin_workflows_collaborators.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 'AdminWorkflowsCollaborators methods.'
command 'admin_workflows_collaborators' do |g|
g.desc 'Add collaborators to workflows within the team or enterprise'
g.long_desc %( Add collaborators to workflows within the team or enterprise )
g.command 'add' do |c|
c.flag 'collaborator_ids', desc: 'Array of collaborators (encoded user IDs) to add; max 50.'
c.flag 'workflow_ids', desc: 'Array of workflow IDs to edit; max 50.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_collaborators_add(options))
end
end

g.desc 'Remove collaborators from workflows within the team or enterprise'
g.long_desc %( Remove collaborators from workflows within the team or enterprise )
g.command 'remove' do |c|
c.flag 'collaborator_ids', desc: 'Array of collaborators (encoded user IDs) to remove; max 50.'
c.flag 'workflow_ids', desc: 'Array of workflow IDs to edit; max 50.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_collaborators_remove(options))
end
end
end
end
end
end
21 changes: 21 additions & 0 deletions bin/commands/admin_workflows_permissions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Cli
class App
desc 'AdminWorkflowsPermissions methods.'
command 'admin_workflows_permissions' do |g|
g.desc 'Look up the permissions for a set of workflows'
g.long_desc %( Look up the permissions for a set of workflows )
g.command 'lookup' do |c|
c.flag 'workflow_ids', desc: 'An array of workflow IDs to look up permissions for.'
c.flag 'max_workflow_triggers', desc: 'Maximum number of triggers to fetch for each workflow when determining overall run permissions; max 1000.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_workflows_permissions_lookup(options))
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion bin/commands/dnd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class App
g.desc 'Turns on Do Not Disturb mode for the current user, or changes its duration.'
g.long_desc %( Turns on Do Not Disturb mode for the current user, or changes its duration. )
g.command 'setSnooze' do |c|
c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.'
c.flag 'num_minutes', desc: 'This argument is required. Number of minutes, from now, to snooze until.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.dnd_setSnooze(options))
end
Expand Down
12 changes: 12 additions & 0 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require_relative 'endpoints/admin_apps'
require_relative 'endpoints/admin_apps_activities'
require_relative 'endpoints/admin_apps_approved'
require_relative 'endpoints/admin_apps_config'
require_relative 'endpoints/admin_apps_requests'
require_relative 'endpoints/admin_apps_restricted'
require_relative 'endpoints/admin_audit_anomaly_allow'
Expand All @@ -14,6 +15,8 @@
require_relative 'endpoints/admin_conversations_ekm'
require_relative 'endpoints/admin_conversations_restrictAccess'
require_relative 'endpoints/admin_emoji'
require_relative 'endpoints/admin_functions'
require_relative 'endpoints/admin_functions_permissions'
require_relative 'endpoints/admin_inviteRequests'
require_relative 'endpoints/admin_inviteRequests_approved'
require_relative 'endpoints/admin_inviteRequests_denied'
Expand All @@ -26,6 +29,9 @@
require_relative 'endpoints/admin_users'
require_relative 'endpoints/admin_users_session'
require_relative 'endpoints/admin_users_unsupportedVersions'
require_relative 'endpoints/admin_workflows'
require_relative 'endpoints/admin_workflows_collaborators'
require_relative 'endpoints/admin_workflows_permissions'
require_relative 'endpoints/api'
require_relative 'endpoints/apps'
require_relative 'endpoints/apps_activities'
Expand Down Expand Up @@ -86,6 +92,7 @@ module Endpoints
include AdminApps
include AdminAppsActivities
include AdminAppsApproved
include AdminAppsConfig
include AdminAppsRequests
include AdminAppsRestricted
include AdminAuditAnomalyAllow
Expand All @@ -95,6 +102,8 @@ module Endpoints
include AdminConversationsEkm
include AdminConversationsRestrictaccess
include AdminEmoji
include AdminFunctions
include AdminFunctionsPermissions
include AdminInviterequests
include AdminInviterequestsApproved
include AdminInviterequestsDenied
Expand All @@ -107,6 +116,9 @@ module Endpoints
include AdminUsers
include AdminUsersSession
include AdminUsersUnsupportedversions
include AdminWorkflows
include AdminWorkflowsCollaborators
include AdminWorkflowsPermissions
include Api
include Apps
include AppsActivities
Expand Down
6 changes: 3 additions & 3 deletions lib/slack/web/api/endpoints/admin_apps_activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module AdminAppsActivities
# Get logs for a specified team/org
#
# @option options [Object] :app_id
# The id of the app to get activities from.
# The ID of the app to get activities from.
# @option options [string] :component_id
# The component id of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
# The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
# @option options [string] :component_type
# The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables').
# @option options [string] :cursor
Expand All @@ -34,7 +34,7 @@ module AdminAppsActivities
# @option options [string] :team_id
# The team who owns this log.
# @option options [string] :trace_id
# The trace id of log events to be returned.
# The trace ID of log events to be returned.
# @see https://api.slack.com/methods/admin.apps.activities.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.activities/admin.apps.activities.list.json
def admin_apps_activities_list(options = {})
Expand Down
40 changes: 40 additions & 0 deletions lib/slack/web/api/endpoints/admin_apps_config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AdminAppsConfig
#
# Look up the app config for connectors by their IDs
#
# @option options [array] :app_ids
# An array of app IDs to get app configs for.
# @see https://api.slack.com/methods/admin.apps.config.lookup
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.config/admin.apps.config.lookup.json
def admin_apps_config_lookup(options = {})
raise ArgumentError, 'Required arguments :app_ids missing' if options[:app_ids].nil?
post('admin.apps.config.lookup', options)
end

#
# Set the app config for a connector
#
# @option options [Object] :app_id
# The encoded app ID to set the app config for.
# @option options [object] :domain_restrictions
# Domain restrictions for the app.
# @option options [string] :workflow_auth_strategy
# The workflow auth permission.
# @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
def admin_apps_config_set(options = {})
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
post('admin.apps.config.set', options)
end
end
end
end
end
end
36 changes: 36 additions & 0 deletions lib/slack/web/api/endpoints/admin_functions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AdminFunctions
#
# Look up functions by a set of apps
#
# @option options [array] :app_ids
# Comma-separated array of app IDs to get functions for; max 50.
# @option options [string] :cursor
# Set cursor to next_cursor returned by the previous call to list items in the next page.
# @option options [integer] :limit
# The number of results that will be returned by the API on each invocation. Must be between 1 and 1000, both inclusive.
# @option options [Object] :team_id
# The team context to retrieve functions from.
# @see https://api.slack.com/methods/admin.functions.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.functions/admin.functions.list.json
def admin_functions_list(options = {})
raise ArgumentError, 'Required arguments :app_ids missing' if options[:app_ids].nil?
if block_given?
Pagination::Cursor.new(self, :admin_functions_list, options).each do |page|
yield page
end
else
post('admin.functions.list', options)
end
end
end
end
end
end
end
Loading

0 comments on commit d8d1567

Please sign in to comment.