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

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

Parameters:



64
65
66
# File 'lib/finch_api/resources/sandbox/connections/accounts.rb', line 64

def initialize(client:)
  @client = client
end

Instance Method Details

#create(company_id: , provider_id: , authentication_type: nil, products: nil, request_options: {}) ⇒ FinchAPI::Models::Sandbox::Connections::AccountCreateResponse

Some parameter documentations has been truncated, see Models::Sandbox::Connections::AccountCreateParams for more details.

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

Parameters:

  • company_id (String)
  • provider_id (String)

    The provider associated with the ‘access_token`

  • authentication_type (Symbol, FinchAPI::Sandbox::Connections::AccountCreateParams::AuthenticationType)
  • products (Array<String>)

    Optional, defaults to Organization products (‘company`, `directory`, `employment

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/finch_api/resources/sandbox/connections/accounts.rb', line 28

def create(params)
  parsed, options = FinchAPI::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(connection_status: nil, request_options: {}) ⇒ FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse

Update an existing sandbox account. Change the connection status to understand how the Finch API responds.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
# File 'lib/finch_api/resources/sandbox/connections/accounts.rb', line 50

def update(params = {})
  parsed, options = FinchAPI::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