aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Blowers <sblowers@findmypast.com>2016-11-01 14:29:44 (GMT)
committerSteven Blowers <sblowers@findmypast.com>2016-11-01 14:29:44 (GMT)
commit01b8203e4d97d08a6462c29bac8fccd11ee8fb97 (patch)
tree66cda6a725f82aa5aced16cf27c193dc28f97864
parentbf62e2d177726a5921b485988c89764dd34eae3f (diff)
downloadzendex-01b8203e4d97d08a6462c29bac8fccd11ee8fb97.tar.gz
zendex-01b8203e4d97d08a6462c29bac8fccd11ee8fb97.tar.xz
adding doctest for user related info
-rw-r--r--lib/zendex/user.ex20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/zendex/user.ex b/lib/zendex/user.ex
index 3983432..9112b7f 100644
--- a/lib/zendex/user.ex
+++ b/lib/zendex/user.ex
@@ -81,6 +81,26 @@ defmodule Zendex.User do
|> CommonHelpers.decode_response
end
+ @doc """
+ Show information relating to the user, example: number of assigned tickets.
+
+ ## Examples
+
+ iex> conn = Zendex.Connection.setup("http://test.zendesk.com", "ZendeskUser", "Password1")
+ %{authentication: "WmVuZGVza1VzZXI6UGFzc3dvcmQx", base_url: "http://test.zendesk.com"}
+ iex> Zendex.User.related_information(conn, 649267)
+ %{"user_related" => %{"assigned_tickets" => 12,
+ "ccd_tickets" => 5,
+ "entry_subscriptions" => 1,
+ "forum_subscriptions" => 3,
+ "organization_subscriptions" => 1,
+ "requested_tickets" => 7,
+ "subscriptions" => 6,
+ "topic_comments" => 116,
+ "topics" => 5,
+ "votes" => 2001}}
+
+ """
@spec related_information(Zendex.Connection.t, integer) :: map
def related_information(connection, id) do
"#{connection.base_url}#{@url}/#{id}/related.json"