Class: AmazonAds::LWA
- Inherits:
-
Object
- Object
- AmazonAds::LWA
- Defined in:
- lib/amazon_ads/lwa.rb
Overview
Requests Login with Amazon (LWA) access tokens for the Amazon Ads API Stateless: each call to #request hits the token endpoint; the caller owns caching
Constant Summary collapse
- URL =
"https://api.amazon.com/auth/o2/token"
Instance Attribute Summary collapse
-
#refresh_token ⇒ Object
readonly
The OAuth refresh token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(refresh_token:, http: HTTP) ⇒ LWA
constructor
A new instance of LWA.
-
#request ⇒ Object
Requests a fresh access token from LWA.
Constructor Details
#initialize(refresh_token:, http: HTTP) ⇒ LWA
Returns a new instance of LWA.
21 22 23 24 |
# File 'lib/amazon_ads/lwa.rb', line 21 def initialize(refresh_token:, http: HTTP) @refresh_token = refresh_token @http = http end |
Instance Attribute Details
#refresh_token ⇒ Object (readonly)
The OAuth refresh token
13 14 15 |
# File 'lib/amazon_ads/lwa.rb', line 13 def refresh_token @refresh_token end |
Class Method Details
.request ⇒ Object
16 17 18 |
# File 'lib/amazon_ads/lwa.rb', line 16 def self.request(...) new(...).request end |