Class: FinchAPI::Resources::Connect::Sessions

Inherits:
Object
  • Object
show all
Defined in:
lib/finch-api/resources/connect/sessions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sessions

Returns a new instance of Sessions.

Parameters:



72
73
74
# File 'lib/finch-api/resources/connect/sessions.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#new(params) ⇒ FinchAPI::Models::Connect::SessionNewResponse

Create a new connect session for an employer

Parameters:

  • params (FinchAPI::Models::Connect::SessionNewParams, Hash{Symbol=>Object})

    .

    @option params [String] :customer_id

    @option params [String] :customer_name

    @option params [Array<Symbol, FinchAPI::Models::Connect::SessionNewParams::Product>] :products

    @option params [String, nil] :customer_email

    @option params [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] :integration

    @option params [Boolean, nil] :manual

    @option params [Float, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30

    days)
    

    @option params [String, nil] :redirect_uri

    @option params [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] :sandbox

    @option params [FinchAPI::RequestOptions, HashSymbol=>Object, nil] :request_options

Returns:



33
34
35
36
37
38
39
40
41
42
# File 'lib/finch-api/resources/connect/sessions.rb', line 33

def new(params)
  parsed, options = FinchAPI::Models::Connect::SessionNewParams.dump_request(params)
  @client.request(
    method: :post,
    path: "connect/sessions",
    body: parsed,
    model: FinchAPI::Models::Connect::SessionNewResponse,
    options: options
  )
end

#reauthenticate(params) ⇒ FinchAPI::Models::Connect::SessionReauthenticateResponse

Create a new Connect session for reauthenticating an existing connection

Parameters:

  • params (FinchAPI::Models::Connect::SessionReauthenticateParams, Hash{Symbol=>Object})

    .

    @option params [String] :connection_id The ID of the existing connection to reauthenticate

    @option params [Integer, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30

    days)
    

    @option params [Array<Symbol, FinchAPI::Models::Connect::SessionReauthenticateParams::Product>, nil] :products The products to request access to (optional for reauthentication)

    @option params [String, nil] :redirect_uri The URI to redirect to after the Connect flow is completed

    @option params [FinchAPI::RequestOptions, HashSymbol=>Object, nil] :request_options

Returns:



60
61
62
63
64
65
66
67
68
69
# File 'lib/finch-api/resources/connect/sessions.rb', line 60

def reauthenticate(params)
  parsed, options = FinchAPI::Models::Connect::SessionReauthenticateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "connect/sessions/reauthenticate",
    body: parsed,
    model: FinchAPI::Models::Connect::SessionReauthenticateResponse,
    options: options
  )
end