diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31674228..ed8c1769 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Change Log
+## 25.0.0
+
+* Breaking: `avatars.getScreenshot` `theme` parameter now uses the `BrowserTheme` enum
+* Breaking: Removed generic type parameters from `presences` service methods
+* Added: `BrowserTheme` enum
+* Updated: `Presence` model is now concrete and adds a `metadata` field
+
## 24.1.1
* Fixed: Removed `Advisor` service and `Insight`, `InsightCTA`, `InsightList`, `Report`, `ReportList` models (admin-only endpoints, not intended for client SDKs)
diff --git a/README.md b/README.md
index 8e537c17..fadaf5f7 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
-implementation("io.appwrite:sdk-for-android:24.2.0")
+implementation("io.appwrite:sdk-for-android:25.0.0")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
io.appwrite
sdk-for-android
- 24.2.0
+ 25.0.0
```
diff --git a/docs/examples/java/avatars/get-screenshot.md b/docs/examples/java/avatars/get-screenshot.md
index 2f261c5f..c016ea5f 100644
--- a/docs/examples/java/avatars/get-screenshot.md
+++ b/docs/examples/java/avatars/get-screenshot.md
@@ -2,7 +2,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Avatars;
-import io.appwrite.enums.Theme;
+import io.appwrite.enums.BrowserTheme;
import io.appwrite.enums.Timezone;
import io.appwrite.enums.BrowserPermission;
import io.appwrite.enums.ImageFormat;
@@ -22,7 +22,7 @@ avatars.getScreenshot(
1920, // viewportWidth (optional)
1080, // viewportHeight (optional)
2, // scale (optional)
- Theme.LIGHT, // theme (optional)
+ BrowserTheme.LIGHT, // theme (optional)
"Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional)
true, // fullpage (optional)
"en-US", // locale (optional)
diff --git a/docs/examples/kotlin/avatars/get-screenshot.md b/docs/examples/kotlin/avatars/get-screenshot.md
index 94551fdb..1093c060 100644
--- a/docs/examples/kotlin/avatars/get-screenshot.md
+++ b/docs/examples/kotlin/avatars/get-screenshot.md
@@ -2,7 +2,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Avatars
-import io.appwrite.enums.Theme
+import io.appwrite.enums.BrowserTheme
import io.appwrite.enums.Timezone
import io.appwrite.enums.BrowserPermission
import io.appwrite.enums.ImageFormat
@@ -22,11 +22,11 @@ val result = avatars.getScreenshot(
viewportWidth = 1920, // (optional)
viewportHeight = 1080, // (optional)
scale = 2, // (optional)
- theme = theme.LIGHT, // (optional)
+ theme = BrowserTheme.LIGHT, // (optional)
userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // (optional)
fullpage = true, // (optional)
locale = "en-US", // (optional)
- timezone = timezone.AFRICA_ABIDJAN, // (optional)
+ timezone = Timezone.AFRICA_ABIDJAN, // (optional)
latitude = 37.7749, // (optional)
longitude = -122.4194, // (optional)
accuracy = 100, // (optional)
diff --git a/library/src/main/java/io/appwrite/Client.kt b/library/src/main/java/io/appwrite/Client.kt
index 98d86a3a..f43ec95a 100644
--- a/library/src/main/java/io/appwrite/Client.kt
+++ b/library/src/main/java/io/appwrite/Client.kt
@@ -94,7 +94,7 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
- "x-sdk-version" to "24.2.0",
+ "x-sdk-version" to "25.0.0",
"x-appwrite-response-format" to "1.9.5"
)
config = mutableMapOf()
diff --git a/library/src/main/java/io/appwrite/enums/Theme.kt b/library/src/main/java/io/appwrite/enums/BrowserTheme.kt
similarity index 82%
rename from library/src/main/java/io/appwrite/enums/Theme.kt
rename to library/src/main/java/io/appwrite/enums/BrowserTheme.kt
index d62acaf2..66584d24 100644
--- a/library/src/main/java/io/appwrite/enums/Theme.kt
+++ b/library/src/main/java/io/appwrite/enums/BrowserTheme.kt
@@ -2,7 +2,7 @@ package io.appwrite.enums
import com.google.gson.annotations.SerializedName
-enum class Theme(val value: String) {
+enum class BrowserTheme(val value: String) {
@SerializedName("light")
LIGHT("light"),
@SerializedName("dark")
diff --git a/library/src/main/java/io/appwrite/models/Document.kt b/library/src/main/java/io/appwrite/models/Document.kt
index a192a1dd..c55e6d26 100644
--- a/library/src/main/java/io/appwrite/models/Document.kt
+++ b/library/src/main/java/io/appwrite/models/Document.kt
@@ -99,7 +99,7 @@ data class Document(
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
permissions = map["\$permissions"] as List,
- data = map["data"]?.jsonCast(to = nestedType) ?: emptyMap().jsonCast(to = nestedType)
+ data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
)
}
}
\ No newline at end of file
diff --git a/library/src/main/java/io/appwrite/models/Presence.kt b/library/src/main/java/io/appwrite/models/Presence.kt
index d62ddc12..48cde361 100644
--- a/library/src/main/java/io/appwrite/models/Presence.kt
+++ b/library/src/main/java/io/appwrite/models/Presence.kt
@@ -6,7 +6,7 @@ import io.appwrite.extensions.jsonCast
/**
* Presence
*/
-data class Presence(
+data class Presence(
/**
* Presence ID.
*/
@@ -56,10 +56,11 @@ data class Presence(
var expiresAt: String?,
/**
- * Additional properties
+ * Presence metadata.
*/
@SerializedName("metadata")
- val metadata: T
+ var metadata: Any?,
+
) {
fun toMap(): Map = mapOf(
"\$id" to id as Any,
@@ -70,37 +71,15 @@ data class Presence(
"status" to status as Any,
"source" to source as Any,
"expiresAt" to expiresAt as Any,
- "metadata" to metadata!!.jsonCast(to = Map::class.java)
+ "metadata" to metadata as Any,
)
companion object {
- operator fun invoke(
- id: String,
- createdAt: String,
- updatedAt: String,
- permissions: List,
- userId: String,
- status: String?,
- source: String,
- expiresAt: String?,
- metadata: Map
- ) = Presence