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

Link to this section Summary

Functions

Gets a list of partial article objects with pagination information.

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

Link to this section Functions

Link to this function

create_article(client, article_data)

View Source

Creates a article

Examples

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

iex> create_article(client, article_attrs)

Link to this function

delete_article(client, article_number)

View Source

Deletes a article

Examples

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

iex> delete_article(client, "missing")

Link to this function

get_article(client, article_number)

View Source

Gets a article

Examples

iex> get_article(client, "1")

iex> get_article(clientm "1")

Link to this function

list_articles(client, query)

View Source

Gets a list of partial article objects with pagination information.

Examples

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

iex> list_articles(client, [])

Link to this function

stream_articles(client, query)

View Source

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

Examples

iex> stream_articles(client, []) stream_of_articles

iex> stream_articles(client, [])

Link to this function

update_article(client, article_number, article_data)

View Source

Updates a article

Examples

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

iex> update_article(clientm "1", article_attrs)