Skip to content

Commit e66f6ce

Browse files
committed
Fixed request to new unrwrapped version for V3 Identity Map
1 parent 127f219 commit e66f6ce

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/main/java/com/uid2/client/IdentityMapV3Input.java

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public static IdentityMapV3Input fromHashedPhones(List<String> hashedPhones) {
4141
private transient final Map<String, List<String>> hashedDiiToRawDii = new HashMap<>();
4242

4343
@SerializedName("email_hash")
44-
private final List<Identity> hashedEmails = new ArrayList<>();
44+
private final List<String> hashedEmails = new ArrayList<>();
4545

4646
@SerializedName("phone_hash")
47-
private final List<Identity> hashedPhones = new ArrayList<>();
47+
private final List<String> hashedPhones = new ArrayList<>();
4848

4949
// We never send unhashed emails or phone numbers in the SDK, but they are required fields in the API request
5050
@SerializedName("email")
@@ -70,7 +70,7 @@ public IdentityMapV3Input withHashedEmails(List<String> hashedEmails) {
7070
* @return this IdentityMapV3Input instance
7171
*/
7272
public IdentityMapV3Input withHashedEmail(String hashedEmail) {
73-
this.hashedEmails.add(new Identity(hashedEmail));
73+
this.hashedEmails.add(hashedEmail);
7474
addToDiiMappings(hashedEmail, hashedEmail);
7575
return this;
7676
}
@@ -91,7 +91,7 @@ public IdentityMapV3Input withHashedPhones(List<String> hashedPhones) {
9191
* @return this IdentityMapV3Input instance
9292
*/
9393
public IdentityMapV3Input withHashedPhone(String hashedPhone) {
94-
this.hashedPhones.add(new Identity(hashedPhone));
94+
this.hashedPhones.add(hashedPhone);
9595
addToDiiMappings(hashedPhone, hashedPhone);
9696
return this;
9797
}
@@ -113,7 +113,7 @@ public IdentityMapV3Input withEmails(List<String> emails) {
113113
*/
114114
public IdentityMapV3Input withEmail(String email) {
115115
String hashedEmail = InputUtil.normalizeAndHashEmail(email);
116-
this.hashedEmails.add(new Identity(hashedEmail));
116+
this.hashedEmails.add(hashedEmail);
117117
addToDiiMappings(hashedEmail, email);
118118
return this;
119119
}
@@ -139,7 +139,7 @@ public IdentityMapV3Input withPhone(String phone) {
139139
}
140140

141141
String hashedPhone = InputUtil.getBase64EncodedHash(phone);
142-
this.hashedPhones.add(new Identity(hashedPhone));
142+
this.hashedPhones.add(hashedPhone);
143143
addToDiiMappings(hashedPhone, phone);
144144
return this;
145145
}
@@ -154,19 +154,9 @@ private void addToDiiMappings(String hashedDii, String rawDii) {
154154

155155
private String getHashedDii(String identityType, int i) {
156156
switch (identityType) {
157-
case "email_hash": return hashedEmails.get(i).identity;
158-
case "phone_hash": return hashedPhones.get(i).identity;
157+
case "email_hash": return hashedEmails.get(i);
158+
case "phone_hash": return hashedPhones.get(i);
159159
}
160160
throw new Uid2Exception("Unexpected identity type: " + identityType);
161161
}
162-
163-
164-
private static class Identity {
165-
@SerializedName("i")
166-
private final String identity;
167-
168-
public Identity(String value) {
169-
this.identity = value;
170-
}
171-
}
172162
}

0 commit comments

Comments
 (0)