slack-ruby-client 0.14.5 → 0.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +11 -4
- data/README.md +51 -19
- data/bin/commands.rb +12 -0
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_conversations.rb +17 -0
- data/bin/commands/admin_emoji.rb +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_users.rb +97 -0
- data/bin/commands/chat.rb +8 -8
- data/bin/commands/conversations.rb +1 -1
- data/bin/commands/files.rb +1 -0
- data/bin/commands/files_remote.rb +1 -1
- data/bin/commands/oauth.rb +1 -1
- data/lib/slack-ruby-client.rb +1 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +24 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
- data/lib/slack/web/api/endpoints/chat.rb +8 -8
- data/lib/slack/web/api/endpoints/conversations.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +2 -0
- data/lib/slack/web/api/endpoints/files_remote.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth.rb +1 -1
- data/lib/slack/web/api/errors.rb +566 -0
- data/lib/slack/web/api/errors/slack_error.rb +12 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/client.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +4 -1
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +10 -1
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +75 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/conversations_spec.rb +1 -1
- data/spec/slack/web/api/errors/slack_error_spec.rb +22 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +26 -3
- metadata +54 -2
@@ -0,0 +1,61 @@
|
|
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 AdminInviterequests
|
9
|
+
#
|
10
|
+
# Approve a workspace invite request.
|
11
|
+
#
|
12
|
+
# @option options [Object] :invite_request_id
|
13
|
+
# ID of the request to invite.
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# ID for the workspace where the invite request was made.
|
16
|
+
# @see https://api.slack.com/methods/admin.inviteRequests.approve
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests/admin.inviteRequests.approve.json
|
18
|
+
def admin_inviteRequests_approve(options = {})
|
19
|
+
throw ArgumentError.new('Required arguments :invite_request_id missing') if options[:invite_request_id].nil?
|
20
|
+
post('admin.inviteRequests.approve', options)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Deny a workspace invite request.
|
25
|
+
#
|
26
|
+
# @option options [Object] :invite_request_id
|
27
|
+
# ID of the request to invite.
|
28
|
+
# @option options [Object] :team_id
|
29
|
+
# ID for the workspace where the invite request was made.
|
30
|
+
# @see https://api.slack.com/methods/admin.inviteRequests.deny
|
31
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests/admin.inviteRequests.deny.json
|
32
|
+
def admin_inviteRequests_deny(options = {})
|
33
|
+
throw ArgumentError.new('Required arguments :invite_request_id missing') if options[:invite_request_id].nil?
|
34
|
+
post('admin.inviteRequests.deny', options)
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# List all pending workspace invite requests.
|
39
|
+
#
|
40
|
+
# @option options [Object] :cursor
|
41
|
+
# Value of the next_cursor field sent as part of the previous API response.
|
42
|
+
# @option options [Object] :limit
|
43
|
+
# The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive.
|
44
|
+
# @option options [Object] :team_id
|
45
|
+
# ID for the workspace where the invite requests were made.
|
46
|
+
# @see https://api.slack.com/methods/admin.inviteRequests.list
|
47
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests/admin.inviteRequests.list.json
|
48
|
+
def admin_inviteRequests_list(options = {})
|
49
|
+
if block_given?
|
50
|
+
Pagination::Cursor.new(self, :admin_inviteRequests_list, options).each do |page|
|
51
|
+
yield page
|
52
|
+
end
|
53
|
+
else
|
54
|
+
post('admin.inviteRequests.list', options)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,33 @@
|
|
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 AdminInviterequestsApproved
|
9
|
+
#
|
10
|
+
# List all approved workspace invite requests.
|
11
|
+
#
|
12
|
+
# @option options [Object] :cursor
|
13
|
+
# Value of the next_cursor field sent as part of the previous API response.
|
14
|
+
# @option options [Object] :limit
|
15
|
+
# The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive.
|
16
|
+
# @option options [Object] :team_id
|
17
|
+
# ID for the workspace where the invite requests were made.
|
18
|
+
# @see https://api.slack.com/methods/admin.inviteRequests.approved.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests.approved/admin.inviteRequests.approved.list.json
|
20
|
+
def admin_inviteRequests_approved_list(options = {})
|
21
|
+
if block_given?
|
22
|
+
Pagination::Cursor.new(self, :admin_inviteRequests_approved_list, options).each do |page|
|
23
|
+
yield page
|
24
|
+
end
|
25
|
+
else
|
26
|
+
post('admin.inviteRequests.approved.list', options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
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 AdminInviterequestsDenied
|
9
|
+
#
|
10
|
+
# List all denied workspace invite requests.
|
11
|
+
#
|
12
|
+
# @option options [Object] :cursor
|
13
|
+
# Value of the next_cursor field sent as part of the previous api response.
|
14
|
+
# @option options [Object] :limit
|
15
|
+
# The number of results that will be returned by the API on each invocation. Must be between 1 - 1000 both inclusive.
|
16
|
+
# @option options [Object] :team_id
|
17
|
+
# ID for the workspace where the invite requests were made.
|
18
|
+
# @see https://api.slack.com/methods/admin.inviteRequests.denied.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.inviteRequests.denied/admin.inviteRequests.denied.list.json
|
20
|
+
def admin_inviteRequests_denied_list(options = {})
|
21
|
+
if block_given?
|
22
|
+
Pagination::Cursor.new(self, :admin_inviteRequests_denied_list, options).each do |page|
|
23
|
+
yield page
|
24
|
+
end
|
25
|
+
else
|
26
|
+
post('admin.inviteRequests.denied.list', options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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 AdminTeams
|
9
|
+
#
|
10
|
+
# Create an Enterprise team.
|
11
|
+
#
|
12
|
+
# @option options [Object] :team_domain
|
13
|
+
# Team domain (for example, slacksoftballteam).
|
14
|
+
# @option options [Object] :team_name
|
15
|
+
# Team name (for example, Slack Softball Team).
|
16
|
+
# @option options [Object] :team_description
|
17
|
+
# Description for the team.
|
18
|
+
# @option options [Object] :team_discoverability
|
19
|
+
# Who can join the team. A team's discoverability can be open, closed, invite_only, or unlisted.
|
20
|
+
# @see https://api.slack.com/methods/admin.teams.create
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams/admin.teams.create.json
|
22
|
+
def admin_teams_create(options = {})
|
23
|
+
throw ArgumentError.new('Required arguments :team_domain missing') if options[:team_domain].nil?
|
24
|
+
throw ArgumentError.new('Required arguments :team_name missing') if options[:team_name].nil?
|
25
|
+
post('admin.teams.create', options)
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# List all teams on an Enterprise organization
|
30
|
+
#
|
31
|
+
# @option options [Object] :cursor
|
32
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
33
|
+
# @option options [Object] :limit
|
34
|
+
# The maximum number of items to return. Must be between 1 - 100 both inclusive.
|
35
|
+
# @see https://api.slack.com/methods/admin.teams.list
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams/admin.teams.list.json
|
37
|
+
def admin_teams_list(options = {})
|
38
|
+
if block_given?
|
39
|
+
Pagination::Cursor.new(self, :admin_teams_list, options).each do |page|
|
40
|
+
yield page
|
41
|
+
end
|
42
|
+
else
|
43
|
+
post('admin.teams.list', options)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -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 AdminTeamsAdmins
|
9
|
+
#
|
10
|
+
# List all of the admins on a given workspace.
|
11
|
+
#
|
12
|
+
# @option options [Object] :team_id
|
13
|
+
# .
|
14
|
+
# @option options [Object] :cursor
|
15
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# The maximum number of items to return.
|
18
|
+
# @see https://api.slack.com/methods/admin.teams.admins.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.admins/admin.teams.admins.list.json
|
20
|
+
def admin_teams_admins_list(options = {})
|
21
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
22
|
+
if block_given?
|
23
|
+
Pagination::Cursor.new(self, :admin_teams_admins_list, options).each do |page|
|
24
|
+
yield page
|
25
|
+
end
|
26
|
+
else
|
27
|
+
post('admin.teams.admins.list', options)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -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 AdminTeamsOwners
|
9
|
+
#
|
10
|
+
# List all of the owners on a given workspace.
|
11
|
+
#
|
12
|
+
# @option options [Object] :team_id
|
13
|
+
# .
|
14
|
+
# @option options [Object] :cursor
|
15
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# The maximum number of items to return. Must be between 1 - 1000 both inclusive.
|
18
|
+
# @see https://api.slack.com/methods/admin.teams.owners.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.owners/admin.teams.owners.list.json
|
20
|
+
def admin_teams_owners_list(options = {})
|
21
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
22
|
+
if block_given?
|
23
|
+
Pagination::Cursor.new(self, :admin_teams_owners_list, options).each do |page|
|
24
|
+
yield page
|
25
|
+
end
|
26
|
+
else
|
27
|
+
post('admin.teams.owners.list', options)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,99 @@
|
|
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 AdminTeamsSettings
|
9
|
+
#
|
10
|
+
# Fetch information about settings in a workspace
|
11
|
+
#
|
12
|
+
# @option options [Object] :team_id
|
13
|
+
# .
|
14
|
+
# @see https://api.slack.com/methods/admin.teams.settings.info
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.info.json
|
16
|
+
def admin_teams_settings_info(options = {})
|
17
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
18
|
+
post('admin.teams.settings.info', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Set the default channels of a workspace.
|
23
|
+
#
|
24
|
+
# @option options [Object] :channel_ids
|
25
|
+
# An array of channel IDs.
|
26
|
+
# @option options [Object] :team_id
|
27
|
+
# ID for the workspace to set the default channel for.
|
28
|
+
# @see https://api.slack.com/methods/admin.teams.settings.setDefaultChannels
|
29
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDefaultChannels.json
|
30
|
+
def admin_teams_settings_setDefaultChannels(options = {})
|
31
|
+
throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil?
|
32
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
33
|
+
post('admin.teams.settings.setDefaultChannels', options)
|
34
|
+
end
|
35
|
+
|
36
|
+
#
|
37
|
+
# Set the description of a given workspace.
|
38
|
+
#
|
39
|
+
# @option options [Object] :description
|
40
|
+
# The new description for the workspace.
|
41
|
+
# @option options [Object] :team_id
|
42
|
+
# ID for the workspace to set the description for.
|
43
|
+
# @see https://api.slack.com/methods/admin.teams.settings.setDescription
|
44
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDescription.json
|
45
|
+
def admin_teams_settings_setDescription(options = {})
|
46
|
+
throw ArgumentError.new('Required arguments :description missing') if options[:description].nil?
|
47
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
48
|
+
post('admin.teams.settings.setDescription', options)
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# An API method that allows admins to set the discoverability of a given workspace
|
53
|
+
#
|
54
|
+
# @option options [Object] :discoverability
|
55
|
+
# This workspace's discovery setting. It must be set to one of open, invite_only, closed, or unlisted.
|
56
|
+
# @option options [Object] :team_id
|
57
|
+
# The ID of the workspace to set discoverability on.
|
58
|
+
# @see https://api.slack.com/methods/admin.teams.settings.setDiscoverability
|
59
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setDiscoverability.json
|
60
|
+
def admin_teams_settings_setDiscoverability(options = {})
|
61
|
+
throw ArgumentError.new('Required arguments :discoverability missing') if options[:discoverability].nil?
|
62
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
63
|
+
post('admin.teams.settings.setDiscoverability', options)
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Sets the icon of a workspace.
|
68
|
+
#
|
69
|
+
# @option options [Object] :image_url
|
70
|
+
# Image URL for the icon.
|
71
|
+
# @option options [Object] :team_id
|
72
|
+
# ID for the workspace to set the icon for.
|
73
|
+
# @see https://api.slack.com/methods/admin.teams.settings.setIcon
|
74
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setIcon.json
|
75
|
+
def admin_teams_settings_setIcon(options = {})
|
76
|
+
throw ArgumentError.new('Required arguments :image_url missing') if options[:image_url].nil?
|
77
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
78
|
+
post('admin.teams.settings.setIcon', options)
|
79
|
+
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# Set the name of a given workspace.
|
83
|
+
#
|
84
|
+
# @option options [Object] :name
|
85
|
+
# The new name of the workspace.
|
86
|
+
# @option options [Object] :team_id
|
87
|
+
# ID for the workspace to set the name for.
|
88
|
+
# @see https://api.slack.com/methods/admin.teams.settings.setName
|
89
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.teams.settings/admin.teams.settings.setName.json
|
90
|
+
def admin_teams_settings_setName(options = {})
|
91
|
+
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
92
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
93
|
+
post('admin.teams.settings.setName', options)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,163 @@
|
|
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 AdminUsers
|
9
|
+
#
|
10
|
+
# Add an Enterprise user to a workspace.
|
11
|
+
#
|
12
|
+
# @option options [Object] :team_id
|
13
|
+
# The ID (T1234) of the workspace.
|
14
|
+
# @option options [Object] :user_id
|
15
|
+
# The ID of the user to add to the workspace.
|
16
|
+
# @option options [Object] :channel_ids
|
17
|
+
# Comma separated values of channel IDs to add user in the new workspace.
|
18
|
+
# @option options [Object] :is_restricted
|
19
|
+
# True if user should be added to the workspace as a guest.
|
20
|
+
# @option options [Object] :is_ultra_restricted
|
21
|
+
# True if user should be added to the workspace as a single-channel guest.
|
22
|
+
# @see https://api.slack.com/methods/admin.users.assign
|
23
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.assign.json
|
24
|
+
def admin_users_assign(options = {})
|
25
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
26
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
27
|
+
post('admin.users.assign', options)
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Invite a user to a workspace.
|
32
|
+
#
|
33
|
+
# @option options [Object] :channel_ids
|
34
|
+
# A comma-separated list of channel_ids for this user to join. At least one channel is required.
|
35
|
+
# @option options [Object] :email
|
36
|
+
# The email address of the person to invite.
|
37
|
+
# @option options [Object] :team_id
|
38
|
+
# The ID (T1234) of the workspace.
|
39
|
+
# @option options [Object] :custom_message
|
40
|
+
# An optional message to send to the user in the invite email.
|
41
|
+
# @option options [Object] :guest_expiration_ts
|
42
|
+
# Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.
|
43
|
+
# @option options [Object] :is_restricted
|
44
|
+
# Is this user a multi-channel guest user? (default: false).
|
45
|
+
# @option options [Object] :is_ultra_restricted
|
46
|
+
# Is this user a single channel guest user? (default: false).
|
47
|
+
# @option options [Object] :real_name
|
48
|
+
# Full name of the user.
|
49
|
+
# @option options [Object] :resend
|
50
|
+
# Allow this invite to be resent in the future if a user has not signed up yet. (default: false).
|
51
|
+
# @see https://api.slack.com/methods/admin.users.invite
|
52
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.invite.json
|
53
|
+
def admin_users_invite(options = {})
|
54
|
+
throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil?
|
55
|
+
throw ArgumentError.new('Required arguments :email missing') if options[:email].nil?
|
56
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
57
|
+
post('admin.users.invite', options)
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# List users on a workspace
|
62
|
+
#
|
63
|
+
# @option options [Object] :team_id
|
64
|
+
# The ID (T1234) of the workspace.
|
65
|
+
# @option options [Object] :cursor
|
66
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
67
|
+
# @option options [Object] :limit
|
68
|
+
# Limit for how many users to be retrieved per page.
|
69
|
+
# @see https://api.slack.com/methods/admin.users.list
|
70
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.list.json
|
71
|
+
def admin_users_list(options = {})
|
72
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
73
|
+
if block_given?
|
74
|
+
Pagination::Cursor.new(self, :admin_users_list, options).each do |page|
|
75
|
+
yield page
|
76
|
+
end
|
77
|
+
else
|
78
|
+
post('admin.users.list', options)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# Remove a user from a workspace.
|
84
|
+
#
|
85
|
+
# @option options [Object] :team_id
|
86
|
+
# The ID (T1234) of the workspace.
|
87
|
+
# @option options [Object] :user_id
|
88
|
+
# The ID of the user to remove.
|
89
|
+
# @see https://api.slack.com/methods/admin.users.remove
|
90
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.remove.json
|
91
|
+
def admin_users_remove(options = {})
|
92
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
93
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
94
|
+
post('admin.users.remove', options)
|
95
|
+
end
|
96
|
+
|
97
|
+
#
|
98
|
+
# Set an existing guest, regular user, or owner to be an admin user.
|
99
|
+
#
|
100
|
+
# @option options [Object] :team_id
|
101
|
+
# The ID (T1234) of the workspace.
|
102
|
+
# @option options [Object] :user_id
|
103
|
+
# The ID of the user to designate as an admin.
|
104
|
+
# @see https://api.slack.com/methods/admin.users.setAdmin
|
105
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setAdmin.json
|
106
|
+
def admin_users_setAdmin(options = {})
|
107
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
108
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
109
|
+
post('admin.users.setAdmin', options)
|
110
|
+
end
|
111
|
+
|
112
|
+
#
|
113
|
+
# Set an expiration for a guest user
|
114
|
+
#
|
115
|
+
# @option options [Object] :expiration_ts
|
116
|
+
# Timestamp when guest account should be disabled.
|
117
|
+
# @option options [Object] :team_id
|
118
|
+
# The ID (T1234) of the workspace.
|
119
|
+
# @option options [Object] :user_id
|
120
|
+
# The ID of the user to set an expiration for.
|
121
|
+
# @see https://api.slack.com/methods/admin.users.setExpiration
|
122
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setExpiration.json
|
123
|
+
def admin_users_setExpiration(options = {})
|
124
|
+
throw ArgumentError.new('Required arguments :expiration_ts missing') if options[:expiration_ts].nil?
|
125
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
126
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
127
|
+
post('admin.users.setExpiration', options)
|
128
|
+
end
|
129
|
+
|
130
|
+
#
|
131
|
+
# Set an existing guest, regular user, or admin user to be a workspace owner.
|
132
|
+
#
|
133
|
+
# @option options [Object] :team_id
|
134
|
+
# The ID (T1234) of the workspace.
|
135
|
+
# @option options [Object] :user_id
|
136
|
+
# Id of the user to promote to owner.
|
137
|
+
# @see https://api.slack.com/methods/admin.users.setOwner
|
138
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setOwner.json
|
139
|
+
def admin_users_setOwner(options = {})
|
140
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
141
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
142
|
+
post('admin.users.setOwner', options)
|
143
|
+
end
|
144
|
+
|
145
|
+
#
|
146
|
+
# Set an existing guest user, admin user, or owner to be a regular user.
|
147
|
+
#
|
148
|
+
# @option options [Object] :team_id
|
149
|
+
# The ID (T1234) of the workspace.
|
150
|
+
# @option options [Object] :user_id
|
151
|
+
# The ID of the user to designate as a regular user.
|
152
|
+
# @see https://api.slack.com/methods/admin.users.setRegular
|
153
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setRegular.json
|
154
|
+
def admin_users_setRegular(options = {})
|
155
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
156
|
+
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
157
|
+
post('admin.users.setRegular', options)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|