Class: Increase::Resources::OAuthTokens

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/oauth_tokens.rb,
sig/increase/resources/oauth_tokens.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ OAuthTokens

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OAuthTokens.



49
50
51
# File 'lib/increase/resources/oauth_tokens.rb', line 49

def initialize(client:)
  @client = client
end

Instance Method Details

#create(grant_type:, client_id: nil, client_secret: nil, code: nil, production_token: nil, request_options: {}) ⇒ Increase::Models::OAuthToken

Create an OAuth Token



35
36
37
38
39
40
41
42
43
44
# File 'lib/increase/resources/oauth_tokens.rb', line 35

def create(params)
  parsed, options = Increase::OAuthTokenCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "oauth/tokens",
    body: parsed,
    model: Increase::OAuthToken,
    options: options
  )
end