Skip to content

Commit

Permalink
Update API from slack-api-ref@0d3f0b6 (2023-08-09)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Aug 9, 2023
1 parent 413ce4a commit 3765415
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 80 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [#490](https://github.com/slack-ruby/slack-ruby-client/pull/490): Add changelog uri to gemspec - [@MatheusRich](https://github.com/MatheusRich).
* [#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).
* Your contribution here.

### 2.1.0 (2023/03/17)
Expand Down
32 changes: 32 additions & 0 deletions bin/commands/admin_apps_activities.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 'AdminAppsActivities methods.'
command 'admin_apps_activities' do |g|
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 '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.'
c.flag 'log_event_type', desc: 'The event type of log events to be returned.'
c.flag 'max_date_created', desc: 'The latest timestamp of the log to retrieve (epoch microseconds).'
c.flag 'min_date_created', desc: 'The earliest timestamp of the log to retrieve (epoch microseconds).'
c.flag 'min_log_level', desc: "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')."
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.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_apps_activities_list(options))
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion bin/commands/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class App
c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
c.flag 'real_name', desc: 'Full name of the user.'
c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. (default: false).'
c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. Resending can only be done via the UI and has no expiration. (default: false).'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_invite(options))
end
Expand Down
6 changes: 3 additions & 3 deletions bin/commands/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class App
c.flag 'channel_name', desc: 'Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.'
c.flag 'channel_id', desc: "ID of the channel that you'd like to accept. Must provide either invite_id or channel_id."
c.flag 'free_trial_accepted', desc: "Whether you'd like to use your workspace's free trial to begin using Slack Connect."
c.flag 'invite_id', desc: 'See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.'
c.flag 'invite_id', desc: "ID of the invite that you'd like to accept. Must provide either invite_id or channel_id. See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation."
c.flag 'is_private', desc: 'Whether the channel should be private.'
c.flag 'team_id', desc: 'The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.'
c.action do |_global_options, options, _args|
Expand Down Expand Up @@ -109,9 +109,9 @@ class App
g.long_desc %( Sends an invitation to a Slack Connect channel )
g.command 'inviteShared' do |c|
c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided.'
c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.'
c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided.'
c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.conversations_inviteShared(options))
end
Expand Down
22 changes: 0 additions & 22 deletions bin/commands/migration.rb

This file was deleted.

2 changes: 1 addition & 1 deletion bin/commands/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class App
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 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.'
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))
end
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require_relative 'endpoints/admin_analytics'
require_relative 'endpoints/admin_apps'
require_relative 'endpoints/admin_apps_activities'
require_relative 'endpoints/admin_apps_approved'
require_relative 'endpoints/admin_apps_requests'
require_relative 'endpoints/admin_apps_restricted'
Expand Down Expand Up @@ -50,7 +51,6 @@
require_relative 'endpoints/files_remote'
require_relative 'endpoints/functions_workflows_steps'
require_relative 'endpoints/functions_workflows_steps_responses'
require_relative 'endpoints/migration'
require_relative 'endpoints/oauth'
require_relative 'endpoints/oauth_v2'
require_relative 'endpoints/openid_connect'
Expand Down Expand Up @@ -83,6 +83,7 @@ module Endpoints

include AdminAnalytics
include AdminApps
include AdminAppsActivities
include AdminAppsApproved
include AdminAppsRequests
include AdminAppsRestricted
Expand Down Expand Up @@ -130,7 +131,6 @@ module Endpoints
include FilesRemote
include FunctionsWorkflowsSteps
include FunctionsWorkflowsStepsResponses
include Migration
include Oauth
include OauthV2
include OpenidConnect
Expand Down
53 changes: 53 additions & 0 deletions lib/slack/web/api/endpoints/admin_apps_activities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AdminAppsActivities
#
# Get logs for a specified team/org
#
# @option options [Object] :app_id
# 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.
# @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
# 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.
# @option options [integer] :limit
# The maximum number of items to return.
# @option options [string] :log_event_type
# The event type of log events to be returned.
# @option options [integer] :max_date_created
# The latest timestamp of the log to retrieve (epoch microseconds).
# @option options [integer] :min_date_created
# 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
# 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').
# @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.
# @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 = {})
if block_given?
Pagination::Cursor.new(self, :admin_apps_activities_list, options).each do |page|
yield page
end
else
post('admin.apps.activities.list', options)
end
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def admin_users_assign(options = {})
# @option options [string] :real_name
# Full name of the user.
# @option options [boolean] :resend
# Allow this invite to be resent in the future if a user has not signed up yet. (default: false).
# Allow this invite to be resent in the future if a user has not signed up yet. Resending can only be done via the UI and has no expiration. (default: false).
# @see https://api.slack.com/methods/admin.users.invite
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.invite.json
def admin_users_invite(options = {})
Expand Down
6 changes: 3 additions & 3 deletions lib/slack/web/api/endpoints/conversations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Conversations
# @option options [boolean] :free_trial_accepted
# Whether you'd like to use your workspace's free trial to begin using Slack Connect.
# @option options [Object] :invite_id
# See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.
# ID of the invite that you'd like to accept. Must provide either invite_id or channel_id. See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.
# @option options [boolean] :is_private
# Whether the channel should be private.
# @option options [Object] :team_id
Expand Down Expand Up @@ -168,11 +168,11 @@ def conversations_invite(options = {})
# @option options [channel] :channel
# ID of the channel on your team that you'd like to share.
# @option options [array] :emails
# Optional email to receive this invite. Either emails or user_ids must be provided.
# Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.
# @option options [boolean] :external_limited
# Optional boolean on whether invite is to a external limited member. Defaults to true.
# @option options [array] :user_ids
# Optional user_id to receive this invite. Either emails or user_ids must be provided.
# Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.
# @see https://api.slack.com/methods/conversations.inviteShared
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.inviteShared.json
def conversations_inviteShared(options = {})
Expand Down
28 changes: 0 additions & 28 deletions lib/slack/web/api/endpoints/migration.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def team_billableInfo(options = {})
# @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.
# @option options [string] :team
# Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.
# Team to get info about; if omitted, will return information about the current team.
# @see https://api.slack.com/methods/team.info
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
def team_info(options = {})
Expand Down
6 changes: 2 additions & 4 deletions lib/slack/web/api/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Web
module Api
module Errors
class AccessDenied < SlackError; end
class AccessTokenExchangeFailed < SlackError; end
class Accesslimited < SlackError; end
class AccountInactive < SlackError; end
class ActionAlreadyInProgress < SlackError; end
Expand Down Expand Up @@ -438,7 +439,6 @@ class NotAuthorized < SlackError; end
class NotBearerToken < SlackError; end
class NotEnabled < SlackError; end
class NotEnoughUsers < SlackError; end
class NotEnterpriseTeam < SlackError; end
class NotFound < SlackError; end
class NotImplemented < SlackError; end
class NotInChannel < SlackError; end
Expand Down Expand Up @@ -594,7 +594,6 @@ class UserIsRestricted < SlackError; end
class UserIsUltraRestricted < SlackError; end
class UserMustBeAdmin < SlackError; end
class UserMustBeInWorkspace < SlackError; end
class UserNotAMemberOfThisWorkspace < SlackError; end
class UserNotFound < SlackError; end
class UserNotInChannel < SlackError; end
class UserNotVisible < SlackError; end
Expand All @@ -611,6 +610,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end

ERROR_CLASSES = {
'access_denied' => AccessDenied,
'access_token_exchange_failed' => AccessTokenExchangeFailed,
'accesslimited' => Accesslimited,
'account_inactive' => AccountInactive,
'action_already_in_progress' => ActionAlreadyInProgress,
Expand Down Expand Up @@ -1043,7 +1043,6 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'not_bearer_token' => NotBearerToken,
'not_enabled' => NotEnabled,
'not_enough_users' => NotEnoughUsers,
'not_enterprise_team' => NotEnterpriseTeam,
'not_found' => NotFound,
'not_implemented' => NotImplemented,
'not_in_channel' => NotInChannel,
Expand Down Expand Up @@ -1199,7 +1198,6 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'user_is_ultra_restricted' => UserIsUltraRestricted,
'user_must_be_admin' => UserMustBeAdmin,
'user_must_be_in_workspace' => UserMustBeInWorkspace,
'user_not_a_member_of_this_workspace' => UserNotAMemberOfThisWorkspace,
'user_not_found' => UserNotFound,
'user_not_in_channel' => UserNotInChannel,
'user_not_visible' => UserNotVisible,
Expand Down
8 changes: 8 additions & 0 deletions spec/slack/web/api/endpoints/admin_apps_activities_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::AdminAppsActivities do
let(:client) { Slack::Web::Client.new }
end
13 changes: 0 additions & 13 deletions spec/slack/web/api/endpoints/migration_spec.rb

This file was deleted.

0 comments on commit 3765415

Please sign in to comment.