Skip to content

Commit e263476

Browse files
authored
Merge branch 'master' into pbeitz/gh-691
2 parents dab77fd + 3f635cd commit e263476

File tree

5 files changed

+61
-1
lines changed

5 files changed

+61
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
<plugin>
254254
<groupId>org.apache.maven.plugins</groupId>
255255
<artifactId>maven-jar-plugin</artifactId>
256-
<version>3.4.1</version>
256+
<version>3.4.2</version>
257257
<configuration>
258258
<archive>
259259
<manifest>

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}")

src/main/java/org/zendesk/client/v2/model/Comment.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
package org.zendesk.client.v2.model;
22

3+
import static com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXTERNAL_PROPERTY;
4+
import static com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME;
5+
36
import com.fasterxml.jackson.annotation.JsonProperty;
7+
import com.fasterxml.jackson.annotation.JsonSubTypes;
8+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
49
import java.io.Serializable;
510
import java.util.Arrays;
611
import java.util.Date;
712
import java.util.List;
13+
import org.zendesk.client.v2.model.comments.VoiceComment;
814

915
/**
1016
* @author stephenc
1117
* @since 09/04/2013 15:09
1218
*/
19+
@JsonTypeInfo(use = NAME, include = EXTERNAL_PROPERTY, property = "type", visible = true)
20+
@JsonSubTypes({
21+
@JsonSubTypes.Type(value = Comment.class, name = "Comment"),
22+
@JsonSubTypes.Type(value = VoiceComment.class, name = "VoiceComment")
23+
})
1324
public class Comment implements Serializable {
1425

1526
private static final long serialVersionUID = 1L;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.zendesk.client.v2.model.comments;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import org.zendesk.client.v2.model.Comment;
5+
6+
public class VoiceComment extends Comment {
7+
8+
private VoiceCommentData data;
9+
10+
@JsonProperty("data")
11+
public VoiceCommentData getData() {
12+
return data;
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.zendesk.client.v2.model.comments;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
/**
6+
* @author besbes
7+
* @since 05/03/2024 13:51
8+
*/
9+
public class VoiceCommentData {
10+
11+
private Long callDuration;
12+
13+
@JsonProperty("call_duration")
14+
public Long getCallDuration() {
15+
return callDuration;
16+
}
17+
}

0 commit comments

Comments
 (0)