Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an object for the uid of the user object #153

Merged
merged 2 commits into from
Apr 26, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ public class User(
@Serializable
public class EID(
@JvmField @SerialName("source") public val source: String,
@JvmField @SerialName("uids") public var uids: Set<Segment>,
@JvmField @SerialName("uids") public var uids: Set<UID>,
standa-dev marked this conversation as resolved.
Show resolved Hide resolved
) {
override fun equals(other: Any?): Boolean = other is EID && other.source == source

override fun hashCode(): Int = source.hashCode()
}

/** Object representing the extended ID UID */
@Serializable
public class UID(
@JvmField @SerialName("id") public var id: String,
@JvmField @SerialName("atype") public var atype: Int = 0,
@JvmField @SerialName("ext") public var ext: Map<String, String> = mutableMapOf()
)
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ const val testJson = """
"uids": [
{
"id": "6bca7f6b-a98a-46c0-be05-6020f7604598",
"atype": 1,
"ext": {
"rtiPartner": "TDID"
}
Expand Down Expand Up @@ -246,6 +247,7 @@ class DeserializationTest : StringSpec({

val eid2 = first { it.source == "adserver.org" }.uids.first()
eid2.id shouldBe "6bca7f6b-a98a-46c0-be05-6020f7604598"
eid2.atype shouldBe 1
eid2.ext.shouldContain("rtiPartner", "TDID")
}
}
Expand Down
Loading