FortnoxEx.Models.Unit (FortnoxEx v0.3.0) View Source
Link to this section Summary
Functions
Creates a unit
Deletes a unit
Gets a unit
Gets a list of partial unit objects with pagination information.
Streams a partial unit objects. Will go through each page of results with a delay between page. The stream will produce a single unit data object for each hit.
Updates a unit
Link to this section Functions
Creates a unit
Examples
iex> create_unit(client, %{"Name" => "ACME") {:ok, %{"UnitNumber" => "1", "Name" => "ACME"}}
iex> create_unit(client, unit_attrs)
Deletes a unit
Examples
iex> delete_unit(client, "1") :ok
iex> delete_unit(client, "missing")
Gets a unit
Examples
iex> get_unit(client, "1")
iex> get_unit(clientm "1")
Gets a list of partial unit objects with pagination information.
Examples
iex> list_units(client, []) {:ok, %{"@CurrentPage" => 1, "@TotalPages" => 1, "@TotalResources" => 1}, [%{"UnitNumber" => "1", "Name" => "ACME"}]}
iex> list_units(client, [])
Streams a partial unit objects. Will go through each page of results with a delay between page. The stream will produce a single unit data object for each hit.
Examples
iex> stream_units(client, []) stream_of_units
iex> stream_units(client, [])
Updates a unit
Examples
iex> update_unit(client, "1", %{"Name" => "Johnny"})
iex> update_unit(clientm "1", unit_attrs)