Skip to content

Commit

Permalink
Merge pull request #664 from timveil-startree/jira-link
Browse files Browse the repository at this point in the history
PR to add support for Jira Links API
  • Loading branch information
PierreBtz authored Feb 5, 2024
2 parents fae7181 + 1399a2f commit 51b74aa
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/zendesk/client/v2/Zendesk.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.zendesk.client.v2.model.Group;
import org.zendesk.client.v2.model.GroupMembership;
import org.zendesk.client.v2.model.Identity;
import org.zendesk.client.v2.model.JiraLink;
import org.zendesk.client.v2.model.JobStatus;
import org.zendesk.client.v2.model.Locale;
import org.zendesk.client.v2.model.Macro;
Expand Down Expand Up @@ -3377,6 +3378,10 @@ public Iterable<ContentTag> getContentTags(int pageSize, String namePrefix) {
handleListWithAfterCursorButNoLinks(ContentTag.class, afterCursorUriBuilder, "records"));
}

public Iterable<JiraLink> getJiraLinks() {
return new PagedIterable<>(cnst("/jira/links"), handleList(JiraLink.class, "links"));
}

private Uri buildContentTagsSearchUrl(int pageSize, String namePrefixFilter, String afterCursor) {
final StringBuilder uriBuilder =
new StringBuilder("/guide/content_tags?page[size]=").append(pageSize);
Expand Down
105 changes: 105 additions & 0 deletions src/main/java/org/zendesk/client/v2/model/JiraLink.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package org.zendesk.client.v2.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.Date;

@JsonIgnoreProperties(ignoreUnknown = true)
public class JiraLink implements SearchResultEntity, Serializable {

private static final long serialVersionUID = 1L;

private Long id;
private Date createdAt;
private Date updatedAt;
private String issueId;
private String issueKey;
private Long ticketId;
private String url;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

@JsonProperty("created_at")
public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

@JsonProperty("updated_at")
public Date getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

@JsonProperty("issue_id")
public String getIssueId() {
return issueId;
}

public void setIssueId(String issueId) {
this.issueId = issueId;
}

@JsonProperty("issue_key")
public String getIssueKey() {
return issueKey;
}

public void setIssueKey(String issueKey) {
this.issueKey = issueKey;
}

@JsonProperty("ticket_id")
public Long getTicketId() {
return ticketId;
}

public void setTicketId(Long ticketId) {
this.ticketId = ticketId;
}

@JsonProperty("url")
public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

@Override
public String toString() {
return "JiraLink{"
+ "id="
+ id
+ ", createdAt="
+ createdAt
+ ", updatedAt="
+ updatedAt
+ ", issueId='"
+ issueId
+ '\''
+ ", issueKey='"
+ issueKey
+ '\''
+ ", ticketId="
+ ticketId
+ ", url='"
+ url
+ '\''
+ '}';
}
}

0 comments on commit 51b74aa

Please sign in to comment.