Class: FinchAPI::Resources::Sandbox::Connections

Inherits:
Object
  • Object
show all
Defined in:
lib/finch-api/resources/sandbox/connections.rb,
lib/finch-api/resources/sandbox/connections/accounts.rb

Defined Under Namespace

Classes: Accounts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Connections

Returns a new instance of Connections.

Parameters:



39
40
41
42
# File 'lib/finch-api/resources/sandbox/connections.rb', line 39

def initialize(client:)
  @client = client
  @accounts = FinchAPI::Resources::Sandbox::Connections::Accounts.new(client: client)
end

Instance Attribute Details

#accountsFinchAPI::Resources::Sandbox::Connections::Accounts (readonly)



8
9
10
# File 'lib/finch-api/resources/sandbox/connections.rb', line 8

def accounts
  @accounts
end

Instance Method Details

#create(params) ⇒ FinchAPI::Models::Sandbox::ConnectionCreateResponse

Create a new connection (new company/provider pair) with a new account

Parameters:

  • params (FinchAPI::Models::Sandbox::ConnectionCreateParams, Hash{Symbol=>Object})

    .

    @option params [String] :provider_id The provider associated with the connection

    @option params [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] :authentication_type

    @option params [Integer] :employee_size Optional: the size of the employer to be created with this connection. Defaults

    to 20. Note that if this is higher than 100, historical payroll data will not be
    generated, and instead only one pay period will be created.
    

    @option params [Array<String>] :products

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

Returns:



27
28
29
30
31
32
33
34
35
36
# File 'lib/finch-api/resources/sandbox/connections.rb', line 27

def create(params)
  parsed, options = FinchAPI::Models::Sandbox::ConnectionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sandbox/connections",
    body: parsed,
    model: FinchAPI::Models::Sandbox::ConnectionCreateResponse,
    options: options
  )
end