From 31ee921e684cf08eaf6d7fb91b3a59be0c67f1cc Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 23 Sep 2025 15:23:52 +1200 Subject: [PATCH] Add order random --- README.md | 4 ++-- .../java/databases/create-line-attribute.md | 2 +- .../java/databases/create-point-attribute.md | 2 +- .../java/databases/create-polygon-attribute.md | 2 +- .../java/databases/update-line-attribute.md | 2 +- .../java/databases/update-point-attribute.md | 2 +- .../java/databases/update-polygon-attribute.md | 2 +- .../examples/java/tablesdb/create-line-column.md | 2 +- .../java/tablesdb/create-point-column.md | 2 +- .../java/tablesdb/create-polygon-column.md | 2 +- .../examples/java/tablesdb/update-line-column.md | 2 +- .../java/tablesdb/update-point-column.md | 2 +- .../java/tablesdb/update-polygon-column.md | 2 +- .../kotlin/databases/create-line-attribute.md | 2 +- .../kotlin/databases/create-point-attribute.md | 2 +- .../kotlin/databases/create-polygon-attribute.md | 2 +- .../kotlin/databases/update-line-attribute.md | 2 +- .../kotlin/databases/update-point-attribute.md | 2 +- .../kotlin/databases/update-polygon-attribute.md | 2 +- .../kotlin/tablesdb/create-line-column.md | 2 +- .../kotlin/tablesdb/create-point-column.md | 2 +- .../kotlin/tablesdb/create-polygon-column.md | 2 +- .../kotlin/tablesdb/update-line-column.md | 2 +- .../kotlin/tablesdb/update-point-column.md | 2 +- .../kotlin/tablesdb/update-polygon-column.md | 2 +- src/main/kotlin/io/appwrite/Client.kt | 4 ++-- src/main/kotlin/io/appwrite/Query.kt | 2 ++ src/main/kotlin/io/appwrite/models/Deployment.kt | 16 ++++++++-------- src/main/kotlin/io/appwrite/models/Execution.kt | 2 +- .../kotlin/io/appwrite/models/HealthAntivirus.kt | 2 +- .../kotlin/io/appwrite/models/HealthStatus.kt | 2 +- src/main/kotlin/io/appwrite/services/TablesDb.kt | 4 ++-- 32 files changed, 43 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 0aa839d9..84aa27a1 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ repositories { Next, add the dependency to your project's `build.gradle(.kts)` file: ```groovy -implementation("io.appwrite:sdk-for-kotlin:11.0.0") +implementation("io.appwrite:sdk-for-kotlin:11.1.0") ``` ### Maven @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-kotlin - 11.0.0 + 11.1.0 ``` diff --git a/docs/examples/java/databases/create-line-attribute.md b/docs/examples/java/databases/create-line-attribute.md index b8ff15a3..ad988b87 100644 --- a/docs/examples/java/databases/create-line-attribute.md +++ b/docs/examples/java/databases/create-line-attribute.md @@ -14,7 +14,7 @@ databases.createLineAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([1, 2], [3, 4], [5, 6]), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/create-point-attribute.md b/docs/examples/java/databases/create-point-attribute.md index f4064619..89d7cc71 100644 --- a/docs/examples/java/databases/create-point-attribute.md +++ b/docs/examples/java/databases/create-point-attribute.md @@ -14,7 +14,7 @@ databases.createPointAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf(1, 2), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/create-polygon-attribute.md b/docs/examples/java/databases/create-polygon-attribute.md index 2fc5e8b4..556fb384 100644 --- a/docs/examples/java/databases/create-polygon-attribute.md +++ b/docs/examples/java/databases/create-polygon-attribute.md @@ -14,7 +14,7 @@ databases.createPolygonAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/update-line-attribute.md b/docs/examples/java/databases/update-line-attribute.md index 3f410481..6a4265bb 100644 --- a/docs/examples/java/databases/update-line-attribute.md +++ b/docs/examples/java/databases/update-line-attribute.md @@ -14,7 +14,7 @@ databases.updateLineAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([1, 2], [3, 4], [5, 6]), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/update-point-attribute.md b/docs/examples/java/databases/update-point-attribute.md index 7a8cb2a8..38d48c27 100644 --- a/docs/examples/java/databases/update-point-attribute.md +++ b/docs/examples/java/databases/update-point-attribute.md @@ -14,7 +14,7 @@ databases.updatePointAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf(1, 2), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/update-polygon-attribute.md b/docs/examples/java/databases/update-polygon-attribute.md index 682e21d7..6e6fd085 100644 --- a/docs/examples/java/databases/update-polygon-attribute.md +++ b/docs/examples/java/databases/update-polygon-attribute.md @@ -14,7 +14,7 @@ databases.updatePolygonAttribute( "", // collectionId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/tablesdb/create-line-column.md b/docs/examples/java/tablesdb/create-line-column.md index 96a0381b..afe029eb 100644 --- a/docs/examples/java/tablesdb/create-line-column.md +++ b/docs/examples/java/tablesdb/create-line-column.md @@ -14,7 +14,7 @@ tablesDB.createLineColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([1, 2], [3, 4], [5, 6]), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/create-point-column.md b/docs/examples/java/tablesdb/create-point-column.md index 51c0e64d..2c9941b0 100644 --- a/docs/examples/java/tablesdb/create-point-column.md +++ b/docs/examples/java/tablesdb/create-point-column.md @@ -14,7 +14,7 @@ tablesDB.createPointColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf(1, 2), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/create-polygon-column.md b/docs/examples/java/tablesdb/create-polygon-column.md index e5a65026..58ca7983 100644 --- a/docs/examples/java/tablesdb/create-polygon-column.md +++ b/docs/examples/java/tablesdb/create-polygon-column.md @@ -14,7 +14,7 @@ tablesDB.createPolygonColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/update-line-column.md b/docs/examples/java/tablesdb/update-line-column.md index fbf151dd..4c65a907 100644 --- a/docs/examples/java/tablesdb/update-line-column.md +++ b/docs/examples/java/tablesdb/update-line-column.md @@ -14,7 +14,7 @@ tablesDB.updateLineColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([1, 2], [3, 4], [5, 6]), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/tablesdb/update-point-column.md b/docs/examples/java/tablesdb/update-point-column.md index f506e719..56ac86a6 100644 --- a/docs/examples/java/tablesdb/update-point-column.md +++ b/docs/examples/java/tablesdb/update-point-column.md @@ -14,7 +14,7 @@ tablesDB.updatePointColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf(1, 2), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/tablesdb/update-polygon-column.md b/docs/examples/java/tablesdb/update-polygon-column.md index e391aed8..189d4731 100644 --- a/docs/examples/java/tablesdb/update-polygon-column.md +++ b/docs/examples/java/tablesdb/update-polygon-column.md @@ -14,7 +14,7 @@ tablesDB.updatePolygonColumn( "", // tableId "", // key false, // required - listOf([1,2], [3, 4]), // default (optional) + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/kotlin/databases/create-line-attribute.md b/docs/examples/kotlin/databases/create-line-attribute.md index 1b196374..af9a4d24 100644 --- a/docs/examples/kotlin/databases/create-line-attribute.md +++ b/docs/examples/kotlin/databases/create-line-attribute.md @@ -14,5 +14,5 @@ val response = databases.createLineAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf([1, 2], [3, 4], [5, 6]) // optional ) diff --git a/docs/examples/kotlin/databases/create-point-attribute.md b/docs/examples/kotlin/databases/create-point-attribute.md index ed279445..04f095ee 100644 --- a/docs/examples/kotlin/databases/create-point-attribute.md +++ b/docs/examples/kotlin/databases/create-point-attribute.md @@ -14,5 +14,5 @@ val response = databases.createPointAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf(1, 2) // optional ) diff --git a/docs/examples/kotlin/databases/create-polygon-attribute.md b/docs/examples/kotlin/databases/create-polygon-attribute.md index 006c8e3c..ffeb3c43 100644 --- a/docs/examples/kotlin/databases/create-polygon-attribute.md +++ b/docs/examples/kotlin/databases/create-polygon-attribute.md @@ -14,5 +14,5 @@ val response = databases.createPolygonAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]) // optional ) diff --git a/docs/examples/kotlin/databases/update-line-attribute.md b/docs/examples/kotlin/databases/update-line-attribute.md index 3b5b78b5..0d6b40a2 100644 --- a/docs/examples/kotlin/databases/update-line-attribute.md +++ b/docs/examples/kotlin/databases/update-line-attribute.md @@ -14,6 +14,6 @@ val response = databases.updateLineAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf([1, 2], [3, 4], [5, 6]), // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/databases/update-point-attribute.md b/docs/examples/kotlin/databases/update-point-attribute.md index 2738fdbf..68d5311c 100644 --- a/docs/examples/kotlin/databases/update-point-attribute.md +++ b/docs/examples/kotlin/databases/update-point-attribute.md @@ -14,6 +14,6 @@ val response = databases.updatePointAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf(1, 2), // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/databases/update-polygon-attribute.md b/docs/examples/kotlin/databases/update-polygon-attribute.md index e2d97d8e..66bbdea1 100644 --- a/docs/examples/kotlin/databases/update-polygon-attribute.md +++ b/docs/examples/kotlin/databases/update-polygon-attribute.md @@ -14,6 +14,6 @@ val response = databases.updatePolygonAttribute( collectionId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/tablesdb/create-line-column.md b/docs/examples/kotlin/tablesdb/create-line-column.md index e867887d..3dd9ebd0 100644 --- a/docs/examples/kotlin/tablesdb/create-line-column.md +++ b/docs/examples/kotlin/tablesdb/create-line-column.md @@ -14,5 +14,5 @@ val response = tablesDB.createLineColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf([1, 2], [3, 4], [5, 6]) // optional ) diff --git a/docs/examples/kotlin/tablesdb/create-point-column.md b/docs/examples/kotlin/tablesdb/create-point-column.md index 6340b375..7fd6ad75 100644 --- a/docs/examples/kotlin/tablesdb/create-point-column.md +++ b/docs/examples/kotlin/tablesdb/create-point-column.md @@ -14,5 +14,5 @@ val response = tablesDB.createPointColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf(1, 2) // optional ) diff --git a/docs/examples/kotlin/tablesdb/create-polygon-column.md b/docs/examples/kotlin/tablesdb/create-polygon-column.md index d11c9549..218b4cba 100644 --- a/docs/examples/kotlin/tablesdb/create-polygon-column.md +++ b/docs/examples/kotlin/tablesdb/create-polygon-column.md @@ -14,5 +14,5 @@ val response = tablesDB.createPolygonColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]) // optional + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]) // optional ) diff --git a/docs/examples/kotlin/tablesdb/update-line-column.md b/docs/examples/kotlin/tablesdb/update-line-column.md index 9f6d976a..571d2520 100644 --- a/docs/examples/kotlin/tablesdb/update-line-column.md +++ b/docs/examples/kotlin/tablesdb/update-line-column.md @@ -14,6 +14,6 @@ val response = tablesDB.updateLineColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf([1, 2], [3, 4], [5, 6]), // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/tablesdb/update-point-column.md b/docs/examples/kotlin/tablesdb/update-point-column.md index 4d28299b..2230e59f 100644 --- a/docs/examples/kotlin/tablesdb/update-point-column.md +++ b/docs/examples/kotlin/tablesdb/update-point-column.md @@ -14,6 +14,6 @@ val response = tablesDB.updatePointColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf(1, 2), // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/tablesdb/update-polygon-column.md b/docs/examples/kotlin/tablesdb/update-polygon-column.md index 0599559b..db3a46bc 100644 --- a/docs/examples/kotlin/tablesdb/update-polygon-column.md +++ b/docs/examples/kotlin/tablesdb/update-polygon-column.md @@ -14,6 +14,6 @@ val response = tablesDB.updatePolygonColumn( tableId = "", key = "", required = false, - default = listOf([1,2], [3, 4]), // optional + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // optional newKey = "" // optional ) diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt index f5d1c6f0..2caf2531 100644 --- a/src/main/kotlin/io/appwrite/Client.kt +++ b/src/main/kotlin/io/appwrite/Client.kt @@ -58,11 +58,11 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "user-agent" to "AppwriteKotlinSDK/11.0.0 ${System.getProperty("http.agent")}", + "user-agent" to "AppwriteKotlinSDK/11.1.0 ${System.getProperty("http.agent")}", "x-sdk-name" to "Kotlin", "x-sdk-platform" to "server", "x-sdk-language" to "kotlin", - "x-sdk-version" to "11.0.0", + "x-sdk-version" to "11.1.0", "x-appwrite-response-format" to "1.8.0", ) diff --git a/src/main/kotlin/io/appwrite/Query.kt b/src/main/kotlin/io/appwrite/Query.kt index 2a544394..717425cb 100644 --- a/src/main/kotlin/io/appwrite/Query.kt +++ b/src/main/kotlin/io/appwrite/Query.kt @@ -41,6 +41,8 @@ class Query( fun orderDesc(attribute: String) = Query("orderDesc", attribute).toJson() + fun orderRandom() = Query("orderRandom").toJson() + fun cursorBefore(documentId: String) = Query("cursorBefore", null, listOf(documentId)).toJson() fun cursorAfter(documentId: String) = Query("cursorAfter", null, listOf(documentId)).toJson() diff --git a/src/main/kotlin/io/appwrite/models/Deployment.kt b/src/main/kotlin/io/appwrite/models/Deployment.kt index 9edb6542..4c32b31b 100644 --- a/src/main/kotlin/io/appwrite/models/Deployment.kt +++ b/src/main/kotlin/io/appwrite/models/Deployment.kt @@ -127,12 +127,6 @@ data class Deployment( @SerializedName("providerRepositoryUrl") val providerRepositoryUrl: String, - /** - * The branch of the vcs repository - */ - @SerializedName("providerBranch") - val providerBranch: String, - /** * The commit hash of the vcs commit */ @@ -163,6 +157,12 @@ data class Deployment( @SerializedName("providerCommitUrl") val providerCommitUrl: String, + /** + * The branch of the vcs repository + */ + @SerializedName("providerBranch") + val providerBranch: String, + /** * The branch of the vcs repository */ @@ -191,12 +191,12 @@ data class Deployment( "providerRepositoryName" to providerRepositoryName as Any, "providerRepositoryOwner" to providerRepositoryOwner as Any, "providerRepositoryUrl" to providerRepositoryUrl as Any, - "providerBranch" to providerBranch as Any, "providerCommitHash" to providerCommitHash as Any, "providerCommitAuthorUrl" to providerCommitAuthorUrl as Any, "providerCommitAuthor" to providerCommitAuthor as Any, "providerCommitMessage" to providerCommitMessage as Any, "providerCommitUrl" to providerCommitUrl as Any, + "providerBranch" to providerBranch as Any, "providerBranchUrl" to providerBranchUrl as Any, ) @@ -226,12 +226,12 @@ data class Deployment( providerRepositoryName = map["providerRepositoryName"] as String, providerRepositoryOwner = map["providerRepositoryOwner"] as String, providerRepositoryUrl = map["providerRepositoryUrl"] as String, - providerBranch = map["providerBranch"] as String, providerCommitHash = map["providerCommitHash"] as String, providerCommitAuthorUrl = map["providerCommitAuthorUrl"] as String, providerCommitAuthor = map["providerCommitAuthor"] as String, providerCommitMessage = map["providerCommitMessage"] as String, providerCommitUrl = map["providerCommitUrl"] as String, + providerBranch = map["providerBranch"] as String, providerBranchUrl = map["providerBranchUrl"] as String, ) } diff --git a/src/main/kotlin/io/appwrite/models/Execution.kt b/src/main/kotlin/io/appwrite/models/Execution.kt index 8b395c66..3d71082b 100644 --- a/src/main/kotlin/io/appwrite/models/Execution.kt +++ b/src/main/kotlin/io/appwrite/models/Execution.kt @@ -68,7 +68,7 @@ data class Execution( val requestPath: String, /** - * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. */ @SerializedName("requestHeaders") val requestHeaders: List, diff --git a/src/main/kotlin/io/appwrite/models/HealthAntivirus.kt b/src/main/kotlin/io/appwrite/models/HealthAntivirus.kt index 3fe33909..070a5ca3 100644 --- a/src/main/kotlin/io/appwrite/models/HealthAntivirus.kt +++ b/src/main/kotlin/io/appwrite/models/HealthAntivirus.kt @@ -14,7 +14,7 @@ data class HealthAntivirus( val version: String, /** - * Antivirus status. Possible values can are: `disabled`, `offline`, `online` + * Antivirus status. Possible values are: `disabled`, `offline`, `online` */ @SerializedName("status") val status: String, diff --git a/src/main/kotlin/io/appwrite/models/HealthStatus.kt b/src/main/kotlin/io/appwrite/models/HealthStatus.kt index 6d0815d3..ad309e52 100644 --- a/src/main/kotlin/io/appwrite/models/HealthStatus.kt +++ b/src/main/kotlin/io/appwrite/models/HealthStatus.kt @@ -20,7 +20,7 @@ data class HealthStatus( val ping: Long, /** - * Service status. Possible values can are: `pass`, `fail` + * Service status. Possible values are: `pass`, `fail` */ @SerializedName("status") val status: String, diff --git a/src/main/kotlin/io/appwrite/services/TablesDb.kt b/src/main/kotlin/io/appwrite/services/TablesDb.kt index f4255988..855901f5 100644 --- a/src/main/kotlin/io/appwrite/services/TablesDb.kt +++ b/src/main/kotlin/io/appwrite/services/TablesDb.kt @@ -2041,7 +2041,7 @@ class TablesDB(client: Client) : Service(client) { * * @param databaseId Database ID. * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. - * @param rows Array of documents data as JSON objects. + * @param rows Array of rows data as JSON objects. * @return [io.appwrite.models.RowList] */ @Throws(AppwriteException::class) @@ -2079,7 +2079,7 @@ class TablesDB(client: Client) : Service(client) { * * @param databaseId Database ID. * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. - * @param rows Array of documents data as JSON objects. + * @param rows Array of rows data as JSON objects. * @return [io.appwrite.models.RowList] */ @Throws(AppwriteException::class)