slack-ruby-client 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/{integtest.yml → integration_test.yml} +6 -5
- data/.github/workflows/{rubocop.yml → lint.yml} +5 -4
- data/.github/workflows/{danger.yml → pr_lint.yml} +8 -6
- data/.github/workflows/test.yml +4 -2
- data/.gitignore +0 -1
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +8 -14
- data/.ruby-version +1 -0
- data/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +5 -4
- data/Gemfile +1 -6
- data/README.md +60 -63
- data/RELEASING.md +1 -1
- data/UPGRADING.md +28 -0
- data/bin/commands/admin_audit_anomaly_allow.rb +23 -0
- data/bin/commands/admin_conversations.rb +12 -11
- data/bin/commands/admin_users.rb +1 -1
- data/bin/commands/admin_users_session.rb +1 -1
- data/bin/commands/apps_connections.rb +2 -2
- data/bin/commands/bookmarks.rb +1 -0
- data/bin/commands/chat.rb +9 -6
- data/bin/commands/conversations.rb +8 -6
- data/bin/commands/files.rb +24 -0
- data/bin/commands/rtm.rb +0 -15
- data/bin/commands/views.rb +4 -2
- data/bin/commands.rb +1 -0
- data/bin/slack +1 -1
- data/lib/slack/real_time/api/message.rb +3 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
- data/lib/slack/real_time/api/typing.rb +2 -1
- data/lib/slack/real_time/client.rb +8 -26
- data/lib/slack/real_time/config.rb +3 -3
- data/lib/slack/real_time/models/channel.rb +4 -0
- data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
- data/lib/slack/real_time/models.rb +2 -1
- data/lib/slack/real_time/stores/base.rb +25 -9
- data/lib/slack/real_time/stores/starter.rb +323 -309
- data/lib/slack/real_time/stores/store.rb +265 -198
- data/lib/slack/real_time/stores.rb +1 -7
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -28
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_emoji.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
- data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_manifest.rb +6 -6
- data/lib/slack/web/api/endpoints/bookmarks.rb +10 -8
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +5 -5
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/chat.rb +36 -30
- data/lib/slack/web/api/endpoints/conversations.rb +37 -33
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +45 -8
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
- data/lib/slack/web/api/endpoints/migration.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -3
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +0 -23
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +4 -4
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
- data/lib/slack/web/api/endpoints/users.rb +4 -4
- data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
- data/lib/slack/web/api/endpoints/views.rb +16 -11
- data/lib/slack/web/api/endpoints/workflows.rb +4 -4
- data/lib/slack/web/api/endpoints.rb +2 -0
- data/lib/slack/web/api/errors.rb +56 -6
- data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +2 -1
- data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
- data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
- data/lib/slack/web/api/patches/views.view-json.patch +55 -0
- data/lib/slack/web/api/templates/method.erb +1 -1
- data/lib/slack/web/config.rb +2 -2
- data/lib/tasks/real_time.rake +44 -22
- data/lib/tasks/web.rake +9 -2
- data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
- data/spec/slack/events/config_spec.rb +2 -0
- data/spec/slack/events/request_spec.rb +4 -0
- data/spec/slack/messages/formatting_spec.rb +10 -0
- data/spec/slack/real_time/api/message_spec.rb +1 -1
- data/spec/slack/real_time/api/ping_spec.rb +1 -1
- data/spec/slack/real_time/api/typing_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +73 -111
- data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +28 -25
- data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
- data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +24 -20
- data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
- data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
- data/spec/slack/real_time/stores/store_spec.rb +50 -0
- data/spec/slack/slack_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +17 -1
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +2 -0
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +13 -4
- data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
- data/spec/slack/web/api/mixins/users_spec.rb +2 -0
- data/spec/slack/web/api/pagination/cursor_spec.rb +4 -0
- data/spec/slack/web/client_spec.rb +14 -4
- data/spec/support/real_time/loaded_client.rb +120 -0
- metadata +18 -35
- data/bin/commands/admin_conversations_whitelist.rb +0 -37
- data/bin/commands/apps_permissions.rb +0 -23
- data/bin/commands/apps_permissions_resources.rb +0 -15
- data/bin/commands/apps_permissions_scopes.rb +0 -13
- data/bin/commands/apps_permissions_users.rb +0 -26
- data/bin/commands/channels.rb +0 -23
- data/bin/commands/groups.rb +0 -14
- data/bin/commands/im.rb +0 -6
- data/bin/commands/mpim.rb +0 -6
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
- data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
- data/lib/slack/web/api/endpoints/channels.rb +0 -25
- data/lib/slack/web/api/endpoints/groups.rb +0 -13
- data/lib/slack/web/api/endpoints/im.rb +0 -13
- data/lib/slack/web/api/endpoints/mpim.rb +0 -13
- data/lib/slack/web/api/endpoints/presence.rb +0 -23
- data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
- data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
- data/spec/fixtures/slack/web/rtm_start.yml +0 -815
- data/spec/slack/real_time/rtm_start_spec.rb +0 -14
- data/spec/slack/real_time/store_spec.rb +0 -12
|
@@ -24,7 +24,7 @@ module Slack
|
|
|
24
24
|
# @see https://api.slack.com/methods/usergroups.create
|
|
25
25
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
|
|
26
26
|
def usergroups_create(options = {})
|
|
27
|
-
|
|
27
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
|
28
28
|
post('usergroups.create', options)
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ module Slack
|
|
|
40
40
|
# @see https://api.slack.com/methods/usergroups.disable
|
|
41
41
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
|
|
42
42
|
def usergroups_disable(options = {})
|
|
43
|
-
|
|
43
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
|
44
44
|
post('usergroups.disable', options)
|
|
45
45
|
end
|
|
46
46
|
|
|
@@ -56,7 +56,7 @@ module Slack
|
|
|
56
56
|
# @see https://api.slack.com/methods/usergroups.enable
|
|
57
57
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
|
|
58
58
|
def usergroups_enable(options = {})
|
|
59
|
-
|
|
59
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
|
60
60
|
post('usergroups.enable', options)
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -97,7 +97,7 @@ module Slack
|
|
|
97
97
|
# @see https://api.slack.com/methods/usergroups.update
|
|
98
98
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
|
|
99
99
|
def usergroups_update(options = {})
|
|
100
|
-
|
|
100
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
|
101
101
|
post('usergroups.update', options)
|
|
102
102
|
end
|
|
103
103
|
end
|
|
@@ -18,7 +18,7 @@ module Slack
|
|
|
18
18
|
# @see https://api.slack.com/methods/usergroups.users.list
|
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
|
|
20
20
|
def usergroups_users_list(options = {})
|
|
21
|
-
|
|
21
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
|
22
22
|
post('usergroups.users.list', options)
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -36,8 +36,8 @@ module Slack
|
|
|
36
36
|
# @see https://api.slack.com/methods/usergroups.users.update
|
|
37
37
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json
|
|
38
38
|
def usergroups_users_update(options = {})
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
|
40
|
+
raise ArgumentError, 'Required arguments :users missing' if options[:users].nil?
|
|
41
41
|
post('usergroups.users.update', options)
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -74,7 +74,7 @@ module Slack
|
|
|
74
74
|
# @see https://api.slack.com/methods/users.info
|
|
75
75
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.info.json
|
|
76
76
|
def users_info(options = {})
|
|
77
|
-
|
|
77
|
+
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
|
|
78
78
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
79
79
|
post('users.info', options)
|
|
80
80
|
end
|
|
@@ -110,7 +110,7 @@ module Slack
|
|
|
110
110
|
# @see https://api.slack.com/methods/users.lookupByEmail
|
|
111
111
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.lookupByEmail.json
|
|
112
112
|
def users_lookupByEmail(options = {})
|
|
113
|
-
|
|
113
|
+
raise ArgumentError, 'Required arguments :email missing' if options[:email].nil?
|
|
114
114
|
post('users.lookupByEmail', options)
|
|
115
115
|
end
|
|
116
116
|
|
|
@@ -132,7 +132,7 @@ module Slack
|
|
|
132
132
|
# X coordinate of top-left corner of crop box.
|
|
133
133
|
# @option options [string] :crop_y
|
|
134
134
|
# Y coordinate of top-left corner of crop box.
|
|
135
|
-
# @option options [
|
|
135
|
+
# @option options [Object] :image
|
|
136
136
|
# File contents via multipart/form-data.
|
|
137
137
|
# @see https://api.slack.com/methods/users.setPhoto
|
|
138
138
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPhoto.json
|
|
@@ -148,7 +148,7 @@ module Slack
|
|
|
148
148
|
# @see https://api.slack.com/methods/users.setPresence
|
|
149
149
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPresence.json
|
|
150
150
|
def users_setPresence(options = {})
|
|
151
|
-
|
|
151
|
+
raise ArgumentError, 'Required arguments :presence missing' if options[:presence].nil?
|
|
152
152
|
post('users.setPresence', options)
|
|
153
153
|
end
|
|
154
154
|
end
|
|
@@ -25,7 +25,7 @@ module Slack
|
|
|
25
25
|
# Invite a guest that can use one channel only
|
|
26
26
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/users.admin/users.admin.invite.json
|
|
27
27
|
def users_admin_invite(options = {})
|
|
28
|
-
|
|
28
|
+
raise ArgumentError, 'Required arguments :email missing' if options[:email].nil?
|
|
29
29
|
logger.warn('The users.admin.invite method is undocumented.')
|
|
30
30
|
post('users.admin.invite', options)
|
|
31
31
|
end
|
|
@@ -37,7 +37,7 @@ module Slack
|
|
|
37
37
|
# User to disable
|
|
38
38
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/users.admin/users.admin.setInactive.json
|
|
39
39
|
def users_admin_setInactive(options = {})
|
|
40
|
-
|
|
40
|
+
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
|
|
41
41
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
42
42
|
logger.warn('The users.admin.setInactive method is undocumented.')
|
|
43
43
|
post('users.admin.setInactive', options)
|
|
@@ -9,15 +9,17 @@ module Slack
|
|
|
9
9
|
#
|
|
10
10
|
# Open a view for a user.
|
|
11
11
|
#
|
|
12
|
-
# @option options [string] :trigger_id
|
|
13
|
-
# Exchange a trigger to post to the user.
|
|
14
12
|
# @option options [view as string] :view
|
|
15
13
|
# A view payload. This must be a JSON-encoded string.
|
|
14
|
+
# @option options [string] :trigger_id
|
|
15
|
+
# Exchange a trigger to post to the user.
|
|
16
|
+
# @option options [string] :interactivity_pointer
|
|
17
|
+
# Exchange an interactivity pointer to post to the user.
|
|
16
18
|
# @see https://api.slack.com/methods/views.open
|
|
17
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.open.json
|
|
18
20
|
def views_open(options = {})
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
|
|
22
|
+
raise ArgumentError, 'One of :trigger_id, :interactivity_pointer is required' unless options[:trigger_id].nil? ^ options[:interactivity_pointer].nil?
|
|
21
23
|
if options.key?(:view)
|
|
22
24
|
view = options[:view]
|
|
23
25
|
view = JSON.dump(view) unless view.is_a?(String)
|
|
@@ -38,8 +40,8 @@ module Slack
|
|
|
38
40
|
# @see https://api.slack.com/methods/views.publish
|
|
39
41
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.publish.json
|
|
40
42
|
def views_publish(options = {})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
raise ArgumentError, 'Required arguments :user_id missing' if options[:user_id].nil?
|
|
44
|
+
raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
|
|
43
45
|
if options.key?(:view)
|
|
44
46
|
view = options[:view]
|
|
45
47
|
view = JSON.dump(view) unless view.is_a?(String)
|
|
@@ -51,15 +53,17 @@ module Slack
|
|
|
51
53
|
#
|
|
52
54
|
# Push a view onto the stack of a root view.
|
|
53
55
|
#
|
|
54
|
-
# @option options [string] :trigger_id
|
|
55
|
-
# Exchange a trigger to post to the user.
|
|
56
56
|
# @option options [view as string] :view
|
|
57
57
|
# A view payload. This must be a JSON-encoded string.
|
|
58
|
+
# @option options [string] :trigger_id
|
|
59
|
+
# Exchange a trigger to post to the user.
|
|
60
|
+
# @option options [string] :interactivity_pointer
|
|
61
|
+
# Exchange an interactivity pointer to post to the user.
|
|
58
62
|
# @see https://api.slack.com/methods/views.push
|
|
59
63
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.push.json
|
|
60
64
|
def views_push(options = {})
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
|
|
66
|
+
raise ArgumentError, 'One of :trigger_id, :interactivity_pointer is required' unless options[:trigger_id].nil? ^ options[:interactivity_pointer].nil?
|
|
63
67
|
if options.key?(:view)
|
|
64
68
|
view = options[:view]
|
|
65
69
|
view = JSON.dump(view) unless view.is_a?(String)
|
|
@@ -82,7 +86,8 @@ module Slack
|
|
|
82
86
|
# @see https://api.slack.com/methods/views.update
|
|
83
87
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json
|
|
84
88
|
def views_update(options = {})
|
|
85
|
-
|
|
89
|
+
raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
|
|
90
|
+
raise ArgumentError, 'One of :external_id, :view_id is required' unless options[:external_id].nil? ^ options[:view_id].nil?
|
|
86
91
|
if options.key?(:view)
|
|
87
92
|
view = options[:view]
|
|
88
93
|
view = JSON.dump(view) unless view.is_a?(String)
|
|
@@ -16,7 +16,7 @@ module Slack
|
|
|
16
16
|
# @see https://api.slack.com/methods/workflows.stepCompleted
|
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.stepCompleted.json
|
|
18
18
|
def workflows_stepCompleted(options = {})
|
|
19
|
-
|
|
19
|
+
raise ArgumentError, 'Required arguments :workflow_step_execute_id missing' if options[:workflow_step_execute_id].nil?
|
|
20
20
|
post('workflows.stepCompleted', options)
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -30,8 +30,8 @@ module Slack
|
|
|
30
30
|
# @see https://api.slack.com/methods/workflows.stepFailed
|
|
31
31
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.stepFailed.json
|
|
32
32
|
def workflows_stepFailed(options = {})
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
raise ArgumentError, 'Required arguments :error missing' if options[:error].nil?
|
|
34
|
+
raise ArgumentError, 'Required arguments :workflow_step_execute_id missing' if options[:workflow_step_execute_id].nil?
|
|
35
35
|
post('workflows.stepFailed', options)
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -51,7 +51,7 @@ module Slack
|
|
|
51
51
|
# @see https://api.slack.com/methods/workflows.updateStep
|
|
52
52
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.updateStep.json
|
|
53
53
|
def workflows_updateStep(options = {})
|
|
54
|
-
|
|
54
|
+
raise ArgumentError, 'Required arguments :workflow_step_edit_id missing' if options[:workflow_step_edit_id].nil?
|
|
55
55
|
post('workflows.updateStep', options)
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -6,6 +6,7 @@ require_relative 'endpoints/admin_apps'
|
|
|
6
6
|
require_relative 'endpoints/admin_apps_approved'
|
|
7
7
|
require_relative 'endpoints/admin_apps_requests'
|
|
8
8
|
require_relative 'endpoints/admin_apps_restricted'
|
|
9
|
+
require_relative 'endpoints/admin_audit_anomaly_allow'
|
|
9
10
|
require_relative 'endpoints/admin_auth_policy'
|
|
10
11
|
require_relative 'endpoints/admin_barriers'
|
|
11
12
|
require_relative 'endpoints/admin_conversations'
|
|
@@ -79,6 +80,7 @@ module Slack
|
|
|
79
80
|
include AdminAppsApproved
|
|
80
81
|
include AdminAppsRequests
|
|
81
82
|
include AdminAppsRestricted
|
|
83
|
+
include AdminAuditAnomalyAllow
|
|
82
84
|
include AdminAuthPolicy
|
|
83
85
|
include AdminBarriers
|
|
84
86
|
include AdminConversations
|
data/lib/slack/web/api/errors.rb
CHANGED
|
@@ -19,8 +19,10 @@ module Slack
|
|
|
19
19
|
class AlreadyProcessed < SlackError; end
|
|
20
20
|
class AlreadyReacted < SlackError; end
|
|
21
21
|
class AlreadyStarred < SlackError; end
|
|
22
|
+
class AltTxtTooLarge < SlackError; end
|
|
22
23
|
class AppManagementAppNotInstalledOnOrg < SlackError; end
|
|
23
24
|
class AppMissingActionUrl < SlackError; end
|
|
25
|
+
class AppNotEligible < SlackError; end
|
|
24
26
|
class AppNotFound < SlackError; end
|
|
25
27
|
class AppRestrictedOrgWide < SlackError; end
|
|
26
28
|
class ApprovalInactive < SlackError; end
|
|
@@ -41,6 +43,7 @@ module Slack
|
|
|
41
43
|
class BarrierAlreadyExists < SlackError; end
|
|
42
44
|
class BarrierNotFound < SlackError; end
|
|
43
45
|
class BarrieredFromUsergroupsNotFound < SlackError; end
|
|
46
|
+
class BlockMismatch < SlackError; end
|
|
44
47
|
class BotNotFound < SlackError; end
|
|
45
48
|
class BotUserRequired < SlackError; end
|
|
46
49
|
class BotsNotAllowed < SlackError; end
|
|
@@ -102,6 +105,7 @@ module Slack
|
|
|
102
105
|
class ChannelTypeNotSupported < SlackError; end
|
|
103
106
|
class ClientIdTokenMismatch < SlackError; end
|
|
104
107
|
class CodeAlreadyUsed < SlackError; end
|
|
108
|
+
class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end
|
|
105
109
|
class ConnectionLimitExceeded < SlackError; end
|
|
106
110
|
class ConnectionLimitExceededPending < SlackError; end
|
|
107
111
|
class CouldNotArchiveChannel < SlackError; end
|
|
@@ -136,6 +140,7 @@ module Slack
|
|
|
136
140
|
class EmailTaken < SlackError; end
|
|
137
141
|
class EmojiLimitReached < SlackError; end
|
|
138
142
|
class EmojiNotFound < SlackError; end
|
|
143
|
+
class EndpointUnavailable < SlackError; end
|
|
139
144
|
class EnterpriseIsRestricted < SlackError; end
|
|
140
145
|
class EnterpriseNotFound < SlackError; end
|
|
141
146
|
class EntityNotFound < SlackError; end
|
|
@@ -153,6 +158,7 @@ module Slack
|
|
|
153
158
|
class ExchangedTriggerId < SlackError; end
|
|
154
159
|
class ExpiredTriggerId < SlackError; end
|
|
155
160
|
class ExternalChannelMigrating < SlackError; end
|
|
161
|
+
class ExternalTeamNotConnectedToThisOrg < SlackError; end
|
|
156
162
|
class ExternallySharedOrDisconnectedChannel < SlackError; end
|
|
157
163
|
class FailToGetTeamsForRestrictedUser < SlackError; end
|
|
158
164
|
class FailedAddingCollaborator < SlackError; end
|
|
@@ -178,6 +184,7 @@ module Slack
|
|
|
178
184
|
class FailedToSetUserToAdmin < SlackError; end
|
|
179
185
|
class FailedToSetUserToOwner < SlackError; end
|
|
180
186
|
class FailedToSetUserToRegular < SlackError; end
|
|
187
|
+
class FailedToStartTrial < SlackError; end
|
|
181
188
|
class FailedToUnlinkChannel < SlackError; end
|
|
182
189
|
class FailedToUnshare < SlackError; end
|
|
183
190
|
class FailedToValidateCaller < SlackError; end
|
|
@@ -196,6 +203,9 @@ module Slack
|
|
|
196
203
|
class FileNotShared < SlackError; end
|
|
197
204
|
class FileNotYetAvailable < SlackError; end
|
|
198
205
|
class FileUnderReview < SlackError; end
|
|
206
|
+
class FileUpdateFailed < SlackError; end
|
|
207
|
+
class FileUploadSizeRestricted < SlackError; end
|
|
208
|
+
class FileUploadsDisabled < SlackError; end
|
|
199
209
|
class ForbiddenHandle < SlackError; end
|
|
200
210
|
class ForbiddenTeam < SlackError; end
|
|
201
211
|
class GroupAlreadyLinkedToChannel < SlackError; end
|
|
@@ -241,6 +251,7 @@ module Slack
|
|
|
241
251
|
class InvalidEntityId < SlackError; end
|
|
242
252
|
class InvalidEventContext < SlackError; end
|
|
243
253
|
class InvalidExternalId < SlackError; end
|
|
254
|
+
class InvalidFieldOrData < SlackError; end
|
|
244
255
|
class InvalidFormData < SlackError; end
|
|
245
256
|
class InvalidGrantType < SlackError; end
|
|
246
257
|
class InvalidGroupProvided < SlackError; end
|
|
@@ -250,6 +261,8 @@ module Slack
|
|
|
250
261
|
class InvalidLink < SlackError; end
|
|
251
262
|
class InvalidManifest < SlackError; end
|
|
252
263
|
class InvalidMetadataFilterKeys < SlackError; end
|
|
264
|
+
class InvalidMetadataFormat < SlackError; end
|
|
265
|
+
class InvalidMetadataSchema < SlackError; end
|
|
253
266
|
class InvalidName < SlackError; end
|
|
254
267
|
class InvalidNameMaxlength < SlackError; end
|
|
255
268
|
class InvalidNamePunctuation < SlackError; end
|
|
@@ -319,13 +332,16 @@ module Slack
|
|
|
319
332
|
class LimitRequired < SlackError; end
|
|
320
333
|
class LinkNotFound < SlackError; end
|
|
321
334
|
class MalwareDetected < SlackError; end
|
|
335
|
+
class ManagedChannelNotSupported < SlackError; end
|
|
322
336
|
class MemberAnalyticsDisabled < SlackError; end
|
|
323
337
|
class MemberLimitExceeded < SlackError; end
|
|
324
338
|
class MessageNotFound < SlackError; end
|
|
325
339
|
class MessageTooLong < SlackError; end
|
|
326
340
|
class MessagesTabDisabled < SlackError; end
|
|
341
|
+
class MetadataMustBeSentFromApp < SlackError; end
|
|
327
342
|
class MetadataNotAvailable < SlackError; end
|
|
328
343
|
class MetadataOnlyDoesNotSupportDate < SlackError; end
|
|
344
|
+
class MetadataTooLarge < SlackError; end
|
|
329
345
|
class MethodDeprecated < SlackError; end
|
|
330
346
|
class MethodNotSupportedForChannelType < SlackError; end
|
|
331
347
|
class MigrationInProgress < SlackError; end
|
|
@@ -360,6 +376,7 @@ module Slack
|
|
|
360
376
|
class NoAliasSelected < SlackError; end
|
|
361
377
|
class NoBotUserForApp < SlackError; end
|
|
362
378
|
class NoChannel < SlackError; end
|
|
379
|
+
class NoChannelMemberships < SlackError; end
|
|
363
380
|
class NoDualBroadcastContentUpdate < SlackError; end
|
|
364
381
|
class NoImageUploaded < SlackError; end
|
|
365
382
|
class NoItemSpecified < SlackError; end
|
|
@@ -374,7 +391,6 @@ module Slack
|
|
|
374
391
|
class NoTeamsToDisconnect < SlackError; end
|
|
375
392
|
class NoText < SlackError; end
|
|
376
393
|
class NoUser < SlackError; end
|
|
377
|
-
class NoUserProvided < SlackError; end
|
|
378
394
|
class NoUsersProvided < SlackError; end
|
|
379
395
|
class NotAdmin < SlackError; end
|
|
380
396
|
class NotAllowed < SlackError; end
|
|
@@ -401,6 +417,7 @@ module Slack
|
|
|
401
417
|
class NotReactable < SlackError; end
|
|
402
418
|
class NotStarred < SlackError; end
|
|
403
419
|
class NotSupported < SlackError; end
|
|
420
|
+
class NotVisible < SlackError; end
|
|
404
421
|
class OauthAuthorizationUrlMismatch < SlackError; end
|
|
405
422
|
class OneOrMoreInvalidChannels < SlackError; end
|
|
406
423
|
class OrgLevelEmailDisplayDisabled < SlackError; end
|
|
@@ -418,6 +435,7 @@ module Slack
|
|
|
418
435
|
class PermissionDenied < SlackError; end
|
|
419
436
|
class PlanUpgradeRequired < SlackError; end
|
|
420
437
|
class PolicyNotFound < SlackError; end
|
|
438
|
+
class PostingToChannelDenied < SlackError; end
|
|
421
439
|
class PostingToGeneralChannelDenied < SlackError; end
|
|
422
440
|
class PreviewFeatureNotAvailable < SlackError; end
|
|
423
441
|
class PrimaryUsergroupNotFound < SlackError; end
|
|
@@ -440,8 +458,8 @@ module Slack
|
|
|
440
458
|
class RestrictedActionReadOnlyChannel < SlackError; end
|
|
441
459
|
class RestrictedActionThreadLocked < SlackError; end
|
|
442
460
|
class RestrictedActionThreadOnlyChannel < SlackError; end
|
|
461
|
+
class RestrictedTooMany < SlackError; end
|
|
443
462
|
class RetentionOverrideNotAllowed < SlackError; end
|
|
444
|
-
class RtmConnectRequired < SlackError; end
|
|
445
463
|
class SentRecently < SlackError; end
|
|
446
464
|
class ServiceUnavailable < SlackError; end
|
|
447
465
|
class SessionExpired < SlackError; end
|
|
@@ -452,11 +470,13 @@ module Slack
|
|
|
452
470
|
class SlackConnectClipSharingBlocked < SlackError; end
|
|
453
471
|
class SlackConnectFileLinkSharingBlocked < SlackError; end
|
|
454
472
|
class SlackConnectFileUploadSharingBlocked < SlackError; end
|
|
473
|
+
class SnippetTooLarge < SlackError; end
|
|
455
474
|
class SnoozeEndFailed < SlackError; end
|
|
456
475
|
class SnoozeFailed < SlackError; end
|
|
457
|
-
class SnoozeNotActive < SlackError; end
|
|
458
476
|
class SpecifyEnterpriseOrTeams < SlackError; end
|
|
477
|
+
class StorageLimitReached < SlackError; end
|
|
459
478
|
class SubteamMaxUsersExceeded < SlackError; end
|
|
479
|
+
class SudoRequired < SlackError; end
|
|
460
480
|
class TeamAccessNotGranted < SlackError; end
|
|
461
481
|
class TeamAddedToOrg < SlackError; end
|
|
462
482
|
class TeamIdOrOrgRequired < SlackError; end
|
|
@@ -496,11 +516,16 @@ module Slack
|
|
|
496
516
|
class TriggerExpired < SlackError; end
|
|
497
517
|
class TwoFactorSetupRequired < SlackError; end
|
|
498
518
|
class UnableToLinkIdpGroupAndChannel < SlackError; end
|
|
519
|
+
class UnableToProcessPostRequest < SlackError; end
|
|
499
520
|
class UnableToUnlinkIdpGroupAndChannel < SlackError; end
|
|
500
521
|
class UnableToUpdateExistingSessions < SlackError; end
|
|
501
522
|
class UnknownError < SlackError; end
|
|
502
523
|
class UnknownMethod < SlackError; end
|
|
524
|
+
class UnknownSnippetType < SlackError; end
|
|
525
|
+
class UnknownSubtype < SlackError; end
|
|
503
526
|
class UnknownType < SlackError; end
|
|
527
|
+
class UnsupportedActionDescribe < SlackError; end
|
|
528
|
+
class UnsupportedActionPut < SlackError; end
|
|
504
529
|
class UnsupportedArguments < SlackError; end
|
|
505
530
|
class UnsupportedContextType < SlackError; end
|
|
506
531
|
class UnsupportedTeamType < SlackError; end
|
|
@@ -547,8 +572,10 @@ module Slack
|
|
|
547
572
|
'already_processed' => AlreadyProcessed,
|
|
548
573
|
'already_reacted' => AlreadyReacted,
|
|
549
574
|
'already_starred' => AlreadyStarred,
|
|
575
|
+
'alt_txt_too_large' => AltTxtTooLarge,
|
|
550
576
|
'app_management_app_not_installed_on_org' => AppManagementAppNotInstalledOnOrg,
|
|
551
577
|
'app_missing_action_url' => AppMissingActionUrl,
|
|
578
|
+
'app_not_eligible' => AppNotEligible,
|
|
552
579
|
'app_not_found' => AppNotFound,
|
|
553
580
|
'app_restricted_org_wide' => AppRestrictedOrgWide,
|
|
554
581
|
'approval_inactive' => ApprovalInactive,
|
|
@@ -569,6 +596,7 @@ module Slack
|
|
|
569
596
|
'barrier_already_exists' => BarrierAlreadyExists,
|
|
570
597
|
'barrier_not_found' => BarrierNotFound,
|
|
571
598
|
'barriered_from_usergroups_not_found' => BarrieredFromUsergroupsNotFound,
|
|
599
|
+
'block_mismatch' => BlockMismatch,
|
|
572
600
|
'bot_not_found' => BotNotFound,
|
|
573
601
|
'bot_user_required' => BotUserRequired,
|
|
574
602
|
'bots_not_allowed' => BotsNotAllowed,
|
|
@@ -630,6 +658,7 @@ module Slack
|
|
|
630
658
|
'channel_type_not_supported' => ChannelTypeNotSupported,
|
|
631
659
|
'client_id_token_mismatch' => ClientIdTokenMismatch,
|
|
632
660
|
'code_already_used' => CodeAlreadyUsed,
|
|
661
|
+
'connected_team_passed_in_is_not_top_level_team' => ConnectedTeamPassedInIsNotTopLevelTeam,
|
|
633
662
|
'connection_limit_exceeded' => ConnectionLimitExceeded,
|
|
634
663
|
'connection_limit_exceeded_pending' => ConnectionLimitExceededPending,
|
|
635
664
|
'could_not_archive_channel' => CouldNotArchiveChannel,
|
|
@@ -664,6 +693,7 @@ module Slack
|
|
|
664
693
|
'email_taken' => EmailTaken,
|
|
665
694
|
'emoji_limit_reached' => EmojiLimitReached,
|
|
666
695
|
'emoji_not_found' => EmojiNotFound,
|
|
696
|
+
'endpoint_unavailable' => EndpointUnavailable,
|
|
667
697
|
'enterprise_is_restricted' => EnterpriseIsRestricted,
|
|
668
698
|
'enterprise_not_found' => EnterpriseNotFound,
|
|
669
699
|
'entity_not_found' => EntityNotFound,
|
|
@@ -681,6 +711,7 @@ module Slack
|
|
|
681
711
|
'exchanged_trigger_id' => ExchangedTriggerId,
|
|
682
712
|
'expired_trigger_id' => ExpiredTriggerId,
|
|
683
713
|
'external_channel_migrating' => ExternalChannelMigrating,
|
|
714
|
+
'external_team_not_connected_to_this_org' => ExternalTeamNotConnectedToThisOrg,
|
|
684
715
|
'externally_shared_or_disconnected_channel' => ExternallySharedOrDisconnectedChannel,
|
|
685
716
|
'fail_to_get_teams_for_restricted_user' => FailToGetTeamsForRestrictedUser,
|
|
686
717
|
'failed_adding_collaborator' => FailedAddingCollaborator,
|
|
@@ -706,6 +737,7 @@ module Slack
|
|
|
706
737
|
'failed_to_set_user_to_admin' => FailedToSetUserToAdmin,
|
|
707
738
|
'failed_to_set_user_to_owner' => FailedToSetUserToOwner,
|
|
708
739
|
'failed_to_set_user_to_regular' => FailedToSetUserToRegular,
|
|
740
|
+
'failed_to_start_trial' => FailedToStartTrial,
|
|
709
741
|
'failed_to_unlink_channel' => FailedToUnlinkChannel,
|
|
710
742
|
'failed_to_unshare' => FailedToUnshare,
|
|
711
743
|
'failed_to_validate_caller' => FailedToValidateCaller,
|
|
@@ -724,6 +756,9 @@ module Slack
|
|
|
724
756
|
'file_not_shared' => FileNotShared,
|
|
725
757
|
'file_not_yet_available' => FileNotYetAvailable,
|
|
726
758
|
'file_under_review' => FileUnderReview,
|
|
759
|
+
'file_update_failed' => FileUpdateFailed,
|
|
760
|
+
'file_upload_size_restricted' => FileUploadSizeRestricted,
|
|
761
|
+
'file_uploads_disabled' => FileUploadsDisabled,
|
|
727
762
|
'forbidden_handle' => ForbiddenHandle,
|
|
728
763
|
'forbidden_team' => ForbiddenTeam,
|
|
729
764
|
'group_already_linked_to_channel' => GroupAlreadyLinkedToChannel,
|
|
@@ -769,6 +804,7 @@ module Slack
|
|
|
769
804
|
'invalid_entity_id' => InvalidEntityId,
|
|
770
805
|
'invalid_event_context' => InvalidEventContext,
|
|
771
806
|
'invalid_external_id' => InvalidExternalId,
|
|
807
|
+
'invalid_field_or_data' => InvalidFieldOrData,
|
|
772
808
|
'invalid_form_data' => InvalidFormData,
|
|
773
809
|
'invalid_grant_type' => InvalidGrantType,
|
|
774
810
|
'invalid_group_provided' => InvalidGroupProvided,
|
|
@@ -778,6 +814,8 @@ module Slack
|
|
|
778
814
|
'invalid_link' => InvalidLink,
|
|
779
815
|
'invalid_manifest' => InvalidManifest,
|
|
780
816
|
'invalid_metadata_filter_keys' => InvalidMetadataFilterKeys,
|
|
817
|
+
'invalid_metadata_format' => InvalidMetadataFormat,
|
|
818
|
+
'invalid_metadata_schema' => InvalidMetadataSchema,
|
|
781
819
|
'invalid_name' => InvalidName,
|
|
782
820
|
'invalid_name_maxlength' => InvalidNameMaxlength,
|
|
783
821
|
'invalid_name_punctuation' => InvalidNamePunctuation,
|
|
@@ -847,13 +885,16 @@ module Slack
|
|
|
847
885
|
'limit_required' => LimitRequired,
|
|
848
886
|
'link_not_found' => LinkNotFound,
|
|
849
887
|
'malware_detected' => MalwareDetected,
|
|
888
|
+
'managed_channel_not_supported' => ManagedChannelNotSupported,
|
|
850
889
|
'member_analytics_disabled' => MemberAnalyticsDisabled,
|
|
851
890
|
'member_limit_exceeded' => MemberLimitExceeded,
|
|
852
891
|
'message_not_found' => MessageNotFound,
|
|
853
892
|
'message_too_long' => MessageTooLong,
|
|
854
893
|
'messages_tab_disabled' => MessagesTabDisabled,
|
|
894
|
+
'metadata_must_be_sent_from_app' => MetadataMustBeSentFromApp,
|
|
855
895
|
'metadata_not_available' => MetadataNotAvailable,
|
|
856
896
|
'metadata_only_does_not_support_date' => MetadataOnlyDoesNotSupportDate,
|
|
897
|
+
'metadata_too_large' => MetadataTooLarge,
|
|
857
898
|
'method_deprecated' => MethodDeprecated,
|
|
858
899
|
'method_not_supported_for_channel_type' => MethodNotSupportedForChannelType,
|
|
859
900
|
'migration_in_progress' => MigrationInProgress,
|
|
@@ -888,6 +929,7 @@ module Slack
|
|
|
888
929
|
'no_alias_selected' => NoAliasSelected,
|
|
889
930
|
'no_bot_user_for_app' => NoBotUserForApp,
|
|
890
931
|
'no_channel' => NoChannel,
|
|
932
|
+
'no_channel_memberships' => NoChannelMemberships,
|
|
891
933
|
'no_dual_broadcast_content_update' => NoDualBroadcastContentUpdate,
|
|
892
934
|
'no_image_uploaded' => NoImageUploaded,
|
|
893
935
|
'no_item_specified' => NoItemSpecified,
|
|
@@ -902,7 +944,6 @@ module Slack
|
|
|
902
944
|
'no_teams_to_disconnect' => NoTeamsToDisconnect,
|
|
903
945
|
'no_text' => NoText,
|
|
904
946
|
'no_user' => NoUser,
|
|
905
|
-
'no_user_provided' => NoUserProvided,
|
|
906
947
|
'no_users_provided' => NoUsersProvided,
|
|
907
948
|
'not_admin' => NotAdmin,
|
|
908
949
|
'not_allowed' => NotAllowed,
|
|
@@ -929,6 +970,7 @@ module Slack
|
|
|
929
970
|
'not_reactable' => NotReactable,
|
|
930
971
|
'not_starred' => NotStarred,
|
|
931
972
|
'not_supported' => NotSupported,
|
|
973
|
+
'not_visible' => NotVisible,
|
|
932
974
|
'oauth_authorization_url_mismatch' => OauthAuthorizationUrlMismatch,
|
|
933
975
|
'one_or_more_invalid_channels' => OneOrMoreInvalidChannels,
|
|
934
976
|
'org_level_email_display_disabled' => OrgLevelEmailDisplayDisabled,
|
|
@@ -946,6 +988,7 @@ module Slack
|
|
|
946
988
|
'permission_denied' => PermissionDenied,
|
|
947
989
|
'plan_upgrade_required' => PlanUpgradeRequired,
|
|
948
990
|
'policy_not_found' => PolicyNotFound,
|
|
991
|
+
'posting_to_channel_denied' => PostingToChannelDenied,
|
|
949
992
|
'posting_to_general_channel_denied' => PostingToGeneralChannelDenied,
|
|
950
993
|
'preview_feature_not_available' => PreviewFeatureNotAvailable,
|
|
951
994
|
'primary_usergroup_not_found' => PrimaryUsergroupNotFound,
|
|
@@ -968,8 +1011,8 @@ module Slack
|
|
|
968
1011
|
'restricted_action_read_only_channel' => RestrictedActionReadOnlyChannel,
|
|
969
1012
|
'restricted_action_thread_locked' => RestrictedActionThreadLocked,
|
|
970
1013
|
'restricted_action_thread_only_channel' => RestrictedActionThreadOnlyChannel,
|
|
1014
|
+
'restricted_too_many' => RestrictedTooMany,
|
|
971
1015
|
'retention_override_not_allowed' => RetentionOverrideNotAllowed,
|
|
972
|
-
'rtm_connect_required' => RtmConnectRequired,
|
|
973
1016
|
'sent_recently' => SentRecently,
|
|
974
1017
|
'service_unavailable' => ServiceUnavailable,
|
|
975
1018
|
'session_expired' => SessionExpired,
|
|
@@ -980,11 +1023,13 @@ module Slack
|
|
|
980
1023
|
'slack_connect_clip_sharing_blocked' => SlackConnectClipSharingBlocked,
|
|
981
1024
|
'slack_connect_file_link_sharing_blocked' => SlackConnectFileLinkSharingBlocked,
|
|
982
1025
|
'slack_connect_file_upload_sharing_blocked' => SlackConnectFileUploadSharingBlocked,
|
|
1026
|
+
'snippet_too_large' => SnippetTooLarge,
|
|
983
1027
|
'snooze_end_failed' => SnoozeEndFailed,
|
|
984
1028
|
'snooze_failed' => SnoozeFailed,
|
|
985
|
-
'snooze_not_active' => SnoozeNotActive,
|
|
986
1029
|
'specify_enterprise_or_teams' => SpecifyEnterpriseOrTeams,
|
|
1030
|
+
'storage_limit_reached' => StorageLimitReached,
|
|
987
1031
|
'subteam_max_users_exceeded' => SubteamMaxUsersExceeded,
|
|
1032
|
+
'sudo_required' => SudoRequired,
|
|
988
1033
|
'team_access_not_granted' => TeamAccessNotGranted,
|
|
989
1034
|
'team_added_to_org' => TeamAddedToOrg,
|
|
990
1035
|
'team_id_or_org_required' => TeamIdOrOrgRequired,
|
|
@@ -1024,11 +1069,16 @@ module Slack
|
|
|
1024
1069
|
'trigger_expired' => TriggerExpired,
|
|
1025
1070
|
'two_factor_setup_required' => TwoFactorSetupRequired,
|
|
1026
1071
|
'unable_to_link_idp_group_and_channel' => UnableToLinkIdpGroupAndChannel,
|
|
1072
|
+
'unable_to_process_post_request' => UnableToProcessPostRequest,
|
|
1027
1073
|
'unable_to_unlink_idp_group_and_channel' => UnableToUnlinkIdpGroupAndChannel,
|
|
1028
1074
|
'unable_to_update_existing_sessions' => UnableToUpdateExistingSessions,
|
|
1029
1075
|
'unknown_error' => UnknownError,
|
|
1030
1076
|
'unknown_method' => UnknownMethod,
|
|
1077
|
+
'unknown_snippet_type' => UnknownSnippetType,
|
|
1078
|
+
'unknown_subtype' => UnknownSubtype,
|
|
1031
1079
|
'unknown_type' => UnknownType,
|
|
1080
|
+
'unsupported_action_describe' => UnsupportedActionDescribe,
|
|
1081
|
+
'unsupported_action_put' => UnsupportedActionPut,
|
|
1032
1082
|
'unsupported_arguments' => UnsupportedArguments,
|
|
1033
1083
|
'unsupported_context_type' => UnsupportedContextType,
|
|
1034
1084
|
'unsupported_team_type' => UnsupportedTeamType,
|
|
@@ -14,7 +14,7 @@ module Slack
|
|
|
14
14
|
# Channel to get ID for, prefixed with #.
|
|
15
15
|
def conversations_id(options = {})
|
|
16
16
|
name = options[:channel]
|
|
17
|
-
|
|
17
|
+
raise ArgumentError, 'Required arguments :channel missing' if name.nil?
|
|
18
18
|
|
|
19
19
|
id_for :channel, name, '#', :conversations_list, :channels, 'channel_not_found'
|
|
20
20
|
end
|
|
@@ -14,7 +14,7 @@ module Slack
|
|
|
14
14
|
# User to get ID for, prefixed with '@'.
|
|
15
15
|
def users_id(options = {})
|
|
16
16
|
name = options[:user]
|
|
17
|
-
|
|
17
|
+
raise ArgumentError, 'Required arguments :user missing' if name.nil?
|
|
18
18
|
|
|
19
19
|
id_for :user, name, '@', :users_list, :members, 'user_not_found'
|
|
20
20
|
end
|
|
@@ -14,7 +14,8 @@ if defined?(Picky)
|
|
|
14
14
|
# Free-formed text to search for.
|
|
15
15
|
def users_search(options = {})
|
|
16
16
|
query = options[:user]
|
|
17
|
-
|
|
17
|
+
raise ArgumentError, 'Required arguments :user missing' if query.nil?
|
|
18
|
+
|
|
18
19
|
index = Picky::Index.new(:users) do
|
|
19
20
|
category :name
|
|
20
21
|
category :first_name
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb
|
|
2
|
-
index
|
|
2
|
+
index 701cd1e..07acc40 100644
|
|
3
3
|
--- a/lib/slack/web/api/endpoints/chat.rb
|
|
4
4
|
+++ b/lib/slack/web/api/endpoints/chat.rb
|
|
5
|
-
@@ -
|
|
6
|
-
# @see https://api.slack.com/methods/chat.postEphemeral
|
|
5
|
+
@@ -122,9 +122,21 @@ module Slack
|
|
7
6
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
|
|
8
7
|
def chat_postEphemeral(options = {})
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
+
|
|
12
|
-
|
|
8
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
|
9
|
+
- raise ArgumentError, 'Required arguments :text missing' if options[:text].nil?
|
|
10
|
+
+ raise ArgumentError, 'Required arguments :text, :attachments or :blocks missing' if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
|
11
|
+
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
|
|
13
12
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
14
13
|
+ # attachments must be passed as an encoded JSON string
|
|
15
14
|
+ if options.key?(:attachments)
|
|
@@ -26,11 +25,11 @@ index d090ae2..50186d5 100644
|
|
|
26
25
|
post('chat.postEphemeral', options)
|
|
27
26
|
end
|
|
28
27
|
|
|
29
|
-
@@ -
|
|
28
|
+
@@ -167,6 +179,19 @@ module Slack
|
|
30
29
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
|
31
30
|
def chat_postMessage(options = {})
|
|
32
|
-
|
|
33
|
-
+
|
|
31
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
|
32
|
+
+ raise ArgumentError, 'Required arguments :text, :attachments or :blocks missing' if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
|
|
34
33
|
+ # attachments must be passed as an encoded JSON string
|
|
35
34
|
+ if options.key?(:attachments)
|
|
36
35
|
+ attachments = options[:attachments]
|
|
@@ -46,12 +45,12 @@ index d090ae2..50186d5 100644
|
|
|
46
45
|
post('chat.postMessage', options)
|
|
47
46
|
end
|
|
48
47
|
|
|
49
|
-
@@ -
|
|
48
|
+
@@ -268,8 +293,21 @@ module Slack
|
|
50
49
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
|
51
50
|
def chat_update(options = {})
|
|
52
|
-
|
|
53
|
-
+
|
|
54
|
-
|
|
51
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
|
52
|
+
+ raise ArgumentError, 'Required arguments :text, :attachments, :blocks or :reply_broadcast missing' if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil? && options[:reply_broadcast].nil?
|
|
53
|
+
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
|
|
55
54
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
|
56
55
|
+ # attachments must be passed as an encoded JSON string
|
|
57
56
|
+ if options.key?(:attachments)
|