Skip to content

Commit 3f635cd

Browse files
authored
Merge pull request #701 from PierreBtz/pbeitz/gh-681
[feature] Add support for locales in the section and categories article searches
2 parents 87d5432 + 8bfe0f6 commit 3f635cd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,13 +2904,31 @@ public Iterable<Article> getArticles(Category category) {
29042904
handleList(Article.class, "articles"));
29052905
}
29062906

2907+
public Iterable<Article> getArticles(Category category, String locale) {
2908+
checkHasId(category);
2909+
return new PagedIterable<>(
2910+
tmpl("/help_center/{locale}/categories/{id}/articles.json")
2911+
.set("id", category.getId())
2912+
.set("locale", locale),
2913+
handleList(Article.class, "articles"));
2914+
}
2915+
29072916
public Iterable<Article> getArticles(Section section) {
29082917
checkHasId(section);
29092918
return new PagedIterable<>(
29102919
tmpl("/help_center/sections/{id}/articles.json").set("id", section.getId()),
29112920
handleList(Article.class, "articles"));
29122921
}
29132922

2923+
public Iterable<Article> getArticles(Section section, String locale) {
2924+
checkHasId(section);
2925+
return new PagedIterable<>(
2926+
tmpl("/help_center/{locale}/sections/{id}/articles.json")
2927+
.set("id", section.getId())
2928+
.set("locale", locale),
2929+
handleList(Article.class, "articles"));
2930+
}
2931+
29142932
public Iterable<Article> getArticlesIncrementally(Date startTime) {
29152933
return new PagedIterable<>(
29162934
tmpl("/help_center/incremental/articles.json{?start_time}")

0 commit comments

Comments
 (0)