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

Link to this section Summary

Functions

Gets a list of partial employee objects with pagination information.

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

Link to this section Functions

Link to this function

create_employee(client, employee_data)

View Source

Creates a employee

Examples

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

iex> create_employee(client, employee_attrs)

Link to this function

delete_employee(client, employee_number)

View Source

Deletes a employee

Examples

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

iex> delete_employee(client, "missing")

Link to this function

get_employee(client, employee_number)

View Source

Gets a employee

Examples

iex> get_employee(client, "1")

iex> get_employee(clientm "1")

Link to this function

list_employees(client, query)

View Source

Gets a list of partial employee objects with pagination information.

Examples

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

iex> list_employees(client, [])

Link to this function

stream_employees(client, query)

View Source

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

Examples

iex> stream_employees(client, []) stream_of_employees

iex> stream_employees(client, [])

Link to this function

update_employee(client, employee_number, employee_data)

View Source

Updates a employee

Examples

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

iex> update_employee(clientm "1", employee_attrs)