Skip to content

Commit

Permalink
Adds external_notifications field to BidResponse (#136)
Browse files Browse the repository at this point in the history
* adds external_notifications field to BidResponse
  • Loading branch information
renam authored Apr 3, 2023
1 parent 36080d0 commit e56bc49
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import kotlin.jvm.JvmStatic
* @property position The position from the request for this ad.
* @property trackers Contains additional tracking urls for measurement.
* @property duration The duration in seconds or 0 if unknown or another ad type.
* @property external_notifications Contains urls used to notify external services.
*/
@Serializable
public class BidResponse(
Expand All @@ -51,11 +52,16 @@ public class BidResponse(
@JvmField @SerialName("position") public val position: String,
@JvmField @SerialName("trackers") public val trackers: Map<String, Array<String>> = emptyMap(),
@JvmField @SerialName("duration") public val duration: Int = 0,
@JvmField @SerialName("external_notifications") public val external_notifications: Map<String, String> = emptyMap(),
) {
/** Urls to fire a request to when an impression is registered */
public val impression_trackers: Array<String>? get() = trackers["impression_trackers"]
/** Urls to fire a request to when a click is registered */
public val click_trackers: Array<String>? get() = trackers["click_trackers"]
/** Url to fire a request to when an there's an auction win */
public val win_response: String? get() = external_notifications["win_response"]
/** Url to fire a request to when an there's an auction loss */
public val loss_response: String? get() = external_notifications["loss_response"]

public companion object {
/** Decodes a BidResponse from a Json string using the built in serializer */
Expand Down

0 comments on commit e56bc49

Please sign in to comment.