Skip to content

Commit 5586abb

Browse files
thewheatjonnyom
authored andcommitted
Add support for more company attributes (#183)
1 parent 7c2f24d commit 5586abb

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

intercom-java/src/main/java/io/intercom/api/Company.java

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public static Company update(Company company) throws InvalidException, Authoriza
4040
entity.setSessionCount(company.getSessionCount());
4141
entity.setMonthlySpend(company.getMonthlySpend());
4242
entity.setRemoteCreatedAt(company.getRemoteCreatedAt());
43+
entity.setIndustry(company.getIndustry());
44+
entity.setSize(company.getSize());
45+
entity.setWebsite(company.getWebsite());
4346
if(company.getCustomAttributes() != null) {
4447
entity.getCustomAttributes().putAll(company.getCustomAttributes());
4548
}
@@ -177,6 +180,9 @@ public String toString() {
177180
@JsonProperty("remote_created_at")
178181
private long remoteCreatedAt;
179182

183+
@JsonProperty("last_request_at")
184+
private long lastRequestAt;
185+
180186
@JsonProperty("created_at")
181187
private long createdAt;
182188

@@ -189,6 +195,15 @@ public String toString() {
189195
@JsonProperty("user_count")
190196
private Integer userCount;
191197

198+
@JsonProperty("size")
199+
private int size;
200+
201+
@JsonProperty("website")
202+
private String website;
203+
204+
@JsonProperty("industry")
205+
private String industry;
206+
192207
@JsonIgnoreProperties(ignoreUnknown = false)
193208
@JsonProperty("custom_attributes")
194209
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@@ -232,6 +247,33 @@ public Company setName(String name) {
232247
return this;
233248
}
234249

250+
public int getSize() {
251+
return size;
252+
}
253+
254+
public Company setSize(int size) {
255+
this.size = size;
256+
return this;
257+
}
258+
259+
public String getWebsite() {
260+
return website;
261+
}
262+
263+
public Company setWebsite(String website) {
264+
this.website = website;
265+
return this;
266+
}
267+
268+
public String getIndustry() {
269+
return industry;
270+
}
271+
272+
public Company setIndustry(String industry) {
273+
this.industry = industry;
274+
return this;
275+
}
276+
235277
public long getCreatedAt() {
236278
return createdAt;
237279
}
@@ -262,6 +304,15 @@ public Company setRemoteCreatedAt(long remoteCreatedAt) {
262304
return this;
263305
}
264306

307+
public long getLastRequestAt() {
308+
return lastRequestAt;
309+
}
310+
311+
public Company setLastRequestAt(long lastRequestAt) {
312+
this.lastRequestAt = lastRequestAt;
313+
return this;
314+
}
315+
265316
public Map<String, CustomAttribute> getCustomAttributes() {
266317
return customAttributes;
267318
}
@@ -322,6 +373,7 @@ public boolean equals(Object o) {
322373
if (remoteCreatedAt != company.remoteCreatedAt) return false;
323374
if (sessionCount != company.sessionCount) return false;
324375
if (updatedAt != company.updatedAt) return false;
376+
if (lastRequestAt != company.lastRequestAt) return false;
325377
if (companyID != null ? !companyID.equals(company.companyID) : company.companyID != null) return false;
326378
if (customAttributes != null ? !customAttributes.equals(company.customAttributes) : company.customAttributes != null)
327379
return false;
@@ -336,6 +388,9 @@ public boolean equals(Object o) {
336388
if (untag != null ? !untag.equals(company.untag) : company.untag != null) return false;
337389
//noinspection RedundantIfStatement
338390
if (userCount != null ? !userCount.equals(company.userCount) : company.userCount != null) return false;
391+
if (size != company.size) return false;
392+
if (website != null ? !website.equals(company.website) : company.website != null) return false;
393+
if (industry != null ? !industry.equals(company.industry) : company.industry != null) return false;
339394

340395
return true;
341396
}
@@ -351,12 +406,16 @@ public int hashCode() {
351406
result = 31 * result + (int) (remoteCreatedAt ^ (remoteCreatedAt >>> 32));
352407
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
353408
result = 31 * result + (int) (updatedAt ^ (updatedAt >>> 32));
409+
result = 31 * result + (int) (lastRequestAt ^ (lastRequestAt >>> 32));
354410
result = 31 * result + (plan != null ? plan.hashCode() : 0);
355411
result = 31 * result + (userCount != null ? userCount.hashCode() : 0);
356412
result = 31 * result + (customAttributes != null ? customAttributes.hashCode() : 0);
357413
result = 31 * result + (segmentCollection != null ? segmentCollection.hashCode() : 0);
358414
result = 31 * result + (tagCollection != null ? tagCollection.hashCode() : 0);
359415
result = 31 * result + (untag != null ? untag.hashCode() : 0);
416+
result = 31 * result + size;
417+
result = 31 * result + (website != null ? website.hashCode() : 0);
418+
result = 31 * result + (industry != null ? industry.hashCode() : 0);
360419
return result;
361420
}
362421

@@ -370,11 +429,15 @@ public String toString() {
370429
", monthlySpend=" + monthlySpend +
371430
", remoteCreatedAt=" + remoteCreatedAt +
372431
", createdAt=" + createdAt +
432+
", lastRequestAt=" + lastRequestAt +
373433
", updatedAt=" + updatedAt +
374434
", plan=" + plan +
375435
", customAttributes=" + customAttributes +
376436
", segmentCollection=" + segmentCollection +
377437
", tagCollection=" + tagCollection +
438+
", size=" + size +
439+
", website='" + website + '\'' +
440+
", industry='" + industry + '\'' +
378441
"} " + super.toString();
379442
}
380443

intercom-java/src/main/java/io/intercom/api/CompanyUpdateBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ private static CompanyWithStringPlan prepareUpdatableCompany(Company company) {
5656
updatableCompany.setSessionCount(company.getSessionCount());
5757
updatableCompany.setMonthlySpend(company.getMonthlySpend());
5858
updatableCompany.setRemoteCreatedAt(company.getRemoteCreatedAt());
59+
updatableCompany.setIndustry(company.getIndustry());
60+
updatableCompany.setSize(company.getSize());
61+
updatableCompany.setWebsite(company.getWebsite());
5962
if (company.getCustomAttributes() != null) {
6063
updatableCompany.getCustomAttributes().putAll(company.getCustomAttributes());
6164
}

intercom-java/src/main/java/io/intercom/api/CompanyWithStringPlan.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ class CompanyWithStringPlan extends TypedData {
3333
@JsonProperty("plan")
3434
private String plan;
3535

36+
@JsonProperty("size")
37+
private int size;
38+
39+
@JsonProperty("website")
40+
private String website;
41+
42+
@JsonProperty("industry")
43+
private String industry;
44+
3645
@JsonIgnoreProperties(ignoreUnknown = false)
3746
@JsonProperty("custom_attributes")
3847
private Map<String, CustomAttribute> customAttributes = Maps.newHashMap();
@@ -96,6 +105,30 @@ public void setRemoteCreatedAt(long remoteCreatedAt) {
96105
this.remoteCreatedAt = remoteCreatedAt;
97106
}
98107

108+
public int getSize() {
109+
return size;
110+
}
111+
112+
public void setSize(int size) {
113+
this.size = size;
114+
}
115+
116+
public String getWebsite() {
117+
return website;
118+
}
119+
120+
public void setWebsite(String website) {
121+
this.website = website;
122+
}
123+
124+
public String getIndustry() {
125+
return industry;
126+
}
127+
128+
public void setIndustry(String industry) {
129+
this.industry = industry;
130+
}
131+
99132
public String getPlan() {
100133
return plan;
101134
}

0 commit comments

Comments
 (0)