Skip to content

Commit

Permalink
Add support for parsing use_new_renderer in kotlin (#154)
Browse files Browse the repository at this point in the history
* add ext to BidResponse and a property to read use_new_renderer
libraries update

* updates agp to 8.5.1

* upgrade gradle to 8.9
  • Loading branch information
renam authored Aug 7, 2024
1 parent 2883f9a commit e087abb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ indent_size=4

[{*.yml,*.yaml}]
indent_size=2

[*.{kt,kts,gradle}]
ij_kotlin_allow_trailing_comma_on_call_site=true
ij_kotlin_allow_trailing_comma=true
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[versions]
android = "8.2.2"
android = "8.5.1"
android-buildtools = "34.0.0"
dokka = "1.9.10"
kotest = "5.8.0"
kotlin = "1.9.22"
kotlin = "1.9.24"
serialization = { require = "[1.3.3, 2.0[", prefer = "1.6.2" }

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class BidResponse(
@JvmField @SerialName("duration") public val duration: Int = 0,
@JvmField @SerialName("exp") public val exp: Int = -1,
@JvmField @SerialName("external_notifications") public val external_notifications: Map<String, String> = emptyMap(),
@JvmField @SerialName("ext") public val ext: 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"]
Expand All @@ -65,6 +66,9 @@ public class BidResponse(
/** Url to fire a request to when this bid loses an auction */
public val loss_response: String? get() = external_notifications["loss_response"]

public val useNewRenderer: Boolean
get() = ext["use_new_renderer"].toBoolean()

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

0 comments on commit e087abb

Please sign in to comment.