FortnoxEx.Models.Account (FortnoxEx v0.3.0) View Source

Link to this section Summary

Functions

Gets a list of partial account objects with pagination information.

Streams a partial account objects. Will go through each page of results with a delay between page. The stream will produce a single account data object for each hit.

Link to this section Functions

Link to this function

create_account(client, account_data)

View Source

Creates a account

Examples

iex> create_account(client, %{"Name" => "ACME") {:ok, %{"AccountNumber" => "1", "Name" => "ACME"}}

iex> create_account(client, account_attrs)

Link to this function

delete_account(client, account_number)

View Source

Deletes a account

Examples

iex> delete_account(client, "1") :ok

iex> delete_account(client, "missing")

Link to this function

get_account(client, account_number)

View Source

Gets a account

Examples

iex> get_account(client, "1")

iex> get_account(clientm "1")

Link to this function

list_accounts(client, query)

View Source

Gets a list of partial account objects with pagination information.

Examples

iex> list_accounts(client, []) {:ok, %{"@CurrentPage" => 1, "@TotalPages" => 1, "@TotalResources" => 1}, [%{"AccountNumber" => "1", "Name" => "ACME"}]}

iex> list_accounts(client, [])

Link to this function

stream_accounts(client, query)

View Source

Streams a partial account objects. Will go through each page of results with a delay between page. The stream will produce a single account data object for each hit.

Examples

iex> stream_accounts(client, []) stream_of_accounts

iex> stream_accounts(client, [])

Link to this function

update_account(client, account_number, account_data)

View Source

Updates a account

Examples

iex> update_account(client, "1", %{"Name" => "Johnny"})

iex> update_account(clientm "1", account_attrs)