Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #653: add missing custom_ticket_statuses api call #654

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/org/zendesk/client/v2/Zendesk.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.zendesk.client.v2.model.Brand;
import org.zendesk.client.v2.model.Comment;
import org.zendesk.client.v2.model.ComplianceDeletionStatus;
import org.zendesk.client.v2.model.CustomTicketStatus;
import org.zendesk.client.v2.model.DeletedTicket;
import org.zendesk.client.v2.model.Field;
import org.zendesk.client.v2.model.Forum;
Expand Down Expand Up @@ -641,6 +642,11 @@ public Iterable<ComplianceDeletionStatus> getComplianceDeletionStatuses(long use
handleList(ComplianceDeletionStatus.class, "compliance_deletion_statuses"));
}

public Iterable<CustomTicketStatus> getCustomTicketStatuses() {
return new PagedIterable<>(
tmpl("/custom_statuses.json"), handleList(CustomTicketStatus.class, "custom_statuses"));
}

public Iterable<Ticket> getUserCCDTickets(long userId) {
return new PagedIterable<>(
tmpl("/users/{userId}/tickets/ccd.json").set("userId", userId),
Expand Down
192 changes: 192 additions & 0 deletions src/main/java/org/zendesk/client/v2/model/CustomTicketStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
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;

/** https://developer.zendesk.com/api-reference/ticketing/tickets/custom_ticket_statuses/ */
@JsonIgnoreProperties(ignoreUnknown = true)
public class CustomTicketStatus implements Serializable {

private static final long serialVersionUID = 1L;

private Long id;
private boolean active;
private String description;

@JsonProperty("agent_label")
private String agentLabel;

@JsonProperty("created_at")
private Date createdAt;

@JsonProperty("end_user_description")
private String endUserDescription;

@JsonProperty("end_user_label")
private String endUserLabel;

@JsonProperty("raw_agent_label")
private String rawAgentLabel;

@JsonProperty("raw_description")
private String rawDescription;

@JsonProperty("raw_end_user_description")
private String rawEndUserDescription;

@JsonProperty("raw_end_user_label")
private String rawEndUserLabel;

@JsonProperty("status_category")
private String statusCategory;

@JsonProperty("updated_at")
private Date updatedAt;

public Long getId() {
return id;
}

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

public boolean isActive() {
return active;
}

public void setActive(boolean active) {
this.active = active;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getAgentLabel() {
return agentLabel;
}

public void setAgentLabel(String agentLabel) {
this.agentLabel = agentLabel;
}

public Date getCreatedAt() {
return createdAt;
}

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

public String getEndUserDescription() {
return endUserDescription;
}

public void setEndUserDescription(String endUserDescription) {
this.endUserDescription = endUserDescription;
}

public String getEndUserLabel() {
return endUserLabel;
}

public void setEndUserLabel(String endUserLabel) {
this.endUserLabel = endUserLabel;
}

public String getRawAgentLabel() {
return rawAgentLabel;
}

public void setRawAgentLabel(String rawAgentLabel) {
this.rawAgentLabel = rawAgentLabel;
}

public String getRawDescription() {
return rawDescription;
}

public void setRawDescription(String rawDescription) {
this.rawDescription = rawDescription;
}

public String getRawEndUserDescription() {
return rawEndUserDescription;
}

public void setRawEndUserDescription(String rawEndUserDescription) {
this.rawEndUserDescription = rawEndUserDescription;
}

public String getRawEndUserLabel() {
return rawEndUserLabel;
}

public void setRawEndUserLabel(String rawEndUserLabel) {
this.rawEndUserLabel = rawEndUserLabel;
}

public String getStatusCategory() {
return statusCategory;
}

public void setStatusCategory(String statusCategory) {
this.statusCategory = statusCategory;
}

public Date getUpdatedAt() {
return updatedAt;
}

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

@Override
public String toString() {
return "CustomTicketStatus{"
+ "id="
+ id
+ ", active="
+ active
+ ", description='"
+ description
+ '\''
+ ", agentLabel='"
+ agentLabel
+ '\''
+ ", createdAt="
+ createdAt
+ ", endUserDescription='"
+ endUserDescription
+ '\''
+ ", endUserLabel='"
+ endUserLabel
+ '\''
+ ", rawAgentLabel='"
+ rawAgentLabel
+ '\''
+ ", rawDescription='"
+ rawDescription
+ '\''
+ ", rawEndUserDescription='"
+ rawEndUserDescription
+ '\''
+ ", rawEndUserLabel='"
+ rawEndUserLabel
+ '\''
+ ", statusCategory='"
+ statusCategory
+ '\''
+ ", updatedAt="
+ updatedAt
+ '}';
}
}