Skip to content

Commit e6d1c77

Browse files
committed
implemented getCategoryTranslation, getSectionTranslation and getArticleTranslation.
1 parent 5b633c3 commit e6d1c77

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/java/org/zendesk/client/v2/Zendesk.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,13 @@ public Iterable<Translation> getArticleTranslations(Long articleId) {
22422242
handleList(Translation.class, "translations"));
22432243
}
22442244

2245+
public Translation getArticleTranslation(long articleId, String locale) {
2246+
return complete(submit(req("GET",
2247+
tmpl("/help_center/articles/{articleId}/translations/{locale}.json")
2248+
.set("articleId", articleId).set("locale", locale)),
2249+
handle(Translation.class, "translation")));
2250+
}
2251+
22452252
public Article createArticle(Article article) {
22462253
checkHasSectionId(article);
22472254
return complete(submit(req("POST", tmpl("/help_center/sections/{id}/articles.json").set("id", article.getSectionId()),
@@ -2333,6 +2340,14 @@ public Iterable<Translation> getCategoryTranslations(Long categoryId) {
23332340
tmpl("/help_center/categories/{categoryId}/translations.json").set("categoryId", categoryId),
23342341
handleList(Translation.class, "translations"));
23352342
}
2343+
2344+
public Translation getCategoryTranslation(long categoryId, String locale) {
2345+
return complete(submit(req("GET",
2346+
tmpl("/help_center/categories/{categoryId}/translations/{locale}.json")
2347+
.set("categoryId", categoryId).set("locale", locale)),
2348+
handle(Translation.class, "translation")));
2349+
}
2350+
23362351
public Category createCategory(Category category) {
23372352
return complete(submit(req("POST", cnst("/help_center/categories.json"),
23382353
JSON, json(Collections.singletonMap("category", category))), handle(Category.class, "category")));
@@ -2384,6 +2399,14 @@ public Iterable<Translation> getSectionTranslations(Long sectionId) {
23842399
tmpl("/help_center/sections/{sectionId}/translations.json").set("sectionId", sectionId),
23852400
handleList(Translation.class, "translations"));
23862401
}
2402+
2403+
public Translation getSectionTranslation(long sectionId, String locale) {
2404+
return complete(submit(req("GET",
2405+
tmpl("/help_center/sections/{sectionId}/translations/{locale}.json")
2406+
.set("sectionId", sectionId).set("locale", locale)),
2407+
handle(Translation.class, "translation")));
2408+
}
2409+
23872410
public Section createSection(Section section) {
23882411
checkHasCategoryId(section);
23892412
return complete(submit(req("POST", tmpl("/help_center/categories/{id}/sections.json").set("id", section.getCategoryId()),

0 commit comments

Comments
 (0)