Class: FinchAPI::Resources::AccessTokens
- Inherits:
-
Object
- Object
- FinchAPI::Resources::AccessTokens
- Defined in:
- lib/finch-api/resources/access_tokens.rb
Instance Method Summary collapse
-
#create(params) ⇒ FinchAPI::Models::CreateAccessTokenResponse
Exchange the authorization code for an access token.
-
#initialize(client:) ⇒ AccessTokens
constructor
A new instance of AccessTokens.
Constructor Details
#initialize(client:) ⇒ AccessTokens
Returns a new instance of AccessTokens.
33 34 35 |
# File 'lib/finch-api/resources/access_tokens.rb', line 33 def initialize(client:) @client = client end |
Instance Method Details
#create(params) ⇒ FinchAPI::Models::CreateAccessTokenResponse
Exchange the authorization code for an access token
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/finch-api/resources/access_tokens.rb', line 21 def create(params) parsed, = FinchAPI::Models::AccessTokenCreateParams.dump_request(params) @client.request( method: :post, path: "auth/token", body: parsed, model: FinchAPI::Models::CreateAccessTokenResponse, options: ) end |