Skip to content

Commit 218a2c0

Browse files
author
Henrique Cabral
committed
Added Item and Variant models
1 parent bd79f63 commit 218a2c0

File tree

2 files changed

+436
-0
lines changed

2 files changed

+436
-0
lines changed
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
package org.zendesk.client.v2.model.dynamic;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
import java.io.Serializable;
6+
import java.util.Date;
7+
import java.util.List;
8+
import java.util.Objects;
9+
10+
public class Item implements Serializable {
11+
12+
private static final long serialVersionUID = 1L;
13+
14+
/** Automatically assigned when creating items */
15+
private Long id;
16+
17+
/** The API url of this item */
18+
private String url;
19+
20+
/** The unique name of the item */
21+
private String name;
22+
23+
/** Automatically generated placeholder for the item, derived from name */
24+
private String placeholder;
25+
26+
/** The default locale for the item. Must be one of the locales the account has active. */
27+
@JsonProperty("default_locale_id")
28+
private Long defaultLocaleId;
29+
30+
/** Indicates the item has outdated variants within it */
31+
private Boolean outdated;
32+
33+
/** When this record was created */
34+
@JsonProperty("created_at")
35+
private Date createdAt;
36+
37+
/** When this record last got updated */
38+
@JsonProperty("updated_at")
39+
private Date updatedAt;
40+
41+
/** All variants within this item */
42+
private List<Variant> variants;
43+
44+
public Item() {
45+
}
46+
47+
public Item(Long id, String url, String name, String placeholder, Long defaultLocaleId, Boolean outdated,
48+
Date createdAt, Date updatedAt, List<Variant> variants) {
49+
this.id = id;
50+
this.url = url;
51+
this.name = name;
52+
this.placeholder = placeholder;
53+
this.defaultLocaleId = defaultLocaleId;
54+
this.outdated = outdated;
55+
this.createdAt = createdAt;
56+
this.updatedAt = updatedAt;
57+
this.variants = variants;
58+
}
59+
60+
public Long getId() {
61+
return this.id;
62+
}
63+
64+
public void setId(Long id) {
65+
this.id = id;
66+
}
67+
68+
public String getUrl() {
69+
return this.url;
70+
}
71+
72+
public void setUrl(String url) {
73+
this.url = url;
74+
}
75+
76+
public String getName() {
77+
return this.name;
78+
}
79+
80+
public void setName(String name) {
81+
this.name = name;
82+
}
83+
84+
public String getPlaceholder() {
85+
return this.placeholder;
86+
}
87+
88+
public void setPlaceholder(String placeholder) {
89+
this.placeholder = placeholder;
90+
}
91+
92+
public Long getDefaultLocaleId() {
93+
return this.defaultLocaleId;
94+
}
95+
96+
public void setDefaultLocaleId(Long defaultLocaleId) {
97+
this.defaultLocaleId = defaultLocaleId;
98+
}
99+
100+
public Boolean isOutdated() {
101+
return this.outdated;
102+
}
103+
104+
public Boolean getOutdated() {
105+
return this.outdated;
106+
}
107+
108+
public void setOutdated(Boolean outdated) {
109+
this.outdated = outdated;
110+
}
111+
112+
public Date getCreatedAt() {
113+
return this.createdAt;
114+
}
115+
116+
public void setCreatedAt(Date createdAt) {
117+
this.createdAt = createdAt;
118+
}
119+
120+
public Date getUpdatedAt() {
121+
return this.updatedAt;
122+
}
123+
124+
public void setUpdatedAt(Date updatedAt) {
125+
this.updatedAt = updatedAt;
126+
}
127+
128+
public List<Variant> getVariants() {
129+
return this.variants;
130+
}
131+
132+
public void setVariants(List<Variant> variants) {
133+
this.variants = variants;
134+
}
135+
136+
public Item id(Long id) {
137+
this.id = id;
138+
return this;
139+
}
140+
141+
public Item url(String url) {
142+
this.url = url;
143+
return this;
144+
}
145+
146+
public Item name(String name) {
147+
this.name = name;
148+
return this;
149+
}
150+
151+
public Item placeholder(String placeholder) {
152+
this.placeholder = placeholder;
153+
return this;
154+
}
155+
156+
public Item defaultLocaleId(Long defaultLocaleId) {
157+
this.defaultLocaleId = defaultLocaleId;
158+
return this;
159+
}
160+
161+
public Item outdated(Boolean outdated) {
162+
this.outdated = outdated;
163+
return this;
164+
}
165+
166+
public Item createdAt(Date createdAt) {
167+
this.createdAt = createdAt;
168+
return this;
169+
}
170+
171+
public Item updatedAt(Date updatedAt) {
172+
this.updatedAt = updatedAt;
173+
return this;
174+
}
175+
176+
public Item variants(List<Variant> variants) {
177+
this.variants = variants;
178+
return this;
179+
}
180+
181+
@Override
182+
public boolean equals(Object o) {
183+
if (o == this)
184+
return true;
185+
if (!(o instanceof Item)) {
186+
return false;
187+
}
188+
Item item = (Item) o;
189+
return Objects.equals(id, item.id) && Objects.equals(url, item.url) && Objects.equals(name, item.name)
190+
&& Objects.equals(placeholder, item.placeholder)
191+
&& Objects.equals(defaultLocaleId, item.defaultLocaleId) && Objects.equals(outdated, item.outdated)
192+
&& Objects.equals(createdAt, item.createdAt) && Objects.equals(updatedAt, item.updatedAt)
193+
&& Objects.equals(variants, item.variants);
194+
}
195+
196+
@Override
197+
public int hashCode() {
198+
return Objects.hash(id, url, name, placeholder, defaultLocaleId, outdated, createdAt, updatedAt, variants);
199+
}
200+
201+
@Override
202+
public String toString() {
203+
return "{" +
204+
" id='" + getId() + "'" +
205+
", url='" + getUrl() + "'" +
206+
", name='" + getName() + "'" +
207+
", placeholder='" + getPlaceholder() + "'" +
208+
", defaultLocaleId='" + getDefaultLocaleId() + "'" +
209+
", outdated='" + isOutdated() + "'" +
210+
", createdAt='" + getCreatedAt() + "'" +
211+
", updatedAt='" + getUpdatedAt() + "'" +
212+
", variants='" + getVariants() + "'" +
213+
"}";
214+
}
215+
216+
217+
}

0 commit comments

Comments
 (0)