zen_ex v0.4.0 ZenEx.Model.User

Provides functions to operate Zendesk User.

Summary

Functions

Create user

Create multiple users

Create or update user specified by id

Create or update multiple users specified by id

Delete (deactivate) user specified by id

Delete (deactivate) multiple users specified by id

List users

Search for users specified by query

Show user specified by id

Update user specified by id

Update multiple users specified by id

Functions

create(user)
create(%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}) ::
  %ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term} |
  {:error, String.t} |
  nil

Create user.

Examples

iex> ZenEx.Model.User.create(%ZenEx.Entity.User{name: "xxx", email: "xxx@xxx"})
%ZenEx.Entity.User{name: "xxx", email: "xxx@xxx", ...}
create_many(users)
create_many([%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}]) ::
  %ZenEx.Entity.JobStatus{id: term, message: term, progress: term, results: term, status: term, total: term, url: term} |
  {:error, String.t}

Create multiple users.

Examples

iex> ZenEx.Model.User.create_many([%ZenEx.Entity.User{name: "xxx"}, ...])
%ZenEx.Entity.JobStatus{id: "xxx"}
create_or_update(user)
create_or_update(%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}) ::
  %ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term} |
  {:error, String.t}

Create or update user specified by id.

Examples

iex> ZenEx.Model.User.create_or_update(%ZenEx.Entity.User{name: "xxx", email: "xxx@xxx"})
%ZenEx.Entity.User{id: xxx, name: "xxx", email: "xxx@xxx", ...}
create_or_update_many(users)
create_or_update_many([%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}]) ::
  %ZenEx.Entity.JobStatus{id: term, message: term, progress: term, results: term, status: term, total: term, url: term} |
  {:error, String.t}

Create or update multiple users specified by id.

Examples

iex> ZenEx.Model.User.create_or_update_many([%ZenEx.Entity.User{id: xxx, name: "xxx"}, ...])
%ZenEx.Entity.JobStatus{id: "xxx"}
destroy(id)
destroy(integer) ::
  %ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term} |
  {:error, String.t}

Delete (deactivate) user specified by id.

Examples

iex> ZenEx.Model.User.destroy(1)
%ZenEx.Entity.User{id: 1, name: "xxx", active: false, ...}
destroy_many(ids)
destroy_many([integer]) ::
  %ZenEx.Entity.JobStatus{id: term, message: term, progress: term, results: term, status: term, total: term, url: term} |
  {:error, String.t}

Delete (deactivate) multiple users specified by id.

Examples

iex> ZenEx.Model.User.destroy_many([xxx, ...])
%ZenEx.Entity.JobStatus{id: "xxx"}
list(opts \\ [])

List users.

Examples

iex> ZenEx.Model.User.list
%ZenEx.Collection{}
search(opts)
search(String.t) ::
  %ZenEx.Collection{count: term, decode_as: term, entities: term, next_page: term, previous_page: term} |
  {:error, String.t}
search(map) ::
  %ZenEx.Collection{count: term, decode_as: term, entities: term, next_page: term, previous_page: term} |
  {:error, String.t}

Search for users specified by query.

Examples

iex> ZenEx.Model.User.search(%{email: "first.last@domain.com"})
%ZenEx.Collection{}

iex> ZenEx.Model.User.search("David"})
%ZenEx.Collection{}
show(id)
show(integer) ::
  %ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term} |
  {:error, String.t}

Show user specified by id.

Examples

iex> ZenEx.Model.User.show(1)
%ZenEx.Entity.User{id: 1, name: "xxx", ...}
update(user)
update(%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}) ::
  %ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term} |
  {:error, String.t}

Update user specified by id.

Examples

iex> ZenEx.Model.User.update(%ZenEx.Entity.User{id: 1, name: "xxx"})
%ZenEx.Entity.User{id: 1, name: "xxx", ...}
update_many(users)
update_many([%ZenEx.Entity.User{active: term, alias: term, created_at: term, custom_role_id: term, details: term, email: term, external_id: term, id: term, last_login_at: term, locale: term, locale_id: term, moderator: term, name: term, notes: term, only_private_comments: term, organization_id: term, phone: term, restricted_agent: term, role: term, shared: term, shared_agent: term, signature: term, suspended: term, tags: term, ticket_restriction: term, time_zone: term, updated_at: term, url: term, user_fields: term, verified: term}]) ::
  %ZenEx.Entity.JobStatus{id: term, message: term, progress: term, results: term, status: term, total: term, url: term} |
  {:error, String.t}

Update multiple users specified by id.

Examples

iex> ZenEx.Model.User.update_many([%ZenEx.Entity.User{id: xxx, name: "xxx"}, ...])
%ZenEx.Entity.JobStatus{id: "xxx"}