slack-ruby-client 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/slack/version.rb
CHANGED
@@ -18,7 +18,7 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.analytics.getFile
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.analytics/admin.analytics.getFile.json
|
20
20
|
def admin_analytics_getFile(options = {})
|
21
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :type missing' if options[:type].nil?
|
22
22
|
post('admin.analytics.getFile', options)
|
23
23
|
end
|
24
24
|
end
|
@@ -35,7 +35,7 @@ module Slack
|
|
35
35
|
# @see https://api.slack.com/methods/admin.apps.clearResolution
|
36
36
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.clearResolution.json
|
37
37
|
def admin_apps_clearResolution(options = {})
|
38
|
-
|
38
|
+
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
|
39
39
|
post('admin.apps.clearResolution', options)
|
40
40
|
end
|
41
41
|
|
@@ -68,7 +68,7 @@ module Slack
|
|
68
68
|
# @see https://api.slack.com/methods/admin.apps.uninstall
|
69
69
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.uninstall.json
|
70
70
|
def admin_apps_uninstall(options = {})
|
71
|
-
|
71
|
+
raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
|
72
72
|
post('admin.apps.uninstall', options)
|
73
73
|
end
|
74
74
|
end
|
@@ -18,7 +18,7 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.apps.requests.cancel
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.requests/admin.apps.requests.cancel.json
|
20
20
|
def admin_apps_requests_cancel(options = {})
|
21
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :request_id missing' if options[:request_id].nil?
|
22
22
|
post('admin.apps.requests.cancel', options)
|
23
23
|
end
|
24
24
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AdminAuditAnomalyAllow
|
9
|
+
#
|
10
|
+
# API to allow enterprise grid admins to read the allow list of IP blocks and ASNs from the enterprise configuration.
|
11
|
+
#
|
12
|
+
# @see https://api.slack.com/methods/admin.audit.anomaly.allow.getItem
|
13
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.audit.anomaly.allow/admin.audit.anomaly.allow.getItem.json
|
14
|
+
def admin_audit_anomaly_allow_getItem(options = {})
|
15
|
+
post('admin.audit.anomaly.allow.getItem', options)
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# API to allow enterprise grid admins to write/overwrite the allow list of IP blocks and ASNs from the enterprise configuration.
|
20
|
+
#
|
21
|
+
# @option options [array] :trusted_asns
|
22
|
+
# allow list of Autonomous System Numbers (ASN) in the enterprise grid configuarion.
|
23
|
+
# @option options [array] :trusted_cidr
|
24
|
+
# allow list of IPv4 addressses using cidr notation in the enterprise grid configuarion.
|
25
|
+
# @see https://api.slack.com/methods/admin.audit.anomaly.allow.updateItem
|
26
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.audit.anomaly.allow/admin.audit.anomaly.allow.updateItem.json
|
27
|
+
def admin_audit_anomaly_allow_updateItem(options = {})
|
28
|
+
post('admin.audit.anomaly.allow.updateItem', options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -18,9 +18,9 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.auth.policy.assignEntities
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.auth.policy/admin.auth.policy.assignEntities.json
|
20
20
|
def admin_auth_policy_assignEntities(options = {})
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :entity_ids missing' if options[:entity_ids].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :entity_type missing' if options[:entity_type].nil?
|
23
|
+
raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
|
24
24
|
post('admin.auth.policy.assignEntities', options)
|
25
25
|
end
|
26
26
|
|
@@ -38,7 +38,7 @@ module Slack
|
|
38
38
|
# @see https://api.slack.com/methods/admin.auth.policy.getEntities
|
39
39
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.auth.policy/admin.auth.policy.getEntities.json
|
40
40
|
def admin_auth_policy_getEntities(options = {})
|
41
|
-
|
41
|
+
raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
|
42
42
|
if block_given?
|
43
43
|
Pagination::Cursor.new(self, :admin_auth_policy_getEntities, options).each do |page|
|
44
44
|
yield page
|
@@ -60,9 +60,9 @@ module Slack
|
|
60
60
|
# @see https://api.slack.com/methods/admin.auth.policy.removeEntities
|
61
61
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.auth.policy/admin.auth.policy.removeEntities.json
|
62
62
|
def admin_auth_policy_removeEntities(options = {})
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
raise ArgumentError, 'Required arguments :entity_ids missing' if options[:entity_ids].nil?
|
64
|
+
raise ArgumentError, 'Required arguments :entity_type missing' if options[:entity_type].nil?
|
65
|
+
raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
|
66
66
|
post('admin.auth.policy.removeEntities', options)
|
67
67
|
end
|
68
68
|
end
|
@@ -18,9 +18,9 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.barriers.create
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.create.json
|
20
20
|
def admin_barriers_create(options = {})
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :barriered_from_usergroup_ids missing' if options[:barriered_from_usergroup_ids].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :primary_usergroup_id missing' if options[:primary_usergroup_id].nil?
|
23
|
+
raise ArgumentError, 'Required arguments :restricted_subjects missing' if options[:restricted_subjects].nil?
|
24
24
|
post('admin.barriers.create', options)
|
25
25
|
end
|
26
26
|
|
@@ -32,7 +32,7 @@ module Slack
|
|
32
32
|
# @see https://api.slack.com/methods/admin.barriers.delete
|
33
33
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.delete.json
|
34
34
|
def admin_barriers_delete(options = {})
|
35
|
-
|
35
|
+
raise ArgumentError, 'Required arguments :barrier_id missing' if options[:barrier_id].nil?
|
36
36
|
post('admin.barriers.delete', options)
|
37
37
|
end
|
38
38
|
|
@@ -69,10 +69,10 @@ module Slack
|
|
69
69
|
# @see https://api.slack.com/methods/admin.barriers.update
|
70
70
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.update.json
|
71
71
|
def admin_barriers_update(options = {})
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
raise ArgumentError, 'Required arguments :barrier_id missing' if options[:barrier_id].nil?
|
73
|
+
raise ArgumentError, 'Required arguments :barriered_from_usergroup_ids missing' if options[:barriered_from_usergroup_ids].nil?
|
74
|
+
raise ArgumentError, 'Required arguments :primary_usergroup_id missing' if options[:primary_usergroup_id].nil?
|
75
|
+
raise ArgumentError, 'Required arguments :restricted_subjects missing' if options[:restricted_subjects].nil?
|
76
76
|
post('admin.barriers.update', options)
|
77
77
|
end
|
78
78
|
end
|
@@ -14,7 +14,7 @@ module Slack
|
|
14
14
|
# @see https://api.slack.com/methods/admin.conversations.archive
|
15
15
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.archive.json
|
16
16
|
def admin_conversations_archive(options = {})
|
17
|
-
|
17
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
18
18
|
post('admin.conversations.archive', options)
|
19
19
|
end
|
20
20
|
|
@@ -28,7 +28,7 @@ module Slack
|
|
28
28
|
# @see https://api.slack.com/methods/admin.conversations.convertToPrivate
|
29
29
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.convertToPrivate.json
|
30
30
|
def admin_conversations_convertToPrivate(options = {})
|
31
|
-
|
31
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
32
32
|
post('admin.conversations.convertToPrivate', options)
|
33
33
|
end
|
34
34
|
|
@@ -48,8 +48,8 @@ module Slack
|
|
48
48
|
# @see https://api.slack.com/methods/admin.conversations.create
|
49
49
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.create.json
|
50
50
|
def admin_conversations_create(options = {})
|
51
|
-
|
52
|
-
|
51
|
+
raise ArgumentError, 'Required arguments :is_private missing' if options[:is_private].nil?
|
52
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
53
53
|
post('admin.conversations.create', options)
|
54
54
|
end
|
55
55
|
|
@@ -61,7 +61,7 @@ module Slack
|
|
61
61
|
# @see https://api.slack.com/methods/admin.conversations.delete
|
62
62
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.delete.json
|
63
63
|
def admin_conversations_delete(options = {})
|
64
|
-
|
64
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
65
65
|
post('admin.conversations.delete', options)
|
66
66
|
end
|
67
67
|
|
@@ -75,7 +75,7 @@ module Slack
|
|
75
75
|
# @see https://api.slack.com/methods/admin.conversations.disconnectShared
|
76
76
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.disconnectShared.json
|
77
77
|
def admin_conversations_disconnectShared(options = {})
|
78
|
-
|
78
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
79
79
|
post('admin.conversations.disconnectShared', options)
|
80
80
|
end
|
81
81
|
|
@@ -87,19 +87,19 @@ module Slack
|
|
87
87
|
# @see https://api.slack.com/methods/admin.conversations.getConversationPrefs
|
88
88
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getConversationPrefs.json
|
89
89
|
def admin_conversations_getConversationPrefs(options = {})
|
90
|
-
|
90
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
91
91
|
post('admin.conversations.getConversationPrefs', options)
|
92
92
|
end
|
93
93
|
|
94
94
|
#
|
95
|
-
# This API endpoint can be used by any admin to get a
|
95
|
+
# This API endpoint can be used by any admin to get a conversation's retention policy.
|
96
96
|
#
|
97
97
|
# @option options [string] :channel_id
|
98
|
-
# The
|
98
|
+
# The conversation to get the retention policy for.
|
99
99
|
# @see https://api.slack.com/methods/admin.conversations.getCustomRetention
|
100
100
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getCustomRetention.json
|
101
101
|
def admin_conversations_getCustomRetention(options = {})
|
102
|
-
|
102
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
103
103
|
post('admin.conversations.getCustomRetention', options)
|
104
104
|
end
|
105
105
|
|
@@ -115,7 +115,7 @@ module Slack
|
|
115
115
|
# @see https://api.slack.com/methods/admin.conversations.getTeams
|
116
116
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getTeams.json
|
117
117
|
def admin_conversations_getTeams(options = {})
|
118
|
-
|
118
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
119
119
|
if block_given?
|
120
120
|
Pagination::Cursor.new(self, :admin_conversations_getTeams, options).each do |page|
|
121
121
|
yield page
|
@@ -135,20 +135,20 @@ module Slack
|
|
135
135
|
# @see https://api.slack.com/methods/admin.conversations.invite
|
136
136
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.invite.json
|
137
137
|
def admin_conversations_invite(options = {})
|
138
|
-
|
139
|
-
|
138
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
139
|
+
raise ArgumentError, 'Required arguments :user_ids missing' if options[:user_ids].nil?
|
140
140
|
post('admin.conversations.invite', options)
|
141
141
|
end
|
142
142
|
|
143
143
|
#
|
144
|
-
# This API endpoint can be used by any admin to remove a
|
144
|
+
# This API endpoint can be used by any admin to remove a conversation's retention policy.
|
145
145
|
#
|
146
146
|
# @option options [string] :channel_id
|
147
|
-
# The
|
147
|
+
# The conversation to set the retention policy for.
|
148
148
|
# @see https://api.slack.com/methods/admin.conversations.removeCustomRetention
|
149
149
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.removeCustomRetention.json
|
150
150
|
def admin_conversations_removeCustomRetention(options = {})
|
151
|
-
|
151
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
152
152
|
post('admin.conversations.removeCustomRetention', options)
|
153
153
|
end
|
154
154
|
|
@@ -162,14 +162,16 @@ module Slack
|
|
162
162
|
# @see https://api.slack.com/methods/admin.conversations.rename
|
163
163
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.rename.json
|
164
164
|
def admin_conversations_rename(options = {})
|
165
|
-
|
166
|
-
|
165
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
166
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
167
167
|
post('admin.conversations.rename', options)
|
168
168
|
end
|
169
169
|
|
170
170
|
#
|
171
171
|
# Search for public or private channels in an Enterprise organization.
|
172
172
|
#
|
173
|
+
# @option options [array] :connected_team_ids
|
174
|
+
# Array of encoded team IDs, signifying the external orgs to search through.
|
173
175
|
# @option options [string] :cursor
|
174
176
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
175
177
|
# @option options [integer] :limit
|
@@ -183,7 +185,7 @@ module Slack
|
|
183
185
|
# @option options [string] :sort_dir
|
184
186
|
# 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).
|
185
187
|
# @option options [array] :team_ids
|
186
|
-
# Comma separated string of team IDs, signifying the workspaces to search through.
|
188
|
+
# Comma separated string of team IDs, signifying the internal workspaces to search through.
|
187
189
|
# @see https://api.slack.com/methods/admin.conversations.search
|
188
190
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.search.json
|
189
191
|
def admin_conversations_search(options = {})
|
@@ -206,23 +208,23 @@ module Slack
|
|
206
208
|
# @see https://api.slack.com/methods/admin.conversations.setConversationPrefs
|
207
209
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setConversationPrefs.json
|
208
210
|
def admin_conversations_setConversationPrefs(options = {})
|
209
|
-
|
210
|
-
|
211
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
212
|
+
raise ArgumentError, 'Required arguments :prefs missing' if options[:prefs].nil?
|
211
213
|
post('admin.conversations.setConversationPrefs', options)
|
212
214
|
end
|
213
215
|
|
214
216
|
#
|
215
|
-
# This API endpoint can be used by any admin to set a
|
217
|
+
# This API endpoint can be used by any admin to set a conversation's retention policy.
|
216
218
|
#
|
217
219
|
# @option options [string] :channel_id
|
218
|
-
# The
|
220
|
+
# The conversation to set the retention policy for.
|
219
221
|
# @option options [integer] :duration_days
|
220
|
-
# The message retention duration in days to set for this
|
222
|
+
# The message retention duration in days to set for this conversation.
|
221
223
|
# @see https://api.slack.com/methods/admin.conversations.setCustomRetention
|
222
224
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setCustomRetention.json
|
223
225
|
def admin_conversations_setCustomRetention(options = {})
|
224
|
-
|
225
|
-
|
226
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
227
|
+
raise ArgumentError, 'Required arguments :duration_days missing' if options[:duration_days].nil?
|
226
228
|
post('admin.conversations.setCustomRetention', options)
|
227
229
|
end
|
228
230
|
|
@@ -240,7 +242,7 @@ module Slack
|
|
240
242
|
# @see https://api.slack.com/methods/admin.conversations.setTeams
|
241
243
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json
|
242
244
|
def admin_conversations_setTeams(options = {})
|
243
|
-
|
245
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
244
246
|
post('admin.conversations.setTeams', options)
|
245
247
|
end
|
246
248
|
|
@@ -252,7 +254,7 @@ module Slack
|
|
252
254
|
# @see https://api.slack.com/methods/admin.conversations.unarchive
|
253
255
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.unarchive.json
|
254
256
|
def admin_conversations_unarchive(options = {})
|
255
|
-
|
257
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
256
258
|
post('admin.conversations.unarchive', options)
|
257
259
|
end
|
258
260
|
end
|
@@ -18,8 +18,8 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.addGroup.json
|
20
20
|
def admin_conversations_restrictAccess_addGroup(options = {})
|
21
|
-
|
22
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :group_id missing' if options[:group_id].nil?
|
23
23
|
post('admin.conversations.restrictAccess.addGroup', options)
|
24
24
|
end
|
25
25
|
|
@@ -33,7 +33,7 @@ module Slack
|
|
33
33
|
# @see https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups
|
34
34
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.listGroups.json
|
35
35
|
def admin_conversations_restrictAccess_listGroups(options = {})
|
36
|
-
|
36
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
37
37
|
post('admin.conversations.restrictAccess.listGroups', options)
|
38
38
|
end
|
39
39
|
|
@@ -49,9 +49,9 @@ module Slack
|
|
49
49
|
# @see https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup
|
50
50
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.removeGroup.json
|
51
51
|
def admin_conversations_restrictAccess_removeGroup(options = {})
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
53
|
+
raise ArgumentError, 'Required arguments :group_id missing' if options[:group_id].nil?
|
54
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
55
55
|
post('admin.conversations.restrictAccess.removeGroup', options)
|
56
56
|
end
|
57
57
|
end
|
@@ -16,8 +16,8 @@ module Slack
|
|
16
16
|
# @see https://api.slack.com/methods/admin.emoji.add
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.add.json
|
18
18
|
def admin_emoji_add(options = {})
|
19
|
-
|
20
|
-
|
19
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
20
|
+
raise ArgumentError, 'Required arguments :url missing' if options[:url].nil?
|
21
21
|
post('admin.emoji.add', options)
|
22
22
|
end
|
23
23
|
|
@@ -31,8 +31,8 @@ module Slack
|
|
31
31
|
# @see https://api.slack.com/methods/admin.emoji.addAlias
|
32
32
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.addAlias.json
|
33
33
|
def admin_emoji_addAlias(options = {})
|
34
|
-
|
35
|
-
|
34
|
+
raise ArgumentError, 'Required arguments :alias_for missing' if options[:alias_for].nil?
|
35
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
36
36
|
post('admin.emoji.addAlias', options)
|
37
37
|
end
|
38
38
|
|
@@ -63,7 +63,7 @@ module Slack
|
|
63
63
|
# @see https://api.slack.com/methods/admin.emoji.remove
|
64
64
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.remove.json
|
65
65
|
def admin_emoji_remove(options = {})
|
66
|
-
|
66
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
67
67
|
post('admin.emoji.remove', options)
|
68
68
|
end
|
69
69
|
|
@@ -77,8 +77,8 @@ module Slack
|
|
77
77
|
# @see https://api.slack.com/methods/admin.emoji.rename
|
78
78
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.rename.json
|
79
79
|
def admin_emoji_rename(options = {})
|
80
|
-
|
81
|
-
|
80
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
81
|
+
raise ArgumentError, 'Required arguments :new_name missing' if options[:new_name].nil?
|
82
82
|
post('admin.emoji.rename', options)
|
83
83
|
end
|
84
84
|
end
|
@@ -16,7 +16,7 @@ module Slack
|
|
16
16
|
# @see https://api.slack.com/methods/admin.inviteRequests.approve
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests/admin.inviteRequests.approve.json
|
18
18
|
def admin_inviteRequests_approve(options = {})
|
19
|
-
|
19
|
+
raise ArgumentError, 'Required arguments :invite_request_id missing' if options[:invite_request_id].nil?
|
20
20
|
post('admin.inviteRequests.approve', options)
|
21
21
|
end
|
22
22
|
|
@@ -30,7 +30,7 @@ module Slack
|
|
30
30
|
# @see https://api.slack.com/methods/admin.inviteRequests.deny
|
31
31
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests/admin.inviteRequests.deny.json
|
32
32
|
def admin_inviteRequests_deny(options = {})
|
33
|
-
|
33
|
+
raise ArgumentError, 'Required arguments :invite_request_id missing' if options[:invite_request_id].nil?
|
34
34
|
post('admin.inviteRequests.deny', options)
|
35
35
|
end
|
36
36
|
|
@@ -20,8 +20,8 @@ module Slack
|
|
20
20
|
# @see https://api.slack.com/methods/admin.teams.create
|
21
21
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams/admin.teams.create.json
|
22
22
|
def admin_teams_create(options = {})
|
23
|
-
|
24
|
-
|
23
|
+
raise ArgumentError, 'Required arguments :team_domain missing' if options[:team_domain].nil?
|
24
|
+
raise ArgumentError, 'Required arguments :team_name missing' if options[:team_name].nil?
|
25
25
|
post('admin.teams.create', options)
|
26
26
|
end
|
27
27
|
|
@@ -18,7 +18,7 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.teams.admins.list
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.admins/admin.teams.admins.list.json
|
20
20
|
def admin_teams_admins_list(options = {})
|
21
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
22
22
|
if block_given?
|
23
23
|
Pagination::Cursor.new(self, :admin_teams_admins_list, options).each do |page|
|
24
24
|
yield page
|
@@ -18,7 +18,7 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.teams.owners.list
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.owners/admin.teams.owners.list.json
|
20
20
|
def admin_teams_owners_list(options = {})
|
21
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
22
22
|
if block_given?
|
23
23
|
Pagination::Cursor.new(self, :admin_teams_owners_list, options).each do |page|
|
24
24
|
yield page
|
@@ -14,7 +14,7 @@ module Slack
|
|
14
14
|
# @see https://api.slack.com/methods/admin.teams.settings.info
|
15
15
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.info.json
|
16
16
|
def admin_teams_settings_info(options = {})
|
17
|
-
|
17
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
18
18
|
post('admin.teams.settings.info', options)
|
19
19
|
end
|
20
20
|
|
@@ -28,8 +28,8 @@ module Slack
|
|
28
28
|
# @see https://api.slack.com/methods/admin.teams.settings.setDefaultChannels
|
29
29
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDefaultChannels.json
|
30
30
|
def admin_teams_settings_setDefaultChannels(options = {})
|
31
|
-
|
32
|
-
|
31
|
+
raise ArgumentError, 'Required arguments :channel_ids missing' if options[:channel_ids].nil?
|
32
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
33
33
|
post('admin.teams.settings.setDefaultChannels', options)
|
34
34
|
end
|
35
35
|
|
@@ -43,8 +43,8 @@ module Slack
|
|
43
43
|
# @see https://api.slack.com/methods/admin.teams.settings.setDescription
|
44
44
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDescription.json
|
45
45
|
def admin_teams_settings_setDescription(options = {})
|
46
|
-
|
47
|
-
|
46
|
+
raise ArgumentError, 'Required arguments :description missing' if options[:description].nil?
|
47
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
48
48
|
post('admin.teams.settings.setDescription', options)
|
49
49
|
end
|
50
50
|
|
@@ -58,8 +58,8 @@ module Slack
|
|
58
58
|
# @see https://api.slack.com/methods/admin.teams.settings.setDiscoverability
|
59
59
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDiscoverability.json
|
60
60
|
def admin_teams_settings_setDiscoverability(options = {})
|
61
|
-
|
62
|
-
|
61
|
+
raise ArgumentError, 'Required arguments :discoverability missing' if options[:discoverability].nil?
|
62
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
63
63
|
post('admin.teams.settings.setDiscoverability', options)
|
64
64
|
end
|
65
65
|
|
@@ -73,8 +73,8 @@ module Slack
|
|
73
73
|
# @see https://api.slack.com/methods/admin.teams.settings.setIcon
|
74
74
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setIcon.json
|
75
75
|
def admin_teams_settings_setIcon(options = {})
|
76
|
-
|
77
|
-
|
76
|
+
raise ArgumentError, 'Required arguments :image_url missing' if options[:image_url].nil?
|
77
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
78
78
|
post('admin.teams.settings.setIcon', options)
|
79
79
|
end
|
80
80
|
|
@@ -88,8 +88,8 @@ module Slack
|
|
88
88
|
# @see https://api.slack.com/methods/admin.teams.settings.setName
|
89
89
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setName.json
|
90
90
|
def admin_teams_settings_setName(options = {})
|
91
|
-
|
92
|
-
|
91
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
92
|
+
raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
|
93
93
|
post('admin.teams.settings.setName', options)
|
94
94
|
end
|
95
95
|
end
|
@@ -18,8 +18,8 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/admin.usergroups.addChannels
|
19
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.addChannels.json
|
20
20
|
def admin_usergroups_addChannels(options = {})
|
21
|
-
|
22
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :channel_ids missing' if options[:channel_ids].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :usergroup_id missing' if options[:usergroup_id].nil?
|
23
23
|
post('admin.usergroups.addChannels', options)
|
24
24
|
end
|
25
25
|
|
@@ -35,8 +35,8 @@ module Slack
|
|
35
35
|
# @see https://api.slack.com/methods/admin.usergroups.addTeams
|
36
36
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.addTeams.json
|
37
37
|
def admin_usergroups_addTeams(options = {})
|
38
|
-
|
39
|
-
|
38
|
+
raise ArgumentError, 'Required arguments :team_ids missing' if options[:team_ids].nil?
|
39
|
+
raise ArgumentError, 'Required arguments :usergroup_id missing' if options[:usergroup_id].nil?
|
40
40
|
post('admin.usergroups.addTeams', options)
|
41
41
|
end
|
42
42
|
|
@@ -52,7 +52,7 @@ module Slack
|
|
52
52
|
# @see https://api.slack.com/methods/admin.usergroups.listChannels
|
53
53
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.listChannels.json
|
54
54
|
def admin_usergroups_listChannels(options = {})
|
55
|
-
|
55
|
+
raise ArgumentError, 'Required arguments :usergroup_id missing' if options[:usergroup_id].nil?
|
56
56
|
post('admin.usergroups.listChannels', options)
|
57
57
|
end
|
58
58
|
|
@@ -66,8 +66,8 @@ module Slack
|
|
66
66
|
# @see https://api.slack.com/methods/admin.usergroups.removeChannels
|
67
67
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.removeChannels.json
|
68
68
|
def admin_usergroups_removeChannels(options = {})
|
69
|
-
|
70
|
-
|
69
|
+
raise ArgumentError, 'Required arguments :channel_ids missing' if options[:channel_ids].nil?
|
70
|
+
raise ArgumentError, 'Required arguments :usergroup_id missing' if options[:usergroup_id].nil?
|
71
71
|
post('admin.usergroups.removeChannels', options)
|
72
72
|
end
|
73
73
|
end
|