Class: FinancialAccountClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/financial_account_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ FinancialAccountClient

Initialize the FinancialAccountClient class with an API client instance.

Parameters:

  • connection (LockstepApi)

    The API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

#create_financial_account(body:) ⇒ Object

Creates a financial account with the specified name.

Parameters:

  • body (FinancialAccountModel)

    Metadata about the financial account to create.



31
32
33
34
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 31

def (body:)
    path = "/api/v1/FinancialAccount"
    @connection.request(:post, path, body, nil)
end

#delete_financial_account(id:) ⇒ Object

Deletes the Financial Account referred to by this unique identifier.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Financial Account to disable; NOT the customer’s ERP key



59
60
61
62
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 59

def (id:)
    path = "/api/v1/FinancialAccount/#{id}"
    @connection.request(:delete, path, nil, nil)
end

#query_financial_accounts(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Parameters:



72
73
74
75
76
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 72

def query_financial_accounts(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/FinancialAccount/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

#retrieve_financial_account(id:) ⇒ Object

Retrieves the financial account specified by this unique identifier.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Account; NOT the customer’s ERP key



40
41
42
43
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 40

def (id:)
    path = "/api/v1/FinancialAccount/#{id}"
    @connection.request(:get, path, nil, nil)
end

#update_financial_account(id:, body:) ⇒ Object

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Account to update; NOT the customer’s ERP key

  • body (object)

    A list of changes to apply to this Account



50
51
52
53
# File 'lib/lockstep_sdk/clients/financial_account_client.rb', line 50

def (id:, body:)
    path = "/api/v1/FinancialAccount/#{id}"
    @connection.request(:patch, path, body.to_camelback_keys.to_json, nil)
end