aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Blowers <sblowers@findmypast.com>2016-11-01 14:01:08 (GMT)
committerSteven Blowers <sblowers@findmypast.com>2016-11-01 14:01:08 (GMT)
commitdc3eabba821ff4f80ca417123629ca9ceb92eb51 (patch)
treeb57b2b2bba042b43b6189ba2b4b751bbe99674f2
parentbfee6d82bd6b5a259482d6398b913e68d680792a (diff)
downloadzendex-dc3eabba821ff4f80ca417123629ca9ceb92eb51.tar.gz
zendex-dc3eabba821ff4f80ca417123629ca9ceb92eb51.tar.xz
adding doctest for deleting a user.
-rw-r--r--lib/zendex/user.ex92
1 files changed, 76 insertions, 16 deletions
diff --git a/lib/zendex/user.ex b/lib/zendex/user.ex
index 6873fb3..88487f3 100644
--- a/lib/zendex/user.ex
+++ b/lib/zendex/user.ex
@@ -26,22 +26,40 @@ defmodule Zendex.User do
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"}}
+ %{"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
@@ -77,6 +95,48 @@ defmodule Zendex.User do
@doc """
Delete a user.
+
+ ## Examples
+
+ iex> conn = Zendex.Connection.setup("http://test.zendesk.com", "ZendeskUser", "Password1")
+ %{authentication: "WmVuZGVza1VzZXI6UGFzc3dvcmQx", base_url: "http://test.zendesk.com"}
+ iex> Zendex.User.delete(conn, 49043)
+ %{"user" => %{"ticket_restriction" => nil,
+ "chat_only" => false,
+ "shared_phone_number" => nil,
+ "notes" => "",
+ "phone" => nil,
+ "organization_id" => 149043,
+ "last_login_at" => "2016-10-28T21:08:23Z",
+ "moderator" => true,
+ "shared" => false,
+ "id" => 49043,
+ "role" => "admin",
+ "external_id" => nil,
+ "shared_agent" => false,
+ "photo" => nil,
+ "verified" => true,
+ "active" => false,
+ "locale_id" => 1,
+ "suspended" => false,
+ "created_at" => "2015-05-28T09:12:45Z",
+ "name" => "Rian Hawkins",
+ "restricted_agent" => false,
+ "locale" => "en-US",
+ "details" => "",
+ "alias" => nil,
+ "url" => "https://test.zendesk.com/api/v2/users/49043.json",
+ "custom_role_id" => nil,
+ "email" => "rian.hawkins@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 delete(connection, id) do