Skip to content

Commit

Permalink
Merge pull request #733 from shalabi/shalabi-cbp-articles
Browse files Browse the repository at this point in the history
Switch article endpoints to use CBP (cursor based pagination)
  • Loading branch information
PierreBtz authored Dec 19, 2024
2 parents e7f274f + 4b4c119 commit 465c7e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/zendesk/client/v2/Zendesk.java
Original file line number Diff line number Diff line change
Expand Up @@ -2899,26 +2899,26 @@ public List<String> getHelpCenterLocales() {
*/
public Iterable<Article> getArticles() {
return new PagedIterable<>(
cnst("/help_center/articles.json"), handleList(Article.class, "articles"));
cbp("/help_center/articles.json"), handleList(Article.class, "articles"));
}

public Iterable<Article> getArticles(String locale) {
return new PagedIterable<>(
tmpl("/help_center/{locale}/articles.json").set("locale", locale),
cbp("/help_center/{locale}/articles.json").set("locale", locale),
handleList(Article.class, "articles"));
}

public Iterable<Article> getArticles(Category category) {
checkHasId(category);
return new PagedIterable<>(
tmpl("/help_center/categories/{id}/articles.json").set("id", category.getId()),
cbp("/help_center/categories/{id}/articles.json").set("id", category.getId()),
handleList(Article.class, "articles"));
}

public Iterable<Article> getArticles(Category category, String locale) {
checkHasId(category);
return new PagedIterable<>(
tmpl("/help_center/{locale}/categories/{id}/articles.json")
cbp("/help_center/{locale}/categories/{id}/articles.json")
.set("id", category.getId())
.set("locale", locale),
handleList(Article.class, "articles"));
Expand All @@ -2927,14 +2927,14 @@ public Iterable<Article> getArticles(Category category, String locale) {
public Iterable<Article> getArticles(Section section) {
checkHasId(section);
return new PagedIterable<>(
tmpl("/help_center/sections/{id}/articles.json").set("id", section.getId()),
cbp("/help_center/sections/{id}/articles.json").set("id", section.getId()),
handleList(Article.class, "articles"));
}

public Iterable<Article> getArticles(Section section, String locale) {
checkHasId(section);
return new PagedIterable<>(
tmpl("/help_center/{locale}/sections/{id}/articles.json")
cbp("/help_center/{locale}/sections/{id}/articles.json")
.set("id", section.getId())
.set("locale", locale),
handleList(Article.class, "articles"));
Expand Down Expand Up @@ -2963,7 +2963,7 @@ public Article getArticle(long id) {

public Iterable<Translation> getArticleTranslations(Long articleId) {
return new PagedIterable<>(
tmpl("/help_center/articles/{articleId}/translations.json").set("articleId", articleId),
cbp("/help_center/articles/{articleId}/translations.json").set("articleId", articleId),
handleList(Translation.class, "translations"));
}

Expand Down

0 comments on commit 465c7e8

Please sign in to comment.