slack-ruby-client 0.14.6 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +9 -2
  4. data/.rubocop_todo.yml +52 -12
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +10 -0
  7. data/CONTRIBUTING.md +24 -6
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/README.md +20 -1
  11. data/UPGRADING.md +6 -0
  12. data/bin/commands.rb +5 -0
  13. data/bin/commands/admin_conversations.rb +1 -1
  14. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  15. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  16. data/bin/commands/admin_usergroups.rb +48 -0
  17. data/bin/commands/calls.rb +52 -0
  18. data/bin/commands/calls_participants.rb +25 -0
  19. data/bin/commands/chat.rb +5 -5
  20. data/bin/commands/conversations.rb +0 -1
  21. data/lib/slack-ruby-client.rb +2 -4
  22. data/lib/slack/messages/message.rb +0 -4
  23. data/lib/slack/real_time/concurrency/async.rb +1 -3
  24. data/lib/slack/real_time/concurrency/eventmachine.rb +3 -3
  25. data/lib/slack/real_time/models/base.rb +0 -4
  26. data/lib/slack/real_time/socket.rb +2 -2
  27. data/lib/slack/real_time/stores/base.rb +3 -1
  28. data/lib/slack/version.rb +1 -1
  29. data/lib/slack/web/api/endpoints.rb +11 -0
  30. data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -1
  31. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  32. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  33. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  34. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  35. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  36. data/lib/slack/web/api/endpoints/channels.rb +28 -13
  37. data/lib/slack/web/api/endpoints/chat.rb +12 -12
  38. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +1 -1
  39. data/lib/slack/web/api/endpoints/conversations.rb +15 -17
  40. data/lib/slack/web/api/endpoints/files.rb +2 -2
  41. data/lib/slack/web/api/endpoints/files_remote.rb +1 -1
  42. data/lib/slack/web/api/endpoints/groups.rb +16 -0
  43. data/lib/slack/web/api/endpoints/im.rb +10 -4
  44. data/lib/slack/web/api/endpoints/mpim.rb +10 -4
  45. data/lib/slack/web/api/endpoints/oauth.rb +0 -3
  46. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  47. data/lib/slack/web/api/endpoints/reactions.rb +3 -3
  48. data/lib/slack/web/api/endpoints/stars.rb +2 -2
  49. data/lib/slack/web/api/errors.rb +92 -2
  50. data/lib/slack/web/api/mixins.rb +1 -0
  51. data/lib/slack/web/api/mixins/conversations.id.rb +27 -0
  52. data/lib/slack/web/api/mixins/ids.id.rb +1 -3
  53. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
  54. data/lib/slack/web/api/templates/method.erb +4 -1
  55. data/lib/slack/web/faraday/connection.rb +23 -20
  56. data/lib/slack/web/pagination/cursor.rb +2 -2
  57. data/slack-ruby-client.gemspec +5 -5
  58. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  59. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  60. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
  61. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  62. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  63. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  64. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +3 -3
  65. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  66. data/spec/slack/web/api/errors/service_unavailable_spec.rb +2 -2
  67. data/spec/slack/web/api/mixins/conversations_spec.rb +41 -0
  68. data/spec/slack/web/client_spec.rb +26 -0
  69. metadata +49 -30
  70. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  71. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  72. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  73. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  74. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
@@ -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
@@ -0,0 +1,25 @@
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
+
16
+ g.desc 'Registers participants removed from a Call.'
17
+ g.long_desc %( Registers participants removed from a Call. )
18
+ g.command 'remove' do |c|
19
+ c.flag 'id', desc: 'id returned by the calls.add method.'
20
+ c.flag 'users', desc: 'The list of users to remove as participants in the Call. Read more on how to specify users here.'
21
+ c.action do |_global_options, options, _args|
22
+ puts JSON.dump($client.calls_participants_remove(options))
23
+ end
24
+ end
25
+ end
@@ -137,13 +137,13 @@ command 'chat' do |g|
137
137
  g.long_desc %( Updates a message. )
138
138
  g.command 'update' do |c|
139
139
  c.flag 'channel', desc: 'Channel containing the message to be updated.'
140
- c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting attachments."
141
140
  c.flag 'ts', desc: 'Timestamp of the message to be updated.'
142
141
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
143
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.'
144
- c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
145
- c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. See below.'
146
- c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.'
142
+ c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field."
143
+ c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field."
144
+ c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
145
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
146
+ c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
147
147
  c.action do |_global_options, options, _args|
148
148
  puts JSON.dump($client.chat_update(options))
149
149
  end
@@ -26,7 +26,6 @@ command 'conversations' do |g|
26
26
  g.command 'create' do |c|
27
27
  c.flag 'name', desc: 'Name of the public or private channel to create.'
28
28
  c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
29
- c.flag 'user_ids', desc: 'Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation. This argument has no effect when used by classic Slack apps.'
30
29
  c.action do |_global_options, options, _args|
31
30
  puts JSON.dump($client.conversations_create(options))
32
31
  end
@@ -15,12 +15,12 @@ require 'json'
15
15
  require 'logger'
16
16
  begin
17
17
  require 'picky'
18
- rescue LoadError # rubocop:disable Lint/HandleExceptions
18
+ rescue LoadError # rubocop:disable Lint/SuppressedException
19
19
  # ignore, only used in users_search
20
20
  end
21
21
  begin
22
22
  require 'openssl'
23
- rescue LoadError # rubocop:disable Lint/HandleExceptions
23
+ rescue LoadError # rubocop:disable Lint/SuppressedException
24
24
  # Used in slack/web/config
25
25
  end
26
26
  require_relative 'slack/web/config'
@@ -37,8 +37,6 @@ require_relative 'slack/web/pagination/cursor'
37
37
  require_relative 'slack/web/client'
38
38
 
39
39
  # RealTime API
40
- require 'active_support'
41
- require 'active_support/core_ext'
42
40
  require_relative 'slack/real_time/concurrency'
43
41
  require_relative 'slack/real_time/socket'
44
42
  require_relative 'slack/real_time/api/message_id'
@@ -2,10 +2,6 @@
2
2
  module Slack
3
3
  module Messages
4
4
  class Message < Hashie::Mash
5
- def presence
6
- super['presence']
7
- end
8
-
9
5
  def to_s
10
6
  keys.sort_by(&:to_s).map do |key|
11
7
  "#{key}=#{self[key]}"
@@ -114,9 +114,7 @@ module Slack
114
114
 
115
115
  def build_endpoint
116
116
  endpoint = ::Async::IO::Endpoint.tcp(addr, port)
117
- if secure?
118
- endpoint = ::Async::IO::SSLEndpoint.new(endpoint, ssl_context: build_ssl_context)
119
- end
117
+ endpoint = ::Async::IO::SSLEndpoint.new(endpoint, ssl_context: build_ssl_context) if secure?
120
118
  endpoint
121
119
  end
122
120
 
@@ -8,9 +8,9 @@ module Slack
8
8
  module Eventmachine
9
9
  class Client < Faye::WebSocket::Client
10
10
  def initialize(url, protocols = nil, options = {})
11
- @logger =
12
- options.fetch(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13
- super url, protocols, options.except(:logger)
11
+ options = options.dup
12
+ @logger = options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13
+ super url, protocols, options
14
14
  end
15
15
 
16
16
  def parse(data)
@@ -3,10 +3,6 @@ module Slack
3
3
  module RealTime
4
4
  module Models
5
5
  class Base < Hashie::Mash
6
- def presence
7
- super['presence']
8
- end
9
-
10
6
  # see https://github.com/intridea/hashie/issues/394
11
7
  def log_built_in_message(*); end
12
8
  end
@@ -8,9 +8,9 @@ module Slack
8
8
 
9
9
  def initialize(url, options = {})
10
10
  @url = url
11
- @options = options
11
+ @options = options.dup
12
12
  @driver = nil
13
- @logger = options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13
+ @logger = @options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
14
14
  @last_message_at = nil
15
15
  end
16
16
 
@@ -4,7 +4,9 @@ module Slack
4
4
  module Stores
5
5
  # Doesn't store anything.
6
6
  class Base
7
- class_attribute :events
7
+ class << self
8
+ attr_accessor :events
9
+ end
8
10
 
9
11
  attr_accessor :users
10
12
  attr_accessor :bots
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Slack
3
- VERSION = '0.14.6'
3
+ VERSION = '0.15.0'
4
4
  end
@@ -6,6 +6,8 @@ require_relative 'endpoints/admin_apps_approved'
6
6
  require_relative 'endpoints/admin_apps_requests'
7
7
  require_relative 'endpoints/admin_apps_restricted'
8
8
  require_relative 'endpoints/admin_conversations'
9
+ require_relative 'endpoints/admin_conversations_restrictAccess'
10
+ require_relative 'endpoints/admin_conversations_whitelist'
9
11
  require_relative 'endpoints/admin_emoji'
10
12
  require_relative 'endpoints/admin_inviteRequests'
11
13
  require_relative 'endpoints/admin_inviteRequests_approved'
@@ -14,6 +16,7 @@ require_relative 'endpoints/admin_teams'
14
16
  require_relative 'endpoints/admin_teams_admins'
15
17
  require_relative 'endpoints/admin_teams_owners'
16
18
  require_relative 'endpoints/admin_teams_settings'
19
+ require_relative 'endpoints/admin_usergroups'
17
20
  require_relative 'endpoints/admin_users'
18
21
  require_relative 'endpoints/admin_users_session'
19
22
  require_relative 'endpoints/api'
@@ -24,6 +27,8 @@ require_relative 'endpoints/apps_permissions_scopes'
24
27
  require_relative 'endpoints/apps_permissions_users'
25
28
  require_relative 'endpoints/auth'
26
29
  require_relative 'endpoints/bots'
30
+ require_relative 'endpoints/calls'
31
+ require_relative 'endpoints/calls_participants'
27
32
  require_relative 'endpoints/channels'
28
33
  require_relative 'endpoints/chat'
29
34
  require_relative 'endpoints/chat_scheduledMessages'
@@ -60,6 +65,7 @@ module Slack
60
65
  module Web
61
66
  module Api
62
67
  module Endpoints
68
+ include Slack::Web::Api::Mixins::Conversations
63
69
  include Slack::Web::Api::Mixins::Channels
64
70
  include Slack::Web::Api::Mixins::Users
65
71
  include Slack::Web::Api::Mixins::Groups
@@ -69,6 +75,8 @@ module Slack
69
75
  include AdminAppsRequests
70
76
  include AdminAppsRestricted
71
77
  include AdminConversations
78
+ include AdminConversationsRestrictaccess
79
+ include AdminConversationsWhitelist
72
80
  include AdminEmoji
73
81
  include AdminInviterequests
74
82
  include AdminInviterequestsApproved
@@ -77,6 +85,7 @@ module Slack
77
85
  include AdminTeamsAdmins
78
86
  include AdminTeamsOwners
79
87
  include AdminTeamsSettings
88
+ include AdminUsergroups
80
89
  include AdminUsers
81
90
  include AdminUsersSession
82
91
  include Api
@@ -87,6 +96,8 @@ module Slack
87
96
  include AppsPermissionsUsers
88
97
  include Auth
89
98
  include Bots
99
+ include Calls
100
+ include CallsParticipants
90
101
  include Channels
91
102
  include Chat
92
103
  include ChatScheduledmessages
@@ -14,7 +14,7 @@ module Slack
14
14
  # @option options [Object] :org_channel
15
15
  # True if channel has to be converted to an org channel.
16
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'].
17
+ # A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
18
18
  # @option options [Object] :team_id
19
19
  # The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
20
20
  # @see https://api.slack.com/methods/admin.conversations.setTeams
@@ -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 AdminConversationsRestrictaccess
9
+ #
10
+ # Add an allowlist of IDP groups for accessing a channel
11
+ #
12
+ # @option options [Object] :channel_id
13
+ # The channel to link this group to.
14
+ # @option options [Object] :group_id
15
+ # The IDP Group ID to be an allowlist 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.restrictAccess.addGroup
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.addGroup.json
20
+ def admin_conversations_restrictAccess_addGroup(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.restrictAccess.addGroup', 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.restrictAccess.listGroups
34
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.listGroups.json
35
+ def admin_conversations_restrictAccess_listGroups(options = {})
36
+ throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
37
+ post('admin.conversations.restrictAccess.listGroups', options)
38
+ end
39
+
40
+ #
41
+ # Remove a linked IDP group linked from a private channel
42
+ #
43
+ # @option options [Object] :channel_id
44
+ # The channel to remove the linked group from.
45
+ # @option options [Object] :group_id
46
+ # The IDP Group ID to remove from the private channel.
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.restrictAccess.removeGroup
50
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.restrictAccess/admin.conversations.restrictAccess.removeGroup.json
51
+ def admin_conversations_restrictAccess_removeGroup(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.restrictAccess.removeGroup', options)
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,64 @@
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 an allowlist 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
+ logger.warn('admin.conversations.whitelist.add: Alternative methods: .')
24
+ post('admin.conversations.whitelist.add', options)
25
+ end
26
+
27
+ #
28
+ # List all IDP Groups linked to a channel
29
+ #
30
+ # @option options [Object] :channel_id
31
+ # .
32
+ # @option options [Object] :team_id
33
+ # 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.
34
+ # @see https://api.slack.com/methods/admin.conversations.whitelist.listGroupsLinkedToChannel
35
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.listGroupsLinkedToChannel.json
36
+ def admin_conversations_whitelist_listGroupsLinkedToChannel(options = {})
37
+ throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
38
+ logger.warn('admin.conversations.whitelist.listGroupsLinkedToChannel: Alternative methods: .')
39
+ post('admin.conversations.whitelist.listGroupsLinkedToChannel', options)
40
+ end
41
+
42
+ #
43
+ # Remove an allowlisted IDP group linked to a private channel
44
+ #
45
+ # @option options [Object] :channel_id
46
+ # The channel to remove a whitelisted group for.
47
+ # @option options [Object] :group_id
48
+ # The IDP Group ID to remove from the private channel whitelist.
49
+ # @option options [Object] :team_id
50
+ # The workspace where the IDP Group and channel exist.
51
+ # @see https://api.slack.com/methods/admin.conversations.whitelist.remove
52
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.remove.json
53
+ def admin_conversations_whitelist_remove(options = {})
54
+ throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
55
+ throw ArgumentError.new('Required arguments :group_id missing') if options[:group_id].nil?
56
+ throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
57
+ logger.warn('admin.conversations.whitelist.remove: Alternative methods: .')
58
+ post('admin.conversations.whitelist.remove', options)
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,77 @@
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 AdminUsergroups
9
+ #
10
+ # Add one or more default channels to an IDP group.
11
+ #
12
+ # @option options [Object] :channel_ids
13
+ # Comma separated string of channel IDs.
14
+ # @option options [Object] :usergroup_id
15
+ # ID of the IDP group to add default channels for.
16
+ # @option options [Object] :team_id
17
+ # The workspace to add default channels in.
18
+ # @see https://api.slack.com/methods/admin.usergroups.addChannels
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.addChannels.json
20
+ def admin_usergroups_addChannels(options = {})
21
+ throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil?
22
+ throw ArgumentError.new('Required arguments :usergroup_id missing') if options[:usergroup_id].nil?
23
+ post('admin.usergroups.addChannels', options)
24
+ end
25
+
26
+ #
27
+ # Associate one or more default workspaces with an organization-wide IDP group.
28
+ #
29
+ # @option options [Object] :team_ids
30
+ # A comma separated list of encoded team (workspace) IDs. Each workspace MUST belong to the organization associated with the token.
31
+ # @option options [Object] :usergroup_id
32
+ # An encoded usergroup (IDP Group) ID.
33
+ # @option options [Object] :auto_provision
34
+ # When true, this method automatically creates new workspace accounts for the IDP group members.
35
+ # @see https://api.slack.com/methods/admin.usergroups.addTeams
36
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.addTeams.json
37
+ def admin_usergroups_addTeams(options = {})
38
+ throw ArgumentError.new('Required arguments :team_ids missing') if options[:team_ids].nil?
39
+ throw ArgumentError.new('Required arguments :usergroup_id missing') if options[:usergroup_id].nil?
40
+ post('admin.usergroups.addTeams', options)
41
+ end
42
+
43
+ #
44
+ # List the channels linked to an org-level IDP group (user group).
45
+ #
46
+ # @option options [Object] :usergroup_id
47
+ # ID of the IDP group to list default channels for.
48
+ # @option options [Object] :include_num_members
49
+ # Flag to include or exclude the count of members per channel.
50
+ # @option options [Object] :team_id
51
+ # ID of the the workspace.
52
+ # @see https://api.slack.com/methods/admin.usergroups.listChannels
53
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.listChannels.json
54
+ def admin_usergroups_listChannels(options = {})
55
+ throw ArgumentError.new('Required arguments :usergroup_id missing') if options[:usergroup_id].nil?
56
+ post('admin.usergroups.listChannels', options)
57
+ end
58
+
59
+ #
60
+ # Remove one or more default channels from an org-level IDP group (user group).
61
+ #
62
+ # @option options [Object] :channel_ids
63
+ # Comma-separated string of channel IDs.
64
+ # @option options [Object] :usergroup_id
65
+ # ID of the IDP Group.
66
+ # @see https://api.slack.com/methods/admin.usergroups.removeChannels
67
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.removeChannels.json
68
+ def admin_usergroups_removeChannels(options = {})
69
+ throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil?
70
+ throw ArgumentError.new('Required arguments :usergroup_id missing') if options[:usergroup_id].nil?
71
+ post('admin.usergroups.removeChannels', options)
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end