Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch article endpoints to use CBP (cursor based pagination) #733

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading