Class: Increase::Resources::OAuthTokens

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

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.

Parameters:



42
43
44
# File 'lib/increase/resources/oauth_tokens.rb', line 42

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

Some parameter documentations has been truncated, see Models::OAuthTokenCreateParams for more details.

Create an OAuth Token

Parameters:

  • grant_type (Symbol, Increase::Models::OAuthTokenCreateParams::GrantType)

    The credential you request in exchange for the code. In Production, this is alwa

  • client_id (String)

    The public identifier for your application.

  • client_secret (String)

    The secret that confirms you own the application. This is redundant given that t

  • code (String)

    The authorization code generated by the user and given to you as a query paramet

  • production_token (String)

    The production token you want to exchange for a sandbox token. This is only avai

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/increase/resources/oauth_tokens.rb', line 28

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