Skip to content

Commit 401a2b4

Browse files
authored
Update APIs (#348)
1 parent f2f2b45 commit 401a2b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+879
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### 0.15.2 (Next)
22

3+
* [#348](https://github.com/slack-ruby/slack-ruby-client/pull/348): Added `admin_conversations_archive`, `admin_conversations_convertToPrivate`, `admin_conversations_create`, `admin_conversations_delete`, `admin_conversations_disconnectShared`, `admin_conversations_getConversationPrefs`, `admin_conversations_getTeams`, `admin_conversations_invite`, `admin_conversations_rename`, `admin_conversations_search`, `admin_conversations_setConversationPrefs`, `admin_conversations_unarchive`, `admin_conversations_ekm_listOriginalConnectedChannelInfo`, `admin_users_session_invalidate`, `apps_event_authorizations_list`, `conversations_mark`, `workflows_stepCompleted`, `workflows_stepFailed`, `workflows_updateStep` endpoints - [@wasabigeek](https://github.com/wasabigeek).
34
* Your contribution here.
45

56
### 0.15.1 (2020/9/3)

bin/commands.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require 'commands/admin_apps_requests'
77
require 'commands/admin_apps_restricted'
88
require 'commands/admin_conversations'
9+
require 'commands/admin_conversations_ekm'
910
require 'commands/admin_conversations_restrictAccess'
1011
require 'commands/admin_conversations_whitelist'
1112
require 'commands/admin_emoji'
@@ -21,6 +22,7 @@
2122
require 'commands/admin_users_session'
2223
require 'commands/api'
2324
require 'commands/apps'
25+
require 'commands/apps_event_authorizations'
2426
require 'commands/apps_permissions'
2527
require 'commands/apps_permissions_resources'
2628
require 'commands/apps_permissions_scopes'
@@ -60,3 +62,4 @@
6062
require 'commands/users_prefs'
6163
require 'commands/users_profile'
6264
require 'commands/views'
65+
require 'commands/workflows'

bin/commands/admin_conversations.rb

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,123 @@
33

44
desc 'AdminConversations methods.'
55
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. )
6+
g.desc 'Archive a public or private channel.'
7+
g.long_desc %( Archive a public or private channel. )
8+
g.command 'archive' do |c|
9+
c.flag 'channel_id', desc: 'The channel to archive.'
10+
c.action do |_global_options, options, _args|
11+
puts JSON.dump($client.admin_conversations_archive(options))
12+
end
13+
end
14+
15+
g.desc 'Convert a public channel to a private channel.'
16+
g.long_desc %( Convert a public channel to a private channel. )
17+
g.command 'convertToPrivate' do |c|
18+
c.flag 'channel_id', desc: 'The channel to convert to private.'
19+
c.action do |_global_options, options, _args|
20+
puts JSON.dump($client.admin_conversations_convertToPrivate(options))
21+
end
22+
end
23+
24+
g.desc 'Create a public or private channel-based conversation.'
25+
g.long_desc %( Create a public or private channel-based conversation. )
26+
g.command 'create' do |c|
27+
c.flag 'is_private', desc: 'When true, creates a private channel instead of a public channel.'
28+
c.flag 'name', desc: 'Name of the public or private channel to create.'
29+
c.flag 'description', desc: 'Description of the public or private channel to create.'
30+
c.flag 'org_wide', desc: 'When true, the channel will be available org-wide. Note: if the channel is not org_wide=true, you must specify a team_id for this channel.'
31+
c.flag 'team_id', desc: 'The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.'
32+
c.action do |_global_options, options, _args|
33+
puts JSON.dump($client.admin_conversations_create(options))
34+
end
35+
end
36+
37+
g.desc 'Delete a public or private channel.'
38+
g.long_desc %( Delete a public or private channel. )
39+
g.command 'delete' do |c|
40+
c.flag 'channel_id', desc: 'The channel to delete.'
41+
c.action do |_global_options, options, _args|
42+
puts JSON.dump($client.admin_conversations_delete(options))
43+
end
44+
end
45+
46+
g.desc 'Disconnect a connected channel from one or more workspaces.'
47+
g.long_desc %( Disconnect a connected channel from one or more workspaces. )
48+
g.command 'disconnectShared' do |c|
49+
c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
50+
c.flag 'leaving_team_ids', desc: 'The team to be removed from the channel. Currently only a single team id can be specified.'
51+
c.action do |_global_options, options, _args|
52+
puts JSON.dump($client.admin_conversations_disconnectShared(options))
53+
end
54+
end
55+
56+
g.desc 'Get conversation preferences for a public or private channel.'
57+
g.long_desc %( Get conversation preferences for a public or private channel. )
58+
g.command 'getConversationPrefs' do |c|
59+
c.flag 'channel_id', desc: 'The channel to get preferences for.'
60+
c.action do |_global_options, options, _args|
61+
puts JSON.dump($client.admin_conversations_getConversationPrefs(options))
62+
end
63+
end
64+
65+
g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.'
66+
g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. )
67+
g.command 'getTeams' do |c|
68+
c.flag 'channel_id', desc: 'The channel to determine connected workspaces within the organization for.'
69+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
70+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
71+
c.action do |_global_options, options, _args|
72+
puts JSON.dump($client.admin_conversations_getTeams(options))
73+
end
74+
end
75+
76+
g.desc 'Invite a user to a public or private channel.'
77+
g.long_desc %( Invite a user to a public or private channel. )
78+
g.command 'invite' do |c|
79+
c.flag 'channel_id', desc: 'The channel that the users will be invited to.'
80+
c.flag 'user_ids', desc: 'The users to invite.'
81+
c.action do |_global_options, options, _args|
82+
puts JSON.dump($client.admin_conversations_invite(options))
83+
end
84+
end
85+
86+
g.desc 'Rename a public or private channel.'
87+
g.long_desc %( Rename a public or private channel. )
88+
g.command 'rename' do |c|
89+
c.flag 'channel_id', desc: 'The channel to rename.'
90+
c.flag 'name', desc: '.'
91+
c.action do |_global_options, options, _args|
92+
puts JSON.dump($client.admin_conversations_rename(options))
93+
end
94+
end
95+
96+
g.desc 'Search for public or private channels in an Enterprise organization.'
97+
g.long_desc %( Search for public or private channels in an Enterprise organization. )
98+
g.command 'search' do |c|
99+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
100+
c.flag 'limit', desc: 'Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.'
101+
c.flag 'query', desc: 'Name of the the channel to query by.'
102+
c.flag 'search_channel_types', desc: 'The type of channel to include or exclude in the search. For example private will search private channels, while private_exclude will exclude them. For a full list of types, check the Types section.'
103+
c.flag 'sort', desc: 'Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.'
104+
c.flag 'sort_dir', desc: '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).'
105+
c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the workspaces to search through.'
106+
c.action do |_global_options, options, _args|
107+
puts JSON.dump($client.admin_conversations_search(options))
108+
end
109+
end
110+
111+
g.desc 'Set the posting permissions for a public or private channel.'
112+
g.long_desc %( Set the posting permissions for a public or private channel. )
113+
g.command 'setConversationPrefs' do |c|
114+
c.flag 'channel_id', desc: 'The channel to set the prefs for.'
115+
c.flag 'prefs', desc: 'The prefs for this channel in a stringified JSON format.'
116+
c.action do |_global_options, options, _args|
117+
puts JSON.dump($client.admin_conversations_setConversationPrefs(options))
118+
end
119+
end
120+
121+
g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.'
122+
g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. )
8123
g.command 'setTeams' do |c|
9124
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
10125
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
@@ -14,4 +129,13 @@
14129
puts JSON.dump($client.admin_conversations_setTeams(options))
15130
end
16131
end
132+
133+
g.desc 'Unarchive a public or private channel.'
134+
g.long_desc %( Unarchive a public or private channel. )
135+
g.command 'unarchive' do |c|
136+
c.flag 'channel_id', desc: 'The channel to unarchive.'
137+
c.action do |_global_options, options, _args|
138+
puts JSON.dump($client.admin_conversations_unarchive(options))
139+
end
140+
end
17141
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 'AdminConversationsEkm methods.'
5+
command 'admin_conversations_ekm' do |g|
6+
g.desc 'List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.'
7+
g.long_desc %( List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM. )
8+
g.command 'listOriginalConnectedChannelInfo' do |c|
9+
c.flag 'channel_ids', desc: 'A comma-separated list of channels to filter to.'
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.flag 'team_ids', desc: 'A comma-separated list of the workspaces to which the channels you would like returned belong.'
13+
c.action do |_global_options, options, _args|
14+
puts JSON.dump($client.admin_conversations_ekm_listOriginalConnectedChannelInfo(options))
15+
end
16+
end
17+
end

bin/commands/admin_conversations_restrictAccess.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
g.command 'addGroup' do |c|
99
c.flag 'channel_id', desc: 'The channel to link this group to.'
1010
c.flag 'group_id', desc: 'The IDP Group ID to be an allowlist for the private channel.'
11-
c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
11+
c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
1212
c.action do |_global_options, options, _args|
1313
puts JSON.dump($client.admin_conversations_restrictAccess_addGroup(options))
1414
end
@@ -18,7 +18,7 @@
1818
g.long_desc %( List all IDP Groups linked to a channel )
1919
g.command 'listGroups' do |c|
2020
c.flag 'channel_id', desc: '.'
21-
c.flag 'team_id', desc: 'The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
21+
c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
2222
c.action do |_global_options, options, _args|
2323
puts JSON.dump($client.admin_conversations_restrictAccess_listGroups(options))
2424
end
@@ -29,7 +29,7 @@
2929
g.command 'removeGroup' do |c|
3030
c.flag 'channel_id', desc: 'The channel to remove the linked group from.'
3131
c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel.'
32-
c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
32+
c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
3333
c.action do |_global_options, options, _args|
3434
puts JSON.dump($client.admin_conversations_restrictAccess_removeGroup(options))
3535
end

bin/commands/admin_users_session.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33

44
desc 'AdminUsersSession methods.'
55
command 'admin_users_session' do |g|
6+
g.desc 'Invalidate a single session for a user by session_id'
7+
g.long_desc %( Invalidate a single session for a user by session_id )
8+
g.command 'invalidate' do |c|
9+
c.flag 'session_id', desc: '.'
10+
c.flag 'team_id', desc: 'ID of the team that the session belongs to.'
11+
c.action do |_global_options, options, _args|
12+
puts JSON.dump($client.admin_users_session_invalidate(options))
13+
end
14+
end
15+
616
g.desc 'Wipes all valid sessions on all devices for a given user'
717
g.long_desc %( Wipes all valid sessions on all devices for a given user )
818
g.command 'reset' do |c|
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AppsEventAuthorizations methods.'
5+
command 'apps_event_authorizations' do |g|
6+
g.desc 'Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.'
7+
g.long_desc %( Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. )
8+
g.command 'list' do |c|
9+
c.flag 'event_context', desc: '.'
10+
c.flag 'cursor', desc: '.'
11+
c.flag 'limit', desc: '.'
12+
c.action do |_global_options, options, _args|
13+
puts JSON.dump($client.apps_event_authorizations_list(options))
14+
end
15+
end
16+
end

bin/commands/conversations.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@
106106
end
107107
end
108108

109+
g.desc 'Sets the read cursor in a channel.'
110+
g.long_desc %( Sets the read cursor in a channel. )
111+
g.command 'mark' do |c|
112+
c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
113+
c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
114+
c.action do |_global_options, options, _args|
115+
puts JSON.dump($client.conversations_mark(options))
116+
end
117+
end
118+
109119
g.desc 'Retrieve members of a conversation.'
110120
g.long_desc %( Retrieve members of a conversation. )
111121
g.command 'members' do |c|
@@ -142,7 +152,7 @@
142152
g.long_desc %( Retrieve a thread of messages posted to a conversation )
143153
g.command 'replies' do |c|
144154
c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
145-
c.flag 'ts', desc: "Unique identifier of a thread's parent message."
155+
c.flag 'ts', desc: "Unique identifier of a thread's parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message."
146156
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
147157
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
148158
c.flag 'latest', desc: 'End of time range of messages to include in results.'

bin/commands/files.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
end
2424
end
2525

26-
g.desc 'Gets information about a team file.'
27-
g.long_desc %( Gets information about a team file. )
26+
g.desc 'Gets information about a file.'
27+
g.long_desc %( Gets information about a file. )
2828
g.command 'info' do |c|
2929
c.flag 'file', desc: 'Specify a file by providing its ID.'
3030
c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection of comments. See pagination for more details."
@@ -34,8 +34,8 @@
3434
end
3535
end
3636

37-
g.desc 'Lists & filters team files.'
38-
g.long_desc %( Lists & filters team files. )
37+
g.desc 'List for a team, in a channel, or from a user with applied filters.'
38+
g.long_desc %( List for a team, in a channel, or from a user with applied filters. )
3939
g.command 'list' do |c|
4040
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
4141
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.'

bin/commands/files_remote.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
g.long_desc %( Share a remote file into a channel. )
5555
g.command 'share' do |c|
5656
c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.'
57-
c.flag 'external_id', desc: 'Creator defined GUID for the file.'
58-
c.flag 'file', desc: 'Specify a file by providing its ID.'
57+
c.flag 'external_id', desc: 'The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.'
58+
c.flag 'file', desc: 'Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.'
5959
c.action do |_global_options, options, _args|
6060
puts JSON.dump($client.files_remote_share(options))
6161
end

0 commit comments

Comments
 (0)