Skip to content

Commit 36dc24c

Browse files
authored
Merge pull request #697 from besbes/feature/voicecomment
Add VoiceComment sub-type
2 parents a2e569a + 3e332f1 commit 36dc24c

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

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)