Skip to content

Commit 4db0f4d

Browse files
committed
regen
1 parent 0389599 commit 4db0f4d

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

src/main/kotlin/io/appwrite/Client.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class Client @JvmOverloads constructor(
617617
val warnings = response.headers["x-appwrite-warning"]
618618
if (warnings != null) {
619619
warnings.split(";").forEach { warning ->
620-
println("Warning: $warning")
620+
System.err.println("Warning: $warning")
621621
}
622622
}
623623

src/main/kotlin/io/appwrite/Query.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class Query(
4141

4242
fun orderDesc(attribute: String) = Query("orderDesc", attribute).toJson()
4343

44+
fun orderRandom() = Query("orderRandom").toJson()
45+
4446
fun cursorBefore(documentId: String) = Query("cursorBefore", null, listOf(documentId)).toJson()
4547

4648
fun cursorAfter(documentId: String) = Query("cursorAfter", null, listOf(documentId)).toJson()

src/main/kotlin/io/appwrite/models/Document.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ data class Document<T>(
9999
createdAt = map["\$createdAt"] as String,
100100
updatedAt = map["\$updatedAt"] as String,
101101
permissions = map["\$permissions"] as List<String>,
102-
data = map.jsonCast(to = nestedType)
102+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
103103
)
104104
}
105105
}

src/main/kotlin/io/appwrite/models/Preferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ data class Preferences<T>(
2929
map: Map<String, Any>,
3030
nestedType: Class<T>
3131
) = Preferences<T>(
32-
data = map.jsonCast(to = nestedType)
32+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
3333
)
3434
}
3535
}

src/main/kotlin/io/appwrite/models/Row.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ data class Row<T>(
9999
createdAt = map["\$createdAt"] as String,
100100
updatedAt = map["\$updatedAt"] as String,
101101
permissions = map["\$permissions"] as List<String>,
102-
data = map.jsonCast(to = nestedType)
102+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
103103
)
104104
}
105105
}

0 commit comments

Comments
 (0)