Skip to content

Commit

Permalink
Update API from slack-api-ref@7c22d0b (2023-07-10)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and dblock committed Jul 11, 2023
1 parent 19fe79d commit dc1d514
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [#476](https://github.com/slack-ruby-client/pulls/476): Update API from [slack-api-ref@d0b2989](https://github.com/slack-ruby/slack-api-ref/commit/d0b2989) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#478](https://github.com/slack-ruby-client/pulls/478): Update API from [slack-api-ref@d797055](https://github.com/slack-ruby/slack-api-ref/commit/d797055) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#480](https://github.com/slack-ruby-client/pulls/480): Add common message formatting utilities - [@chrisbloom7](https://github.com/chrisbloom7).
* [#481](https://github.com/slack-ruby-client/pulls/481): Update API from [slack-api-ref@7c22d0b](https://github.com/slack-ruby/slack-api-ref/commit/7c22d0b) - [@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/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 'AppsActivities methods.'
command 'apps_activities' do |g|
g.desc 'Get logs for a specified app'
g.long_desc %( Get logs for a specified app )
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.apps_activities_list(options))
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion bin/commands/reminders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class App
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 '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: 'The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.'
c.flag 'user', desc: 'No longer supported - reminders cannot be set for other users. Previously, was the user who would receive the reminder.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.reminders_add(options))
end
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/stars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Cli
class App
desc 'Stars methods.'
command 'stars' do |g|
g.desc 'Save an item for later. Formerly known as _adding a star_.'
g.long_desc %( Save an item for later. Formerly known as _adding a star_. )
g.desc 'Save an item for later. Formerly known as adding a star.'
g.long_desc %( Save an item for later. Formerly known as adding a star. )
g.command 'add' do |c|
c.flag 'channel', desc: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).'
c.flag 'file', desc: 'File to add star to.'
Expand All @@ -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 "Listed a user's saved items, formerly known as stars."
g.long_desc %( Listed 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
4 changes: 2 additions & 2 deletions lib/slack/real_time/stores/starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ def initialize(attrs, _options = {})
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/shared_channel_invite_received.json
# on :shared_channel_invite_received do |data|

# A member has starred an item.
# A member has saved an item for later or starred an item.
# @see https://api.slack.com/events/star_added
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
# on :star_added do |data|

# A member removed a star.
# A member has removed an item saved for later or starred an item.
# @see https://api.slack.com/events/star_removed
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
# on :star_removed do |data|
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/real_time/stores/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ def team
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/shared_channel_invite_received.json
# on :shared_channel_invite_received do |data|

# A member has starred an item.
# A member has saved an item for later or starred an item.
# @see https://api.slack.com/events/star_added
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
# on :star_added do |data|

# A member removed a star.
# A member has removed an item saved for later or starred an item.
# @see https://api.slack.com/events/star_removed
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
# on :star_removed do |data|
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_activities'
require_relative 'endpoints/apps_auth_external'
require_relative 'endpoints/apps_connections'
require_relative 'endpoints/apps_datastore'
Expand Down Expand Up @@ -106,6 +107,7 @@ module Endpoints
include AdminUsersUnsupportedversions
include Api
include Apps
include AppsActivities
include AppsAuthExternal
include AppsConnections
include AppsDatastore
Expand Down
54 changes: 54 additions & 0 deletions lib/slack/web/api/endpoints/apps_activities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
module Web
module Api
module Endpoints
module AppsActivities
#
# Get logs for a specified app
#
# @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/apps.activities.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.activities/apps.activities.list.json
def apps_activities_list(options = {})
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
if block_given?
Pagination::Cursor.new(self, :apps_activities_list, options).each do |page|
yield page
end
else
post('apps.activities.list', options)
end
end
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/slack/web/api/endpoints/reminders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Reminders
# @option options [string] :team_id
# Encoded team id, required if org token is used.
# @option options [user] :user
# The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.
# No longer supported - reminders cannot be set for other users. Previously, was the user who would receive the reminder.
# @see https://api.slack.com/methods/reminders.add
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.add.json
def reminders_add(options = {})
Expand Down
4 changes: 2 additions & 2 deletions lib/slack/web/api/endpoints/stars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Api
module Endpoints
module Stars
#
# Save an item for later. Formerly known as _adding a star_.
# Save an item for later. Formerly known as adding a star.
#
# @option options [channel] :channel
# Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
Expand All @@ -25,7 +25,7 @@ def stars_add(options = {})
end

#
# List a user's saved items, formerly known as stars.
# Listed 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
6 changes: 6 additions & 0 deletions lib/slack/web/api/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class DuplicateMessageNotFound < SlackError; end
class EditWindowClosed < SlackError; end
class EkmAccessDenied < SlackError; end
class EmailDoesNotMatch < SlackError; end
class EmailNotVerified < SlackError; end
class EmailTaken < SlackError; end
class EmojiLimitReached < SlackError; end
class EmojiNotFound < SlackError; end
Expand Down Expand Up @@ -455,6 +456,7 @@ class OneOrMoreInvalidChannels < SlackError; end
class OrgLevelEmailDisplayDisabled < SlackError; end
class OrgLoginRequired < SlackError; end
class OrgNotFound < SlackError; end
class OrgResolutionRequired < SlackError; end
class OrgUserNotInTeam < SlackError; end
class OverMaxEntityLimit < SlackError; end
class OverPaginationLimit < SlackError; end
Expand Down Expand Up @@ -523,6 +525,7 @@ class TeamNotFound < SlackError; end
class TeamNotOnEnterprise < SlackError; end
class TeamQuotaExceeded < SlackError; end
class TeamsNotFound < SlackError; end
class TemplateNotVisible < SlackError; end
class ThreadLocked < SlackError; end
class ThreadNotFound < SlackError; end
class TimeInPast < SlackError; end
Expand Down Expand Up @@ -751,6 +754,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'edit_window_closed' => EditWindowClosed,
'ekm_access_denied' => EkmAccessDenied,
'email_does_not_match' => EmailDoesNotMatch,
'email_not_verified' => EmailNotVerified,
'email_taken' => EmailTaken,
'emoji_limit_reached' => EmojiLimitReached,
'emoji_not_found' => EmojiNotFound,
Expand Down Expand Up @@ -1056,6 +1060,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'org_level_email_display_disabled' => OrgLevelEmailDisplayDisabled,
'org_login_required' => OrgLoginRequired,
'org_not_found' => OrgNotFound,
'org_resolution_required' => OrgResolutionRequired,
'org_user_not_in_team' => OrgUserNotInTeam,
'over_max_entity_limit' => OverMaxEntityLimit,
'over_pagination_limit' => OverPaginationLimit,
Expand Down Expand Up @@ -1124,6 +1129,7 @@ class WorkflowsExportCsvNotEnabled < SlackError; end
'team_not_on_enterprise' => TeamNotOnEnterprise,
'team_quota_exceeded' => TeamQuotaExceeded,
'teams_not_found' => TeamsNotFound,
'template_not_visible' => TemplateNotVisible,
'thread_locked' => ThreadLocked,
'thread_not_found' => ThreadNotFound,
'time_in_past' => TimeInPast,
Expand Down
13 changes: 13 additions & 0 deletions spec/slack/web/api/endpoints/apps_activities_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::AppsActivities do
let(:client) { Slack::Web::Client.new }
context 'apps.activities_list' do
it 'requires app_id' do
expect { client.apps_activities_list }.to raise_error ArgumentError, /Required arguments :app_id missing/
end
end
end

0 comments on commit dc1d514

Please sign in to comment.