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

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 Sessions.

Parameters:



82
83
84
# File 'lib/finch_api/resources/connect/sessions.rb', line 82

def initialize(client:)
  @client = client
end

Instance Method Details

#new(customer_id: , customer_name: , products: , customer_email: nil, integration: nil, manual: nil, minutes_to_expire: nil, redirect_uri: nil, sandbox: nil, request_options: {}) ⇒ FinchAPI::Models::Connect::SessionNewResponse

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

Create a new connect session for an employer

Parameters:

  • customer_id (String)
  • customer_name (String)
  • products (Array<Symbol, FinchAPI::Connect::SessionNewParams::Product>)
  • customer_email (String, nil)
  • integration (FinchAPI::Connect::SessionNewParams::Integration, nil)
  • manual (Boolean, nil)
  • minutes_to_expire (Float, nil)

    The number of minutes until the session expires (defaults to 43,200, which is 30

  • redirect_uri (String, nil)
  • sandbox (Symbol, FinchAPI::Connect::SessionNewParams::Sandbox, nil)
  • request_options (FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
# File 'lib/finch_api/resources/connect/sessions.rb', line 37

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

#reauthenticate(connection_id: , minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}) ⇒ FinchAPI::Models::Connect::SessionReauthenticateResponse

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

Create a new Connect session for reauthenticating an existing connection

Parameters:

  • connection_id (String)

    The ID of the existing connection to reauthenticate

  • minutes_to_expire (Integer, nil)

    The number of minutes until the session expires (defaults to 43,200, which is 30

  • products (Array<Symbol, FinchAPI::Connect::SessionReauthenticateParams::Product>, nil)

    The products to request access to (optional for reauthentication)

  • redirect_uri (String, nil)

    The URI to redirect to after the Connect flow is completed

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

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
# File 'lib/finch_api/resources/connect/sessions.rb', line 68

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