Skip to content

Commit 6946a7d

Browse files
committed
handle company plan and custom attributes on update
1 parent 30ab0eb commit 6946a7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ 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.setPlan(company.getPlan().getName());
43+
if(company.getCustomAttributes() != null) {
44+
entity.getCustomAttributes().putAll(company.getCustomAttributes());
45+
}
46+
if(company.getPlan() !=null ) {
47+
entity.setPlan(company.getPlan().getName());
48+
}
4449
return DataResource.update(entity, "companies", Company.class);
4550
}
4651

0 commit comments

Comments
 (0)