Class: SocialstatsSDK::Resources::OAuth
- Inherits:
-
Base
- Object
- Base
- SocialstatsSDK::Resources::OAuth
show all
- Defined in:
- lib/socialstats_sdk/resources/oauth.rb
Constant Summary
Constants inherited
from Base
Base::CREATOR_IDENTIFIER_KEYS
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#attempt_status(state_token) ⇒ Object
32
33
34
35
36
|
# File 'lib/socialstats_sdk/resources/oauth.rb', line 32
def attempt_status(state_token)
raise ArgumentError, "state_token is required" if state_token.to_s.empty?
request_get("oauth-attempts/#{escape(state_token)}")
end
|
#create(source_id:, **params) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/socialstats_sdk/resources/oauth.rb', line 8
def create(source_id:, **params)
raise ArgumentError, "source_id is required" if source_id.to_s.empty?
query = params.merge(source_id: source_id)
require_any_identifier!(query, CREATOR_IDENTIFIER_KEYS)
post("oauth", params: query)
end
|
#get(authorization_id) ⇒ Object
20
21
22
23
24
|
# File 'lib/socialstats_sdk/resources/oauth.rb', line 20
def get(authorization_id)
raise ArgumentError, "authorization_id is required" if authorization_id.to_s.empty?
request_get("oauth/#{escape(authorization_id)}")
end
|
#list(**params) ⇒ Object
16
17
18
|
# File 'lib/socialstats_sdk/resources/oauth.rb', line 16
def list(**params)
request_get("oauth", params: params)
end
|
#revoke(authorization_id) ⇒ Object
26
27
28
29
30
|
# File 'lib/socialstats_sdk/resources/oauth.rb', line 26
def revoke(authorization_id)
raise ArgumentError, "authorization_id is required" if authorization_id.to_s.empty?
delete("oauth/#{escape(authorization_id)}")
end
|