Skip to content

Commit c04a831

Browse files
authored
Update New Methods (#327)
* Update slack-api-ref reference * Add AdminConversationsWhitelist methods * Update AdminConversations docs * Add endpoints for AdminConversationsWhitelist * Update changelog * Add more new methods * Update changelog
1 parent 9b20556 commit c04a831

19 files changed

+621
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
### 0.15.0 (Next)
22

3-
* [#326](https://github.com/slack-ruby/slack-ruby-client/pull/326): Update new methods - [@wasabigeek](https://github.com/wasabigeek).
3+
* [#322](https://github.com/slack-ruby/slack-ruby-client/pull/322): Cache `Faraday::Connection` for persistent adapters - [@drbrain](https://github.com/drbrain).
44
* [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Require Faraday >= 1.0 - [@dblock](https://github.com/dblock).
55
* [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Upgrade slack-ruby-danger, rubocop, rubocop-rspec and rubocop-performance - [@dblock](https://github.com/dblock).
6-
* [#322](https://github.com/slack-ruby/slack-ruby-client/pull/322): Cache `Faraday::Connection` for persistent adapters - [@drbrain](https://github.com/drbrain).
6+
* [#327](https://github.com/slack-ruby/slack-ruby-client/pull/327), [#326](https://github.com/slack-ruby/slack-ruby-client/pull/326): Added `admin_conversations_whitelist`, `admin_usergroups`, `calls` and `calls_participants` endpoints - [@wasabigeek](https://github.com/wasabigeek).
77
* Your contribution here.
88

99
### 0.14.6 (2020/3/28)

bin/commands.rb

Lines changed: 4 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_whitelist'
910
require 'commands/admin_emoji'
1011
require 'commands/admin_inviteRequests'
1112
require 'commands/admin_inviteRequests_approved'
@@ -14,6 +15,7 @@
1415
require 'commands/admin_teams_admins'
1516
require 'commands/admin_teams_owners'
1617
require 'commands/admin_teams_settings'
18+
require 'commands/admin_usergroups'
1719
require 'commands/admin_users'
1820
require 'commands/admin_users_session'
1921
require 'commands/api'
@@ -24,6 +26,8 @@
2426
require 'commands/apps_permissions_users'
2527
require 'commands/auth'
2628
require 'commands/bots'
29+
require 'commands/calls'
30+
require 'commands/calls_participants'
2731
require 'commands/channels'
2832
require 'commands/chat'
2933
require 'commands/chat_scheduledMessages'

bin/commands/admin_conversations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
g.command 'setTeams' do |c|
99
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
1010
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']."
11+
c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.'
1212
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
1313
c.action do |_global_options, options, _args|
1414
puts JSON.dump($client.admin_conversations_setTeams(options))
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminConversationsWhitelist methods.'
5+
command 'admin_conversations_whitelist' do |g|
6+
g.desc 'Add a whitelist of IDP groups for accessing a channel'
7+
g.long_desc %( Add a whitelist of IDP groups for accessing a channel )
8+
g.command 'add' do |c|
9+
c.flag 'channel_id', desc: 'The channel to whitelist a group for.'
10+
c.flag 'group_id', desc: 'The IDP Group ID to whitelist for the private channel.'
11+
c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
12+
c.action do |_global_options, options, _args|
13+
puts JSON.dump($client.admin_conversations_whitelist_add(options))
14+
end
15+
end
16+
17+
g.desc 'List all IDP Groups linked to a channel'
18+
g.long_desc %( List all IDP Groups linked to a channel )
19+
g.command 'listGroupsLinkedToChannel' do |c|
20+
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.'
22+
c.action do |_global_options, options, _args|
23+
puts JSON.dump($client.admin_conversations_whitelist_listGroupsLinkedToChannel(options))
24+
end
25+
end
26+
27+
g.desc 'Remove a whitelisted IDP group linked to a private channel'
28+
g.long_desc %( Remove a whitelisted IDP group linked to a private channel )
29+
g.command 'remove' do |c|
30+
c.flag 'channel_id', desc: 'The channel to remove a whitelisted group for.'
31+
c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel whitelist.'
32+
c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
33+
c.action do |_global_options, options, _args|
34+
puts JSON.dump($client.admin_conversations_whitelist_remove(options))
35+
end
36+
end
37+
end

bin/commands/admin_usergroups.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'AdminUsergroups methods.'
5+
command 'admin_usergroups' do |g|
6+
g.desc 'Add one or more default channels to an IDP group.'
7+
g.long_desc %( Add one or more default channels to an IDP group. )
8+
g.command 'addChannels' do |c|
9+
c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
10+
c.flag 'team_id', desc: 'The workspace to add default channels in.'
11+
c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
12+
c.action do |_global_options, options, _args|
13+
puts JSON.dump($client.admin_usergroups_addChannels(options))
14+
end
15+
end
16+
17+
g.desc 'Add one or more teams to the list of teams associated with an org-level usergroup.'
18+
g.long_desc %( Add one or more teams to the list of teams associated with an org-level usergroup. )
19+
g.command 'addTeams' do |c|
20+
c.flag 'team_ids', desc: 'A comma separated list of encoded team IDs. Teams MUST belong to the organization.'
21+
c.flag 'usergroup_id', desc: 'A encoded usergroup ID.'
22+
c.flag 'auto_provision', desc: 'A boolean to control whether to automatically create new team users for the usergroup memebrs or not.'
23+
c.action do |_global_options, options, _args|
24+
puts JSON.dump($client.admin_usergroups_addTeams(options))
25+
end
26+
end
27+
28+
g.desc 'List the channels linked to an org-level IDP group (user group).'
29+
g.long_desc %( List the channels linked to an org-level IDP group (user group). )
30+
g.command 'listChannels' do |c|
31+
c.flag 'usergroup_id', desc: 'ID of the IDP group to list default channels for.'
32+
c.flag 'include_num_members', desc: 'Flag to include or exclude the count of members per channel.'
33+
c.flag 'team_id', desc: 'ID of the the workspace.'
34+
c.action do |_global_options, options, _args|
35+
puts JSON.dump($client.admin_usergroups_listChannels(options))
36+
end
37+
end
38+
39+
g.desc 'Remove one or more default channels from an org-level IDP group (user group).'
40+
g.long_desc %( Remove one or more default channels from an org-level IDP group (user group). )
41+
g.command 'removeChannels' do |c|
42+
c.flag 'channel_ids', desc: 'Comma-separated string of channel IDs.'
43+
c.flag 'usergroup_id', desc: 'ID of the IDP Group.'
44+
c.action do |_global_options, options, _args|
45+
puts JSON.dump($client.admin_usergroups_removeChannels(options))
46+
end
47+
end
48+
end

bin/commands/calls.rb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'Calls methods.'
5+
command 'calls' do |g|
6+
g.desc 'Registers a new Call.'
7+
g.long_desc %( Registers a new Call. )
8+
g.command 'add' do |c|
9+
c.flag 'external_unique_id', desc: 'An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.'
10+
c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
11+
c.flag 'created_by', desc: 'The valid Slack user ID of the user who created this Call. When this method is called with a user token, the created_by field is optional and defaults to the authed user of the token. Otherwise, the field is required.'
12+
c.flag 'date_start', desc: 'Call start time in UTC UNIX timestamp format.'
13+
c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
14+
c.flag 'external_display_id', desc: 'An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.'
15+
c.flag 'title', desc: 'The name of the Call.'
16+
c.flag 'users', desc: 'The list of users to register as participants in the Call. Read more on how to specify users here.'
17+
c.action do |_global_options, options, _args|
18+
puts JSON.dump($client.calls_add(options))
19+
end
20+
end
21+
22+
g.desc 'Ends a Call.'
23+
g.long_desc %( Ends a Call. )
24+
g.command 'end' do |c|
25+
c.flag 'id', desc: 'id returned when registering the call using the calls.add method.'
26+
c.flag 'duration', desc: 'Call duration in seconds.'
27+
c.action do |_global_options, options, _args|
28+
puts JSON.dump($client.calls_end(options))
29+
end
30+
end
31+
32+
g.desc 'Returns information about a Call.'
33+
g.long_desc %( Returns information about a Call. )
34+
g.command 'info' do |c|
35+
c.flag 'id', desc: 'id of the Call returned by the calls.add method.'
36+
c.action do |_global_options, options, _args|
37+
puts JSON.dump($client.calls_info(options))
38+
end
39+
end
40+
41+
g.desc 'Updates information about a Call.'
42+
g.long_desc %( Updates information about a Call. )
43+
g.command 'update' do |c|
44+
c.flag 'id', desc: 'id returned by the calls.add method.'
45+
c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
46+
c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
47+
c.flag 'title', desc: 'The name of the Call.'
48+
c.action do |_global_options, options, _args|
49+
puts JSON.dump($client.calls_update(options))
50+
end
51+
end
52+
end

bin/commands/calls_participants.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
# This file was auto-generated by lib/tasks/web.rake
3+
4+
desc 'CallsParticipants methods.'
5+
command 'calls_participants' do |g|
6+
g.desc 'Registers new participants added to a Call.'
7+
g.long_desc %( Registers new participants added to a Call. )
8+
g.command 'add' do |c|
9+
c.flag 'id', desc: 'id returned by the calls.add method.'
10+
c.flag 'users', desc: 'The list of users to add as participants in the Call. Read more on how to specify users here.'
11+
c.action do |_global_options, options, _args|
12+
puts JSON.dump($client.calls_participants_add(options))
13+
end
14+
end
15+
end

lib/slack/web/api/endpoints.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require_relative 'endpoints/admin_apps_requests'
77
require_relative 'endpoints/admin_apps_restricted'
88
require_relative 'endpoints/admin_conversations'
9+
require_relative 'endpoints/admin_conversations_whitelist'
910
require_relative 'endpoints/admin_emoji'
1011
require_relative 'endpoints/admin_inviteRequests'
1112
require_relative 'endpoints/admin_inviteRequests_approved'
@@ -14,6 +15,7 @@
1415
require_relative 'endpoints/admin_teams_admins'
1516
require_relative 'endpoints/admin_teams_owners'
1617
require_relative 'endpoints/admin_teams_settings'
18+
require_relative 'endpoints/admin_usergroups'
1719
require_relative 'endpoints/admin_users'
1820
require_relative 'endpoints/admin_users_session'
1921
require_relative 'endpoints/api'
@@ -24,6 +26,8 @@
2426
require_relative 'endpoints/apps_permissions_users'
2527
require_relative 'endpoints/auth'
2628
require_relative 'endpoints/bots'
29+
require_relative 'endpoints/calls'
30+
require_relative 'endpoints/calls_participants'
2731
require_relative 'endpoints/channels'
2832
require_relative 'endpoints/chat'
2933
require_relative 'endpoints/chat_scheduledMessages'
@@ -69,6 +73,7 @@ module Endpoints
6973
include AdminAppsRequests
7074
include AdminAppsRestricted
7175
include AdminConversations
76+
include AdminConversationsWhitelist
7277
include AdminEmoji
7378
include AdminInviterequests
7479
include AdminInviterequestsApproved
@@ -77,6 +82,7 @@ module Endpoints
7782
include AdminTeamsAdmins
7883
include AdminTeamsOwners
7984
include AdminTeamsSettings
85+
include AdminUsergroups
8086
include AdminUsers
8187
include AdminUsersSession
8288
include Api
@@ -87,6 +93,8 @@ module Endpoints
8793
include AppsPermissionsUsers
8894
include Auth
8995
include Bots
96+
include Calls
97+
include CallsParticipants
9098
include Channels
9199
include Chat
92100
include ChatScheduledmessages

lib/slack/web/api/endpoints/admin_conversations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module AdminConversations
1414
# @option options [Object] :org_channel
1515
# True if channel has to be converted to an org channel.
1616
# @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'].
17+
# A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
1818
# @option options [Object] :team_id
1919
# The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
2020
# @see https://api.slack.com/methods/admin.conversations.setTeams
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 AdminConversationsWhitelist
9+
#
10+
# Add a whitelist of IDP groups for accessing a channel
11+
#
12+
# @option options [Object] :channel_id
13+
# The channel to whitelist a group for.
14+
# @option options [Object] :group_id
15+
# The IDP Group ID to whitelist for the private channel.
16+
# @option options [Object] :team_id
17+
# The workspace where the IDP Group and channel exist.
18+
# @see https://api.slack.com/methods/admin.conversations.whitelist.add
19+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.add.json
20+
def admin_conversations_whitelist_add(options = {})
21+
throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
22+
throw ArgumentError.new('Required arguments :group_id missing') if options[:group_id].nil?
23+
post('admin.conversations.whitelist.add', options)
24+
end
25+
26+
#
27+
# List all IDP Groups linked to a channel
28+
#
29+
# @option options [Object] :channel_id
30+
# .
31+
# @option options [Object] :team_id
32+
# 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.
33+
# @see https://api.slack.com/methods/admin.conversations.whitelist.listGroupsLinkedToChannel
34+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.listGroupsLinkedToChannel.json
35+
def admin_conversations_whitelist_listGroupsLinkedToChannel(options = {})
36+
throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
37+
post('admin.conversations.whitelist.listGroupsLinkedToChannel', options)
38+
end
39+
40+
#
41+
# Remove a whitelisted IDP group linked to a private channel
42+
#
43+
# @option options [Object] :channel_id
44+
# The channel to remove a whitelisted group for.
45+
# @option options [Object] :group_id
46+
# The IDP Group ID to remove from the private channel whitelist.
47+
# @option options [Object] :team_id
48+
# The workspace where the IDP Group and channel exist.
49+
# @see https://api.slack.com/methods/admin.conversations.whitelist.remove
50+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.remove.json
51+
def admin_conversations_whitelist_remove(options = {})
52+
throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
53+
throw ArgumentError.new('Required arguments :group_id missing') if options[:group_id].nil?
54+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
55+
post('admin.conversations.whitelist.remove', options)
56+
end
57+
end
58+
end
59+
end
60+
end
61+
end

0 commit comments

Comments
 (0)