aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteven Blowers <sblowers@findmypast.com>2016-11-01 13:19:48 +0000
committerSteven Blowers <sblowers@findmypast.com>2016-11-01 13:19:48 +0000
commit96cf6093809b049dd55efd6c10593b95ec2e5d03 (patch)
tree3df2eba089385ac94aa49c61b83bf0b1697cdb2b /lib
parent5c6913cfc6025c6f97a5be93c444cab0376022fc (diff)
downloadzendex-96cf6093809b049dd55efd6c10593b95ec2e5d03.tar.gz
zendex-96cf6093809b049dd55efd6c10593b95ec2e5d03.tar.xz
adding doctest and example to show user function
Diffstat (limited to 'lib')
-rw-r--r--lib/zendex/user.ex23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/zendex/user.ex b/lib/zendex/user.ex
index 31c3a06..4cae662 100644
--- a/lib/zendex/user.ex
+++ b/lib/zendex/user.ex
@@ -20,6 +20,29 @@ defmodule Zendex.User do
@doc """
Show a specific user, given their id.
+
+ ## Examples
+
+ iex> conn = Zendex.Connection.setup("http://test.zendesk.com", "ZendeskUser", "Password1")
+ %{authentication: "WmVuZGVza1VzZXI6UGFzc3dvcmQx", base_url: "http://test.zendesk.com"}
+ iex> Zendex.User.show(conn, 295204)
+ %{"user" => %{"ticket_restriction" => nil, "chat_only" => false,
+ "shared_phone_number" => nil, "notes" => "", "phone" => nil,
+ "organization_id" => 11129520411,
+ "last_login_at" => "2016-10-28T21:08:23Z", "moderator" => true,
+ "shared" => false, "id" => 295204, "role" => "admin",
+ "external_id" => nil, "shared_agent" => false, "photo" => nil,
+ "verified" => true, "active" => true, "locale_id" => 1,
+ "suspended" => false, "created_at" => "2015-05-28T09:12:45Z",
+ "name" => "Nikolao Aikema", "restricted_agent" => false,
+ "locale" => "en-US", "details" => "", "alias" => nil,
+ "url" => "https://test.zendesk.com/api/v2/users/295204.json",
+ "custom_role_id" => nil, "email" => "nikolao.aikema@test.com",
+ "signature" => nil, "two_factor_auth_enabled" => nil,
+ "time_zone" => "London", "only_private_comments" => false,
+ "user_fields" => %{"customer_complaint" => nil}, "tags" => [],
+ "updated_at" => "2016-10-28T21:08:23Z"}}
+
"""
@spec show(Zendex.Connection.t, integer) :: map
def show(connection, id) do