FortnoxEx.Models.Customer (FortnoxEx v0.1.0) View Source

Link to this section Summary

Functions

Gets a list of partial customer objects with pagination information.

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

Link to this section Functions

Link to this function

create_customer(client, customer_data)

View Source

Creates a customer

Examples

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

iex> create_customer(client, customer_attrs)

Link to this function

delete_customer(client, customer_number)

View Source

Deletes a customer

Examples

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

iex> delete_customer(client, "missing")

Link to this function

get_customer(client, customer_number)

View Source

Gets a customer

Examples

iex> get_customer(client, "1")

iex> get_customer(clientm "1")

Link to this function

list_customers(client, query)

View Source

Gets a list of partial customer objects with pagination information.

Examples

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

iex> list_customers(client, [])

Link to this function

stream_customers(client, query)

View Source

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

Examples

iex> stream_customers(client, []) stream_of_customers

iex> stream_customers(client, [])

Link to this function

update_customer(client, customer_number, customer_data)

View Source

Updates a customer

Examples

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

iex> update_customer(clientm "1", customer_attrs)