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

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Accounts

Returns a new instance of Accounts.

Parameters:



57
58
59
# File 'lib/finch-api/resources/sandbox/connections/accounts.rb', line 57

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params) ⇒ FinchAPI::Models::Sandbox::Connections::AccountCreateResponse

Create a new account for an existing connection (company/provider pair)

Parameters:

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

    .

    @option params [String] :company_id

    @option params [String] :provider_id The provider associated with the ‘access_token`

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

    @option params [Array<String>] :products Optional, defaults to Organization products (‘company`, `directory`,

    `employment`, `individual`)
    

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

Returns:



24
25
26
27
28
29
30
31
32
33
# File 'lib/finch-api/resources/sandbox/connections/accounts.rb', line 24

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

#update(params = {}) ⇒ FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse

Update an existing sandbox account. Change the connection status to understand

how the Finch API responds.

Parameters:

Returns:



45
46
47
48
49
50
51
52
53
54
# File 'lib/finch-api/resources/sandbox/connections/accounts.rb', line 45

def update(params = {})
  parsed, options = FinchAPI::Models::Sandbox::Connections::AccountUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: "sandbox/connections/accounts",
    body: parsed,
    model: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse,
    options: options
  )
end