Skip to content

Commit 3f358cf

Browse files
committed
Support List Locales operation
1 parent 7d3b4cc commit 3f358cf

File tree

3 files changed

+111
-1
lines changed

3 files changed

+111
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Here is the status of the various API components:
8282
* [Attachments](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/)
8383
* [Automations](https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/)
8484
* [Job Statuses](https://developer.zendesk.com/api-reference/ticketing/ticket-management/job_statuses/)
85-
* [Locales](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/)
85+
* [Locales](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/) - Partial (List Locales)
8686
* [Macros](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/)*except for restrictions*
8787
* [Satisfaction Ratings](https://developer.zendesk.com/api-reference/ticketing/ticket-management/satisfaction_ratings/)
8888
* [Sharing Agreements](https://developer.zendesk.com/api-reference/ticketing/account-configuration/sharing_agreements/)

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.zendesk.client.v2.model.GroupMembership;
5656
import org.zendesk.client.v2.model.Identity;
5757
import org.zendesk.client.v2.model.JobStatus;
58+
import org.zendesk.client.v2.model.Locale;
5859
import org.zendesk.client.v2.model.Macro;
5960
import org.zendesk.client.v2.model.Metric;
6061
import org.zendesk.client.v2.model.Organization;
@@ -2643,6 +2644,20 @@ public void deleteDynamicContentItemVariant(Long itemId, DynamicContentItemVaria
26432644
handleStatus()));
26442645
}
26452646

2647+
//////////////////////////////////////////////////////////////////////
2648+
// Action methods for Locales
2649+
//////////////////////////////////////////////////////////////////////
2650+
2651+
/**
2652+
* https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/#list-locales
2653+
*
2654+
* @return the translation locales available for the account.
2655+
* @since FIXME
2656+
*/
2657+
public Iterable<Locale> getLocales() {
2658+
return new PagedIterable<>(cnst("/locales.json"), handleList(Locale.class, "locales"));
2659+
}
2660+
26462661
// TODO search with query building API
26472662

26482663
//////////////////////////////////////////////////////////////////////
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
package org.zendesk.client.v2.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import java.io.Serializable;
5+
import java.util.Date;
6+
7+
/**
8+
* See <a
9+
* href="https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/">
10+
* Locales in Zendesk API </a>
11+
*
12+
* @since FIXME
13+
*/
14+
public class Locale implements Serializable {
15+
16+
private static final long serialVersionUID = 1L;
17+
18+
private Date createdAt;
19+
private Long id;
20+
private String locale;
21+
private String name;
22+
private Date updatedAt;
23+
private String url;
24+
25+
@JsonProperty("created_at")
26+
public Date getCreatedAt() {
27+
return createdAt;
28+
}
29+
30+
public void setCreatedAt(Date createdAt) {
31+
this.createdAt = createdAt;
32+
}
33+
34+
public Long getId() {
35+
return id;
36+
}
37+
38+
public void setId(Long id) {
39+
this.id = id;
40+
}
41+
42+
public String getLocale() {
43+
return locale;
44+
}
45+
46+
public void setLocale(String locale) {
47+
this.locale = locale;
48+
}
49+
50+
public String getName() {
51+
return name;
52+
}
53+
54+
public void setName(String name) {
55+
this.name = name;
56+
}
57+
58+
@JsonProperty("updated_at")
59+
public Date getUpdatedAt() {
60+
return updatedAt;
61+
}
62+
63+
public void setUpdatedAt(Date updatedAt) {
64+
this.updatedAt = updatedAt;
65+
}
66+
67+
public String getUrl() {
68+
return url;
69+
}
70+
71+
public void setUrl(String url) {
72+
this.url = url;
73+
}
74+
75+
@Override
76+
public String toString() {
77+
return "Locale{"
78+
+ "createdAt="
79+
+ createdAt
80+
+ ", id="
81+
+ id
82+
+ ", locale='"
83+
+ locale
84+
+ '\''
85+
+ ", name='"
86+
+ name
87+
+ '\''
88+
+ ", updatedAt="
89+
+ updatedAt
90+
+ ", url='"
91+
+ url
92+
+ '\''
93+
+ '}';
94+
}
95+
}

0 commit comments

Comments
 (0)