Skip to content

Commit 948c077

Browse files
thewheatchoran
authored andcommitted
Add conversation ratings (#235)
1 parent 8584257 commit 948c077

File tree

4 files changed

+235
-0
lines changed

4 files changed

+235
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ private static boolean isAdminQuery(Map<String, String> params) {
183183
@JsonProperty("conversation_message")
184184
private ConversationMessage conversationMessage;
185185

186+
@JsonProperty("conversation_rating")
187+
private ConversationRating conversationRating;
188+
186189
@JsonProperty("user")
187190
private User user;
188191

@@ -259,6 +262,10 @@ public ConversationMessage getConversationMessage() {
259262
return conversationMessage;
260263
}
261264

265+
public ConversationRating getConversationRating() {
266+
return conversationRating;
267+
}
268+
262269
public User getUser() {
263270
return user;
264271
}
@@ -327,6 +334,8 @@ public boolean equals(Object o) {
327334
if (assignee != null ? !assignee.equals(that.assignee) : that.assignee != null) return false;
328335
if (conversationMessage != null ? !conversationMessage.equals(that.conversationMessage) : that.conversationMessage != null)
329336
return false;
337+
if (conversationRating != null ? !conversationRating.equals(that.conversationRating) : that.conversationRating != null)
338+
return false;
330339
if (conversationPartCollection != null ? !conversationPartCollection.equals(that.conversationPartCollection) : that.conversationPartCollection != null)
331340
return false;
332341
if (tagCollection != null ? !tagCollection.equals(that.tagCollection) : that.tagCollection != null)
@@ -347,6 +356,7 @@ public int hashCode() {
347356
result = 31 * result + (id != null ? id.hashCode() : 0);
348357
result = 31 * result + (state != null ? state.hashCode() : 0);
349358
result = 31 * result + (conversationMessage != null ? conversationMessage.hashCode() : 0);
359+
result = 31 * result + (conversationRating != null ? conversationRating.hashCode() : 0);
350360
result = 31 * result + (user != null ? user.hashCode() : 0);
351361
result = 31 * result + (assignee != null ? assignee.hashCode() : 0);
352362
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
@@ -379,6 +389,7 @@ public String toString() {
379389
", state=" + state +
380390
", read=" + read +
381391
", links=" + links +
392+
", conversationRating=" + conversationRating +
382393
"} " + super.toString();
383394
}
384395
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package io.intercom.api;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
6+
import java.util.List;
7+
8+
@SuppressWarnings("UnusedDeclaration")
9+
@JsonIgnoreProperties(ignoreUnknown = true)
10+
public class ConversationRating extends TypedData {
11+
12+
@JsonProperty
13+
private int rating;
14+
15+
@JsonProperty
16+
private String remark;
17+
18+
@JsonProperty("created_at")
19+
private long createdAt;
20+
21+
@JsonProperty
22+
private Customer customer;
23+
24+
@JsonProperty
25+
private Teammate teammate;
26+
27+
public ConversationRating() {
28+
}
29+
30+
public int getRating() {
31+
return rating;
32+
}
33+
34+
public String getRemark() {
35+
return remark;
36+
}
37+
38+
public long getCreatedAt() {
39+
return createdAt;
40+
}
41+
42+
public Customer getCustomer() {
43+
return customer;
44+
}
45+
46+
public Teammate getTeammate() {
47+
return teammate;
48+
}
49+
50+
@Override
51+
public int hashCode() {
52+
int result = remark != null ? remark.hashCode() : 0;
53+
result = 31 * result + (customer != null ? customer.hashCode() : 0);
54+
result = 31 * result + (teammate != null ? teammate.hashCode() : 0);
55+
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
56+
result = 31 * result + rating;
57+
58+
return result;
59+
}
60+
61+
@Override
62+
public boolean equals(Object o) {
63+
if (this == o) return true;
64+
if (o == null || getClass() != o.getClass()) return false;
65+
66+
ConversationRating that = (ConversationRating) o;
67+
68+
if (customer != null ? !customer.equals(that.customer) : that.customer != null) return false;
69+
if (teammate != null ? !teammate.equals(that.teammate) : that.teammate != null) return false;
70+
if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
71+
if (createdAt != that.createdAt) return false;
72+
if (rating != that.rating) return false;
73+
74+
return true;
75+
}
76+
77+
@Override
78+
public String toString() {
79+
return "ConversationRating{" +
80+
"rating='" + rating + '\'' +
81+
", remark='" + remark + '\'' +
82+
", created_at='" + createdAt + '\'' +
83+
", customer=" + customer +
84+
", teammate=" + teammate +
85+
"} " + super.toString();
86+
}
87+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package io.intercom.api;
2+
3+
4+
import com.fasterxml.jackson.annotation.JsonIgnore;
5+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6+
import com.fasterxml.jackson.annotation.JsonInclude;
7+
import com.fasterxml.jackson.annotation.JsonProperty;
8+
9+
@SuppressWarnings("UnusedDeclaration")
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
12+
public class Customer extends TypedData {
13+
14+
@JsonProperty("type")
15+
private String type;
16+
17+
@JsonProperty("id")
18+
private String id;
19+
20+
public Customer() {
21+
}
22+
23+
public String getType() {
24+
return type;
25+
}
26+
27+
public Customer setType(String type) {
28+
this.type = type;
29+
return this;
30+
}
31+
32+
public String getId() {
33+
return id;
34+
}
35+
36+
public Customer setId(String id) {
37+
this.id = id;
38+
return this;
39+
}
40+
41+
@Override
42+
public int hashCode() {
43+
int result = id != null ? id.hashCode() : 0;
44+
result = 31 * result + (type != null ? type.hashCode() : 0);
45+
return result;
46+
}
47+
48+
@Override
49+
public boolean equals(Object o) {
50+
if (this == o) return true;
51+
if (o == null || getClass() != o.getClass()) return false;
52+
53+
Customer customer = (Customer) o;
54+
55+
if (id != null ? !id.equals(customer.id) : customer.id != null) return false;
56+
if (type != null ? !type.equals(customer.type) : customer.type != null) return false;
57+
58+
return true;
59+
}
60+
61+
@Override
62+
public String toString() {
63+
return "Customer{" +
64+
"type='" + type + '\'' +
65+
", id='" + id+ '\'' +
66+
"} " + super.toString();
67+
}
68+
69+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package io.intercom.api;
2+
3+
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5+
import com.fasterxml.jackson.annotation.JsonInclude;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
8+
@SuppressWarnings("UnusedDeclaration")
9+
@JsonIgnoreProperties(ignoreUnknown = true)
10+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
11+
public class Teammate extends TypedData {
12+
13+
@JsonProperty("type")
14+
private String type;
15+
16+
@JsonProperty("id")
17+
private String id;
18+
19+
public Teammate() {
20+
}
21+
22+
public String getType() {
23+
return type;
24+
}
25+
26+
public Teammate setType(String type) {
27+
this.type = type;
28+
return this;
29+
}
30+
31+
public String getId() {
32+
return id;
33+
}
34+
35+
public Teammate setId(String id) {
36+
this.id = id;
37+
return this;
38+
}
39+
40+
@Override
41+
public int hashCode() {
42+
int result = id != null ? id.hashCode() : 0;
43+
result = 31 * result + (type != null ? type.hashCode() : 0);
44+
return result;
45+
}
46+
47+
@Override
48+
public boolean equals(Object o) {
49+
if (this == o) return true;
50+
if (o == null || getClass() != o.getClass()) return false;
51+
52+
Teammate teammate = (Teammate) o;
53+
54+
if (id != null ? !id.equals(teammate.id) : teammate.id != null) return false;
55+
if (type != null ? !type.equals(teammate.type) : teammate.type != null) return false;
56+
57+
return true;
58+
}
59+
60+
@Override
61+
public String toString() {
62+
return "Teammate{" +
63+
"type='" + type + '\'' +
64+
", id='" + id+ '\'' +
65+
"} " + super.toString();
66+
}
67+
68+
}

0 commit comments

Comments
 (0)