Skip to content

Commit b839392

Browse files
committed
Added admin_teams_settings_info, admin_users_list, admin_users_setExpiration, admin_apps_approved_list, admin_apps_restricted_list, admin_conversations_setTeams, admin_emoji_add, admin_emoji_addAlias, admin_emoji_list, admin_emoji_remove and admin_emoji_rename endpoints.
1 parent a50de84 commit b839392

35 files changed

+604
-52
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
### 0.14.6 (Next)
22

3-
* [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin.inviteRequests.approve`, `admin.inviteRequests.deny`, `admin.inviteRequests.list`, `admin.inviteRequests.approved.list`, `admin.inviteRequests.denied.list`, `admin.teams.create`, `admin.teams.list`, `admin.teams.admins.list`, `admin.teams.owners.list`, `admin.teams.settings`, `admin.teams.settings.setIcon`, `admin.teams.settings.setName`, `admin.teams.settings.setDescription`, `admin.users.assign`, `admin.users.invite`, `admin.users.remove`, `admin.users.setAdmin`, `admin.users.setOwner` and `admin.users.setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
3+
* [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin_inviteRequests_approve`, `admin_inviteRequests_deny`, `admin_inviteRequests_list`, `admin_inviteRequests_approved_list`, `admin_inviteRequests_denied_list`, `admin_teams_create`, `admin_teams_list`, `admin_teams_admins_list`, `admin_teams_owners_list`, `admin_teams_settings`, `admin_teams_settings_setIcon`, `admin_teams_settings_setName`, `admin_teams_settings_setDescription`, `admin_users_assign`, `admin_users_invite`, `admin_users_remove`, `admin_users_setAdmin`, `admin_users_setOwner` and `admin_users_setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
44
* [#311](https://github.com/slack-ruby/slack-ruby-client/pull/311): Made Web API `response_metadata` more accessible in errors - [@jmanian](https://github.com/jmanian).
55
* [#312](https://github.com/slack-ruby/slack-ruby-client/pull/312): Added specific error classes for Web API - [@jmanian](https://github.com/jmanian).
6+
* [#313](https://github.com/slack-ruby/slack-ruby-client/pull/313): Added `admin_teams_settings_info`, `admin_users_list`, `admin_users_setExpiration`, `admin_apps_approved_list`, `admin_apps_restricted_list`, `admin_conversations_setTeams`, `admin_emoji_add`, `admin_emoji_addAlias`, `admin_emoji_list`, `admin_emoji_remove` and `admin_emoji_rename` endpoints - [@dblock](https://github.com/dblock).
67
* Your contribution here.
78

89
### 0.14.5 (2019/12/23)
910

1011
* [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk).
1112
* [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk).
12-
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Added `admin.apps`, `admin.app.requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
13-
* [#303](https://github.com/slack-ruby/slack-ruby-client/pull/303): Added `oauth.v2.access` and `views.publish` endpoints - [@jwright](https://github.com/jwright).
13+
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Added `admin_apps`, `admin_app_requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
14+
* [#303](https://github.com/slack-ruby/slack-ruby-client/pull/303): Added `oauth_v2_access` and `views_publish` endpoints - [@jwright](https://github.com/jwright).
1415
* [#309](https://github.com/slack-ruby/slack-ruby-client/pull/309): Stop ping on `inactive_account` and `invalid_auth` - [@dblock](https://github.com/dblock).
1516

1617
### 0.14.4 (2019/7/28)

bin/commands.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
# This file was auto-generated by lib/tasks/web.rake
33

44
require 'commands/admin_apps'
5+
require 'commands/admin_apps_approved'
56
require 'commands/admin_apps_requests'
7+
require 'commands/admin_apps_restricted'
8+
require 'commands/admin_conversations'
9+
require 'commands/admin_emoji'
610
require 'commands/admin_inviteRequests'
711
require 'commands/admin_inviteRequests_approved'
812
require 'commands/admin_inviteRequests_denied'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminAppsApproved methods.'
5+
command 'admin_apps_approved' do |g|
6+
g.desc 'List approved apps for an org or workspace.'
7+
g.long_desc %( List approved apps for an org or workspace. )
8+
g.command 'list' do |c|
9+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
10+
c.flag 'enterprise_id', desc: '.'
11+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
12+
c.flag 'team_id', desc: '.'
13+
c.action do |_global_options, options, _args|
14+
puts JSON.dump($client.admin_apps_approved_list(options))
15+
end
16+
end
17+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminAppsRestricted methods.'
5+
command 'admin_apps_restricted' do |g|
6+
g.desc 'List restricted apps for an org or workspace.'
7+
g.long_desc %( List restricted apps for an org or workspace. )
8+
g.command 'list' do |c|
9+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
10+
c.flag 'enterprise_id', desc: '.'
11+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
12+
c.flag 'team_id', desc: '.'
13+
c.action do |_global_options, options, _args|
14+
puts JSON.dump($client.admin_apps_restricted_list(options))
15+
end
16+
end
17+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminConversations methods.'
5+
command 'admin_conversations' do |g|
6+
g.desc 'Set the workspaces in an Enterprise grid org that connect to a channel.'
7+
g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a channel. )
8+
g.command 'setTeams' do |c|
9+
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
10+
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
11+
c.flag 'target_team_ids', desc: "The list of workspaces to which the channel should be shared. Not required if the channel is being shared orgwide. Example: ['T1234', 'T5678']."
12+
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
13+
c.action do |_global_options, options, _args|
14+
puts JSON.dump($client.admin_conversations_setTeams(options))
15+
end
16+
end
17+
end

bin/commands/admin_emoji.rb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminEmoji methods.'
5+
command 'admin_emoji' do |g|
6+
g.desc 'Add an emoji.'
7+
g.long_desc %( Add an emoji. )
8+
g.command 'add' do |c|
9+
c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.'
10+
c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.'
11+
c.action do |_global_options, options, _args|
12+
puts JSON.dump($client.admin_emoji_add(options))
13+
end
14+
end
15+
16+
g.desc 'Add an emoji alias.'
17+
g.long_desc %( Add an emoji alias. )
18+
g.command 'addAlias' do |c|
19+
c.flag 'alias_for', desc: 'The alias of the emoji.'
20+
c.flag 'name', desc: 'The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.'
21+
c.action do |_global_options, options, _args|
22+
puts JSON.dump($client.admin_emoji_addAlias(options))
23+
end
24+
end
25+
26+
g.desc 'List emoji for an Enterprise Grid organization.'
27+
g.long_desc %( List emoji for an Enterprise Grid organization. )
28+
g.command 'list' do |c|
29+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
30+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
31+
c.action do |_global_options, options, _args|
32+
puts JSON.dump($client.admin_emoji_list(options))
33+
end
34+
end
35+
36+
g.desc 'Remove an emoji across an Enterprise Grid organization'
37+
g.long_desc %( Remove an emoji across an Enterprise Grid organization )
38+
g.command 'remove' do |c|
39+
c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.'
40+
c.action do |_global_options, options, _args|
41+
puts JSON.dump($client.admin_emoji_remove(options))
42+
end
43+
end
44+
45+
g.desc 'Rename an emoji.'
46+
g.long_desc %( Rename an emoji. )
47+
g.command 'rename' do |c|
48+
c.flag 'name', desc: 'The name of the emoji to be renamed. Colons (:myemoji:) around the value are not required, although they may be included.'
49+
c.flag 'new_name', desc: 'The new name of the emoji.'
50+
c.action do |_global_options, options, _args|
51+
puts JSON.dump($client.admin_emoji_rename(options))
52+
end
53+
end
54+
end

bin/commands/admin_teams_settings.rb

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,49 @@
33

44
desc 'AdminTeamsSettings methods.'
55
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+
625
g.desc 'Set the description of a given workspace.'
726
g.long_desc %( Set the description of a given workspace. )
827
g.command 'setDescription' do |c|
9-
c.flag 'description', desc: '.'
28+
c.flag 'description', desc: 'The new description for the workspace.'
1029
c.flag 'team_id', desc: 'ID for the workspace to set the description for.'
1130
c.action do |_global_options, options, _args|
1231
puts JSON.dump($client.admin_teams_settings_setDescription(options))
1332
end
1433
end
1534

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+
1645
g.desc 'Sets the icon of a workspace.'
1746
g.long_desc %( Sets the icon of a workspace. )
1847
g.command 'setIcon' do |c|
19-
c.flag 'image_url', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
48+
c.flag 'image_url', desc: 'Image URL for the icon.'
2049
c.flag 'team_id', desc: 'ID for the workspace to set the icon for.'
2150
c.action do |_global_options, options, _args|
2251
puts JSON.dump($client.admin_teams_settings_setIcon(options))
@@ -26,7 +55,7 @@
2655
g.desc 'Set the name of a given workspace.'
2756
g.long_desc %( Set the name of a given workspace. )
2857
g.command 'setName' do |c|
29-
c.flag 'name', desc: '.'
58+
c.flag 'name', desc: 'The new name of the workspace.'
3059
c.flag 'team_id', desc: 'ID for the workspace to set the name for.'
3160
c.action do |_global_options, options, _args|
3261
puts JSON.dump($client.admin_teams_settings_setName(options))

bin/commands/admin_users.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
g.command 'assign' do |c|
99
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
1010
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.'
1112
c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
1213
c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
1314
c.action do |_global_options, options, _args|
@@ -32,6 +33,17 @@
3233
end
3334
end
3435

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+
3547
g.desc 'Remove a user from a workspace.'
3648
g.long_desc %( Remove a user from a workspace. )
3749
g.command 'remove' do |c|
@@ -52,6 +64,17 @@
5264
end
5365
end
5466

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+
5578
g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
5679
g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
5780
g.command 'setOwner' do |c|

bin/commands/chat.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
g.command 'postEphemeral' do |c|
6262
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
6363
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: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
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.'
6565
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.'
6666
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.'
6767
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
@@ -80,12 +80,12 @@
8080
g.long_desc %( Sends a message to a channel. )
8181
g.command 'postMessage' do |c|
8282
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: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation."
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.'
8585
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
8686
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.'
8989
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
9090
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
9191
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
@@ -104,12 +104,12 @@
104104
g.command 'scheduleMessage' do |c|
105105
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.'
106106
c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
107-
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation."
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 authorship below.'
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.'
109109
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
110110
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
111111
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 below.'
112+
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See chat.postMessage.'
113113
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.'
114114
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."
115115
c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'

bin/commands/files.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
g.long_desc %( Lists & filters team files. )
3939
g.command 'list' do |c|
4040
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.'
4142
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
4243
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
4344
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.'

0 commit comments

Comments
 (0)