-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
165 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
# This file was auto-generated by lib/tasks/web.rake | ||
|
||
desc 'OauthV2 methods.' | ||
command 'oauth_v2' do |g| | ||
g.desc 'Exchanges a temporary OAuth verifier code for an access token.' | ||
g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. ) | ||
g.command 'access' do |c| | ||
c.flag 'code', desc: 'The code param returned via the OAuth callback.' | ||
c.flag 'client_id', desc: 'Issued when you created your application.' | ||
c.flag 'client_secret', desc: 'Issued when you created your application.' | ||
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).' | ||
c.action do |_global_options, options, _args| | ||
puts JSON.dump($client.oauth_v2_access(options)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
# This file was auto-generated by lib/tasks/web.rake | ||
|
||
module Slack | ||
module Web | ||
module Api | ||
module Endpoints | ||
module OauthV2 | ||
# | ||
# Exchanges a temporary OAuth verifier code for an access token. | ||
# | ||
# @option options [Object] :code | ||
# The code param returned via the OAuth callback. | ||
# @option options [Object] :client_id | ||
# Issued when you created your application. | ||
# @option options [Object] :client_secret | ||
# Issued when you created your application. | ||
# @option options [Object] :redirect_uri | ||
# This must match the originally submitted URI (if one was sent). | ||
# @see https://api.slack.com/methods/oauth.v2.access | ||
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.access.json | ||
def oauth_v2_access(options = {}) | ||
throw ArgumentError.new('Required arguments :code missing') if options[:code].nil? | ||
post('oauth.v2.access', options) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb | ||
index 31626b9..8182a9c 100644 | ||
--- a/lib/slack/web/api/endpoints/views.rb | ||
+++ b/lib/slack/web/api/endpoints/views.rb | ||
@@ -40,6 +40,11 @@ module Slack | ||
def views_publish(options = {}) | ||
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? | ||
throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? | ||
+ if options.key?(:view) | ||
+ view = options[:view] | ||
+ view = JSON.dump(view) unless view.is_a?(String) | ||
+ options = options.merge(view: view) | ||
+ end | ||
post('views.publish', options) | ||
end | ||
|
Submodule slack-api-ref
updated
13 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
# This file was auto-generated by lib/tasks/web.rake | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe Slack::Web::Api::Endpoints::OauthV2 do | ||
let(:client) { Slack::Web::Client.new } | ||
context 'oauth.v2_access' do | ||
it 'requires code' do | ||
expect { client.oauth_v2_access }.to raise_error ArgumentError, /Required arguments :code missing/ | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters