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

Link to this section Summary

Functions

Gets a list of partial asset objects with pagination information.

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

Link to this section Functions

Link to this function

create_asset(client, asset_data)

View Source

Creates a asset

Examples

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

iex> create_asset(client, asset_attrs)

Link to this function

delete_asset(client, asset_number)

View Source

Deletes a asset

Examples

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

iex> delete_asset(client, "missing")

Link to this function

get_asset(client, asset_number)

View Source

Gets a asset

Examples

iex> get_asset(client, "1")

iex> get_asset(clientm "1")

Link to this function

list_assets(client, query)

View Source

Gets a list of partial asset objects with pagination information.

Examples

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

iex> list_assets(client, [])

Link to this function

stream_assets(client, query)

View Source

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

Examples

iex> stream_assets(client, []) stream_of_assets

iex> stream_assets(client, [])

Link to this function

update_asset(client, asset_number, asset_data)

View Source

Updates a asset

Examples

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

iex> update_asset(clientm "1", asset_attrs)