slack-ruby-client 0.14.5 → 0.14.6
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/.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,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminTeamsOwners methods.'
|
5
|
+
command 'admin_teams_owners' do |g|
|
6
|
+
g.desc 'List all of the owners on a given workspace.'
|
7
|
+
g.long_desc %( List all of the owners on a given workspace. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'team_id', desc: '.'
|
10
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
11
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
12
|
+
c.action do |_global_options, options, _args|
|
13
|
+
puts JSON.dump($client.admin_teams_owners_list(options))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminTeamsSettings methods.'
|
5
|
+
command 'admin_teams_settings' do |g|
|
6
|
+
g.desc 'Fetch information about settings in a workspace'
|
7
|
+
g.long_desc %( Fetch information about settings in a workspace )
|
8
|
+
g.command 'info' do |c|
|
9
|
+
c.flag 'team_id', desc: '.'
|
10
|
+
c.action do |_global_options, options, _args|
|
11
|
+
puts JSON.dump($client.admin_teams_settings_info(options))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
g.desc 'Set the default channels of a workspace.'
|
16
|
+
g.long_desc %( Set the default channels of a workspace. )
|
17
|
+
g.command 'setDefaultChannels' do |c|
|
18
|
+
c.flag 'channel_ids', desc: 'An array of channel IDs.'
|
19
|
+
c.flag 'team_id', desc: 'ID for the workspace to set the default channel for.'
|
20
|
+
c.action do |_global_options, options, _args|
|
21
|
+
puts JSON.dump($client.admin_teams_settings_setDefaultChannels(options))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
g.desc 'Set the description of a given workspace.'
|
26
|
+
g.long_desc %( Set the description of a given workspace. )
|
27
|
+
g.command 'setDescription' do |c|
|
28
|
+
c.flag 'description', desc: 'The new description for the workspace.'
|
29
|
+
c.flag 'team_id', desc: 'ID for the workspace to set the description for.'
|
30
|
+
c.action do |_global_options, options, _args|
|
31
|
+
puts JSON.dump($client.admin_teams_settings_setDescription(options))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
g.desc 'An API method that allows admins to set the discoverability of a given workspace'
|
36
|
+
g.long_desc %( An API method that allows admins to set the discoverability of a given workspace )
|
37
|
+
g.command 'setDiscoverability' do |c|
|
38
|
+
c.flag 'discoverability', desc: "This workspace's discovery setting. It must be set to one of open, invite_only, closed, or unlisted."
|
39
|
+
c.flag 'team_id', desc: 'The ID of the workspace to set discoverability on.'
|
40
|
+
c.action do |_global_options, options, _args|
|
41
|
+
puts JSON.dump($client.admin_teams_settings_setDiscoverability(options))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
g.desc 'Sets the icon of a workspace.'
|
46
|
+
g.long_desc %( Sets the icon of a workspace. )
|
47
|
+
g.command 'setIcon' do |c|
|
48
|
+
c.flag 'image_url', desc: 'Image URL for the icon.'
|
49
|
+
c.flag 'team_id', desc: 'ID for the workspace to set the icon for.'
|
50
|
+
c.action do |_global_options, options, _args|
|
51
|
+
puts JSON.dump($client.admin_teams_settings_setIcon(options))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
g.desc 'Set the name of a given workspace.'
|
56
|
+
g.long_desc %( Set the name of a given workspace. )
|
57
|
+
g.command 'setName' do |c|
|
58
|
+
c.flag 'name', desc: 'The new name of the workspace.'
|
59
|
+
c.flag 'team_id', desc: 'ID for the workspace to set the name for.'
|
60
|
+
c.action do |_global_options, options, _args|
|
61
|
+
puts JSON.dump($client.admin_teams_settings_setName(options))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminUsers methods.'
|
5
|
+
command 'admin_users' do |g|
|
6
|
+
g.desc 'Add an Enterprise user to a workspace.'
|
7
|
+
g.long_desc %( Add an Enterprise user to a workspace. )
|
8
|
+
g.command 'assign' do |c|
|
9
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
10
|
+
c.flag 'user_id', desc: 'The ID of the user to add to the workspace.'
|
11
|
+
c.flag 'channel_ids', desc: 'Comma separated values of channel IDs to add user in the new workspace.'
|
12
|
+
c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
|
13
|
+
c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
|
14
|
+
c.action do |_global_options, options, _args|
|
15
|
+
puts JSON.dump($client.admin_users_assign(options))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
g.desc 'Invite a user to a workspace.'
|
20
|
+
g.long_desc %( Invite a user to a workspace. )
|
21
|
+
g.command 'invite' do |c|
|
22
|
+
c.flag 'channel_ids', desc: 'A comma-separated list of channel_ids for this user to join. At least one channel is required.'
|
23
|
+
c.flag 'email', desc: 'The email address of the person to invite.'
|
24
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
25
|
+
c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.'
|
26
|
+
c.flag 'guest_expiration_ts', desc: '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.'
|
27
|
+
c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
|
28
|
+
c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
|
29
|
+
c.flag 'real_name', desc: 'Full name of the user.'
|
30
|
+
c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. (default: false).'
|
31
|
+
c.action do |_global_options, options, _args|
|
32
|
+
puts JSON.dump($client.admin_users_invite(options))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
g.desc 'List users on a workspace'
|
37
|
+
g.long_desc %( List users on a workspace )
|
38
|
+
g.command 'list' do |c|
|
39
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
40
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
41
|
+
c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
|
42
|
+
c.action do |_global_options, options, _args|
|
43
|
+
puts JSON.dump($client.admin_users_list(options))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
g.desc 'Remove a user from a workspace.'
|
48
|
+
g.long_desc %( Remove a user from a workspace. )
|
49
|
+
g.command 'remove' do |c|
|
50
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
51
|
+
c.flag 'user_id', desc: 'The ID of the user to remove.'
|
52
|
+
c.action do |_global_options, options, _args|
|
53
|
+
puts JSON.dump($client.admin_users_remove(options))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
g.desc 'Set an existing guest, regular user, or owner to be an admin user.'
|
58
|
+
g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. )
|
59
|
+
g.command 'setAdmin' do |c|
|
60
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
61
|
+
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
|
62
|
+
c.action do |_global_options, options, _args|
|
63
|
+
puts JSON.dump($client.admin_users_setAdmin(options))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
g.desc 'Set an expiration for a guest user'
|
68
|
+
g.long_desc %( Set an expiration for a guest user )
|
69
|
+
g.command 'setExpiration' do |c|
|
70
|
+
c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.'
|
71
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
72
|
+
c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
|
73
|
+
c.action do |_global_options, options, _args|
|
74
|
+
puts JSON.dump($client.admin_users_setExpiration(options))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
|
79
|
+
g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
|
80
|
+
g.command 'setOwner' do |c|
|
81
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
82
|
+
c.flag 'user_id', desc: 'Id of the user to promote to owner.'
|
83
|
+
c.action do |_global_options, options, _args|
|
84
|
+
puts JSON.dump($client.admin_users_setOwner(options))
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
g.desc 'Set an existing guest user, admin user, or owner to be a regular user.'
|
89
|
+
g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. )
|
90
|
+
g.command 'setRegular' do |c|
|
91
|
+
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
|
92
|
+
c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.'
|
93
|
+
c.action do |_global_options, options, _args|
|
94
|
+
puts JSON.dump($client.admin_users_setRegular(options))
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/bin/commands/chat.rb
CHANGED
@@ -61,7 +61,7 @@ command 'chat' do |g|
|
|
61
61
|
g.command 'postEphemeral' do |c|
|
62
62
|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
63
63
|
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
|
64
|
-
c.flag 'text', desc:
|
64
|
+
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
|
65
65
|
c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
|
66
66
|
c.flag 'as_user', desc: 'Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
|
67
67
|
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
|
@@ -80,12 +80,12 @@ command 'chat' do |g|
|
|
80
80
|
g.long_desc %( Sends a message to a channel. )
|
81
81
|
g.command 'postMessage' do |c|
|
82
82
|
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
|
83
|
-
c.flag 'text', desc:
|
84
|
-
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
|
83
|
+
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
|
84
|
+
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.'
|
85
85
|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
86
86
|
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
|
87
|
-
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
|
88
|
-
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
|
87
|
+
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
|
88
|
+
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
|
89
89
|
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
90
90
|
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
|
91
91
|
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
@@ -104,12 +104,12 @@ command 'chat' do |g|
|
|
104
104
|
g.command 'scheduleMessage' do |c|
|
105
105
|
c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
|
106
106
|
c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
|
107
|
-
c.flag 'text', desc:
|
108
|
-
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See
|
107
|
+
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
|
108
|
+
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See chat.postMessage.'
|
109
109
|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
110
110
|
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
|
111
111
|
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
112
|
-
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See
|
112
|
+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See chat.postMessage.'
|
113
113
|
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
|
114
114
|
c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
|
115
115
|
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
|
@@ -61,7 +61,7 @@ command 'conversations' do |g|
|
|
61
61
|
g.long_desc %( Invites users to a channel. )
|
62
62
|
g.command 'invite' do |c|
|
63
63
|
c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
|
64
|
-
c.flag 'users', desc: 'A comma separated list of user IDs. Up to
|
64
|
+
c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
|
65
65
|
c.action do |_global_options, options, _args|
|
66
66
|
puts JSON.dump($client.conversations_invite(options))
|
67
67
|
end
|
data/bin/commands/files.rb
CHANGED
@@ -38,6 +38,7 @@ command 'files' do |g|
|
|
38
38
|
g.long_desc %( Lists & filters team files. )
|
39
39
|
g.command 'list' do |c|
|
40
40
|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
41
|
+
c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.'
|
41
42
|
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
42
43
|
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
43
44
|
c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.'
|
@@ -10,7 +10,7 @@ command 'files_remote' do |g|
|
|
10
10
|
c.flag 'external_url', desc: 'URL of the remote file.'
|
11
11
|
c.flag 'title', desc: 'Title of the file being shared.'
|
12
12
|
c.flag 'filetype', desc: 'type of file.'
|
13
|
-
c.flag 'indexable_file_contents', desc: '
|
13
|
+
c.flag 'indexable_file_contents', desc: 'A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.'
|
14
14
|
c.flag 'preview_image', desc: 'Preview of the document via multipart/form-data.'
|
15
15
|
c.action do |_global_options, options, _args|
|
16
16
|
puts JSON.dump($client.files_remote_add(options))
|
data/bin/commands/oauth.rb
CHANGED
@@ -10,7 +10,7 @@ command 'oauth' do |g|
|
|
10
10
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
11
11
|
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
12
12
|
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
13
|
-
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
|
13
|
+
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
|
14
14
|
c.action do |_global_options, options, _args|
|
15
15
|
puts JSON.dump($client.oauth_access(options))
|
16
16
|
end
|
data/lib/slack-ruby-client.rb
CHANGED
@@ -27,6 +27,7 @@ require_relative 'slack/web/config'
|
|
27
27
|
require_relative 'slack/web/api/errors/slack_error'
|
28
28
|
require_relative 'slack/web/api/errors/too_many_requests_error'
|
29
29
|
require_relative 'slack/web/api/error'
|
30
|
+
require_relative 'slack/web/api/errors'
|
30
31
|
require_relative 'slack/web/faraday/response/raise_error'
|
31
32
|
require_relative 'slack/web/faraday/connection'
|
32
33
|
require_relative 'slack/web/faraday/request'
|
data/lib/slack/version.rb
CHANGED
@@ -2,7 +2,19 @@
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
4
|
require_relative 'endpoints/admin_apps'
|
5
|
+
require_relative 'endpoints/admin_apps_approved'
|
5
6
|
require_relative 'endpoints/admin_apps_requests'
|
7
|
+
require_relative 'endpoints/admin_apps_restricted'
|
8
|
+
require_relative 'endpoints/admin_conversations'
|
9
|
+
require_relative 'endpoints/admin_emoji'
|
10
|
+
require_relative 'endpoints/admin_inviteRequests'
|
11
|
+
require_relative 'endpoints/admin_inviteRequests_approved'
|
12
|
+
require_relative 'endpoints/admin_inviteRequests_denied'
|
13
|
+
require_relative 'endpoints/admin_teams'
|
14
|
+
require_relative 'endpoints/admin_teams_admins'
|
15
|
+
require_relative 'endpoints/admin_teams_owners'
|
16
|
+
require_relative 'endpoints/admin_teams_settings'
|
17
|
+
require_relative 'endpoints/admin_users'
|
6
18
|
require_relative 'endpoints/admin_users_session'
|
7
19
|
require_relative 'endpoints/api'
|
8
20
|
require_relative 'endpoints/apps'
|
@@ -53,7 +65,19 @@ module Slack
|
|
53
65
|
include Slack::Web::Api::Mixins::Groups
|
54
66
|
|
55
67
|
include AdminApps
|
68
|
+
include AdminAppsApproved
|
56
69
|
include AdminAppsRequests
|
70
|
+
include AdminAppsRestricted
|
71
|
+
include AdminConversations
|
72
|
+
include AdminEmoji
|
73
|
+
include AdminInviterequests
|
74
|
+
include AdminInviterequestsApproved
|
75
|
+
include AdminInviterequestsDenied
|
76
|
+
include AdminTeams
|
77
|
+
include AdminTeamsAdmins
|
78
|
+
include AdminTeamsOwners
|
79
|
+
include AdminTeamsSettings
|
80
|
+
include AdminUsers
|
57
81
|
include AdminUsersSession
|
58
82
|
include Api
|
59
83
|
include Apps
|
@@ -0,0 +1,35 @@
|
|
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 AdminAppsApproved
|
9
|
+
#
|
10
|
+
# List approved apps for an org or workspace.
|
11
|
+
#
|
12
|
+
# @option options [Object] :cursor
|
13
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
14
|
+
# @option options [Object] :enterprise_id
|
15
|
+
# .
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# The maximum number of items to return. Must be between 1 - 1000 both inclusive.
|
18
|
+
# @option options [Object] :team_id
|
19
|
+
# .
|
20
|
+
# @see https://api.slack.com/methods/admin.apps.approved.list
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.approved/admin.apps.approved.list.json
|
22
|
+
def admin_apps_approved_list(options = {})
|
23
|
+
if block_given?
|
24
|
+
Pagination::Cursor.new(self, :admin_apps_approved_list, options).each do |page|
|
25
|
+
yield page
|
26
|
+
end
|
27
|
+
else
|
28
|
+
post('admin.apps.approved.list', options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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 AdminAppsRestricted
|
9
|
+
#
|
10
|
+
# List restricted apps for an org or workspace.
|
11
|
+
#
|
12
|
+
# @option options [Object] :cursor
|
13
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
14
|
+
# @option options [Object] :enterprise_id
|
15
|
+
# .
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# The maximum number of items to return. Must be between 1 - 1000 both inclusive.
|
18
|
+
# @option options [Object] :team_id
|
19
|
+
# .
|
20
|
+
# @see https://api.slack.com/methods/admin.apps.restricted.list
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.restricted/admin.apps.restricted.list.json
|
22
|
+
def admin_apps_restricted_list(options = {})
|
23
|
+
if block_given?
|
24
|
+
Pagination::Cursor.new(self, :admin_apps_restricted_list, options).each do |page|
|
25
|
+
yield page
|
26
|
+
end
|
27
|
+
else
|
28
|
+
post('admin.apps.restricted.list', options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,30 @@
|
|
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 AdminConversations
|
9
|
+
#
|
10
|
+
# Set the workspaces in an Enterprise grid org that connect to a channel.
|
11
|
+
#
|
12
|
+
# @option options [Object] :channel_id
|
13
|
+
# The encoded channel_id to add or remove to workspaces.
|
14
|
+
# @option options [Object] :org_channel
|
15
|
+
# True if channel has to be converted to an org channel.
|
16
|
+
# @option options [Object] :target_team_ids
|
17
|
+
# The list of workspaces to which the channel should be shared. Not required if the channel is being shared orgwide. Example: ['T1234', 'T5678'].
|
18
|
+
# @option options [Object] :team_id
|
19
|
+
# The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
|
20
|
+
# @see https://api.slack.com/methods/admin.conversations.setTeams
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setTeams.json
|
22
|
+
def admin_conversations_setTeams(options = {})
|
23
|
+
throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
|
24
|
+
post('admin.conversations.setTeams', options)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,88 @@
|
|
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 AdminEmoji
|
9
|
+
#
|
10
|
+
# Add an emoji.
|
11
|
+
#
|
12
|
+
# @option options [Object] :name
|
13
|
+
# The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.
|
14
|
+
# @option options [Object] :url
|
15
|
+
# The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.
|
16
|
+
# @see https://api.slack.com/methods/admin.emoji.add
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.add.json
|
18
|
+
def admin_emoji_add(options = {})
|
19
|
+
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
20
|
+
throw ArgumentError.new('Required arguments :url missing') if options[:url].nil?
|
21
|
+
post('admin.emoji.add', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Add an emoji alias.
|
26
|
+
#
|
27
|
+
# @option options [Object] :alias_for
|
28
|
+
# The alias of the emoji.
|
29
|
+
# @option options [Object] :name
|
30
|
+
# The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.
|
31
|
+
# @see https://api.slack.com/methods/admin.emoji.addAlias
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.addAlias.json
|
33
|
+
def admin_emoji_addAlias(options = {})
|
34
|
+
throw ArgumentError.new('Required arguments :alias_for missing') if options[:alias_for].nil?
|
35
|
+
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
36
|
+
post('admin.emoji.addAlias', options)
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# List emoji for an Enterprise Grid organization.
|
41
|
+
#
|
42
|
+
# @option options [Object] :cursor
|
43
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
44
|
+
# @option options [Object] :limit
|
45
|
+
# The maximum number of items to return. Must be between 1 - 1000 both inclusive.
|
46
|
+
# @see https://api.slack.com/methods/admin.emoji.list
|
47
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.list.json
|
48
|
+
def admin_emoji_list(options = {})
|
49
|
+
if block_given?
|
50
|
+
Pagination::Cursor.new(self, :admin_emoji_list, options).each do |page|
|
51
|
+
yield page
|
52
|
+
end
|
53
|
+
else
|
54
|
+
post('admin.emoji.list', options)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Remove an emoji across an Enterprise Grid organization
|
60
|
+
#
|
61
|
+
# @option options [Object] :name
|
62
|
+
# The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.
|
63
|
+
# @see https://api.slack.com/methods/admin.emoji.remove
|
64
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.remove.json
|
65
|
+
def admin_emoji_remove(options = {})
|
66
|
+
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
67
|
+
post('admin.emoji.remove', options)
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# Rename an emoji.
|
72
|
+
#
|
73
|
+
# @option options [Object] :name
|
74
|
+
# The name of the emoji to be renamed. Colons (:myemoji:) around the value are not required, although they may be included.
|
75
|
+
# @option options [Object] :new_name
|
76
|
+
# The new name of the emoji.
|
77
|
+
# @see https://api.slack.com/methods/admin.emoji.rename
|
78
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.rename.json
|
79
|
+
def admin_emoji_rename(options = {})
|
80
|
+
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
81
|
+
throw ArgumentError.new('Required arguments :new_name missing') if options[:new_name].nil?
|
82
|
+
post('admin.emoji.rename', options)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|