Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/BaseContentFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public abstract class BaseContentFieldSet<T extends BaseContentFieldSet<T>>
extends BaseAppBrowserSiteBrandFieldSet<T> {
@Expose @SerializedName("$content_id") private String contentId;
@Expose @SerializedName("$status") private String status;
@Expose @SerializedName(USER_EMAIL) private String userEmail;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

public String getContentId() {
Expand Down Expand Up @@ -35,4 +36,13 @@ public T setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return (T) this;
}

public String getUserEmail() {
return userEmail;
}

public T setUserEmail(String userEmail) {
this.userEmail = userEmail;
return (T) this;
}
}
30 changes: 30 additions & 0 deletions src/main/java/com/siftscience/model/FlagContentFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ public String toString() {
}
}

@Expose @SerializedName("$brand_name") private String brandName;
@Expose @SerializedName("$content_id") private String contentId;
@Expose @SerializedName("$flagged_by") private String flaggedBy;
@Expose @SerializedName("$reason") private String reason;
@Expose @SerializedName("$site_country") private String siteCountry;
@Expose @SerializedName("$site_domain") private String siteDomain;
@Expose @SerializedName(USER_EMAIL) private String userEmail;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

Expand Down Expand Up @@ -85,4 +88,31 @@ public FlagContentFieldSet setVerificationPhoneNumber(String verificationPhoneNu
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}

public String getSiteDomain() {
return siteDomain;
}

public FlagContentFieldSet setSiteDomain(String siteDomain) {
this.siteDomain = siteDomain;
return this;
}

public String getSiteCountry() {
return siteCountry;
}

public FlagContentFieldSet setSiteCountry(String siteCountry) {
this.siteCountry = siteCountry;
return this;
}

public String getBrandName() {
return brandName;
}

public FlagContentFieldSet setBrandName(String brandName) {
this.brandName = brandName;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Review {
@Expose @SerializedName("$contact_email") private String contactEmail;
@Expose @SerializedName("$locations") private List<Address> locations;
@Expose @SerializedName("$reviewed_content_id") private String reviewedContentId;
@Expose @SerializedName("$reviewed_user_id") private String reviewedUserId;
@Expose @SerializedName("$images") private List<Image> images;
@Expose @SerializedName("$rating") private Double rating;

Expand Down Expand Up @@ -76,4 +77,13 @@ public Review setReviewedContentId(String reviewedContentId) {
this.reviewedContentId = reviewedContentId;
return this;
}

public String getReviewedUserId() {
return reviewedUserId;
}

public Review setReviewedUserId(String reviewedUserId) {
this.reviewedUserId = reviewedUserId;
return this;
}
}
28 changes: 28 additions & 0 deletions src/test/java/com/siftscience/ContentEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void testCreateComment() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$comment\" : {\n" +
" \"$body\": \"Congrats on the new role!\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -103,6 +104,7 @@ public void testCreateComment() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setComment(c)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -135,6 +137,7 @@ public void testCreateListing() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$listing\" : {\n" +
" \"$subject\": \"2 Bedroom Apartment for Rent\",\n" +
" \"$body\": \"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\n" +
Expand Down Expand Up @@ -232,6 +235,7 @@ public void testCreateListing() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setListing(l)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -263,6 +267,7 @@ public void testCreateMessage() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$message\" : {\n" +
" \"$body\": \"Let's meet at 5pm\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -316,6 +321,7 @@ public void testCreateMessage() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setMessage(m)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -347,6 +353,7 @@ public void testCreateProfile() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$profile\" : {\n" +
" \"$body\": \"Hi! My name is Alex and I just moved to New London!\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -417,6 +424,7 @@ public void testCreateProfile() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setProfile(p)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -448,6 +456,7 @@ public void testCreatePost() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$post\" : {\n" +
" \"$subject\": \"My new apartment!\"," +
" \"$body\": \"Moved into my new apartment yesterday.\",\n" +
Expand Down Expand Up @@ -535,6 +544,7 @@ public void testCreatePost() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setPost(p)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -566,6 +576,7 @@ public void testCreateReview() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$review\" : {\n" +
" \"$subject\": \"Amazing Tacos!\"," +
" \"$body\": \"I ate the tacos.\",\n" +
Expand All @@ -577,6 +588,7 @@ public void testCreateReview() throws Exception {
" \"$zipcode\": \"98112\"\n" +
" }],\n" +
" \"$reviewed_content_id\": \"listing-234234\",\n" +
" \"$reviewed_user_id\": \"fyw3989sjpqr71\",\n" +
" \"$images\": [{\n" +
" \"$md5_hash\": \"aflshdfbalsubdf3234sfdkjb\",\n" +
" \"$link\": \"https://www.domain.com/file.png\",\n" +
Expand Down Expand Up @@ -627,6 +639,7 @@ public void testCreateReview() throws Exception {
.setContactEmail("alex_301@domain.com")
.setLocations(Collections.singletonList(locationAddress))
.setReviewedContentId("listing-234234")
.setReviewedUserId("fyw3989sjpqr71")
.setImages(images)
.setRating(4.5);

Expand All @@ -637,6 +650,7 @@ public void testCreateReview() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setReview(r)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -668,6 +682,7 @@ public void testUpdateComment() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$comment\" : {\n" +
" \"$body\": \"Congrats on the new role!\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -724,6 +739,7 @@ public void testUpdateComment() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setComment(c)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -756,6 +772,7 @@ public void testUpdateListing() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$listing\" : {\n" +
" \"$subject\": \"2 Bedroom Apartment for Rent\",\n" +
" \"$body\": \"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\n" +
Expand Down Expand Up @@ -853,6 +870,7 @@ public void testUpdateListing() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setListing(l)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -884,6 +902,7 @@ public void testUpdateMessage() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$message\" : {\n" +
" \"$body\": \"Let's meet at 5pm\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -941,6 +960,7 @@ public void testUpdateMessage() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setMessage(m)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -972,6 +992,7 @@ public void testUpdateProfile() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$profile\" : {\n" +
" \"$body\": \"Hi! My name is Alex and I just moved to New London!\",\n" +
" \"$contact_email\": \"alex_301@domain.com\",\n" +
Expand Down Expand Up @@ -1042,6 +1063,7 @@ public void testUpdateProfile() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setProfile(p)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -1073,6 +1095,7 @@ public void testUpdatePost() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$post\" : {\n" +
" \"$subject\": \"My new apartment!\"," +
" \"$body\": \"Moved into my new apartment yesterday.\",\n" +
Expand Down Expand Up @@ -1160,6 +1183,7 @@ public void testUpdatePost() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setPost(p)
.setVerificationPhoneNumber("+12345678901"));

Expand Down Expand Up @@ -1191,6 +1215,7 @@ public void testUpdateReview() throws Exception {
" \"$session_id\" : \"a234ksjfgn435sfg\",\n" +
" \"$status\" : \"$active\",\n" +
" \"$ip\" : \"255.255.255.0\",\n" +
" \"$user_email\" : \"billjones1@example.com\",\n" +
" \"$review\" : {\n" +
" \"$subject\": \"Amazing Tacos!\"," +
" \"$body\": \"I ate the tacos.\",\n" +
Expand All @@ -1202,6 +1227,7 @@ public void testUpdateReview() throws Exception {
" \"$zipcode\": \"98112\"\n" +
" }],\n" +
" \"$reviewed_content_id\": \"listing-234234\",\n" +
" \"$reviewed_user_id\": \"fyw3989sjpqr71\",\n" +
" \"$images\": [{\n" +
" \"$md5_hash\": \"aflshdfbalsubdf3234sfdkjb\",\n" +
" \"$link\": \"https://www.domain.com/file.png\",\n" +
Expand Down Expand Up @@ -1252,6 +1278,7 @@ public void testUpdateReview() throws Exception {
.setContactEmail("alex_301@domain.com")
.setLocations(Collections.singletonList(locationAddress))
.setReviewedContentId("listing-234234")
.setReviewedUserId("fyw3989sjpqr71")
.setImages(images)
.setRating(4.5);

Expand All @@ -1262,6 +1289,7 @@ public void testUpdateReview() throws Exception {
.setSessionId("a234ksjfgn435sfg")
.setStatus("$active")
.setIp("255.255.255.0")
.setUserEmail("billjones1@example.com")
.setReview(r)
.setVerificationPhoneNumber("+12345678901"));

Expand Down
6 changes: 6 additions & 0 deletions src/test/java/com/siftscience/FlagContentEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ public void testFlagContent() throws Exception {
String expectedRequestBody = "{\n" +
" \"$type\" : \"$flag_content\", \n" +
" \"$api_key\" : \"YOUR_API_KEY\",\n" +
" \"$brand_name\" : \"sift\",\n" +
" \"$user_id\" : \"billy_jones_301\",\n" +
" \"$content_id\" : \"9671500641\",\n" +
"\n" +
" \"$flagged_by\" : \"jamieli89\",\n" +
" \"$reason\" : \"" + this.reason.value + "\",\n" +
" \"$site_country\" : \"US\",\n" +
" \"$site_domain\" : \"sift.com\",\n" +
" \"$user_email\" : \"billy_jones_301@email.com\",\n" +
" \"$verification_phone_number\" : \"+12345678901\"\n" +
"}";
Expand Down Expand Up @@ -75,6 +78,9 @@ public void testFlagContent() throws Exception {
.setContentId("9671500641")
.setFlaggedBy("jamieli89")
.setReason(this.reason)
.setBrandName("sift")
.setSiteCountry("US")
.setSiteDomain("sift.com")
.setUserEmail("billy_jones_301@email.com")
.setVerificationPhoneNumber("+12345678901"));

Expand Down