zen_ex v0.4.2 ZenEx.HelpCenter.Model.Translation

Provides functions to operate Zendesk HelpCenter Translation.

Link to this section Summary

Functions

Create translation specified by category or section or article id.

Delete translation specified by id.

List translations by category or section or article id.

List missing locales by category or section or article id.

Show translation specified by bcp-47 code of locale (es-419, en-us, pr-br) and article id.

Update translation specified by category or section or article id.

Link to this section Functions

Link to this function

create(list, translation)

Specs

create([{:category_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}
create([{:section_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}
create([{:article_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}

Create translation specified by category or section or article id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.create([article_id: 1], %ZenEx.HelpCenter.Entity.Translation{title: xxx, locale: xxx, ...})
%ZenEx.HelpCenter.Entity.Translation{title: xxx, locale: xxx, ...}

Specs

destroy(integer()) :: :ok | :error

Delete translation specified by id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.destroy(1)
:ok
Link to this function

list(arg1, opts \\ [])

List translations by category or section or article id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.list(article_id: 1)
%ZenEx.Collection{}
Link to this function

list_missing(list)

Specs

list_missing([{:category_id, integer()}]) :: [String.t()]
list_missing([{:section_id, integer()}]) :: [String.t()]
list_missing([{:article_id, integer()}]) :: [String.t()]

List missing locales by category or section or article id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.list_missing(article_id: 1)
["en-us", "da-dk"]
Link to this function

show(locale, article_id)

Specs

show(String.t(), integer()) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}

Show translation specified by bcp-47 code of locale (es-419, en-us, pr-br) and article id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.show("en-us", 1)
%ZenEx.HelpCenter.Entity.Translation{id: 1, title: xxx, locale: "en-us", ...}
Link to this function

update(list, translation)

Specs

update([{:category_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}
update([{:section_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}
update([{:article_id, integer()}], %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}) :: %ZenEx.HelpCenter.Entity.Translation{
  body: term(),
  created_at: term(),
  created_by_id: term(),
  draft: term(),
  html_url: term(),
  id: term(),
  locale: term(),
  outdated: term(),
  source_id: term(),
  source_type: term(),
  title: term(),
  updated_at: term(),
  updated_by_id: term(),
  url: term()
}

Update translation specified by category or section or article id.

Examples

iex> ZenEx.HelpCenter.Model.Translation.update([article_id: 1], %ZenEx.HelpCenter.Entity.Translation{id: 1, title: xxx, locale: xxx, ...})
%ZenEx.HelpCenter.Entity.Translation{id: 1, title: xxx, locale: xxx, ...}