slack-ruby-client 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +0 -14
- data/.travis.yml +1 -4
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +3 -10
- data/README.md +9 -27
- data/UPGRADING.md +14 -2
- data/bin/commands.rb +7 -0
- data/bin/commands/admin_analytics.rb +15 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +154 -2
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +4 -4
- data/bin/commands/admin_conversations_whitelist.rb +1 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_usergroups.rb +2 -2
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_users_session.rb +22 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/channels.rb +6 -3
- data/bin/commands/chat.rb +4 -4
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +14 -2
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/files.rb +6 -5
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +5 -3
- data/bin/commands/im.rb +1 -1
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +3 -3
- data/bin/commands/pins.rb +0 -2
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/search.rb +4 -1
- data/bin/commands/team.rb +3 -0
- data/bin/commands/usergroups.rb +6 -1
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +5 -3
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +1 -1
- data/bin/commands/workflows.rb +38 -0
- data/lib/slack-ruby-client.rb +2 -0
- data/lib/slack/events/request.rb +5 -1
- data/lib/slack/real_time/client.rb +0 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -4
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +14 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +231 -1
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +4 -6
- data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -0
- data/lib/slack/web/api/endpoints/channels.rb +9 -3
- data/lib/slack/web/api/endpoints/chat.rb +3 -3
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -0
- data/lib/slack/web/api/endpoints/conversations.rb +21 -1
- data/lib/slack/web/api/endpoints/files.rb +4 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +2 -2
- data/lib/slack/web/api/endpoints/groups.rb +7 -3
- data/lib/slack/web/api/endpoints/im.rb +1 -1
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +3 -3
- data/lib/slack/web/api/endpoints/pins.rb +0 -5
- data/lib/slack/web/api/endpoints/reactions.rb +2 -0
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/team.rb +6 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints/users.rb +7 -5
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
- data/lib/slack/web/api/endpoints/views.rb +1 -1
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/errors.rb +194 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +16 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
- data/lib/tasks/web.rake +7 -3
- data/spec/slack/events/request_spec.rb +7 -3
- data/spec/slack/real_time/client_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -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/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/im_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/mpim_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/client_spec.rb +56 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +7 -6
- metadata +32 -19
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Slack
|
3
|
+
module Web
|
4
|
+
module Api
|
5
|
+
module Errors
|
6
|
+
class ServerError < InternalError; end
|
7
|
+
class ParsingError < ServerError; end
|
8
|
+
class HttpRequestError < ServerError; end
|
9
|
+
class TimeoutError < HttpRequestError; end
|
10
|
+
class UnavailableError < HttpRequestError; end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -12,7 +12,7 @@ RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %>
|
|
12
12
|
context '<%= group %>_<%= name %>' do
|
13
13
|
<% required_params.each do |arg_name, arg_v| %>
|
14
14
|
it 'requires <%= arg_name %>' do
|
15
|
-
<% params_except_required = required_params.reject{ |name, _| name == arg_name }.map{|var, opts| "#{var}:
|
15
|
+
<% params_except_required = required_params.reject{ |name, _| name == arg_name }.map{ |var, opts| "#{var}: %q[#{opts['example']}]"}.join(', ') %>
|
16
16
|
expect { client.<%= group.gsub(".", "_") %>_<%= name %><%= params_except_required.empty? ? '' : "(#{params_except_required})" %> }.to raise_error ArgumentError, /Required arguments :<%= arg_name %> missing/
|
17
17
|
end
|
18
18
|
<% end %>
|
@@ -24,7 +24,7 @@ module Slack
|
|
24
24
|
::Faraday::Connection.new(endpoint, options) do |connection|
|
25
25
|
connection.use ::Faraday::Request::Multipart
|
26
26
|
connection.use ::Faraday::Request::UrlEncoded
|
27
|
-
connection.use ::Faraday::Response::
|
27
|
+
connection.use ::Slack::Web::Faraday::Response::WrapError
|
28
28
|
connection.use ::Slack::Web::Faraday::Response::RaiseError
|
29
29
|
connection.use ::FaradayMiddleware::Mashify, mash_class: Slack::Messages::Message
|
30
30
|
connection.use ::FaradayMiddleware::ParseJson
|
@@ -6,7 +6,12 @@ module Slack
|
|
6
6
|
class RaiseError < ::Faraday::Response::Middleware
|
7
7
|
def on_complete(env)
|
8
8
|
raise Slack::Web::Api::Errors::TooManyRequestsError, env.response if env.status == 429
|
9
|
-
|
9
|
+
|
10
|
+
return unless env.success?
|
11
|
+
|
12
|
+
body = env.body
|
13
|
+
return unless body
|
14
|
+
return if body['ok']
|
10
15
|
|
11
16
|
error_message =
|
12
17
|
body['error'] || body['errors'].map { |message| message['error'] }.join(',')
|
@@ -15,6 +20,16 @@ module Slack
|
|
15
20
|
error_class ||= Slack::Web::Api::Errors::SlackError
|
16
21
|
raise error_class.new(error_message, env.response)
|
17
22
|
end
|
23
|
+
|
24
|
+
def call(env)
|
25
|
+
super
|
26
|
+
rescue Slack::Web::Api::Errors::SlackError, Slack::Web::Api::Errors::TooManyRequestsError
|
27
|
+
raise
|
28
|
+
rescue ::Faraday::ParsingError
|
29
|
+
raise Slack::Web::Api::Errors::ParsingError.new('parsing_error', env.response)
|
30
|
+
rescue ::Faraday::TimeoutError, ::Faraday::ConnectionFailed
|
31
|
+
raise Slack::Web::Api::Errors::TimeoutError.new('timeout_error', env.response)
|
32
|
+
end
|
18
33
|
end
|
19
34
|
end
|
20
35
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Slack
|
3
|
+
module Web
|
4
|
+
module Faraday
|
5
|
+
module Response
|
6
|
+
class WrapError < ::Faraday::Response::RaiseError
|
7
|
+
def on_complete(env)
|
8
|
+
super
|
9
|
+
rescue Slack::Web::Api::Errors::SlackError
|
10
|
+
raise
|
11
|
+
rescue ::Faraday::ServerError
|
12
|
+
raise Slack::Web::Api::Errors::UnavailableError.new('unavailable_error', env.response)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/tasks/web.rake
CHANGED
@@ -51,10 +51,14 @@ namespace :slack do
|
|
51
51
|
rendered_method_spec = method_spec_template.result(group: group, names: names)
|
52
52
|
File.write "spec/slack/web/api/endpoints/#{snaked_group}_spec.rb", rendered_method_spec
|
53
53
|
end
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
|
55
|
+
unless ENV.key?('SKIP_PATCH')
|
56
|
+
Dir.glob("lib/slack/web/api/patches/#{group}*.patch").sort.each do |patch|
|
57
|
+
puts "- patching #{patch}"
|
58
|
+
system("git apply #{patch}") || raise('failed to apply patch')
|
59
|
+
end
|
57
60
|
end
|
61
|
+
|
58
62
|
# command
|
59
63
|
raise "Missing group #{group}" unless groups.key?(group)
|
60
64
|
|
@@ -26,9 +26,7 @@ RSpec.describe Slack::Events::Request do
|
|
26
26
|
'X-Slack-Request-Timestamp' => timestamp,
|
27
27
|
'X-Slack-Signature' => signature
|
28
28
|
},
|
29
|
-
body:
|
30
|
-
read: body
|
31
|
-
)
|
29
|
+
body: StringIO.new(body)
|
32
30
|
)
|
33
31
|
end
|
34
32
|
|
@@ -42,6 +40,12 @@ RSpec.describe Slack::Events::Request do
|
|
42
40
|
expect(request.timestamp).to eq timestamp
|
43
41
|
expect(request.version).to eq 'v0'
|
44
42
|
end
|
43
|
+
|
44
|
+
it 'rewinds the request body after reading it' do
|
45
|
+
expect(request.body).to eq body
|
46
|
+
expect(http_request.body.read).to eq body
|
47
|
+
end
|
48
|
+
|
45
49
|
context 'time' do
|
46
50
|
after do
|
47
51
|
Timecop.return
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
RSpec.describe Slack::RealTime::Client do
|
4
|
+
RSpec.describe Slack::RealTime::Client do
|
5
5
|
let(:ws) { double(Slack::RealTime::Concurrency::Mock::WebSocket, on: true) }
|
6
6
|
|
7
7
|
before do
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
require 'spec_helper'
|
5
|
+
|
6
|
+
RSpec.describe Slack::Web::Api::Endpoints::AdminAnalytics do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.analytics_getFile' do
|
9
|
+
it 'requires type' do
|
10
|
+
expect { client.admin_analytics_getFile }.to raise_error ArgumentError, /Required arguments :type missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -5,4 +5,9 @@ require 'spec_helper'
|
|
5
5
|
|
6
6
|
RSpec.describe Slack::Web::Api::Endpoints::AdminApps do
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.apps_clearResolution' do
|
9
|
+
it 'requires app_id' do
|
10
|
+
expect { client.admin_apps_clearResolution }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
11
|
+
end
|
12
|
+
end
|
8
13
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
require 'spec_helper'
|
5
|
+
|
6
|
+
RSpec.describe Slack::Web::Api::Endpoints::AdminBarriers do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.barriers_create' do
|
9
|
+
it 'requires barriered_from_usergroup_ids' do
|
10
|
+
expect { client.admin_barriers_create(primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/
|
11
|
+
end
|
12
|
+
it 'requires primary_usergroup_id' do
|
13
|
+
expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/
|
14
|
+
end
|
15
|
+
it 'requires restricted_subjects' do
|
16
|
+
expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/
|
17
|
+
end
|
18
|
+
end
|
19
|
+
context 'admin.barriers_delete' do
|
20
|
+
it 'requires barrier_id' do
|
21
|
+
expect { client.admin_barriers_delete }.to raise_error ArgumentError, /Required arguments :barrier_id missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'admin.barriers_update' do
|
25
|
+
it 'requires barrier_id' do
|
26
|
+
expect { client.admin_barriers_update(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barrier_id missing/
|
27
|
+
end
|
28
|
+
it 'requires barriered_from_usergroup_ids' do
|
29
|
+
expect { client.admin_barriers_update(barrier_id: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/
|
30
|
+
end
|
31
|
+
it 'requires primary_usergroup_id' do
|
32
|
+
expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/
|
33
|
+
end
|
34
|
+
it 'requires restricted_subjects' do
|
35
|
+
expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -7,10 +7,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsRestrictaccess do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.conversations.restrictAccess_addGroup' do
|
9
9
|
it 'requires channel_id' do
|
10
|
-
expect { client.admin_conversations_restrictAccess_addGroup(group_id:
|
10
|
+
expect { client.admin_conversations_restrictAccess_addGroup(group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
11
|
end
|
12
12
|
it 'requires group_id' do
|
13
|
-
expect { client.admin_conversations_restrictAccess_addGroup(channel_id:
|
13
|
+
expect { client.admin_conversations_restrictAccess_addGroup(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.conversations.restrictAccess_listGroups' do
|
@@ -20,13 +20,13 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsRestrictaccess do
|
|
20
20
|
end
|
21
21
|
context 'admin.conversations.restrictAccess_removeGroup' do
|
22
22
|
it 'requires channel_id' do
|
23
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(group_id:
|
23
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(group_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
24
24
|
end
|
25
25
|
it 'requires group_id' do
|
26
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id:
|
26
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
27
27
|
end
|
28
28
|
it 'requires team_id' do
|
29
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id:
|
29
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -5,9 +5,94 @@ require 'spec_helper'
|
|
5
5
|
|
6
6
|
RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.conversations_archive' do
|
9
|
+
it 'requires channel_id' do
|
10
|
+
expect { client.admin_conversations_archive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
context 'admin.conversations_convertToPrivate' do
|
14
|
+
it 'requires channel_id' do
|
15
|
+
expect { client.admin_conversations_convertToPrivate }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
16
|
+
end
|
17
|
+
end
|
18
|
+
context 'admin.conversations_create' do
|
19
|
+
it 'requires is_private' do
|
20
|
+
expect { client.admin_conversations_create(name: %q[mychannel]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
|
21
|
+
end
|
22
|
+
it 'requires name' do
|
23
|
+
expect { client.admin_conversations_create(is_private: %q[true]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
context 'admin.conversations_delete' do
|
27
|
+
it 'requires channel_id' do
|
28
|
+
expect { client.admin_conversations_delete }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context 'admin.conversations_disconnectShared' do
|
32
|
+
it 'requires channel_id' do
|
33
|
+
expect { client.admin_conversations_disconnectShared }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
34
|
+
end
|
35
|
+
end
|
36
|
+
context 'admin.conversations_getConversationPrefs' do
|
37
|
+
it 'requires channel_id' do
|
38
|
+
expect { client.admin_conversations_getConversationPrefs }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
context 'admin.conversations_getCustomRetention' do
|
42
|
+
it 'requires channel_id' do
|
43
|
+
expect { client.admin_conversations_getCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
context 'admin.conversations_getTeams' do
|
47
|
+
it 'requires channel_id' do
|
48
|
+
expect { client.admin_conversations_getTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
49
|
+
end
|
50
|
+
end
|
51
|
+
context 'admin.conversations_invite' do
|
52
|
+
it 'requires channel_id' do
|
53
|
+
expect { client.admin_conversations_invite(user_ids: %q[U1234,U2345,U3456]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
54
|
+
end
|
55
|
+
it 'requires user_ids' do
|
56
|
+
expect { client.admin_conversations_invite(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
context 'admin.conversations_removeCustomRetention' do
|
60
|
+
it 'requires channel_id' do
|
61
|
+
expect { client.admin_conversations_removeCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
62
|
+
end
|
63
|
+
end
|
64
|
+
context 'admin.conversations_rename' do
|
65
|
+
it 'requires channel_id' do
|
66
|
+
expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
67
|
+
end
|
68
|
+
it 'requires name' do
|
69
|
+
expect { client.admin_conversations_rename(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
70
|
+
end
|
71
|
+
end
|
72
|
+
context 'admin.conversations_setConversationPrefs' do
|
73
|
+
it 'requires channel_id' do
|
74
|
+
expect { client.admin_conversations_setConversationPrefs(prefs: %q[{'who_can_post':'type:admin,user:U1234,subteam:S1234'}]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
75
|
+
end
|
76
|
+
it 'requires prefs' do
|
77
|
+
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[C1234]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
78
|
+
end
|
79
|
+
end
|
80
|
+
context 'admin.conversations_setCustomRetention' do
|
81
|
+
it 'requires channel_id' do
|
82
|
+
expect { client.admin_conversations_setCustomRetention(duration_days: %q[500]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
83
|
+
end
|
84
|
+
it 'requires duration_days' do
|
85
|
+
expect { client.admin_conversations_setCustomRetention(channel_id: %q[C12345678]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
86
|
+
end
|
87
|
+
end
|
8
88
|
context 'admin.conversations_setTeams' do
|
9
89
|
it 'requires channel_id' do
|
10
90
|
expect { client.admin_conversations_setTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
91
|
end
|
12
92
|
end
|
93
|
+
context 'admin.conversations_unarchive' do
|
94
|
+
it 'requires channel_id' do
|
95
|
+
expect { client.admin_conversations_unarchive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
96
|
+
end
|
97
|
+
end
|
13
98
|
end
|
@@ -7,10 +7,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsWhitelist do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.conversations.whitelist_add' do
|
9
9
|
it 'requires channel_id' do
|
10
|
-
expect { client.admin_conversations_whitelist_add(group_id:
|
10
|
+
expect { client.admin_conversations_whitelist_add(group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
11
|
end
|
12
12
|
it 'requires group_id' do
|
13
|
-
expect { client.admin_conversations_whitelist_add(channel_id:
|
13
|
+
expect { client.admin_conversations_whitelist_add(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.conversations.whitelist_listGroupsLinkedToChannel' do
|
@@ -20,13 +20,13 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsWhitelist do
|
|
20
20
|
end
|
21
21
|
context 'admin.conversations.whitelist_remove' do
|
22
22
|
it 'requires channel_id' do
|
23
|
-
expect { client.admin_conversations_whitelist_remove(group_id:
|
23
|
+
expect { client.admin_conversations_whitelist_remove(group_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
24
24
|
end
|
25
25
|
it 'requires group_id' do
|
26
|
-
expect { client.admin_conversations_whitelist_remove(channel_id:
|
26
|
+
expect { client.admin_conversations_whitelist_remove(channel_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
27
27
|
end
|
28
28
|
it 'requires team_id' do
|
29
|
-
expect { client.admin_conversations_whitelist_remove(channel_id:
|
29
|
+
expect { client.admin_conversations_whitelist_remove(channel_id: %q[], group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -7,18 +7,18 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminEmoji do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.emoji_add' do
|
9
9
|
it 'requires name' do
|
10
|
-
expect { client.admin_emoji_add(url:
|
10
|
+
expect { client.admin_emoji_add(url: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
11
11
|
end
|
12
12
|
it 'requires url' do
|
13
|
-
expect { client.admin_emoji_add(name:
|
13
|
+
expect { client.admin_emoji_add(name: %q[]) }.to raise_error ArgumentError, /Required arguments :url missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.emoji_addAlias' do
|
17
17
|
it 'requires alias_for' do
|
18
|
-
expect { client.admin_emoji_addAlias(name:
|
18
|
+
expect { client.admin_emoji_addAlias(name: %q[]) }.to raise_error ArgumentError, /Required arguments :alias_for missing/
|
19
19
|
end
|
20
20
|
it 'requires name' do
|
21
|
-
expect { client.admin_emoji_addAlias(alias_for:
|
21
|
+
expect { client.admin_emoji_addAlias(alias_for: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
22
22
|
end
|
23
23
|
end
|
24
24
|
context 'admin.emoji_remove' do
|
@@ -28,10 +28,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminEmoji do
|
|
28
28
|
end
|
29
29
|
context 'admin.emoji_rename' do
|
30
30
|
it 'requires name' do
|
31
|
-
expect { client.admin_emoji_rename(new_name:
|
31
|
+
expect { client.admin_emoji_rename(new_name: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
32
32
|
end
|
33
33
|
it 'requires new_name' do
|
34
|
-
expect { client.admin_emoji_rename(name:
|
34
|
+
expect { client.admin_emoji_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :new_name missing/
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -12,42 +12,42 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminTeamsSettings do
|
|
12
12
|
end
|
13
13
|
context 'admin.teams.settings_setDefaultChannels' do
|
14
14
|
it 'requires channel_ids' do
|
15
|
-
expect { client.admin_teams_settings_setDefaultChannels(team_id:
|
15
|
+
expect { client.admin_teams_settings_setDefaultChannels(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
16
16
|
end
|
17
17
|
it 'requires team_id' do
|
18
|
-
expect { client.admin_teams_settings_setDefaultChannels(channel_ids:
|
18
|
+
expect { client.admin_teams_settings_setDefaultChannels(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
19
19
|
end
|
20
20
|
end
|
21
21
|
context 'admin.teams.settings_setDescription' do
|
22
22
|
it 'requires description' do
|
23
|
-
expect { client.admin_teams_settings_setDescription(team_id:
|
23
|
+
expect { client.admin_teams_settings_setDescription(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :description missing/
|
24
24
|
end
|
25
25
|
it 'requires team_id' do
|
26
|
-
expect { client.admin_teams_settings_setDescription(description:
|
26
|
+
expect { client.admin_teams_settings_setDescription(description: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
27
27
|
end
|
28
28
|
end
|
29
29
|
context 'admin.teams.settings_setDiscoverability' do
|
30
30
|
it 'requires discoverability' do
|
31
|
-
expect { client.admin_teams_settings_setDiscoverability(team_id:
|
31
|
+
expect { client.admin_teams_settings_setDiscoverability(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :discoverability missing/
|
32
32
|
end
|
33
33
|
it 'requires team_id' do
|
34
|
-
expect { client.admin_teams_settings_setDiscoverability(discoverability:
|
34
|
+
expect { client.admin_teams_settings_setDiscoverability(discoverability: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
35
35
|
end
|
36
36
|
end
|
37
37
|
context 'admin.teams.settings_setIcon' do
|
38
38
|
it 'requires image_url' do
|
39
|
-
expect { client.admin_teams_settings_setIcon(team_id:
|
39
|
+
expect { client.admin_teams_settings_setIcon(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :image_url missing/
|
40
40
|
end
|
41
41
|
it 'requires team_id' do
|
42
|
-
expect { client.admin_teams_settings_setIcon(image_url:
|
42
|
+
expect { client.admin_teams_settings_setIcon(image_url: %q[http://mysite.com/icon.jpeg]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
43
43
|
end
|
44
44
|
end
|
45
45
|
context 'admin.teams.settings_setName' do
|
46
46
|
it 'requires name' do
|
47
|
-
expect { client.admin_teams_settings_setName(team_id:
|
47
|
+
expect { client.admin_teams_settings_setName(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
48
48
|
end
|
49
49
|
it 'requires team_id' do
|
50
|
-
expect { client.admin_teams_settings_setName(name:
|
50
|
+
expect { client.admin_teams_settings_setName(name: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|