FortnoxEx.Models.Asset (FortnoxEx v0.3.0) View Source
Link to this section Summary
Functions
Creates a asset
Deletes a asset
Gets a asset
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.
Updates a asset
Link to this section Functions
Creates a asset
Examples
iex> create_asset(client, %{"Name" => "ACME") {:ok, %{"AssetNumber" => "1", "Name" => "ACME"}}
iex> create_asset(client, asset_attrs)
Deletes a asset
Examples
iex> delete_asset(client, "1") :ok
iex> delete_asset(client, "missing")
Gets a asset
Examples
iex> get_asset(client, "1")
iex> get_asset(clientm "1")
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, [])
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, [])
Updates a asset
Examples
iex> update_asset(client, "1", %{"Name" => "Johnny"})
iex> update_asset(clientm "1", asset_attrs)