zen_ex v0.4.2 ZenEx.Model.User

Provides functions to operate Zendesk User.

Link to this section 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.

Link to this section Functions

Specs

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", ...}
Link to this function

create_many(users)

Specs

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"}
Link to this function

create_or_update(user)

Specs

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", ...}
Link to this function

create_or_update_many(users)

Specs

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"}

Specs

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, ...}
Link to this function

destroy_many(ids)

Specs

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"}
Link to this function

list(opts \\ [])

List users.

Examples

iex> ZenEx.Model.User.list
%ZenEx.Collection{}

Specs

search(map()) ::
  %ZenEx.Collection{
    count: term(),
    decode_as: term(),
    entities: term(),
    next_page: term(),
    previous_page: term()
  }
  | {:error, String.t()}
search(String.t()) ::
  %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{}

Specs

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", ...}

Specs

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", ...}
Link to this function

update_many(users)

Specs

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"}