Skip to content

Commit 51b74aa

Browse files
authored
Merge pull request #664 from timveil-startree/jira-link
PR to add support for Jira Links API
2 parents fae7181 + 1399a2f commit 51b74aa

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

src/main/java/org/zendesk/client/v2/Zendesk.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.zendesk.client.v2.model.Group;
5656
import org.zendesk.client.v2.model.GroupMembership;
5757
import org.zendesk.client.v2.model.Identity;
58+
import org.zendesk.client.v2.model.JiraLink;
5859
import org.zendesk.client.v2.model.JobStatus;
5960
import org.zendesk.client.v2.model.Locale;
6061
import org.zendesk.client.v2.model.Macro;
@@ -3377,6 +3378,10 @@ public Iterable<ContentTag> getContentTags(int pageSize, String namePrefix) {
33773378
handleListWithAfterCursorButNoLinks(ContentTag.class, afterCursorUriBuilder, "records"));
33783379
}
33793380

3381+
public Iterable<JiraLink> getJiraLinks() {
3382+
return new PagedIterable<>(cnst("/jira/links"), handleList(JiraLink.class, "links"));
3383+
}
3384+
33803385
private Uri buildContentTagsSearchUrl(int pageSize, String namePrefixFilter, String afterCursor) {
33813386
final StringBuilder uriBuilder =
33823387
new StringBuilder("/guide/content_tags?page[size]=").append(pageSize);
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
package org.zendesk.client.v2.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import java.io.Serializable;
6+
import java.util.Date;
7+
8+
@JsonIgnoreProperties(ignoreUnknown = true)
9+
public class JiraLink implements SearchResultEntity, Serializable {
10+
11+
private static final long serialVersionUID = 1L;
12+
13+
private Long id;
14+
private Date createdAt;
15+
private Date updatedAt;
16+
private String issueId;
17+
private String issueKey;
18+
private Long ticketId;
19+
private String url;
20+
21+
public Long getId() {
22+
return id;
23+
}
24+
25+
public void setId(Long id) {
26+
this.id = id;
27+
}
28+
29+
@JsonProperty("created_at")
30+
public Date getCreatedAt() {
31+
return createdAt;
32+
}
33+
34+
public void setCreatedAt(Date createdAt) {
35+
this.createdAt = createdAt;
36+
}
37+
38+
@JsonProperty("updated_at")
39+
public Date getUpdatedAt() {
40+
return updatedAt;
41+
}
42+
43+
public void setUpdatedAt(Date updatedAt) {
44+
this.updatedAt = updatedAt;
45+
}
46+
47+
@JsonProperty("issue_id")
48+
public String getIssueId() {
49+
return issueId;
50+
}
51+
52+
public void setIssueId(String issueId) {
53+
this.issueId = issueId;
54+
}
55+
56+
@JsonProperty("issue_key")
57+
public String getIssueKey() {
58+
return issueKey;
59+
}
60+
61+
public void setIssueKey(String issueKey) {
62+
this.issueKey = issueKey;
63+
}
64+
65+
@JsonProperty("ticket_id")
66+
public Long getTicketId() {
67+
return ticketId;
68+
}
69+
70+
public void setTicketId(Long ticketId) {
71+
this.ticketId = ticketId;
72+
}
73+
74+
@JsonProperty("url")
75+
public String getUrl() {
76+
return url;
77+
}
78+
79+
public void setUrl(String url) {
80+
this.url = url;
81+
}
82+
83+
@Override
84+
public String toString() {
85+
return "JiraLink{"
86+
+ "id="
87+
+ id
88+
+ ", createdAt="
89+
+ createdAt
90+
+ ", updatedAt="
91+
+ updatedAt
92+
+ ", issueId='"
93+
+ issueId
94+
+ '\''
95+
+ ", issueKey='"
96+
+ issueKey
97+
+ '\''
98+
+ ", ticketId="
99+
+ ticketId
100+
+ ", url='"
101+
+ url
102+
+ '\''
103+
+ '}';
104+
}
105+
}

0 commit comments

Comments
 (0)