File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed
main/java/org/zendesk/client/v2
test/java/org/zendesk/client/v2 Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ Here is the status of the various API components:
55
55
* [ Topics] ( http://developer.zendesk.com/documentation/rest_api/topics.html ) ✓
56
56
* [ Topic Comments] ( http://developer.zendesk.com/documentation/rest_api/topic_comments.html )
57
57
* [ Topic Subscriptions] ( http://developer.zendesk.com/documentation/rest_api/topic_subscriptions.html )
58
+ * [ Help Center Categories] ( https://developer.zendesk.com/rest_api/docs/help_center/categories )
59
+ * [ Help Center Sections] ( https://developer.zendesk.com/rest_api/docs/help_center/sections )
60
+ * [ Help Center Articles] ( https://developer.zendesk.com/rest_api/docs/help_center/articles )
58
61
* [ Topic Votes] ( http://developer.zendesk.com/documentation/rest_api/topic_votes.html )
59
62
* [ Account Settings] ( http://developer.zendesk.com/documentation/rest_api/account_settings.html )
60
63
* [ Activity Stream] ( http://developer.zendesk.com/documentation/rest_api/activity_stream.html )
Original file line number Diff line number Diff line change @@ -1209,15 +1209,13 @@ public void updateInstallation(int id, String json) {
1209
1209
//////////////////////////////////////////////////////////////////////
1210
1210
1211
1211
/**
1212
- * Get first page of articles from help center.
1212
+ * Get all articles from help center.
1213
1213
*
1214
- * @deprecated use #getArticlesFromPage(int). Same as #getArticlesFromPage(0)
1215
1214
* @return List of Articles.
1216
1215
*/
1217
- @ Deprecated
1218
- public List <Article > getArticles () {
1219
- return complete (submit (req ("GET" , cnst ("/help_center/articles.json" )),
1220
- handleList (Article .class , "articles" )));
1216
+ public Iterable <Article > getArticles () {
1217
+ return new PagedIterable <Article >(cnst ("/help_center/articles.json" ),
1218
+ handleList (Article .class , "articles" ));
1221
1219
}
1222
1220
1223
1221
public List <Article > getArticlesFromPage (int page ) {
Original file line number Diff line number Diff line change 17
17
import org .zendesk .client .v2 .model .TicketForm ;
18
18
import org .zendesk .client .v2 .model .User ;
19
19
import org .zendesk .client .v2 .model .events .Event ;
20
+ import org .zendesk .client .v2 .model .hc .Article ;
20
21
import org .zendesk .client .v2 .model .targets .Target ;
21
22
22
23
import java .util .ArrayList ;
@@ -476,4 +477,15 @@ public void getGroups() throws Exception {
476
477
}
477
478
}
478
479
480
+ @ Test
481
+ public void getArticles () throws Exception {
482
+ createClientWithTokenOrPassword ();
483
+ int count = 0 ;
484
+ for (Article t : instance .getArticles ()) {
485
+ assertThat (t .getTitle (), notNullValue ());
486
+ if (++count > 40 ) { // Check enough to pull 2 result pages
487
+ break ;
488
+ }
489
+ }
490
+ }
479
491
}
You can’t perform that action at this time.
0 commit comments