From 254b949c9489dab8277db2f14f6f8c62b4f56470 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 Mar 2026 13:12:23 +0000 Subject: [PATCH 1/8] feat: update Kotlin SDK to 15.0.0 * Breaking: Renamed `IndexType` to `DatabasesIndexType` in docs. * Breaking: Replaced `.setKey()` with `.setSession()` in docs examples. * Added: Added `DocumentsDB` service with document management methods. * Updated: Updated docs to reflect new `DatabasesIndexType` and `DocumentsDB` examples. --- CHANGELOG.md | 12 +- README.md | 6 +- docs/examples/java/databases/create-index.md | 4 +- .../java/databases/upsert-documents.md | 2 +- .../java/documentsdb/create-collection.md | 34 + .../java/documentsdb/create-document.md | 37 + .../java/documentsdb/create-documents.md | 27 + .../examples/java/documentsdb/create-index.md | 33 + .../java/documentsdb/create-operations.md | 34 + .../java/documentsdb/create-transaction.md | 25 + docs/examples/java/documentsdb/create.md | 27 + .../decrement-document-attribute.md | 31 + .../java/documentsdb/delete-collection.md | 26 + .../java/documentsdb/delete-document.md | 28 + .../java/documentsdb/delete-documents.md | 28 + .../examples/java/documentsdb/delete-index.md | 27 + .../java/documentsdb/delete-transaction.md | 25 + docs/examples/java/documentsdb/delete.md | 25 + .../java/documentsdb/get-collection.md | 26 + .../examples/java/documentsdb/get-document.md | 29 + docs/examples/java/documentsdb/get-index.md | 27 + .../java/documentsdb/get-transaction.md | 25 + docs/examples/java/documentsdb/get.md | 25 + .../increment-document-attribute.md | 31 + .../java/documentsdb/list-collections.md | 28 + .../java/documentsdb/list-documents.md | 30 + .../examples/java/documentsdb/list-indexes.md | 28 + .../java/documentsdb/list-transactions.md | 25 + docs/examples/java/documentsdb/list.md | 27 + .../java/documentsdb/update-collection.md | 32 + .../java/documentsdb/update-document.md | 32 + .../java/documentsdb/update-documents.md | 29 + .../java/documentsdb/update-transaction.md | 27 + docs/examples/java/documentsdb/update.md | 27 + .../java/documentsdb/upsert-document.md | 32 + .../java/documentsdb/upsert-documents.md | 28 + docs/examples/java/functions/create.md | 4 +- docs/examples/java/functions/update.md | 4 +- docs/examples/java/project/create-variable.md | 28 + docs/examples/java/project/delete-variable.md | 25 + docs/examples/java/project/get-variable.md | 25 + docs/examples/java/project/list-variables.md | 26 + docs/examples/java/project/update-variable.md | 28 + docs/examples/java/sites/create.md | 5 +- docs/examples/java/sites/update.md | 5 +- docs/examples/java/tablesdb/create-index.md | 4 +- .../java/users/update-impersonator.md | 26 + .../java/vectorsdb/create-collection.md | 33 + .../java/vectorsdb/create-document.md | 36 + .../java/vectorsdb/create-documents.md | 27 + docs/examples/java/vectorsdb/create-index.md | 33 + .../java/vectorsdb/create-operations.md | 34 + .../java/vectorsdb/create-text-embeddings.md | 27 + .../java/vectorsdb/create-transaction.md | 25 + docs/examples/java/vectorsdb/create.md | 27 + .../java/vectorsdb/delete-collection.md | 26 + .../java/vectorsdb/delete-document.md | 28 + .../java/vectorsdb/delete-documents.md | 28 + docs/examples/java/vectorsdb/delete-index.md | 27 + .../java/vectorsdb/delete-transaction.md | 25 + docs/examples/java/vectorsdb/delete.md | 25 + .../examples/java/vectorsdb/get-collection.md | 26 + docs/examples/java/vectorsdb/get-document.md | 29 + docs/examples/java/vectorsdb/get-index.md | 27 + .../java/vectorsdb/get-transaction.md | 25 + docs/examples/java/vectorsdb/get.md | 25 + .../java/vectorsdb/list-collections.md | 28 + .../examples/java/vectorsdb/list-documents.md | 30 + docs/examples/java/vectorsdb/list-indexes.md | 28 + .../java/vectorsdb/list-transactions.md | 25 + docs/examples/java/vectorsdb/list.md | 27 + .../java/vectorsdb/update-collection.md | 33 + .../java/vectorsdb/update-document.md | 32 + .../java/vectorsdb/update-documents.md | 29 + .../java/vectorsdb/update-transaction.md | 27 + docs/examples/java/vectorsdb/update.md | 27 + .../java/vectorsdb/upsert-document.md | 32 + .../java/vectorsdb/upsert-documents.md | 28 + docs/examples/java/webhooks/create.md | 32 + docs/examples/java/webhooks/delete.md | 25 + docs/examples/java/webhooks/get.md | 25 + docs/examples/java/webhooks/list.md | 26 + .../java/webhooks/update-signature.md | 25 + docs/examples/java/webhooks/update.md | 32 + .../examples/kotlin/databases/create-index.md | 4 +- .../kotlin/databases/upsert-documents.md | 2 +- .../kotlin/documentsdb/create-collection.md | 25 + .../kotlin/documentsdb/create-document.md | 28 + .../kotlin/documentsdb/create-documents.md | 18 + .../kotlin/documentsdb/create-index.md | 24 + .../kotlin/documentsdb/create-operations.md | 25 + .../kotlin/documentsdb/create-transaction.md | 16 + docs/examples/kotlin/documentsdb/create.md | 18 + .../decrement-document-attribute.md | 22 + .../kotlin/documentsdb/delete-collection.md | 17 + .../kotlin/documentsdb/delete-document.md | 19 + .../kotlin/documentsdb/delete-documents.md | 19 + .../kotlin/documentsdb/delete-index.md | 18 + .../kotlin/documentsdb/delete-transaction.md | 16 + docs/examples/kotlin/documentsdb/delete.md | 16 + .../kotlin/documentsdb/get-collection.md | 17 + .../kotlin/documentsdb/get-document.md | 20 + docs/examples/kotlin/documentsdb/get-index.md | 18 + .../kotlin/documentsdb/get-transaction.md | 16 + docs/examples/kotlin/documentsdb/get.md | 16 + .../increment-document-attribute.md | 22 + .../kotlin/documentsdb/list-collections.md | 19 + .../kotlin/documentsdb/list-documents.md | 21 + .../kotlin/documentsdb/list-indexes.md | 19 + .../kotlin/documentsdb/list-transactions.md | 16 + docs/examples/kotlin/documentsdb/list.md | 18 + .../kotlin/documentsdb/update-collection.md | 23 + .../kotlin/documentsdb/update-document.md | 23 + .../kotlin/documentsdb/update-documents.md | 20 + .../kotlin/documentsdb/update-transaction.md | 18 + docs/examples/kotlin/documentsdb/update.md | 18 + .../kotlin/documentsdb/upsert-document.md | 23 + .../kotlin/documentsdb/upsert-documents.md | 19 + docs/examples/kotlin/functions/create.md | 4 +- docs/examples/kotlin/functions/update.md | 4 +- .../kotlin/project/create-variable.md | 19 + .../kotlin/project/delete-variable.md | 16 + docs/examples/kotlin/project/get-variable.md | 16 + .../examples/kotlin/project/list-variables.md | 17 + .../kotlin/project/update-variable.md | 19 + docs/examples/kotlin/sites/create.md | 5 +- docs/examples/kotlin/sites/update.md | 5 +- docs/examples/kotlin/tablesdb/create-index.md | 4 +- .../kotlin/users/update-impersonator.md | 17 + .../kotlin/vectorsdb/create-collection.md | 24 + .../kotlin/vectorsdb/create-document.md | 27 + .../kotlin/vectorsdb/create-documents.md | 18 + .../examples/kotlin/vectorsdb/create-index.md | 24 + .../kotlin/vectorsdb/create-operations.md | 25 + .../vectorsdb/create-text-embeddings.md | 18 + .../kotlin/vectorsdb/create-transaction.md | 16 + docs/examples/kotlin/vectorsdb/create.md | 18 + .../kotlin/vectorsdb/delete-collection.md | 17 + .../kotlin/vectorsdb/delete-document.md | 19 + .../kotlin/vectorsdb/delete-documents.md | 19 + .../examples/kotlin/vectorsdb/delete-index.md | 18 + .../kotlin/vectorsdb/delete-transaction.md | 16 + docs/examples/kotlin/vectorsdb/delete.md | 16 + .../kotlin/vectorsdb/get-collection.md | 17 + .../examples/kotlin/vectorsdb/get-document.md | 20 + docs/examples/kotlin/vectorsdb/get-index.md | 18 + .../kotlin/vectorsdb/get-transaction.md | 16 + docs/examples/kotlin/vectorsdb/get.md | 16 + .../kotlin/vectorsdb/list-collections.md | 19 + .../kotlin/vectorsdb/list-documents.md | 21 + .../examples/kotlin/vectorsdb/list-indexes.md | 19 + .../kotlin/vectorsdb/list-transactions.md | 16 + docs/examples/kotlin/vectorsdb/list.md | 18 + .../kotlin/vectorsdb/update-collection.md | 24 + .../kotlin/vectorsdb/update-document.md | 23 + .../kotlin/vectorsdb/update-documents.md | 20 + .../kotlin/vectorsdb/update-transaction.md | 18 + docs/examples/kotlin/vectorsdb/update.md | 18 + .../kotlin/vectorsdb/upsert-document.md | 23 + .../kotlin/vectorsdb/upsert-documents.md | 19 + docs/examples/kotlin/webhooks/create.md | 23 + docs/examples/kotlin/webhooks/delete.md | 16 + docs/examples/kotlin/webhooks/get.md | 16 + docs/examples/kotlin/webhooks/list.md | 17 + .../kotlin/webhooks/update-signature.md | 16 + docs/examples/kotlin/webhooks/update.md | 23 + src/main/kotlin/io/appwrite/Client.kt | 51 +- .../io/appwrite/enums/BackupServices.kt | 6 + .../kotlin/io/appwrite/enums/BuildRuntime.kt | 174 +- .../kotlin/io/appwrite/enums/DatabaseType.kt | 6 +- .../io/appwrite/enums/DatabasesIndexType.kt | 16 + .../io/appwrite/enums/DocumentsDBIndexType.kt | 16 + src/main/kotlin/io/appwrite/enums/Model.kt | 10 + src/main/kotlin/io/appwrite/enums/Runtime.kt | 174 +- src/main/kotlin/io/appwrite/enums/Scopes.kt | 8 + .../{IndexType.kt => TablesDBIndexType.kt} | 2 +- .../io/appwrite/enums/VectorsDBIndexType.kt | 20 + .../io/appwrite/models/AttributeObject.kt | 87 + .../io/appwrite/models/AttributeVector.kt | 95 + .../kotlin/io/appwrite/models/Document.kt | 6 +- .../kotlin/io/appwrite/models/Embedding.kt | 54 + .../io/appwrite/models/EmbeddingList.kt | 38 + .../kotlin/io/appwrite/models/Function.kt | 26 +- src/main/kotlin/io/appwrite/models/Log.kt | 6 +- src/main/kotlin/io/appwrite/models/Row.kt | 6 +- src/main/kotlin/io/appwrite/models/Site.kt | 34 +- src/main/kotlin/io/appwrite/models/User.kt | 20 + .../io/appwrite/models/VectorsdbCollection.kt | 126 ++ .../models/VectorsdbCollectionList.kt | 38 + src/main/kotlin/io/appwrite/models/Webhook.kt | 126 ++ .../kotlin/io/appwrite/models/WebhookList.kt | 38 + .../kotlin/io/appwrite/services/Databases.kt | 2 +- .../io/appwrite/services/DocumentsDB.kt | 1588 +++++++++++++++++ .../kotlin/io/appwrite/services/Functions.kt | 24 +- .../kotlin/io/appwrite/services/Project.kt | 189 ++ src/main/kotlin/io/appwrite/services/Sites.kt | 30 +- .../kotlin/io/appwrite/services/TablesDB.kt | 2 +- src/main/kotlin/io/appwrite/services/Users.kt | 58 +- .../kotlin/io/appwrite/services/VectorsDB.kt | 1451 +++++++++++++++ .../kotlin/io/appwrite/services/Webhooks.kt | 244 +++ 200 files changed, 8334 insertions(+), 70 deletions(-) create mode 100644 docs/examples/java/documentsdb/create-collection.md create mode 100644 docs/examples/java/documentsdb/create-document.md create mode 100644 docs/examples/java/documentsdb/create-documents.md create mode 100644 docs/examples/java/documentsdb/create-index.md create mode 100644 docs/examples/java/documentsdb/create-operations.md create mode 100644 docs/examples/java/documentsdb/create-transaction.md create mode 100644 docs/examples/java/documentsdb/create.md create mode 100644 docs/examples/java/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/java/documentsdb/delete-collection.md create mode 100644 docs/examples/java/documentsdb/delete-document.md create mode 100644 docs/examples/java/documentsdb/delete-documents.md create mode 100644 docs/examples/java/documentsdb/delete-index.md create mode 100644 docs/examples/java/documentsdb/delete-transaction.md create mode 100644 docs/examples/java/documentsdb/delete.md create mode 100644 docs/examples/java/documentsdb/get-collection.md create mode 100644 docs/examples/java/documentsdb/get-document.md create mode 100644 docs/examples/java/documentsdb/get-index.md create mode 100644 docs/examples/java/documentsdb/get-transaction.md create mode 100644 docs/examples/java/documentsdb/get.md create mode 100644 docs/examples/java/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/java/documentsdb/list-collections.md create mode 100644 docs/examples/java/documentsdb/list-documents.md create mode 100644 docs/examples/java/documentsdb/list-indexes.md create mode 100644 docs/examples/java/documentsdb/list-transactions.md create mode 100644 docs/examples/java/documentsdb/list.md create mode 100644 docs/examples/java/documentsdb/update-collection.md create mode 100644 docs/examples/java/documentsdb/update-document.md create mode 100644 docs/examples/java/documentsdb/update-documents.md create mode 100644 docs/examples/java/documentsdb/update-transaction.md create mode 100644 docs/examples/java/documentsdb/update.md create mode 100644 docs/examples/java/documentsdb/upsert-document.md create mode 100644 docs/examples/java/documentsdb/upsert-documents.md create mode 100644 docs/examples/java/project/create-variable.md create mode 100644 docs/examples/java/project/delete-variable.md create mode 100644 docs/examples/java/project/get-variable.md create mode 100644 docs/examples/java/project/list-variables.md create mode 100644 docs/examples/java/project/update-variable.md create mode 100644 docs/examples/java/users/update-impersonator.md create mode 100644 docs/examples/java/vectorsdb/create-collection.md create mode 100644 docs/examples/java/vectorsdb/create-document.md create mode 100644 docs/examples/java/vectorsdb/create-documents.md create mode 100644 docs/examples/java/vectorsdb/create-index.md create mode 100644 docs/examples/java/vectorsdb/create-operations.md create mode 100644 docs/examples/java/vectorsdb/create-text-embeddings.md create mode 100644 docs/examples/java/vectorsdb/create-transaction.md create mode 100644 docs/examples/java/vectorsdb/create.md create mode 100644 docs/examples/java/vectorsdb/delete-collection.md create mode 100644 docs/examples/java/vectorsdb/delete-document.md create mode 100644 docs/examples/java/vectorsdb/delete-documents.md create mode 100644 docs/examples/java/vectorsdb/delete-index.md create mode 100644 docs/examples/java/vectorsdb/delete-transaction.md create mode 100644 docs/examples/java/vectorsdb/delete.md create mode 100644 docs/examples/java/vectorsdb/get-collection.md create mode 100644 docs/examples/java/vectorsdb/get-document.md create mode 100644 docs/examples/java/vectorsdb/get-index.md create mode 100644 docs/examples/java/vectorsdb/get-transaction.md create mode 100644 docs/examples/java/vectorsdb/get.md create mode 100644 docs/examples/java/vectorsdb/list-collections.md create mode 100644 docs/examples/java/vectorsdb/list-documents.md create mode 100644 docs/examples/java/vectorsdb/list-indexes.md create mode 100644 docs/examples/java/vectorsdb/list-transactions.md create mode 100644 docs/examples/java/vectorsdb/list.md create mode 100644 docs/examples/java/vectorsdb/update-collection.md create mode 100644 docs/examples/java/vectorsdb/update-document.md create mode 100644 docs/examples/java/vectorsdb/update-documents.md create mode 100644 docs/examples/java/vectorsdb/update-transaction.md create mode 100644 docs/examples/java/vectorsdb/update.md create mode 100644 docs/examples/java/vectorsdb/upsert-document.md create mode 100644 docs/examples/java/vectorsdb/upsert-documents.md create mode 100644 docs/examples/java/webhooks/create.md create mode 100644 docs/examples/java/webhooks/delete.md create mode 100644 docs/examples/java/webhooks/get.md create mode 100644 docs/examples/java/webhooks/list.md create mode 100644 docs/examples/java/webhooks/update-signature.md create mode 100644 docs/examples/java/webhooks/update.md create mode 100644 docs/examples/kotlin/documentsdb/create-collection.md create mode 100644 docs/examples/kotlin/documentsdb/create-document.md create mode 100644 docs/examples/kotlin/documentsdb/create-documents.md create mode 100644 docs/examples/kotlin/documentsdb/create-index.md create mode 100644 docs/examples/kotlin/documentsdb/create-operations.md create mode 100644 docs/examples/kotlin/documentsdb/create-transaction.md create mode 100644 docs/examples/kotlin/documentsdb/create.md create mode 100644 docs/examples/kotlin/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/kotlin/documentsdb/delete-collection.md create mode 100644 docs/examples/kotlin/documentsdb/delete-document.md create mode 100644 docs/examples/kotlin/documentsdb/delete-documents.md create mode 100644 docs/examples/kotlin/documentsdb/delete-index.md create mode 100644 docs/examples/kotlin/documentsdb/delete-transaction.md create mode 100644 docs/examples/kotlin/documentsdb/delete.md create mode 100644 docs/examples/kotlin/documentsdb/get-collection.md create mode 100644 docs/examples/kotlin/documentsdb/get-document.md create mode 100644 docs/examples/kotlin/documentsdb/get-index.md create mode 100644 docs/examples/kotlin/documentsdb/get-transaction.md create mode 100644 docs/examples/kotlin/documentsdb/get.md create mode 100644 docs/examples/kotlin/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/kotlin/documentsdb/list-collections.md create mode 100644 docs/examples/kotlin/documentsdb/list-documents.md create mode 100644 docs/examples/kotlin/documentsdb/list-indexes.md create mode 100644 docs/examples/kotlin/documentsdb/list-transactions.md create mode 100644 docs/examples/kotlin/documentsdb/list.md create mode 100644 docs/examples/kotlin/documentsdb/update-collection.md create mode 100644 docs/examples/kotlin/documentsdb/update-document.md create mode 100644 docs/examples/kotlin/documentsdb/update-documents.md create mode 100644 docs/examples/kotlin/documentsdb/update-transaction.md create mode 100644 docs/examples/kotlin/documentsdb/update.md create mode 100644 docs/examples/kotlin/documentsdb/upsert-document.md create mode 100644 docs/examples/kotlin/documentsdb/upsert-documents.md create mode 100644 docs/examples/kotlin/project/create-variable.md create mode 100644 docs/examples/kotlin/project/delete-variable.md create mode 100644 docs/examples/kotlin/project/get-variable.md create mode 100644 docs/examples/kotlin/project/list-variables.md create mode 100644 docs/examples/kotlin/project/update-variable.md create mode 100644 docs/examples/kotlin/users/update-impersonator.md create mode 100644 docs/examples/kotlin/vectorsdb/create-collection.md create mode 100644 docs/examples/kotlin/vectorsdb/create-document.md create mode 100644 docs/examples/kotlin/vectorsdb/create-documents.md create mode 100644 docs/examples/kotlin/vectorsdb/create-index.md create mode 100644 docs/examples/kotlin/vectorsdb/create-operations.md create mode 100644 docs/examples/kotlin/vectorsdb/create-text-embeddings.md create mode 100644 docs/examples/kotlin/vectorsdb/create-transaction.md create mode 100644 docs/examples/kotlin/vectorsdb/create.md create mode 100644 docs/examples/kotlin/vectorsdb/delete-collection.md create mode 100644 docs/examples/kotlin/vectorsdb/delete-document.md create mode 100644 docs/examples/kotlin/vectorsdb/delete-documents.md create mode 100644 docs/examples/kotlin/vectorsdb/delete-index.md create mode 100644 docs/examples/kotlin/vectorsdb/delete-transaction.md create mode 100644 docs/examples/kotlin/vectorsdb/delete.md create mode 100644 docs/examples/kotlin/vectorsdb/get-collection.md create mode 100644 docs/examples/kotlin/vectorsdb/get-document.md create mode 100644 docs/examples/kotlin/vectorsdb/get-index.md create mode 100644 docs/examples/kotlin/vectorsdb/get-transaction.md create mode 100644 docs/examples/kotlin/vectorsdb/get.md create mode 100644 docs/examples/kotlin/vectorsdb/list-collections.md create mode 100644 docs/examples/kotlin/vectorsdb/list-documents.md create mode 100644 docs/examples/kotlin/vectorsdb/list-indexes.md create mode 100644 docs/examples/kotlin/vectorsdb/list-transactions.md create mode 100644 docs/examples/kotlin/vectorsdb/list.md create mode 100644 docs/examples/kotlin/vectorsdb/update-collection.md create mode 100644 docs/examples/kotlin/vectorsdb/update-document.md create mode 100644 docs/examples/kotlin/vectorsdb/update-documents.md create mode 100644 docs/examples/kotlin/vectorsdb/update-transaction.md create mode 100644 docs/examples/kotlin/vectorsdb/update.md create mode 100644 docs/examples/kotlin/vectorsdb/upsert-document.md create mode 100644 docs/examples/kotlin/vectorsdb/upsert-documents.md create mode 100644 docs/examples/kotlin/webhooks/create.md create mode 100644 docs/examples/kotlin/webhooks/delete.md create mode 100644 docs/examples/kotlin/webhooks/get.md create mode 100644 docs/examples/kotlin/webhooks/list.md create mode 100644 docs/examples/kotlin/webhooks/update-signature.md create mode 100644 docs/examples/kotlin/webhooks/update.md create mode 100644 src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt create mode 100644 src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt create mode 100644 src/main/kotlin/io/appwrite/enums/Model.kt rename src/main/kotlin/io/appwrite/enums/{IndexType.kt => TablesDBIndexType.kt} (86%) create mode 100644 src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt create mode 100644 src/main/kotlin/io/appwrite/models/AttributeObject.kt create mode 100644 src/main/kotlin/io/appwrite/models/AttributeVector.kt create mode 100644 src/main/kotlin/io/appwrite/models/Embedding.kt create mode 100644 src/main/kotlin/io/appwrite/models/EmbeddingList.kt create mode 100644 src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt create mode 100644 src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt create mode 100644 src/main/kotlin/io/appwrite/models/Webhook.kt create mode 100644 src/main/kotlin/io/appwrite/models/WebhookList.kt create mode 100644 src/main/kotlin/io/appwrite/services/DocumentsDB.kt create mode 100644 src/main/kotlin/io/appwrite/services/Project.kt create mode 100644 src/main/kotlin/io/appwrite/services/VectorsDB.kt create mode 100644 src/main/kotlin/io/appwrite/services/Webhooks.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index afd1c28..5c25b40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,11 @@ # Change Log -## 14.1.0 +## 15.0.0 -* Added getConsolePausing health status endpoint -* Added `ttl` parameter for cached list results (0-86400s) -* Added optional `activate` parameter to Sites.createDeployment -* Updated Document and Row sequence ID descriptions -* Updated Databases docs to refer to collections, not tables -* Added deprecated updateRelationshipAttribute public API; use TablesDB.updateRelationshipColumn instead +* Breaking: Renamed `IndexType` to `DatabasesIndexType` in docs. +* Breaking: Replaced `.setKey()` with `.setSession()` in docs examples. +* Added: Added `DocumentsDB` service with document management methods. +* Updated: Updated docs to reflect new `DatabasesIndexType` and `DocumentsDB` examples. ## 14.0.1 diff --git a/README.md b/README.md index fc72244..6815572 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square) ![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) @@ -39,7 +39,7 @@ repositories { Next, add the dependency to your project's `build.gradle(.kts)` file: ```groovy -implementation("io.appwrite:sdk-for-kotlin:14.1.0") +implementation("io.appwrite:sdk-for-kotlin:15.0.0") ``` ### Maven @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-kotlin - 14.1.0 + 15.0.0 ``` diff --git a/docs/examples/java/databases/create-index.md b/docs/examples/java/databases/create-index.md index 5dc2222..28a10ca 100644 --- a/docs/examples/java/databases/create-index.md +++ b/docs/examples/java/databases/create-index.md @@ -2,7 +2,7 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; -import io.appwrite.enums.IndexType; +import io.appwrite.enums.DatabasesIndexType; import io.appwrite.enums.OrderBy; Client client = new Client() @@ -16,7 +16,7 @@ databases.createIndex( "", // databaseId "", // collectionId "", // key - IndexType.KEY, // type + DatabasesIndexType.KEY, // type List.of(), // attributes List.of(OrderBy.ASC), // orders (optional) List.of(), // lengths (optional) diff --git a/docs/examples/java/databases/upsert-documents.md b/docs/examples/java/databases/upsert-documents.md index 80e3862..eec131b 100644 --- a/docs/examples/java/databases/upsert-documents.md +++ b/docs/examples/java/databases/upsert-documents.md @@ -6,7 +6,7 @@ import io.appwrite.services.Databases; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID - .setKey(""); // Your secret API key + .setSession(""); // The user session to authenticate with Databases databases = new Databases(client); diff --git a/docs/examples/java/documentsdb/create-collection.md b/docs/examples/java/documentsdb/create-collection.md new file mode 100644 index 0000000..306abf6 --- /dev/null +++ b/docs/examples/java/documentsdb/create-collection.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createCollection( + "", // databaseId + "", // collectionId + "", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + List.of(), // attributes (optional) + List.of(), // indexes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create-document.md b/docs/examples/java/documentsdb/create-document.md new file mode 100644 index 0000000..d4ba188 --- /dev/null +++ b/docs/examples/java/documentsdb/create-document.md @@ -0,0 +1,37 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create-documents.md b/docs/examples/java/documentsdb/create-documents.md new file mode 100644 index 0000000..6cc3e44 --- /dev/null +++ b/docs/examples/java/documentsdb/create-documents.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create-index.md b/docs/examples/java/documentsdb/create-index.md new file mode 100644 index 0000000..95a2363 --- /dev/null +++ b/docs/examples/java/documentsdb/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; +import io.appwrite.enums.DocumentsDBIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createIndex( + "", // databaseId + "", // collectionId + "", // key + DocumentsDBIndexType.KEY, // type + List.of(), // attributes + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create-operations.md b/docs/examples/java/documentsdb/create-operations.md new file mode 100644 index 0000000..b7dc488 --- /dev/null +++ b/docs/examples/java/documentsdb/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create-transaction.md b/docs/examples/java/documentsdb/create-transaction.md new file mode 100644 index 0000000..1cd52e5 --- /dev/null +++ b/docs/examples/java/documentsdb/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/create.md b/docs/examples/java/documentsdb/create.md new file mode 100644 index 0000000..8c433fe --- /dev/null +++ b/docs/examples/java/documentsdb/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.create( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/decrement-document-attribute.md b/docs/examples/java/documentsdb/decrement-document-attribute.md new file mode 100644 index 0000000..640eccf --- /dev/null +++ b/docs/examples/java/documentsdb/decrement-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete-collection.md b/docs/examples/java/documentsdb/delete-collection.md new file mode 100644 index 0000000..6953b7e --- /dev/null +++ b/docs/examples/java/documentsdb/delete-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteCollection( + "", // databaseId + "", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete-document.md b/docs/examples/java/documentsdb/delete-document.md new file mode 100644 index 0000000..4cda79c --- /dev/null +++ b/docs/examples/java/documentsdb/delete-document.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete-documents.md b/docs/examples/java/documentsdb/delete-documents.md new file mode 100644 index 0000000..38acb98 --- /dev/null +++ b/docs/examples/java/documentsdb/delete-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete-index.md b/docs/examples/java/documentsdb/delete-index.md new file mode 100644 index 0000000..a86ce3a --- /dev/null +++ b/docs/examples/java/documentsdb/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteIndex( + "", // databaseId + "", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete-transaction.md b/docs/examples/java/documentsdb/delete-transaction.md new file mode 100644 index 0000000..e7f4252 --- /dev/null +++ b/docs/examples/java/documentsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/delete.md b/docs/examples/java/documentsdb/delete.md new file mode 100644 index 0000000..31c3dd8 --- /dev/null +++ b/docs/examples/java/documentsdb/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.delete( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/get-collection.md b/docs/examples/java/documentsdb/get-collection.md new file mode 100644 index 0000000..8622d6c --- /dev/null +++ b/docs/examples/java/documentsdb/get-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getCollection( + "", // databaseId + "", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/get-document.md b/docs/examples/java/documentsdb/get-document.md new file mode 100644 index 0000000..0e75f98 --- /dev/null +++ b/docs/examples/java/documentsdb/get-document.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/get-index.md b/docs/examples/java/documentsdb/get-index.md new file mode 100644 index 0000000..f387418 --- /dev/null +++ b/docs/examples/java/documentsdb/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getIndex( + "", // databaseId + "", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/get-transaction.md b/docs/examples/java/documentsdb/get-transaction.md new file mode 100644 index 0000000..e377bf0 --- /dev/null +++ b/docs/examples/java/documentsdb/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/get.md b/docs/examples/java/documentsdb/get.md new file mode 100644 index 0000000..6aba548 --- /dev/null +++ b/docs/examples/java/documentsdb/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.get( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/increment-document-attribute.md b/docs/examples/java/documentsdb/increment-document-attribute.md new file mode 100644 index 0000000..096a495 --- /dev/null +++ b/docs/examples/java/documentsdb/increment-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/list-collections.md b/docs/examples/java/documentsdb/list-collections.md new file mode 100644 index 0000000..bca8249 --- /dev/null +++ b/docs/examples/java/documentsdb/list-collections.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listCollections( + "", // databaseId + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/list-documents.md b/docs/examples/java/documentsdb/list-documents.md new file mode 100644 index 0000000..8cbcd8a --- /dev/null +++ b/docs/examples/java/documentsdb/list-documents.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/list-indexes.md b/docs/examples/java/documentsdb/list-indexes.md new file mode 100644 index 0000000..9544488 --- /dev/null +++ b/docs/examples/java/documentsdb/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listIndexes( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/list-transactions.md b/docs/examples/java/documentsdb/list-transactions.md new file mode 100644 index 0000000..cc56f53 --- /dev/null +++ b/docs/examples/java/documentsdb/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/list.md b/docs/examples/java/documentsdb/list.md new file mode 100644 index 0000000..0e7b2b4 --- /dev/null +++ b/docs/examples/java/documentsdb/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.list( + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/update-collection.md b/docs/examples/java/documentsdb/update-collection.md new file mode 100644 index 0000000..f1c5f0d --- /dev/null +++ b/docs/examples/java/documentsdb/update-collection.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateCollection( + "", // databaseId + "", // collectionId + "", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/update-document.md b/docs/examples/java/documentsdb/update-document.md new file mode 100644 index 0000000..c133292 --- /dev/null +++ b/docs/examples/java/documentsdb/update-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/update-documents.md b/docs/examples/java/documentsdb/update-documents.md new file mode 100644 index 0000000..8b96274 --- /dev/null +++ b/docs/examples/java/documentsdb/update-documents.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocuments( + "", // databaseId + "", // collectionId + Map.of("a", "b"), // data (optional) + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/update-transaction.md b/docs/examples/java/documentsdb/update-transaction.md new file mode 100644 index 0000000..17cd8f2 --- /dev/null +++ b/docs/examples/java/documentsdb/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/update.md b/docs/examples/java/documentsdb/update.md new file mode 100644 index 0000000..09ba4ae --- /dev/null +++ b/docs/examples/java/documentsdb/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.update( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/upsert-document.md b/docs/examples/java/documentsdb/upsert-document.md new file mode 100644 index 0000000..2c20c63 --- /dev/null +++ b/docs/examples/java/documentsdb/upsert-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/documentsdb/upsert-documents.md b/docs/examples/java/documentsdb/upsert-documents.md new file mode 100644 index 0000000..9758252 --- /dev/null +++ b/docs/examples/java/documentsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/functions/create.md b/docs/examples/java/functions/create.md index 47015f3..d423c66 100644 --- a/docs/examples/java/functions/create.md +++ b/docs/examples/java/functions/create.md @@ -30,7 +30,9 @@ functions.create( "", // providerBranch (optional) false, // providerSilentMode (optional) "", // providerRootDirectory (optional) - "", // specification (optional) + "", // buildSpecification (optional) + "", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/update.md b/docs/examples/java/functions/update.md index 7ab2402..5e7b5c8 100644 --- a/docs/examples/java/functions/update.md +++ b/docs/examples/java/functions/update.md @@ -30,7 +30,9 @@ functions.update( "", // providerBranch (optional) false, // providerSilentMode (optional) "", // providerRootDirectory (optional) - "", // specification (optional) + "", // buildSpecification (optional) + "", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/project/create-variable.md b/docs/examples/java/project/create-variable.md new file mode 100644 index 0000000..62d7a47 --- /dev/null +++ b/docs/examples/java/project/create-variable.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Project project = new Project(client); + +project.createVariable( + "", // variableId + "", // key + "", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/project/delete-variable.md b/docs/examples/java/project/delete-variable.md new file mode 100644 index 0000000..98ff61d --- /dev/null +++ b/docs/examples/java/project/delete-variable.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Project project = new Project(client); + +project.deleteVariable( + "", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/project/get-variable.md b/docs/examples/java/project/get-variable.md new file mode 100644 index 0000000..f922e27 --- /dev/null +++ b/docs/examples/java/project/get-variable.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Project project = new Project(client); + +project.getVariable( + "", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/project/list-variables.md b/docs/examples/java/project/list-variables.md new file mode 100644 index 0000000..bfcfbd6 --- /dev/null +++ b/docs/examples/java/project/list-variables.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Project project = new Project(client); + +project.listVariables( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/project/update-variable.md b/docs/examples/java/project/update-variable.md new file mode 100644 index 0000000..19e7d88 --- /dev/null +++ b/docs/examples/java/project/update-variable.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Project project = new Project(client); + +project.updateVariable( + "", // variableId + "", // key (optional) + "", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/sites/create.md b/docs/examples/java/sites/create.md index 328b395..1f1f8e3 100644 --- a/docs/examples/java/sites/create.md +++ b/docs/examples/java/sites/create.md @@ -23,6 +23,7 @@ sites.create( 1, // timeout (optional) "", // installCommand (optional) "", // buildCommand (optional) + "", // startCommand (optional) "", // outputDirectory (optional) Adapter.STATIC, // adapter (optional) "", // installationId (optional) @@ -31,7 +32,9 @@ sites.create( "", // providerBranch (optional) false, // providerSilentMode (optional) "", // providerRootDirectory (optional) - "", // specification (optional) + "", // buildSpecification (optional) + "", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/sites/update.md b/docs/examples/java/sites/update.md index 6f34a38..5086605 100644 --- a/docs/examples/java/sites/update.md +++ b/docs/examples/java/sites/update.md @@ -22,6 +22,7 @@ sites.update( 1, // timeout (optional) "", // installCommand (optional) "", // buildCommand (optional) + "", // startCommand (optional) "", // outputDirectory (optional) BuildRuntime.NODE_14_5, // buildRuntime (optional) Adapter.STATIC, // adapter (optional) @@ -31,7 +32,9 @@ sites.update( "", // providerBranch (optional) false, // providerSilentMode (optional) "", // providerRootDirectory (optional) - "", // specification (optional) + "", // buildSpecification (optional) + "", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/create-index.md b/docs/examples/java/tablesdb/create-index.md index 0ad4055..17b6e1d 100644 --- a/docs/examples/java/tablesdb/create-index.md +++ b/docs/examples/java/tablesdb/create-index.md @@ -2,7 +2,7 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; -import io.appwrite.enums.IndexType; +import io.appwrite.enums.TablesDBIndexType; import io.appwrite.enums.OrderBy; Client client = new Client() @@ -16,7 +16,7 @@ tablesDB.createIndex( "", // databaseId "", // tableId "", // key - IndexType.KEY, // type + TablesDBIndexType.KEY, // type List.of(), // columns List.of(OrderBy.ASC), // orders (optional) List.of(), // lengths (optional) diff --git a/docs/examples/java/users/update-impersonator.md b/docs/examples/java/users/update-impersonator.md new file mode 100644 index 0000000..879e436 --- /dev/null +++ b/docs/examples/java/users/update-impersonator.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Users users = new Users(client); + +users.updateImpersonator( + "", // userId + false, // impersonator + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-collection.md b/docs/examples/java/vectorsdb/create-collection.md new file mode 100644 index 0000000..d3dc60b --- /dev/null +++ b/docs/examples/java/vectorsdb/create-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createCollection( + "", // databaseId + "", // collectionId + "", // name + 1, // dimension + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-document.md b/docs/examples/java/vectorsdb/create-document.md new file mode 100644 index 0000000..474a941 --- /dev/null +++ b/docs/examples/java/vectorsdb/create-document.md @@ -0,0 +1,36 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "embeddings", List.of(0.12, -0.55, 0.88, 1.02), + "metadata", Map.of( + "key", "value" + ) + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-documents.md b/docs/examples/java/vectorsdb/create-documents.md new file mode 100644 index 0000000..21090e6 --- /dev/null +++ b/docs/examples/java/vectorsdb/create-documents.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-index.md b/docs/examples/java/vectorsdb/create-index.md new file mode 100644 index 0000000..3c5c572 --- /dev/null +++ b/docs/examples/java/vectorsdb/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; +import io.appwrite.enums.VectorsDBIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createIndex( + "", // databaseId + "", // collectionId + "", // key + VectorsDBIndexType.HNSW_EUCLIDEAN, // type + List.of(), // attributes + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-operations.md b/docs/examples/java/vectorsdb/create-operations.md new file mode 100644 index 0000000..bc2f85e --- /dev/null +++ b/docs/examples/java/vectorsdb/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-text-embeddings.md b/docs/examples/java/vectorsdb/create-text-embeddings.md new file mode 100644 index 0000000..73e0fe5 --- /dev/null +++ b/docs/examples/java/vectorsdb/create-text-embeddings.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; +import io.appwrite.enums.Model; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createTextEmbeddings( + List.of(), // texts + Model.EMBEDDINGGEMMA, // model (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create-transaction.md b/docs/examples/java/vectorsdb/create-transaction.md new file mode 100644 index 0000000..c855284 --- /dev/null +++ b/docs/examples/java/vectorsdb/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/create.md b/docs/examples/java/vectorsdb/create.md new file mode 100644 index 0000000..e9a1e42 --- /dev/null +++ b/docs/examples/java/vectorsdb/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.create( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete-collection.md b/docs/examples/java/vectorsdb/delete-collection.md new file mode 100644 index 0000000..c0d9eec --- /dev/null +++ b/docs/examples/java/vectorsdb/delete-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteCollection( + "", // databaseId + "", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete-document.md b/docs/examples/java/vectorsdb/delete-document.md new file mode 100644 index 0000000..9ab5e57 --- /dev/null +++ b/docs/examples/java/vectorsdb/delete-document.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete-documents.md b/docs/examples/java/vectorsdb/delete-documents.md new file mode 100644 index 0000000..31a425a --- /dev/null +++ b/docs/examples/java/vectorsdb/delete-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete-index.md b/docs/examples/java/vectorsdb/delete-index.md new file mode 100644 index 0000000..a8c4b57 --- /dev/null +++ b/docs/examples/java/vectorsdb/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteIndex( + "", // databaseId + "", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete-transaction.md b/docs/examples/java/vectorsdb/delete-transaction.md new file mode 100644 index 0000000..b71ee2a --- /dev/null +++ b/docs/examples/java/vectorsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/delete.md b/docs/examples/java/vectorsdb/delete.md new file mode 100644 index 0000000..821dacf --- /dev/null +++ b/docs/examples/java/vectorsdb/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.delete( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/get-collection.md b/docs/examples/java/vectorsdb/get-collection.md new file mode 100644 index 0000000..b158bd8 --- /dev/null +++ b/docs/examples/java/vectorsdb/get-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getCollection( + "", // databaseId + "", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/get-document.md b/docs/examples/java/vectorsdb/get-document.md new file mode 100644 index 0000000..8a048ca --- /dev/null +++ b/docs/examples/java/vectorsdb/get-document.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/get-index.md b/docs/examples/java/vectorsdb/get-index.md new file mode 100644 index 0000000..7470705 --- /dev/null +++ b/docs/examples/java/vectorsdb/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getIndex( + "", // databaseId + "", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/get-transaction.md b/docs/examples/java/vectorsdb/get-transaction.md new file mode 100644 index 0000000..8996a56 --- /dev/null +++ b/docs/examples/java/vectorsdb/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/get.md b/docs/examples/java/vectorsdb/get.md new file mode 100644 index 0000000..47c5494 --- /dev/null +++ b/docs/examples/java/vectorsdb/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.get( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/list-collections.md b/docs/examples/java/vectorsdb/list-collections.md new file mode 100644 index 0000000..39b35d5 --- /dev/null +++ b/docs/examples/java/vectorsdb/list-collections.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listCollections( + "", // databaseId + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/list-documents.md b/docs/examples/java/vectorsdb/list-documents.md new file mode 100644 index 0000000..857d796 --- /dev/null +++ b/docs/examples/java/vectorsdb/list-documents.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/list-indexes.md b/docs/examples/java/vectorsdb/list-indexes.md new file mode 100644 index 0000000..40b4dbc --- /dev/null +++ b/docs/examples/java/vectorsdb/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listIndexes( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/list-transactions.md b/docs/examples/java/vectorsdb/list-transactions.md new file mode 100644 index 0000000..6b0890a --- /dev/null +++ b/docs/examples/java/vectorsdb/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/list.md b/docs/examples/java/vectorsdb/list.md new file mode 100644 index 0000000..80a20b6 --- /dev/null +++ b/docs/examples/java/vectorsdb/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.list( + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/update-collection.md b/docs/examples/java/vectorsdb/update-collection.md new file mode 100644 index 0000000..9359c80 --- /dev/null +++ b/docs/examples/java/vectorsdb/update-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateCollection( + "", // databaseId + "", // collectionId + "", // name + 1, // dimension (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/update-document.md b/docs/examples/java/vectorsdb/update-document.md new file mode 100644 index 0000000..1800ff4 --- /dev/null +++ b/docs/examples/java/vectorsdb/update-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/update-documents.md b/docs/examples/java/vectorsdb/update-documents.md new file mode 100644 index 0000000..820cbe5 --- /dev/null +++ b/docs/examples/java/vectorsdb/update-documents.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocuments( + "", // databaseId + "", // collectionId + Map.of("a", "b"), // data (optional) + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/update-transaction.md b/docs/examples/java/vectorsdb/update-transaction.md new file mode 100644 index 0000000..6d648df --- /dev/null +++ b/docs/examples/java/vectorsdb/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/update.md b/docs/examples/java/vectorsdb/update.md new file mode 100644 index 0000000..4fc2abe --- /dev/null +++ b/docs/examples/java/vectorsdb/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.update( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/upsert-document.md b/docs/examples/java/vectorsdb/upsert-document.md new file mode 100644 index 0000000..cdefe63 --- /dev/null +++ b/docs/examples/java/vectorsdb/upsert-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/vectorsdb/upsert-documents.md b/docs/examples/java/vectorsdb/upsert-documents.md new file mode 100644 index 0000000..6371a0c --- /dev/null +++ b/docs/examples/java/vectorsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/create.md b/docs/examples/java/webhooks/create.md new file mode 100644 index 0000000..22a856e --- /dev/null +++ b/docs/examples/java/webhooks/create.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.create( + "", // webhookId + "", // url + "", // name + List.of(), // events + false, // enabled (optional) + false, // security (optional) + "", // httpUser (optional) + "", // httpPass (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/delete.md b/docs/examples/java/webhooks/delete.md new file mode 100644 index 0000000..21c5304 --- /dev/null +++ b/docs/examples/java/webhooks/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.delete( + "", // webhookId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/get.md b/docs/examples/java/webhooks/get.md new file mode 100644 index 0000000..07ed771 --- /dev/null +++ b/docs/examples/java/webhooks/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.get( + "", // webhookId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/list.md b/docs/examples/java/webhooks/list.md new file mode 100644 index 0000000..22e3d32 --- /dev/null +++ b/docs/examples/java/webhooks/list.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.list( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/update-signature.md b/docs/examples/java/webhooks/update-signature.md new file mode 100644 index 0000000..2526dd5 --- /dev/null +++ b/docs/examples/java/webhooks/update-signature.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.updateSignature( + "", // webhookId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/java/webhooks/update.md b/docs/examples/java/webhooks/update.md new file mode 100644 index 0000000..cb7cf9b --- /dev/null +++ b/docs/examples/java/webhooks/update.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.update( + "", // webhookId + "", // name + "", // url + List.of(), // events + false, // enabled (optional) + false, // security (optional) + "", // httpUser (optional) + "", // httpPass (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/docs/examples/kotlin/databases/create-index.md b/docs/examples/kotlin/databases/create-index.md index 85d3729..aae520e 100644 --- a/docs/examples/kotlin/databases/create-index.md +++ b/docs/examples/kotlin/databases/create-index.md @@ -2,7 +2,7 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases -import io.appwrite.enums.IndexType +import io.appwrite.enums.DatabasesIndexType import io.appwrite.enums.OrderBy val client = Client() @@ -16,7 +16,7 @@ val response = databases.createIndex( databaseId = "", collectionId = "", key = "", - type = IndexType.KEY, + type = DatabasesIndexType.KEY, attributes = listOf(), orders = listOf(OrderBy.ASC), // optional lengths = listOf() // optional diff --git a/docs/examples/kotlin/databases/upsert-documents.md b/docs/examples/kotlin/databases/upsert-documents.md index a9e673c..a2c0b93 100644 --- a/docs/examples/kotlin/databases/upsert-documents.md +++ b/docs/examples/kotlin/databases/upsert-documents.md @@ -6,7 +6,7 @@ import io.appwrite.services.Databases val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID - .setKey("") // Your secret API key + .setSession("") // The user session to authenticate with val databases = Databases(client) diff --git a/docs/examples/kotlin/documentsdb/create-collection.md b/docs/examples/kotlin/documentsdb/create-collection.md new file mode 100644 index 0000000..29974f2 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-collection.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createCollection( + databaseId = "", + collectionId = "", + name = "", + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false, // optional + attributes = listOf(), // optional + indexes = listOf() // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/create-document.md b/docs/examples/kotlin/documentsdb/create-document.md new file mode 100644 index 0000000..64c800a --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())) // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/create-documents.md b/docs/examples/kotlin/documentsdb/create-documents.md new file mode 100644 index 0000000..ba73a05 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf() +) +``` diff --git a/docs/examples/kotlin/documentsdb/create-index.md b/docs/examples/kotlin/documentsdb/create-index.md new file mode 100644 index 0000000..766066e --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.enums.DocumentsDBIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createIndex( + databaseId = "", + collectionId = "", + key = "", + type = DocumentsDBIndexType.KEY, + attributes = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/create-operations.md b/docs/examples/kotlin/documentsdb/create-operations.md new file mode 100644 index 0000000..851b65c --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/create-transaction.md b/docs/examples/kotlin/documentsdb/create-transaction.md new file mode 100644 index 0000000..b695e53 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createTransaction( + ttl = 60 // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/create.md b/docs/examples/kotlin/documentsdb/create.md new file mode 100644 index 0000000..51bbf16 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.create( + databaseId = "", + name = "", + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/decrement-document-attribute.md b/docs/examples/kotlin/documentsdb/decrement-document-attribute.md new file mode 100644 index 0000000..dff032d --- /dev/null +++ b/docs/examples/kotlin/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // optional + min = 0, // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete-collection.md b/docs/examples/kotlin/documentsdb/delete-collection.md new file mode 100644 index 0000000..9f57b18 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteCollection( + databaseId = "", + collectionId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete-document.md b/docs/examples/kotlin/documentsdb/delete-document.md new file mode 100644 index 0000000..36624b6 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete-documents.md b/docs/examples/kotlin/documentsdb/delete-documents.md new file mode 100644 index 0000000..9a5397c --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete-index.md b/docs/examples/kotlin/documentsdb/delete-index.md new file mode 100644 index 0000000..46eb726 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteIndex( + databaseId = "", + collectionId = "", + key = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete-transaction.md b/docs/examples/kotlin/documentsdb/delete-transaction.md new file mode 100644 index 0000000..3adfb9a --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteTransaction( + transactionId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/delete.md b/docs/examples/kotlin/documentsdb/delete.md new file mode 100644 index 0000000..63ef123 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.delete( + databaseId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/get-collection.md b/docs/examples/kotlin/documentsdb/get-collection.md new file mode 100644 index 0000000..aee65b9 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/get-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getCollection( + databaseId = "", + collectionId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/get-document.md b/docs/examples/kotlin/documentsdb/get-document.md new file mode 100644 index 0000000..eb2aad8 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/get-index.md b/docs/examples/kotlin/documentsdb/get-index.md new file mode 100644 index 0000000..5c83dbe --- /dev/null +++ b/docs/examples/kotlin/documentsdb/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getIndex( + databaseId = "", + collectionId = "", + key = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/get-transaction.md b/docs/examples/kotlin/documentsdb/get-transaction.md new file mode 100644 index 0000000..7ac55d4 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getTransaction( + transactionId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/get.md b/docs/examples/kotlin/documentsdb/get.md new file mode 100644 index 0000000..aa24055 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.get( + databaseId = "" +) +``` diff --git a/docs/examples/kotlin/documentsdb/increment-document-attribute.md b/docs/examples/kotlin/documentsdb/increment-document-attribute.md new file mode 100644 index 0000000..a770461 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // optional + max = 0, // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/list-collections.md b/docs/examples/kotlin/documentsdb/list-collections.md new file mode 100644 index 0000000..0240c1d --- /dev/null +++ b/docs/examples/kotlin/documentsdb/list-collections.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listCollections( + databaseId = "", + queries = listOf(), // optional + search = "", // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/list-documents.md b/docs/examples/kotlin/documentsdb/list-documents.md new file mode 100644 index 0000000..d1c688f --- /dev/null +++ b/docs/examples/kotlin/documentsdb/list-documents.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + transactionId = "", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/list-indexes.md b/docs/examples/kotlin/documentsdb/list-indexes.md new file mode 100644 index 0000000..b83909e --- /dev/null +++ b/docs/examples/kotlin/documentsdb/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listIndexes( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/list-transactions.md b/docs/examples/kotlin/documentsdb/list-transactions.md new file mode 100644 index 0000000..00967cc --- /dev/null +++ b/docs/examples/kotlin/documentsdb/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listTransactions( + queries = listOf() // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/list.md b/docs/examples/kotlin/documentsdb/list.md new file mode 100644 index 0000000..ec0f18b --- /dev/null +++ b/docs/examples/kotlin/documentsdb/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.list( + queries = listOf(), // optional + search = "", // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/update-collection.md b/docs/examples/kotlin/documentsdb/update-collection.md new file mode 100644 index 0000000..b8f7d56 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/update-collection.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateCollection( + databaseId = "", + collectionId = "", + name = "", + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/update-document.md b/docs/examples/kotlin/documentsdb/update-document.md new file mode 100644 index 0000000..e7bdba5 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/update-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/update-documents.md b/docs/examples/kotlin/documentsdb/update-documents.md new file mode 100644 index 0000000..175b6ee --- /dev/null +++ b/docs/examples/kotlin/documentsdb/update-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateDocuments( + databaseId = "", + collectionId = "", + data = mapOf( "a" to "b" ), // optional + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/update-transaction.md b/docs/examples/kotlin/documentsdb/update-transaction.md new file mode 100644 index 0000000..99ace75 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateTransaction( + transactionId = "", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/update.md b/docs/examples/kotlin/documentsdb/update.md new file mode 100644 index 0000000..4239c22 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.update( + databaseId = "", + name = "", + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/upsert-document.md b/docs/examples/kotlin/documentsdb/upsert-document.md new file mode 100644 index 0000000..6b31df0 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/upsert-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/documentsdb/upsert-documents.md b/docs/examples/kotlin/documentsdb/upsert-documents.md new file mode 100644 index 0000000..abf4633 --- /dev/null +++ b/docs/examples/kotlin/documentsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.upsertDocuments( + databaseId = "", + collectionId = "", + documents = listOf(), + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/functions/create.md b/docs/examples/kotlin/functions/create.md index 0ad7f97..ce62e40 100644 --- a/docs/examples/kotlin/functions/create.md +++ b/docs/examples/kotlin/functions/create.md @@ -30,6 +30,8 @@ val response = functions.create( providerBranch = "", // optional providerSilentMode = false, // optional providerRootDirectory = "", // optional - specification = "" // optional + buildSpecification = "", // optional + runtimeSpecification = "", // optional + deploymentRetention = 0 // optional ) ``` diff --git a/docs/examples/kotlin/functions/update.md b/docs/examples/kotlin/functions/update.md index c04a3c9..a686091 100644 --- a/docs/examples/kotlin/functions/update.md +++ b/docs/examples/kotlin/functions/update.md @@ -30,6 +30,8 @@ val response = functions.update( providerBranch = "", // optional providerSilentMode = false, // optional providerRootDirectory = "", // optional - specification = "" // optional + buildSpecification = "", // optional + runtimeSpecification = "", // optional + deploymentRetention = 0 // optional ) ``` diff --git a/docs/examples/kotlin/project/create-variable.md b/docs/examples/kotlin/project/create-variable.md new file mode 100644 index 0000000..e61e1ba --- /dev/null +++ b/docs/examples/kotlin/project/create-variable.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val project = Project(client) + +val response = project.createVariable( + variableId = "", + key = "", + value = "", + secret = false // optional +) +``` diff --git a/docs/examples/kotlin/project/delete-variable.md b/docs/examples/kotlin/project/delete-variable.md new file mode 100644 index 0000000..674d805 --- /dev/null +++ b/docs/examples/kotlin/project/delete-variable.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val project = Project(client) + +val response = project.deleteVariable( + variableId = "" +) +``` diff --git a/docs/examples/kotlin/project/get-variable.md b/docs/examples/kotlin/project/get-variable.md new file mode 100644 index 0000000..59dea64 --- /dev/null +++ b/docs/examples/kotlin/project/get-variable.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val project = Project(client) + +val response = project.getVariable( + variableId = "" +) +``` diff --git a/docs/examples/kotlin/project/list-variables.md b/docs/examples/kotlin/project/list-variables.md new file mode 100644 index 0000000..d455a15 --- /dev/null +++ b/docs/examples/kotlin/project/list-variables.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val project = Project(client) + +val response = project.listVariables( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/project/update-variable.md b/docs/examples/kotlin/project/update-variable.md new file mode 100644 index 0000000..cc6b22e --- /dev/null +++ b/docs/examples/kotlin/project/update-variable.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val project = Project(client) + +val response = project.updateVariable( + variableId = "", + key = "", // optional + value = "", // optional + secret = false // optional +) +``` diff --git a/docs/examples/kotlin/sites/create.md b/docs/examples/kotlin/sites/create.md index a0a0205..9bc8982 100644 --- a/docs/examples/kotlin/sites/create.md +++ b/docs/examples/kotlin/sites/create.md @@ -23,6 +23,7 @@ val response = sites.create( timeout = 1, // optional installCommand = "", // optional buildCommand = "", // optional + startCommand = "", // optional outputDirectory = "", // optional adapter = Adapter.STATIC, // optional installationId = "", // optional @@ -31,6 +32,8 @@ val response = sites.create( providerBranch = "", // optional providerSilentMode = false, // optional providerRootDirectory = "", // optional - specification = "" // optional + buildSpecification = "", // optional + runtimeSpecification = "", // optional + deploymentRetention = 0 // optional ) ``` diff --git a/docs/examples/kotlin/sites/update.md b/docs/examples/kotlin/sites/update.md index e3b1ecb..63ff5b0 100644 --- a/docs/examples/kotlin/sites/update.md +++ b/docs/examples/kotlin/sites/update.md @@ -22,6 +22,7 @@ val response = sites.update( timeout = 1, // optional installCommand = "", // optional buildCommand = "", // optional + startCommand = "", // optional outputDirectory = "", // optional buildRuntime = BuildRuntime.NODE_14_5, // optional adapter = Adapter.STATIC, // optional @@ -31,6 +32,8 @@ val response = sites.update( providerBranch = "", // optional providerSilentMode = false, // optional providerRootDirectory = "", // optional - specification = "" // optional + buildSpecification = "", // optional + runtimeSpecification = "", // optional + deploymentRetention = 0 // optional ) ``` diff --git a/docs/examples/kotlin/tablesdb/create-index.md b/docs/examples/kotlin/tablesdb/create-index.md index b3c09ee..021290d 100644 --- a/docs/examples/kotlin/tablesdb/create-index.md +++ b/docs/examples/kotlin/tablesdb/create-index.md @@ -2,7 +2,7 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB -import io.appwrite.enums.IndexType +import io.appwrite.enums.TablesDBIndexType import io.appwrite.enums.OrderBy val client = Client() @@ -16,7 +16,7 @@ val response = tablesDB.createIndex( databaseId = "", tableId = "", key = "", - type = IndexType.KEY, + type = TablesDBIndexType.KEY, columns = listOf(), orders = listOf(OrderBy.ASC), // optional lengths = listOf() // optional diff --git a/docs/examples/kotlin/users/update-impersonator.md b/docs/examples/kotlin/users/update-impersonator.md new file mode 100644 index 0000000..58a8e6e --- /dev/null +++ b/docs/examples/kotlin/users/update-impersonator.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val users = Users(client) + +val response = users.updateImpersonator( + userId = "", + impersonator = false +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-collection.md b/docs/examples/kotlin/vectorsdb/create-collection.md new file mode 100644 index 0000000..0cd1e4a --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createCollection( + databaseId = "", + collectionId = "", + name = "", + dimension = 1, + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-document.md b/docs/examples/kotlin/vectorsdb/create-document.md new file mode 100644 index 0000000..220d27a --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-document.md @@ -0,0 +1,27 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "embeddings" to listOf(0.12, -0.55, 0.88, 1.02), + "metadata" to mapOf( + "key" to "value" + ) + ), + permissions = listOf(Permission.read(Role.any())) // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-documents.md b/docs/examples/kotlin/vectorsdb/create-documents.md new file mode 100644 index 0000000..e5fe9a9 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-documents.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf() +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-index.md b/docs/examples/kotlin/vectorsdb/create-index.md new file mode 100644 index 0000000..c6c661e --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.enums.VectorsDBIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createIndex( + databaseId = "", + collectionId = "", + key = "", + type = VectorsDBIndexType.HNSW_EUCLIDEAN, + attributes = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-operations.md b/docs/examples/kotlin/vectorsdb/create-operations.md new file mode 100644 index 0000000..f6bc636 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-text-embeddings.md b/docs/examples/kotlin/vectorsdb/create-text-embeddings.md new file mode 100644 index 0000000..c722c66 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-text-embeddings.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.enums.Model + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createTextEmbeddings( + texts = listOf(), + model = Model.EMBEDDINGGEMMA // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create-transaction.md b/docs/examples/kotlin/vectorsdb/create-transaction.md new file mode 100644 index 0000000..b2430a1 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createTransaction( + ttl = 60 // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/create.md b/docs/examples/kotlin/vectorsdb/create.md new file mode 100644 index 0000000..cff2ab1 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.create( + databaseId = "", + name = "", + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete-collection.md b/docs/examples/kotlin/vectorsdb/delete-collection.md new file mode 100644 index 0000000..4e929ca --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteCollection( + databaseId = "", + collectionId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete-document.md b/docs/examples/kotlin/vectorsdb/delete-document.md new file mode 100644 index 0000000..2fff745 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete-documents.md b/docs/examples/kotlin/vectorsdb/delete-documents.md new file mode 100644 index 0000000..53ecd50 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete-index.md b/docs/examples/kotlin/vectorsdb/delete-index.md new file mode 100644 index 0000000..d779381 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteIndex( + databaseId = "", + collectionId = "", + key = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete-transaction.md b/docs/examples/kotlin/vectorsdb/delete-transaction.md new file mode 100644 index 0000000..f04bef2 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteTransaction( + transactionId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/delete.md b/docs/examples/kotlin/vectorsdb/delete.md new file mode 100644 index 0000000..d4d480e --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.delete( + databaseId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/get-collection.md b/docs/examples/kotlin/vectorsdb/get-collection.md new file mode 100644 index 0000000..68599a7 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/get-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getCollection( + databaseId = "", + collectionId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/get-document.md b/docs/examples/kotlin/vectorsdb/get-document.md new file mode 100644 index 0000000..9a2fb13 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/get-index.md b/docs/examples/kotlin/vectorsdb/get-index.md new file mode 100644 index 0000000..3844920 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getIndex( + databaseId = "", + collectionId = "", + key = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/get-transaction.md b/docs/examples/kotlin/vectorsdb/get-transaction.md new file mode 100644 index 0000000..9fee449 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getTransaction( + transactionId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/get.md b/docs/examples/kotlin/vectorsdb/get.md new file mode 100644 index 0000000..fc9d6bd --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.get( + databaseId = "" +) +``` diff --git a/docs/examples/kotlin/vectorsdb/list-collections.md b/docs/examples/kotlin/vectorsdb/list-collections.md new file mode 100644 index 0000000..12250df --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/list-collections.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listCollections( + databaseId = "", + queries = listOf(), // optional + search = "", // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/list-documents.md b/docs/examples/kotlin/vectorsdb/list-documents.md new file mode 100644 index 0000000..ec74ab6 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/list-documents.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + transactionId = "", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/list-indexes.md b/docs/examples/kotlin/vectorsdb/list-indexes.md new file mode 100644 index 0000000..28f0fc0 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listIndexes( + databaseId = "", + collectionId = "", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/list-transactions.md b/docs/examples/kotlin/vectorsdb/list-transactions.md new file mode 100644 index 0000000..3801d18 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listTransactions( + queries = listOf() // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/list.md b/docs/examples/kotlin/vectorsdb/list.md new file mode 100644 index 0000000..4051f0f --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.list( + queries = listOf(), // optional + search = "", // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/update-collection.md b/docs/examples/kotlin/vectorsdb/update-collection.md new file mode 100644 index 0000000..331c85c --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/update-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateCollection( + databaseId = "", + collectionId = "", + name = "", + dimension = 1, // optional + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/update-document.md b/docs/examples/kotlin/vectorsdb/update-document.md new file mode 100644 index 0000000..5725757 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/update-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/update-documents.md b/docs/examples/kotlin/vectorsdb/update-documents.md new file mode 100644 index 0000000..32aac30 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/update-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateDocuments( + databaseId = "", + collectionId = "", + data = mapOf( "a" to "b" ), // optional + queries = listOf(), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/update-transaction.md b/docs/examples/kotlin/vectorsdb/update-transaction.md new file mode 100644 index 0000000..5f34609 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateTransaction( + transactionId = "", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/update.md b/docs/examples/kotlin/vectorsdb/update.md new file mode 100644 index 0000000..1a42f4f --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.update( + databaseId = "", + name = "", + enabled = false // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/upsert-document.md b/docs/examples/kotlin/vectorsdb/upsert-document.md new file mode 100644 index 0000000..dd18e1d --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/upsert-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/vectorsdb/upsert-documents.md b/docs/examples/kotlin/vectorsdb/upsert-documents.md new file mode 100644 index 0000000..7172222 --- /dev/null +++ b/docs/examples/kotlin/vectorsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.upsertDocuments( + databaseId = "", + collectionId = "", + documents = listOf(), + transactionId = "" // optional +) +``` diff --git a/docs/examples/kotlin/webhooks/create.md b/docs/examples/kotlin/webhooks/create.md new file mode 100644 index 0000000..d5eaedd --- /dev/null +++ b/docs/examples/kotlin/webhooks/create.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.create( + webhookId = "", + url = "", + name = "", + events = listOf(), + enabled = false, // optional + security = false, // optional + httpUser = "", // optional + httpPass = "" // optional +) +``` diff --git a/docs/examples/kotlin/webhooks/delete.md b/docs/examples/kotlin/webhooks/delete.md new file mode 100644 index 0000000..6f381c2 --- /dev/null +++ b/docs/examples/kotlin/webhooks/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.delete( + webhookId = "" +) +``` diff --git a/docs/examples/kotlin/webhooks/get.md b/docs/examples/kotlin/webhooks/get.md new file mode 100644 index 0000000..1f82c0b --- /dev/null +++ b/docs/examples/kotlin/webhooks/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.get( + webhookId = "" +) +``` diff --git a/docs/examples/kotlin/webhooks/list.md b/docs/examples/kotlin/webhooks/list.md new file mode 100644 index 0000000..f3f9f23 --- /dev/null +++ b/docs/examples/kotlin/webhooks/list.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.list( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/docs/examples/kotlin/webhooks/update-signature.md b/docs/examples/kotlin/webhooks/update-signature.md new file mode 100644 index 0000000..d58f9ef --- /dev/null +++ b/docs/examples/kotlin/webhooks/update-signature.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.updateSignature( + webhookId = "" +) +``` diff --git a/docs/examples/kotlin/webhooks/update.md b/docs/examples/kotlin/webhooks/update.md new file mode 100644 index 0000000..06e7d31 --- /dev/null +++ b/docs/examples/kotlin/webhooks/update.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.update( + webhookId = "", + name = "", + url = "", + events = listOf(), + enabled = false, // optional + security = false, // optional + httpUser = "", // optional + httpPass = "" // optional +) +``` diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt index 18232f2..0fd7889 100644 --- a/src/main/kotlin/io/appwrite/Client.kt +++ b/src/main/kotlin/io/appwrite/Client.kt @@ -57,12 +57,12 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "user-agent" to "AppwriteKotlinSDK/14.1.0 ${System.getProperty("http.agent")}", + "user-agent" to "AppwriteKotlinSDK/15.0.0 ${System.getProperty("http.agent")}", "x-sdk-name" to "Kotlin", "x-sdk-platform" to "server", "x-sdk-language" to "kotlin", - "x-sdk-version" to "14.1.0", - "x-appwrite-response-format" to "1.8.0", + "x-sdk-version" to "15.0.0", + "x-appwrite-response-format" to "1.9.0", ) config = mutableMapOf() @@ -158,6 +158,51 @@ class Client @JvmOverloads constructor( return this } + /** + * Set ImpersonateUserId + * + * Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param {string} impersonateuserid + * + * @return this + */ + fun setImpersonateUserId(value: String): Client { + config["impersonateUserId"] = value + addHeader("x-appwrite-impersonate-user-id", value) + return this + } + + /** + * Set ImpersonateUserEmail + * + * Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param {string} impersonateuseremail + * + * @return this + */ + fun setImpersonateUserEmail(value: String): Client { + config["impersonateUserEmail"] = value + addHeader("x-appwrite-impersonate-user-email", value) + return this + } + + /** + * Set ImpersonateUserPhone + * + * Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param {string} impersonateuserphone + * + * @return this + */ + fun setImpersonateUserPhone(value: String): Client { + config["impersonateUserPhone"] = value + addHeader("x-appwrite-impersonate-user-phone", value) + return this + } + /** * Set self Signed * diff --git a/src/main/kotlin/io/appwrite/enums/BackupServices.kt b/src/main/kotlin/io/appwrite/enums/BackupServices.kt index e82c017..3cadb7e 100644 --- a/src/main/kotlin/io/appwrite/enums/BackupServices.kt +++ b/src/main/kotlin/io/appwrite/enums/BackupServices.kt @@ -5,6 +5,12 @@ import com.google.gson.annotations.SerializedName enum class BackupServices(val value: String) { @SerializedName("databases") DATABASES("databases"), + @SerializedName("tablesdb") + TABLESDB("tablesdb"), + @SerializedName("documentsdb") + DOCUMENTSDB("documentsdb"), + @SerializedName("vectorsdb") + VECTORSDB("vectorsdb"), @SerializedName("functions") FUNCTIONS("functions"), @SerializedName("storage") diff --git a/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt index ff8b115..efab3af 100644 --- a/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt +++ b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt @@ -174,7 +174,179 @@ enum class BuildRuntime(val value: String) { @SerializedName("flutter-3.35") FLUTTER_3_35("flutter-3.35"), @SerializedName("flutter-3.38") - FLUTTER_3_38("flutter-3.38"); + FLUTTER_3_38("flutter-3.38"), + @SerializedName("node-14.5-rc") + NODE_14_5_RC("node-14.5-rc"), + @SerializedName("node-16.0-rc") + NODE_16_0_RC("node-16.0-rc"), + @SerializedName("node-18.0-rc") + NODE_18_0_RC("node-18.0-rc"), + @SerializedName("node-19.0-rc") + NODE_19_0_RC("node-19.0-rc"), + @SerializedName("node-20.0-rc") + NODE_20_0_RC("node-20.0-rc"), + @SerializedName("node-21.0-rc") + NODE_21_0_RC("node-21.0-rc"), + @SerializedName("node-22-rc") + NODE_22_RC("node-22-rc"), + @SerializedName("node-23-rc") + NODE_23_RC("node-23-rc"), + @SerializedName("node-24-rc") + NODE_24_RC("node-24-rc"), + @SerializedName("node-25-rc") + NODE_25_RC("node-25-rc"), + @SerializedName("php-8.0-rc") + PHP_8_0_RC("php-8.0-rc"), + @SerializedName("php-8.1-rc") + PHP_8_1_RC("php-8.1-rc"), + @SerializedName("php-8.2-rc") + PHP_8_2_RC("php-8.2-rc"), + @SerializedName("php-8.3-rc") + PHP_8_3_RC("php-8.3-rc"), + @SerializedName("php-8.4-rc") + PHP_8_4_RC("php-8.4-rc"), + @SerializedName("ruby-3.0-rc") + RUBY_3_0_RC("ruby-3.0-rc"), + @SerializedName("ruby-3.1-rc") + RUBY_3_1_RC("ruby-3.1-rc"), + @SerializedName("ruby-3.2-rc") + RUBY_3_2_RC("ruby-3.2-rc"), + @SerializedName("ruby-3.3-rc") + RUBY_3_3_RC("ruby-3.3-rc"), + @SerializedName("ruby-3.4-rc") + RUBY_3_4_RC("ruby-3.4-rc"), + @SerializedName("ruby-4.0-rc") + RUBY_4_0_RC("ruby-4.0-rc"), + @SerializedName("python-3.8-rc") + PYTHON_3_8_RC("python-3.8-rc"), + @SerializedName("python-3.9-rc") + PYTHON_3_9_RC("python-3.9-rc"), + @SerializedName("python-3.10-rc") + PYTHON_3_10_RC("python-3.10-rc"), + @SerializedName("python-3.11-rc") + PYTHON_3_11_RC("python-3.11-rc"), + @SerializedName("python-3.12-rc") + PYTHON_3_12_RC("python-3.12-rc"), + @SerializedName("python-3.13-rc") + PYTHON_3_13_RC("python-3.13-rc"), + @SerializedName("python-3.14-rc") + PYTHON_3_14_RC("python-3.14-rc"), + @SerializedName("python-ml-3.11-rc") + PYTHON_ML_3_11_RC("python-ml-3.11-rc"), + @SerializedName("python-ml-3.12-rc") + PYTHON_ML_3_12_RC("python-ml-3.12-rc"), + @SerializedName("python-ml-3.13-rc") + PYTHON_ML_3_13_RC("python-ml-3.13-rc"), + @SerializedName("deno-1.40-rc") + DENO_1_40_RC("deno-1.40-rc"), + @SerializedName("deno-1.46-rc") + DENO_1_46_RC("deno-1.46-rc"), + @SerializedName("deno-2.0-rc") + DENO_2_0_RC("deno-2.0-rc"), + @SerializedName("deno-2.5-rc") + DENO_2_5_RC("deno-2.5-rc"), + @SerializedName("deno-2.6-rc") + DENO_2_6_RC("deno-2.6-rc"), + @SerializedName("dart-2.15-rc") + DART_2_15_RC("dart-2.15-rc"), + @SerializedName("dart-2.16-rc") + DART_2_16_RC("dart-2.16-rc"), + @SerializedName("dart-2.17-rc") + DART_2_17_RC("dart-2.17-rc"), + @SerializedName("dart-2.18-rc") + DART_2_18_RC("dart-2.18-rc"), + @SerializedName("dart-2.19-rc") + DART_2_19_RC("dart-2.19-rc"), + @SerializedName("dart-3.0-rc") + DART_3_0_RC("dart-3.0-rc"), + @SerializedName("dart-3.1-rc") + DART_3_1_RC("dart-3.1-rc"), + @SerializedName("dart-3.3-rc") + DART_3_3_RC("dart-3.3-rc"), + @SerializedName("dart-3.5-rc") + DART_3_5_RC("dart-3.5-rc"), + @SerializedName("dart-3.8-rc") + DART_3_8_RC("dart-3.8-rc"), + @SerializedName("dart-3.9-rc") + DART_3_9_RC("dart-3.9-rc"), + @SerializedName("dart-3.10-rc") + DART_3_10_RC("dart-3.10-rc"), + @SerializedName("dotnet-6.0-rc") + DOTNET_6_0_RC("dotnet-6.0-rc"), + @SerializedName("dotnet-7.0-rc") + DOTNET_7_0_RC("dotnet-7.0-rc"), + @SerializedName("dotnet-8.0-rc") + DOTNET_8_0_RC("dotnet-8.0-rc"), + @SerializedName("dotnet-10-rc") + DOTNET_10_RC("dotnet-10-rc"), + @SerializedName("java-8.0-rc") + JAVA_8_0_RC("java-8.0-rc"), + @SerializedName("java-11.0-rc") + JAVA_11_0_RC("java-11.0-rc"), + @SerializedName("java-17.0-rc") + JAVA_17_0_RC("java-17.0-rc"), + @SerializedName("java-18.0-rc") + JAVA_18_0_RC("java-18.0-rc"), + @SerializedName("java-21.0-rc") + JAVA_21_0_RC("java-21.0-rc"), + @SerializedName("java-22-rc") + JAVA_22_RC("java-22-rc"), + @SerializedName("java-25-rc") + JAVA_25_RC("java-25-rc"), + @SerializedName("swift-5.5-rc") + SWIFT_5_5_RC("swift-5.5-rc"), + @SerializedName("swift-5.8-rc") + SWIFT_5_8_RC("swift-5.8-rc"), + @SerializedName("swift-5.9-rc") + SWIFT_5_9_RC("swift-5.9-rc"), + @SerializedName("swift-5.10-rc") + SWIFT_5_10_RC("swift-5.10-rc"), + @SerializedName("swift-6.2-rc") + SWIFT_6_2_RC("swift-6.2-rc"), + @SerializedName("kotlin-1.6-rc") + KOTLIN_1_6_RC("kotlin-1.6-rc"), + @SerializedName("kotlin-1.8-rc") + KOTLIN_1_8_RC("kotlin-1.8-rc"), + @SerializedName("kotlin-1.9-rc") + KOTLIN_1_9_RC("kotlin-1.9-rc"), + @SerializedName("kotlin-2.0-rc") + KOTLIN_2_0_RC("kotlin-2.0-rc"), + @SerializedName("kotlin-2.3-rc") + KOTLIN_2_3_RC("kotlin-2.3-rc"), + @SerializedName("cpp-17-rc") + CPP_17_RC("cpp-17-rc"), + @SerializedName("cpp-20-rc") + CPP_20_RC("cpp-20-rc"), + @SerializedName("bun-1.0-rc") + BUN_1_0_RC("bun-1.0-rc"), + @SerializedName("bun-1.1-rc") + BUN_1_1_RC("bun-1.1-rc"), + @SerializedName("bun-1.2-rc") + BUN_1_2_RC("bun-1.2-rc"), + @SerializedName("bun-1.3-rc") + BUN_1_3_RC("bun-1.3-rc"), + @SerializedName("go-1.23-rc") + GO_1_23_RC("go-1.23-rc"), + @SerializedName("go-1.24-rc") + GO_1_24_RC("go-1.24-rc"), + @SerializedName("go-1.25-rc") + GO_1_25_RC("go-1.25-rc"), + @SerializedName("go-1.26-rc") + GO_1_26_RC("go-1.26-rc"), + @SerializedName("static-1-rc") + STATIC_1_RC("static-1-rc"), + @SerializedName("flutter-3.24-rc") + FLUTTER_3_24_RC("flutter-3.24-rc"), + @SerializedName("flutter-3.27-rc") + FLUTTER_3_27_RC("flutter-3.27-rc"), + @SerializedName("flutter-3.29-rc") + FLUTTER_3_29_RC("flutter-3.29-rc"), + @SerializedName("flutter-3.32-rc") + FLUTTER_3_32_RC("flutter-3.32-rc"), + @SerializedName("flutter-3.35-rc") + FLUTTER_3_35_RC("flutter-3.35-rc"), + @SerializedName("flutter-3.38-rc") + FLUTTER_3_38_RC("flutter-3.38-rc"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/DatabaseType.kt b/src/main/kotlin/io/appwrite/enums/DatabaseType.kt index 8aeb0f4..f2dfc31 100644 --- a/src/main/kotlin/io/appwrite/enums/DatabaseType.kt +++ b/src/main/kotlin/io/appwrite/enums/DatabaseType.kt @@ -6,7 +6,11 @@ enum class DatabaseType(val value: String) { @SerializedName("legacy") LEGACY("legacy"), @SerializedName("tablesdb") - TABLESDB("tablesdb"); + TABLESDB("tablesdb"), + @SerializedName("documentsdb") + DOCUMENTSDB("documentsdb"), + @SerializedName("vectorsdb") + VECTORSDB("vectorsdb"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt b/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt new file mode 100644 index 0000000..491eec4 --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt @@ -0,0 +1,16 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class DatabasesIndexType(val value: String) { + @SerializedName("key") + KEY("key"), + @SerializedName("fulltext") + FULLTEXT("fulltext"), + @SerializedName("unique") + UNIQUE("unique"), + @SerializedName("spatial") + SPATIAL("spatial"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt b/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt new file mode 100644 index 0000000..97ab70c --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt @@ -0,0 +1,16 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class DocumentsDBIndexType(val value: String) { + @SerializedName("key") + KEY("key"), + @SerializedName("fulltext") + FULLTEXT("fulltext"), + @SerializedName("unique") + UNIQUE("unique"), + @SerializedName("spatial") + SPATIAL("spatial"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Model.kt b/src/main/kotlin/io/appwrite/enums/Model.kt new file mode 100644 index 0000000..7ec7ace --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/Model.kt @@ -0,0 +1,10 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class Model(val value: String) { + @SerializedName("embeddinggemma") + EMBEDDINGGEMMA("embeddinggemma"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Runtime.kt b/src/main/kotlin/io/appwrite/enums/Runtime.kt index 4991836..77d059d 100644 --- a/src/main/kotlin/io/appwrite/enums/Runtime.kt +++ b/src/main/kotlin/io/appwrite/enums/Runtime.kt @@ -174,7 +174,179 @@ enum class Runtime(val value: String) { @SerializedName("flutter-3.35") FLUTTER_3_35("flutter-3.35"), @SerializedName("flutter-3.38") - FLUTTER_3_38("flutter-3.38"); + FLUTTER_3_38("flutter-3.38"), + @SerializedName("node-14.5-rc") + NODE_14_5_RC("node-14.5-rc"), + @SerializedName("node-16.0-rc") + NODE_16_0_RC("node-16.0-rc"), + @SerializedName("node-18.0-rc") + NODE_18_0_RC("node-18.0-rc"), + @SerializedName("node-19.0-rc") + NODE_19_0_RC("node-19.0-rc"), + @SerializedName("node-20.0-rc") + NODE_20_0_RC("node-20.0-rc"), + @SerializedName("node-21.0-rc") + NODE_21_0_RC("node-21.0-rc"), + @SerializedName("node-22-rc") + NODE_22_RC("node-22-rc"), + @SerializedName("node-23-rc") + NODE_23_RC("node-23-rc"), + @SerializedName("node-24-rc") + NODE_24_RC("node-24-rc"), + @SerializedName("node-25-rc") + NODE_25_RC("node-25-rc"), + @SerializedName("php-8.0-rc") + PHP_8_0_RC("php-8.0-rc"), + @SerializedName("php-8.1-rc") + PHP_8_1_RC("php-8.1-rc"), + @SerializedName("php-8.2-rc") + PHP_8_2_RC("php-8.2-rc"), + @SerializedName("php-8.3-rc") + PHP_8_3_RC("php-8.3-rc"), + @SerializedName("php-8.4-rc") + PHP_8_4_RC("php-8.4-rc"), + @SerializedName("ruby-3.0-rc") + RUBY_3_0_RC("ruby-3.0-rc"), + @SerializedName("ruby-3.1-rc") + RUBY_3_1_RC("ruby-3.1-rc"), + @SerializedName("ruby-3.2-rc") + RUBY_3_2_RC("ruby-3.2-rc"), + @SerializedName("ruby-3.3-rc") + RUBY_3_3_RC("ruby-3.3-rc"), + @SerializedName("ruby-3.4-rc") + RUBY_3_4_RC("ruby-3.4-rc"), + @SerializedName("ruby-4.0-rc") + RUBY_4_0_RC("ruby-4.0-rc"), + @SerializedName("python-3.8-rc") + PYTHON_3_8_RC("python-3.8-rc"), + @SerializedName("python-3.9-rc") + PYTHON_3_9_RC("python-3.9-rc"), + @SerializedName("python-3.10-rc") + PYTHON_3_10_RC("python-3.10-rc"), + @SerializedName("python-3.11-rc") + PYTHON_3_11_RC("python-3.11-rc"), + @SerializedName("python-3.12-rc") + PYTHON_3_12_RC("python-3.12-rc"), + @SerializedName("python-3.13-rc") + PYTHON_3_13_RC("python-3.13-rc"), + @SerializedName("python-3.14-rc") + PYTHON_3_14_RC("python-3.14-rc"), + @SerializedName("python-ml-3.11-rc") + PYTHON_ML_3_11_RC("python-ml-3.11-rc"), + @SerializedName("python-ml-3.12-rc") + PYTHON_ML_3_12_RC("python-ml-3.12-rc"), + @SerializedName("python-ml-3.13-rc") + PYTHON_ML_3_13_RC("python-ml-3.13-rc"), + @SerializedName("deno-1.40-rc") + DENO_1_40_RC("deno-1.40-rc"), + @SerializedName("deno-1.46-rc") + DENO_1_46_RC("deno-1.46-rc"), + @SerializedName("deno-2.0-rc") + DENO_2_0_RC("deno-2.0-rc"), + @SerializedName("deno-2.5-rc") + DENO_2_5_RC("deno-2.5-rc"), + @SerializedName("deno-2.6-rc") + DENO_2_6_RC("deno-2.6-rc"), + @SerializedName("dart-2.15-rc") + DART_2_15_RC("dart-2.15-rc"), + @SerializedName("dart-2.16-rc") + DART_2_16_RC("dart-2.16-rc"), + @SerializedName("dart-2.17-rc") + DART_2_17_RC("dart-2.17-rc"), + @SerializedName("dart-2.18-rc") + DART_2_18_RC("dart-2.18-rc"), + @SerializedName("dart-2.19-rc") + DART_2_19_RC("dart-2.19-rc"), + @SerializedName("dart-3.0-rc") + DART_3_0_RC("dart-3.0-rc"), + @SerializedName("dart-3.1-rc") + DART_3_1_RC("dart-3.1-rc"), + @SerializedName("dart-3.3-rc") + DART_3_3_RC("dart-3.3-rc"), + @SerializedName("dart-3.5-rc") + DART_3_5_RC("dart-3.5-rc"), + @SerializedName("dart-3.8-rc") + DART_3_8_RC("dart-3.8-rc"), + @SerializedName("dart-3.9-rc") + DART_3_9_RC("dart-3.9-rc"), + @SerializedName("dart-3.10-rc") + DART_3_10_RC("dart-3.10-rc"), + @SerializedName("dotnet-6.0-rc") + DOTNET_6_0_RC("dotnet-6.0-rc"), + @SerializedName("dotnet-7.0-rc") + DOTNET_7_0_RC("dotnet-7.0-rc"), + @SerializedName("dotnet-8.0-rc") + DOTNET_8_0_RC("dotnet-8.0-rc"), + @SerializedName("dotnet-10-rc") + DOTNET_10_RC("dotnet-10-rc"), + @SerializedName("java-8.0-rc") + JAVA_8_0_RC("java-8.0-rc"), + @SerializedName("java-11.0-rc") + JAVA_11_0_RC("java-11.0-rc"), + @SerializedName("java-17.0-rc") + JAVA_17_0_RC("java-17.0-rc"), + @SerializedName("java-18.0-rc") + JAVA_18_0_RC("java-18.0-rc"), + @SerializedName("java-21.0-rc") + JAVA_21_0_RC("java-21.0-rc"), + @SerializedName("java-22-rc") + JAVA_22_RC("java-22-rc"), + @SerializedName("java-25-rc") + JAVA_25_RC("java-25-rc"), + @SerializedName("swift-5.5-rc") + SWIFT_5_5_RC("swift-5.5-rc"), + @SerializedName("swift-5.8-rc") + SWIFT_5_8_RC("swift-5.8-rc"), + @SerializedName("swift-5.9-rc") + SWIFT_5_9_RC("swift-5.9-rc"), + @SerializedName("swift-5.10-rc") + SWIFT_5_10_RC("swift-5.10-rc"), + @SerializedName("swift-6.2-rc") + SWIFT_6_2_RC("swift-6.2-rc"), + @SerializedName("kotlin-1.6-rc") + KOTLIN_1_6_RC("kotlin-1.6-rc"), + @SerializedName("kotlin-1.8-rc") + KOTLIN_1_8_RC("kotlin-1.8-rc"), + @SerializedName("kotlin-1.9-rc") + KOTLIN_1_9_RC("kotlin-1.9-rc"), + @SerializedName("kotlin-2.0-rc") + KOTLIN_2_0_RC("kotlin-2.0-rc"), + @SerializedName("kotlin-2.3-rc") + KOTLIN_2_3_RC("kotlin-2.3-rc"), + @SerializedName("cpp-17-rc") + CPP_17_RC("cpp-17-rc"), + @SerializedName("cpp-20-rc") + CPP_20_RC("cpp-20-rc"), + @SerializedName("bun-1.0-rc") + BUN_1_0_RC("bun-1.0-rc"), + @SerializedName("bun-1.1-rc") + BUN_1_1_RC("bun-1.1-rc"), + @SerializedName("bun-1.2-rc") + BUN_1_2_RC("bun-1.2-rc"), + @SerializedName("bun-1.3-rc") + BUN_1_3_RC("bun-1.3-rc"), + @SerializedName("go-1.23-rc") + GO_1_23_RC("go-1.23-rc"), + @SerializedName("go-1.24-rc") + GO_1_24_RC("go-1.24-rc"), + @SerializedName("go-1.25-rc") + GO_1_25_RC("go-1.25-rc"), + @SerializedName("go-1.26-rc") + GO_1_26_RC("go-1.26-rc"), + @SerializedName("static-1-rc") + STATIC_1_RC("static-1-rc"), + @SerializedName("flutter-3.24-rc") + FLUTTER_3_24_RC("flutter-3.24-rc"), + @SerializedName("flutter-3.27-rc") + FLUTTER_3_27_RC("flutter-3.27-rc"), + @SerializedName("flutter-3.29-rc") + FLUTTER_3_29_RC("flutter-3.29-rc"), + @SerializedName("flutter-3.32-rc") + FLUTTER_3_32_RC("flutter-3.32-rc"), + @SerializedName("flutter-3.35-rc") + FLUTTER_3_35_RC("flutter-3.35-rc"), + @SerializedName("flutter-3.38-rc") + FLUTTER_3_38_RC("flutter-3.38-rc"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Scopes.kt b/src/main/kotlin/io/appwrite/enums/Scopes.kt index 1b77212..0dcf844 100644 --- a/src/main/kotlin/io/appwrite/enums/Scopes.kt +++ b/src/main/kotlin/io/appwrite/enums/Scopes.kt @@ -117,6 +117,14 @@ enum class Scopes(val value: String) { TOKENS_READ("tokens.read"), @SerializedName("tokens.write") TOKENS_WRITE("tokens.write"), + @SerializedName("webhooks.read") + WEBHOOKS_READ("webhooks.read"), + @SerializedName("webhooks.write") + WEBHOOKS_WRITE("webhooks.write"), + @SerializedName("project.read") + PROJECT_READ("project.read"), + @SerializedName("project.write") + PROJECT_WRITE("project.write"), @SerializedName("policies.write") POLICIES_WRITE("policies.write"), @SerializedName("policies.read") diff --git a/src/main/kotlin/io/appwrite/enums/IndexType.kt b/src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt similarity index 86% rename from src/main/kotlin/io/appwrite/enums/IndexType.kt rename to src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt index eeebc06..452fe9d 100644 --- a/src/main/kotlin/io/appwrite/enums/IndexType.kt +++ b/src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt @@ -2,7 +2,7 @@ package io.appwrite.enums import com.google.gson.annotations.SerializedName -enum class IndexType(val value: String) { +enum class TablesDBIndexType(val value: String) { @SerializedName("key") KEY("key"), @SerializedName("fulltext") diff --git a/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt b/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt new file mode 100644 index 0000000..898f5ac --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt @@ -0,0 +1,20 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class VectorsDBIndexType(val value: String) { + @SerializedName("hnsw_euclidean") + HNSW_EUCLIDEAN("hnsw_euclidean"), + @SerializedName("hnsw_dot") + HNSW_DOT("hnsw_dot"), + @SerializedName("hnsw_cosine") + HNSW_COSINE("hnsw_cosine"), + @SerializedName("object") + OBJECT("object"), + @SerializedName("key") + KEY("key"), + @SerializedName("unique") + UNIQUE("unique"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeObject.kt b/src/main/kotlin/io/appwrite/models/AttributeObject.kt new file mode 100644 index 0000000..82d0292 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/AttributeObject.kt @@ -0,0 +1,87 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast +import io.appwrite.enums.AttributeStatus + +/** + * AttributeObject + */ +data class AttributeObject( + /** + * Attribute Key. + */ + @SerializedName("key") + val key: String, + + /** + * Attribute type. + */ + @SerializedName("type") + val type: String, + + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: AttributeStatus, + + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + @SerializedName("error") + val error: String, + + /** + * Is attribute required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is attribute an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Attribute creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Attribute update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status.value as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = AttributeObject( + key = map["key"] as String, + type = map["type"] as String, + status = AttributeStatus.values().find { it.value == map["status"] as String }!!, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeVector.kt b/src/main/kotlin/io/appwrite/models/AttributeVector.kt new file mode 100644 index 0000000..96ffece --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/AttributeVector.kt @@ -0,0 +1,95 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast +import io.appwrite.enums.AttributeStatus + +/** + * AttributeVector + */ +data class AttributeVector( + /** + * Attribute Key. + */ + @SerializedName("key") + val key: String, + + /** + * Attribute type. + */ + @SerializedName("type") + val type: String, + + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: AttributeStatus, + + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + @SerializedName("error") + val error: String, + + /** + * Is attribute required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is attribute an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Attribute creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Attribute update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Vector dimensions. + */ + @SerializedName("size") + val size: Long, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status.value as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "size" to size as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = AttributeVector( + key = map["key"] as String, + type = map["type"] as String, + status = AttributeStatus.values().find { it.value == map["status"] as String }!!, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + size = (map["size"] as Number).toLong(), + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Document.kt b/src/main/kotlin/io/appwrite/models/Document.kt index 830fe38..c55e6d2 100644 --- a/src/main/kotlin/io/appwrite/models/Document.kt +++ b/src/main/kotlin/io/appwrite/models/Document.kt @@ -17,7 +17,7 @@ data class Document( * Document sequence ID. */ @SerializedName("\$sequence") - val sequence: Long, + val sequence: String, /** * Collection ID. @@ -69,7 +69,7 @@ data class Document( companion object { operator fun invoke( id: String, - sequence: Long, + sequence: String, collectionId: String, databaseId: String, createdAt: String, @@ -93,7 +93,7 @@ data class Document( nestedType: Class ) = Document( id = map["\$id"] as String, - sequence = (map["\$sequence"] as Number).toLong(), + sequence = map["\$sequence"] as String, collectionId = map["\$collectionId"] as String, databaseId = map["\$databaseId"] as String, createdAt = map["\$createdAt"] as String, diff --git a/src/main/kotlin/io/appwrite/models/Embedding.kt b/src/main/kotlin/io/appwrite/models/Embedding.kt new file mode 100644 index 0000000..24d931f --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Embedding.kt @@ -0,0 +1,54 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Embedding + */ +data class Embedding( + /** + * Embedding model used to generate embeddings. + */ + @SerializedName("model") + val model: String, + + /** + * Number of dimensions for each embedding vector. + */ + @SerializedName("dimension") + val dimension: Long, + + /** + * Embedding vector values. If an error occurs, this will be an empty array. + */ + @SerializedName("embedding") + val embedding: List, + + /** + * Error message if embedding generation fails. Empty string if no error. + */ + @SerializedName("error") + val error: String, + +) { + fun toMap(): Map = mapOf( + "model" to model as Any, + "dimension" to dimension as Any, + "embedding" to embedding as Any, + "error" to error as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Embedding( + model = map["model"] as String, + dimension = (map["dimension"] as Number).toLong(), + embedding = map["embedding"] as List, + error = map["error"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/EmbeddingList.kt b/src/main/kotlin/io/appwrite/models/EmbeddingList.kt new file mode 100644 index 0000000..cd6acbd --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/EmbeddingList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Embedding list + */ +data class EmbeddingList( + /** + * Total number of embeddings that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of embeddings. + */ + @SerializedName("embeddings") + val embeddings: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "embeddings" to embeddings.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = EmbeddingList( + total = (map["total"] as Number).toLong(), + embeddings = (map["embeddings"] as List>).map { Embedding.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Function.kt b/src/main/kotlin/io/appwrite/models/Function.kt index 6cc111f..566c58d 100644 --- a/src/main/kotlin/io/appwrite/models/Function.kt +++ b/src/main/kotlin/io/appwrite/models/Function.kt @@ -61,6 +61,12 @@ data class Function( @SerializedName("runtime") val runtime: String, + /** + * How many days to keep the non-active deployments before they will be automatically deleted. + */ + @SerializedName("deploymentRetention") + val deploymentRetention: Long, + /** * Function's active deployment ID. */ @@ -170,10 +176,16 @@ data class Function( val providerSilentMode: Boolean, /** - * Machine specification for builds and executions. + * Machine specification for deployment builds. */ - @SerializedName("specification") - val specification: String, + @SerializedName("buildSpecification") + val buildSpecification: String, + + /** + * Machine specification for executions. + */ + @SerializedName("runtimeSpecification") + val runtimeSpecification: String, ) { fun toMap(): Map = mapOf( @@ -186,6 +198,7 @@ data class Function( "live" to live as Any, "logging" to logging as Any, "runtime" to runtime as Any, + "deploymentRetention" to deploymentRetention as Any, "deploymentId" to deploymentId as Any, "deploymentCreatedAt" to deploymentCreatedAt as Any, "latestDeploymentId" to latestDeploymentId as Any, @@ -204,7 +217,8 @@ data class Function( "providerBranch" to providerBranch as Any, "providerRootDirectory" to providerRootDirectory as Any, "providerSilentMode" to providerSilentMode as Any, - "specification" to specification as Any, + "buildSpecification" to buildSpecification as Any, + "runtimeSpecification" to runtimeSpecification as Any, ) companion object { @@ -222,6 +236,7 @@ data class Function( live = map["live"] as Boolean, logging = map["logging"] as Boolean, runtime = map["runtime"] as String, + deploymentRetention = (map["deploymentRetention"] as Number).toLong(), deploymentId = map["deploymentId"] as String, deploymentCreatedAt = map["deploymentCreatedAt"] as String, latestDeploymentId = map["latestDeploymentId"] as String, @@ -240,7 +255,8 @@ data class Function( providerBranch = map["providerBranch"] as String, providerRootDirectory = map["providerRootDirectory"] as String, providerSilentMode = map["providerSilentMode"] as Boolean, - specification = map["specification"] as String, + buildSpecification = map["buildSpecification"] as String, + runtimeSpecification = map["runtimeSpecification"] as String, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Log.kt b/src/main/kotlin/io/appwrite/models/Log.kt index c2df960..fe8c60b 100644 --- a/src/main/kotlin/io/appwrite/models/Log.kt +++ b/src/main/kotlin/io/appwrite/models/Log.kt @@ -14,19 +14,19 @@ data class Log( val event: String, /** - * User ID. + * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. */ @SerializedName("userId") val userId: String, /** - * User Email. + * User email of the actor recorded for this log. During impersonation, this is the original impersonator. */ @SerializedName("userEmail") val userEmail: String, /** - * User Name. + * User name of the actor recorded for this log. During impersonation, this is the original impersonator. */ @SerializedName("userName") val userName: String, diff --git a/src/main/kotlin/io/appwrite/models/Row.kt b/src/main/kotlin/io/appwrite/models/Row.kt index 793d278..488ec7b 100644 --- a/src/main/kotlin/io/appwrite/models/Row.kt +++ b/src/main/kotlin/io/appwrite/models/Row.kt @@ -17,7 +17,7 @@ data class Row( * Row sequence ID. */ @SerializedName("\$sequence") - val sequence: Long, + val sequence: String, /** * Table ID. @@ -69,7 +69,7 @@ data class Row( companion object { operator fun invoke( id: String, - sequence: Long, + sequence: String, tableId: String, databaseId: String, createdAt: String, @@ -93,7 +93,7 @@ data class Row( nestedType: Class ) = Row( id = map["\$id"] as String, - sequence = (map["\$sequence"] as Number).toLong(), + sequence = map["\$sequence"] as String, tableId = map["\$tableId"] as String, databaseId = map["\$databaseId"] as String, createdAt = map["\$createdAt"] as String, diff --git a/src/main/kotlin/io/appwrite/models/Site.kt b/src/main/kotlin/io/appwrite/models/Site.kt index c246ac1..0359543 100644 --- a/src/main/kotlin/io/appwrite/models/Site.kt +++ b/src/main/kotlin/io/appwrite/models/Site.kt @@ -55,6 +55,12 @@ data class Site( @SerializedName("framework") val framework: String, + /** + * How many days to keep the non-active deployments before they will be automatically deleted. + */ + @SerializedName("deploymentRetention") + val deploymentRetention: Long, + /** * Site's active deployment ID. */ @@ -121,6 +127,12 @@ data class Site( @SerializedName("buildCommand") val buildCommand: String, + /** + * Custom command to use when starting site runtime. + */ + @SerializedName("startCommand") + val startCommand: String, + /** * The directory where the site build output is located. */ @@ -158,10 +170,16 @@ data class Site( val providerSilentMode: Boolean, /** - * Machine specification for builds and executions. + * Machine specification for deployment builds. */ - @SerializedName("specification") - val specification: String, + @SerializedName("buildSpecification") + val buildSpecification: String, + + /** + * Machine specification for SSR executions. + */ + @SerializedName("runtimeSpecification") + val runtimeSpecification: String, /** * Site build runtime. @@ -191,6 +209,7 @@ data class Site( "live" to live as Any, "logging" to logging as Any, "framework" to framework as Any, + "deploymentRetention" to deploymentRetention as Any, "deploymentId" to deploymentId as Any, "deploymentCreatedAt" to deploymentCreatedAt as Any, "deploymentScreenshotLight" to deploymentScreenshotLight as Any, @@ -202,13 +221,15 @@ data class Site( "timeout" to timeout as Any, "installCommand" to installCommand as Any, "buildCommand" to buildCommand as Any, + "startCommand" to startCommand as Any, "outputDirectory" to outputDirectory as Any, "installationId" to installationId as Any, "providerRepositoryId" to providerRepositoryId as Any, "providerBranch" to providerBranch as Any, "providerRootDirectory" to providerRootDirectory as Any, "providerSilentMode" to providerSilentMode as Any, - "specification" to specification as Any, + "buildSpecification" to buildSpecification as Any, + "runtimeSpecification" to runtimeSpecification as Any, "buildRuntime" to buildRuntime as Any, "adapter" to adapter as Any, "fallbackFile" to fallbackFile as Any, @@ -228,6 +249,7 @@ data class Site( live = map["live"] as Boolean, logging = map["logging"] as Boolean, framework = map["framework"] as String, + deploymentRetention = (map["deploymentRetention"] as Number).toLong(), deploymentId = map["deploymentId"] as String, deploymentCreatedAt = map["deploymentCreatedAt"] as String, deploymentScreenshotLight = map["deploymentScreenshotLight"] as String, @@ -239,13 +261,15 @@ data class Site( timeout = (map["timeout"] as Number).toLong(), installCommand = map["installCommand"] as String, buildCommand = map["buildCommand"] as String, + startCommand = map["startCommand"] as String, outputDirectory = map["outputDirectory"] as String, installationId = map["installationId"] as String, providerRepositoryId = map["providerRepositoryId"] as String, providerBranch = map["providerBranch"] as String, providerRootDirectory = map["providerRootDirectory"] as String, providerSilentMode = map["providerSilentMode"] as Boolean, - specification = map["specification"] as String, + buildSpecification = map["buildSpecification"] as String, + runtimeSpecification = map["runtimeSpecification"] as String, buildRuntime = map["buildRuntime"] as String, adapter = map["adapter"] as String, fallbackFile = map["fallbackFile"] as String, diff --git a/src/main/kotlin/io/appwrite/models/User.kt b/src/main/kotlin/io/appwrite/models/User.kt index e9a1144..a76d61f 100644 --- a/src/main/kotlin/io/appwrite/models/User.kt +++ b/src/main/kotlin/io/appwrite/models/User.kt @@ -121,6 +121,18 @@ data class User( @SerializedName("accessedAt") val accessedAt: String, + /** + * Whether the user can impersonate other users. + */ + @SerializedName("impersonator") + var impersonator: Boolean?, + + /** + * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. + */ + @SerializedName("impersonatorUserId") + var impersonatorUserId: String?, + ) { fun toMap(): Map = mapOf( "\$id" to id as Any, @@ -142,6 +154,8 @@ data class User( "prefs" to prefs.toMap() as Any, "targets" to targets.map { it.toMap() } as Any, "accessedAt" to accessedAt as Any, + "impersonator" to impersonator as Any, + "impersonatorUserId" to impersonatorUserId as Any, ) companion object { @@ -165,6 +179,8 @@ data class User( prefs: Preferences>, targets: List, accessedAt: String, + impersonator: Boolean?, + impersonatorUserId: String?, ) = User>( id, createdAt, @@ -185,6 +201,8 @@ data class User( prefs, targets, accessedAt, + impersonator, + impersonatorUserId, ) @Suppress("UNCHECKED_CAST") @@ -211,6 +229,8 @@ data class User( prefs = Preferences.from(map = map["prefs"] as Map, nestedType), targets = (map["targets"] as List>).map { Target.from(map = it) }, accessedAt = map["accessedAt"] as String, + impersonator = map["impersonator"] as? Boolean, + impersonatorUserId = map["impersonatorUserId"] as? String, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt b/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt new file mode 100644 index 0000000..4c15f3e --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt @@ -0,0 +1,126 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * VectorsDB Collection + */ +data class VectorsdbCollection( + /** + * Collection ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Collection creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Collection update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + @SerializedName("\$permissions") + val permissions: List, + + /** + * Database ID. + */ + @SerializedName("databaseId") + val databaseId: String, + + /** + * Collection name. + */ + @SerializedName("name") + val name: String, + + /** + * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + */ + @SerializedName("enabled") + val enabled: Boolean, + + /** + * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + @SerializedName("documentSecurity") + val documentSecurity: Boolean, + + /** + * Collection attributes. + */ + @SerializedName("attributes") + val attributes: List, + + /** + * Collection indexes. + */ + @SerializedName("indexes") + val indexes: List, + + /** + * Maximum document size in bytes. Returns 0 when no limit applies. + */ + @SerializedName("bytesMax") + val bytesMax: Long, + + /** + * Currently used document size in bytes based on defined attributes. + */ + @SerializedName("bytesUsed") + val bytesUsed: Long, + + /** + * Embedding dimension. + */ + @SerializedName("dimension") + val dimension: Long, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "\$permissions" to permissions as Any, + "databaseId" to databaseId as Any, + "name" to name as Any, + "enabled" to enabled as Any, + "documentSecurity" to documentSecurity as Any, + "attributes" to attributes as Any, + "indexes" to indexes.map { it.toMap() } as Any, + "bytesMax" to bytesMax as Any, + "bytesUsed" to bytesUsed as Any, + "dimension" to dimension as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = VectorsdbCollection( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + permissions = map["\$permissions"] as List, + databaseId = map["databaseId"] as String, + name = map["name"] as String, + enabled = map["enabled"] as Boolean, + documentSecurity = map["documentSecurity"] as Boolean, + attributes = map["attributes"] as List, + indexes = (map["indexes"] as List>).map { Index.from(map = it) }, + bytesMax = (map["bytesMax"] as Number).toLong(), + bytesUsed = (map["bytesUsed"] as Number).toLong(), + dimension = (map["dimension"] as Number).toLong(), + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt b/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt new file mode 100644 index 0000000..44f0285 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * VectorsDB Collections List + */ +data class VectorsdbCollectionList( + /** + * Total number of collections that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of collections. + */ + @SerializedName("collections") + val collections: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "collections" to collections.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = VectorsdbCollectionList( + total = (map["total"] as Number).toLong(), + collections = (map["collections"] as List>).map { VectorsdbCollection.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Webhook.kt b/src/main/kotlin/io/appwrite/models/Webhook.kt new file mode 100644 index 0000000..23b1bf7 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Webhook.kt @@ -0,0 +1,126 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Webhook + */ +data class Webhook( + /** + * Webhook ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Webhook creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Webhook update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Webhook name. + */ + @SerializedName("name") + val name: String, + + /** + * Webhook URL endpoint. + */ + @SerializedName("url") + val url: String, + + /** + * Webhook trigger events. + */ + @SerializedName("events") + val events: List, + + /** + * Indicated if SSL / TLS Certificate verification is enabled. + */ + @SerializedName("security") + val security: Boolean, + + /** + * HTTP basic authentication username. + */ + @SerializedName("httpUser") + val httpUser: String, + + /** + * HTTP basic authentication password. + */ + @SerializedName("httpPass") + val httpPass: String, + + /** + * Signature key which can be used to validated incoming + */ + @SerializedName("signatureKey") + val signatureKey: String, + + /** + * Indicates if this webhook is enabled. + */ + @SerializedName("enabled") + val enabled: Boolean, + + /** + * Webhook error logs from the most recent failure. + */ + @SerializedName("logs") + val logs: String, + + /** + * Number of consecutive failed webhook attempts. + */ + @SerializedName("attempts") + val attempts: Long, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "name" to name as Any, + "url" to url as Any, + "events" to events as Any, + "security" to security as Any, + "httpUser" to httpUser as Any, + "httpPass" to httpPass as Any, + "signatureKey" to signatureKey as Any, + "enabled" to enabled as Any, + "logs" to logs as Any, + "attempts" to attempts as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Webhook( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + name = map["name"] as String, + url = map["url"] as String, + events = map["events"] as List, + security = map["security"] as Boolean, + httpUser = map["httpUser"] as String, + httpPass = map["httpPass"] as String, + signatureKey = map["signatureKey"] as String, + enabled = map["enabled"] as Boolean, + logs = map["logs"] as String, + attempts = (map["attempts"] as Number).toLong(), + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/WebhookList.kt b/src/main/kotlin/io/appwrite/models/WebhookList.kt new file mode 100644 index 0000000..887ad05 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/WebhookList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Webhooks List + */ +data class WebhookList( + /** + * Total number of webhooks that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of webhooks. + */ + @SerializedName("webhooks") + val webhooks: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "webhooks" to webhooks.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = WebhookList( + total = (map["total"] as Number).toLong(), + webhooks = (map["webhooks"] as List>).map { Webhook.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Databases.kt b/src/main/kotlin/io/appwrite/services/Databases.kt index ef4f371..d483f23 100644 --- a/src/main/kotlin/io/appwrite/services/Databases.kt +++ b/src/main/kotlin/io/appwrite/services/Databases.kt @@ -3537,7 +3537,7 @@ class Databases(client: Client) : Service(client) { databaseId: String, collectionId: String, key: String, - type: io.appwrite.enums.IndexType, + type: io.appwrite.enums.DatabasesIndexType, attributes: List, orders: List? = null, lengths: List? = null, diff --git a/src/main/kotlin/io/appwrite/services/DocumentsDB.kt b/src/main/kotlin/io/appwrite/services/DocumentsDB.kt new file mode 100644 index 0000000..82a929d --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/DocumentsDB.kt @@ -0,0 +1,1588 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * +**/ +class DocumentsDB(client: Client) : Service(client) { + + /** + * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name + * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.DatabaseList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + queries: List? = null, + search: String? = null, + total: Boolean? = null, + ): io.appwrite.models.DatabaseList { + val apiPath = "/documentsdb" + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DatabaseList = { + io.appwrite.models.DatabaseList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.DatabaseList::class.java, + converter, + ) + } + + /** + * Create a new Database. + * + * + * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Database name. Max length: 128 chars. + * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun create( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/documentsdb" + + val apiParams = mutableMapOf( + "databaseId" to databaseId, + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). + * @return [io.appwrite.models.TransactionList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listTransactions( + queries: List? = null, + ): io.appwrite.models.TransactionList { + val apiPath = "/documentsdb/transactions" + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.TransactionList = { + io.appwrite.models.TransactionList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.TransactionList::class.java, + converter, + ) + } + + /** + * + * + * @param ttl Seconds before the transaction expires. + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createTransaction( + ttl: Long? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/documentsdb/transactions" + + val apiParams = mutableMapOf( + "ttl" to ttl, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @return [io.appwrite.models.Transaction] + */ + @Throws(AppwriteException::class) + suspend fun getTransaction( + transactionId: String, + ): io.appwrite.models.Transaction { + val apiPath = "/documentsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @param commit Commit transaction? + * @param rollback Rollback transaction? + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateTransaction( + transactionId: String, + commit: Boolean? = null, + rollback: Boolean? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/documentsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + "commit" to commit, + "rollback" to rollback, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteTransaction( + transactionId: String, + ): Any { + val apiPath = "/documentsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @param operations Array of staged operations. + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createOperations( + transactionId: String, + operations: List? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/documentsdb/transactions/{transactionId}/operations" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + "operations" to operations, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + * + * @param databaseId Database ID. + * @return [io.appwrite.models.Database] + */ + @Throws(AppwriteException::class) + suspend fun get( + databaseId: String, + ): io.appwrite.models.Database { + val apiPath = "/documentsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * Update a database by its unique ID. + * + * @param databaseId Database ID. + * @param name Database name. Max length: 128 chars. + * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/documentsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + * + * @param databaseId Database ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + databaseId: String, + ): Any { + val apiPath = "/documentsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + * + * @param databaseId Database ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.CollectionList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listCollections( + databaseId: String, + queries: List? = null, + search: String? = null, + total: Boolean? = null, + ): io.appwrite.models.CollectionList { + val apiPath = "/documentsdb/{databaseId}/collections" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.CollectionList = { + io.appwrite.models.CollectionList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.CollectionList::class.java, + converter, + ) + } + + /** + * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Collection name. Max length: 128 chars. + * @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param attributes Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @return [io.appwrite.models.Collection] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createCollection( + databaseId: String, + collectionId: String, + name: String, + permissions: List? = null, + documentSecurity: Boolean? = null, + enabled: Boolean? = null, + attributes: List? = null, + indexes: List? = null, + ): io.appwrite.models.Collection { + val apiPath = "/documentsdb/{databaseId}/collections" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "collectionId" to collectionId, + "name" to name, + "permissions" to permissions, + "documentSecurity" to documentSecurity, + "enabled" to enabled, + "attributes" to attributes, + "indexes" to indexes, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Collection = { + io.appwrite.models.Collection.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Collection::class.java, + converter, + ) + } + + /** + * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @return [io.appwrite.models.Collection] + */ + @Throws(AppwriteException::class) + suspend fun getCollection( + databaseId: String, + collectionId: String, + ): io.appwrite.models.Collection { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Collection = { + io.appwrite.models.Collection.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Collection::class.java, + converter, + ) + } + + /** + * Update a collection by its unique ID. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param name Collection name. Max length: 128 chars. + * @param permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @return [io.appwrite.models.Collection] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateCollection( + databaseId: String, + collectionId: String, + name: String, + permissions: List? = null, + documentSecurity: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Collection { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "name" to name, + "permissions" to permissions, + "documentSecurity" to documentSecurity, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Collection = { + io.appwrite.models.Collection.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Collection::class.java, + converter, + ) + } + + /** + * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteCollection( + databaseId: String, + collectionId: String, + ): Any { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + total: Boolean? = null, + ttl: Long? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + "total" to total, + "ttl" to ttl, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + total: Boolean? = null, + ttl: Long? = null, + ): io.appwrite.models.DocumentList> = listDocuments( + databaseId, + collectionId, + queries, + transactionId, + total, + ttl, + nestedType = classOf(), + ) + + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Document data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documentId" to documentId, + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Document data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + ): io.appwrite.models.Document> = createDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] + */ + @Throws(AppwriteException::class) + suspend fun createDocuments( + databaseId: String, + collectionId: String, + documents: List, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documents" to documents, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] + */ + @Throws(AppwriteException::class) + suspend fun createDocuments( + databaseId: String, + collectionId: String, + documents: List, + ): io.appwrite.models.DocumentList> = createDocuments( + databaseId, + collectionId, + documents, + nestedType = classOf(), + ) + + /** + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documents Array of document data as JSON objects. May contain partial documents. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocuments( + databaseId: String, + collectionId: String, + documents: List, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documents" to documents, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documents Array of document data as JSON objects. May contain partial documents. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocuments( + databaseId: String, + collectionId: String, + documents: List, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = upsertDocuments( + databaseId, + collectionId, + documents, + transactionId, + nestedType = classOf(), + ) + + /** + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = null, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "data" to data, + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = null, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = updateDocuments( + databaseId, + collectionId, + data, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = deleteDocuments( + databaseId, + collectionId, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = getDocument( + databaseId, + collectionId, + documentId, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required fields of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required fields of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = upsertDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + transactionId, + nestedType = classOf(), + ) + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only fields and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only fields and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = updateDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + transactionId, + nestedType = classOf(), + ) + + /** + * Delete a document by its unique ID. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param transactionId Transaction ID for staging the operation. + * @return [Any] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocument( + databaseId: String, + collectionId: String, + documentId: String, + transactionId: String? = null, + ): Any { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to decrement the attribute by. The value must be a number. + * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + min: Double? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + .replace("{attribute}", attribute) + + val apiParams = mutableMapOf( + "value" to value, + "min" to min, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to decrement the attribute by. The value must be a number. + * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + min: Double? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = decrementDocumentAttribute( + databaseId, + collectionId, + documentId, + attribute, + value, + min, + transactionId, + nestedType = classOf(), + ) + + /** + * Increment a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + max: Double? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + .replace("{attribute}", attribute) + + val apiParams = mutableMapOf( + "value" to value, + "max" to max, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Increment a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + max: Double? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = incrementDocumentAttribute( + databaseId, + collectionId, + documentId, + attribute, + value, + max, + transactionId, + nestedType = classOf(), + ) + + /** + * List indexes in the collection. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.IndexList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listIndexes( + databaseId: String, + collectionId: String, + queries: List? = null, + total: Boolean? = null, + ): io.appwrite.models.IndexList { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.IndexList = { + io.appwrite.models.IndexList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.IndexList::class.java, + converter, + ) + } + + /** + * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @param type Index type. + * @param attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param orders Array of index orders. Maximum of 100 orders are allowed. + * @param lengths Length of index. Maximum of 100 + * @return [io.appwrite.models.Index] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createIndex( + databaseId: String, + collectionId: String, + key: String, + type: io.appwrite.enums.DocumentsDBIndexType, + attributes: List, + orders: List? = null, + lengths: List? = null, + ): io.appwrite.models.Index { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "key" to key, + "type" to type, + "attributes" to attributes, + "orders" to orders, + "lengths" to lengths, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Index = { + io.appwrite.models.Index.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Index::class.java, + converter, + ) + } + + /** + * Get index by ID. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @return [io.appwrite.models.Index] + */ + @Throws(AppwriteException::class) + suspend fun getIndex( + databaseId: String, + collectionId: String, + key: String, + ): io.appwrite.models.Index { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Index = { + io.appwrite.models.Index.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Index::class.java, + converter, + ) + } + + /** + * Delete an index. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteIndex( + databaseId: String, + collectionId: String, + key: String, + ): Any { + val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Functions.kt b/src/main/kotlin/io/appwrite/services/Functions.kt index 33bb88b..5019863 100644 --- a/src/main/kotlin/io/appwrite/services/Functions.kt +++ b/src/main/kotlin/io/appwrite/services/Functions.kt @@ -72,7 +72,9 @@ class Functions(client: Client) : Service(client) { * @param providerBranch Production branch for the repo linked to the function. * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param providerRootDirectory Path to function code in the linked repo. - * @param specification Runtime specification for the function and builds. + * @param buildSpecification Build specification for the function deployments. + * @param runtimeSpecification Runtime specification for the function executions. + * @param deploymentRetention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @return [io.appwrite.models.Function] */ @JvmOverloads @@ -95,7 +97,9 @@ class Functions(client: Client) : Service(client) { providerBranch: String? = null, providerSilentMode: Boolean? = null, providerRootDirectory: String? = null, - specification: String? = null, + buildSpecification: String? = null, + runtimeSpecification: String? = null, + deploymentRetention: Long? = null, ): io.appwrite.models.Function { val apiPath = "/functions" @@ -117,7 +121,9 @@ class Functions(client: Client) : Service(client) { "providerBranch" to providerBranch, "providerSilentMode" to providerSilentMode, "providerRootDirectory" to providerRootDirectory, - "specification" to specification, + "buildSpecification" to buildSpecification, + "runtimeSpecification" to runtimeSpecification, + "deploymentRetention" to deploymentRetention, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", @@ -239,7 +245,9 @@ class Functions(client: Client) : Service(client) { * @param providerBranch Production branch for the repo linked to the function * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param providerRootDirectory Path to function code in the linked repo. - * @param specification Runtime specification for the function and builds. + * @param buildSpecification Build specification for the function deployments. + * @param runtimeSpecification Runtime specification for the function executions. + * @param deploymentRetention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @return [io.appwrite.models.Function] */ @JvmOverloads @@ -262,7 +270,9 @@ class Functions(client: Client) : Service(client) { providerBranch: String? = null, providerSilentMode: Boolean? = null, providerRootDirectory: String? = null, - specification: String? = null, + buildSpecification: String? = null, + runtimeSpecification: String? = null, + deploymentRetention: Long? = null, ): io.appwrite.models.Function { val apiPath = "/functions/{functionId}" .replace("{functionId}", functionId) @@ -284,7 +294,9 @@ class Functions(client: Client) : Service(client) { "providerBranch" to providerBranch, "providerSilentMode" to providerSilentMode, "providerRootDirectory" to providerRootDirectory, - "specification" to specification, + "buildSpecification" to buildSpecification, + "runtimeSpecification" to runtimeSpecification, + "deploymentRetention" to deploymentRetention, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", diff --git a/src/main/kotlin/io/appwrite/services/Project.kt b/src/main/kotlin/io/appwrite/services/Project.kt new file mode 100644 index 0000000..52c0b30 --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/Project.kt @@ -0,0 +1,189 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * The Project service allows you to manage all the projects in your Appwrite server. +**/ +class Project(client: Client) : Service(client) { + + /** + * Get a list of all project environment variables. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.VariableList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listVariables( + queries: List? = null, + total: Boolean? = null, + ): io.appwrite.models.VariableList { + val apiPath = "/project/variables" + + val apiParams = mutableMapOf( + "queries" to queries, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.VariableList = { + io.appwrite.models.VariableList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VariableList::class.java, + converter, + ) + } + + /** + * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. + * + * @param variableId Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param key Variable key. Max length: 255 chars. + * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @return [io.appwrite.models.Variable] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createVariable( + variableId: String, + key: String, + value: String, + secret: Boolean? = null, + ): io.appwrite.models.Variable { + val apiPath = "/project/variables" + + val apiParams = mutableMapOf( + "variableId" to variableId, + "key" to key, + "value" to value, + "secret" to secret, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Get a variable by its unique ID. + * + * @param variableId Variable ID. + * @return [io.appwrite.models.Variable] + */ + @Throws(AppwriteException::class) + suspend fun getVariable( + variableId: String, + ): io.appwrite.models.Variable { + val apiPath = "/project/variables/{variableId}" + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Update variable by its unique ID. + * + * @param variableId Variable ID. + * @param key Variable key. Max length: 255 chars. + * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @return [io.appwrite.models.Variable] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateVariable( + variableId: String, + key: String? = null, + value: String? = null, + secret: Boolean? = null, + ): io.appwrite.models.Variable { + val apiPath = "/project/variables/{variableId}" + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + "key" to key, + "value" to value, + "secret" to secret, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Delete a variable by its unique ID. + * + * @param variableId Variable ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteVariable( + variableId: String, + ): Any { + val apiPath = "/project/variables/{variableId}" + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Sites.kt b/src/main/kotlin/io/appwrite/services/Sites.kt index 2b638ea..e1823cc 100644 --- a/src/main/kotlin/io/appwrite/services/Sites.kt +++ b/src/main/kotlin/io/appwrite/services/Sites.kt @@ -64,6 +64,7 @@ class Sites(client: Client) : Service(client) { * @param timeout Maximum request time in seconds. * @param installCommand Install Command. * @param buildCommand Build Command. + * @param startCommand Custom start command. Leave empty to use default. * @param outputDirectory Output Directory for site. * @param adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr * @param installationId Appwrite Installation ID for VCS (Version Control System) deployment. @@ -72,7 +73,9 @@ class Sites(client: Client) : Service(client) { * @param providerBranch Production branch for the repo linked to the site. * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param providerRootDirectory Path to site code in the linked repo. - * @param specification Framework specification for the site and builds. + * @param buildSpecification Build specification for the site deployments. + * @param runtimeSpecification Runtime specification for the SSR executions. + * @param deploymentRetention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @return [io.appwrite.models.Site] */ @JvmOverloads @@ -87,6 +90,7 @@ class Sites(client: Client) : Service(client) { timeout: Long? = null, installCommand: String? = null, buildCommand: String? = null, + startCommand: String? = null, outputDirectory: String? = null, adapter: io.appwrite.enums.Adapter? = null, installationId: String? = null, @@ -95,7 +99,9 @@ class Sites(client: Client) : Service(client) { providerBranch: String? = null, providerSilentMode: Boolean? = null, providerRootDirectory: String? = null, - specification: String? = null, + buildSpecification: String? = null, + runtimeSpecification: String? = null, + deploymentRetention: Long? = null, ): io.appwrite.models.Site { val apiPath = "/sites" @@ -108,6 +114,7 @@ class Sites(client: Client) : Service(client) { "timeout" to timeout, "installCommand" to installCommand, "buildCommand" to buildCommand, + "startCommand" to startCommand, "outputDirectory" to outputDirectory, "buildRuntime" to buildRuntime, "adapter" to adapter, @@ -117,7 +124,9 @@ class Sites(client: Client) : Service(client) { "providerBranch" to providerBranch, "providerSilentMode" to providerSilentMode, "providerRootDirectory" to providerRootDirectory, - "specification" to specification, + "buildSpecification" to buildSpecification, + "runtimeSpecification" to runtimeSpecification, + "deploymentRetention" to deploymentRetention, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", @@ -230,6 +239,7 @@ class Sites(client: Client) : Service(client) { * @param timeout Maximum request time in seconds. * @param installCommand Install Command. * @param buildCommand Build Command. + * @param startCommand Custom start command. Leave empty to use default. * @param outputDirectory Output Directory for site. * @param buildRuntime Runtime to use during build step. * @param adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr @@ -239,7 +249,9 @@ class Sites(client: Client) : Service(client) { * @param providerBranch Production branch for the repo linked to the site. * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param providerRootDirectory Path to site code in the linked repo. - * @param specification Framework specification for the site and builds. + * @param buildSpecification Build specification for the site deployments. + * @param runtimeSpecification Runtime specification for the SSR executions. + * @param deploymentRetention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @return [io.appwrite.models.Site] */ @JvmOverloads @@ -253,6 +265,7 @@ class Sites(client: Client) : Service(client) { timeout: Long? = null, installCommand: String? = null, buildCommand: String? = null, + startCommand: String? = null, outputDirectory: String? = null, buildRuntime: io.appwrite.enums.BuildRuntime? = null, adapter: io.appwrite.enums.Adapter? = null, @@ -262,7 +275,9 @@ class Sites(client: Client) : Service(client) { providerBranch: String? = null, providerSilentMode: Boolean? = null, providerRootDirectory: String? = null, - specification: String? = null, + buildSpecification: String? = null, + runtimeSpecification: String? = null, + deploymentRetention: Long? = null, ): io.appwrite.models.Site { val apiPath = "/sites/{siteId}" .replace("{siteId}", siteId) @@ -275,6 +290,7 @@ class Sites(client: Client) : Service(client) { "timeout" to timeout, "installCommand" to installCommand, "buildCommand" to buildCommand, + "startCommand" to startCommand, "outputDirectory" to outputDirectory, "buildRuntime" to buildRuntime, "adapter" to adapter, @@ -284,7 +300,9 @@ class Sites(client: Client) : Service(client) { "providerBranch" to providerBranch, "providerSilentMode" to providerSilentMode, "providerRootDirectory" to providerRootDirectory, - "specification" to specification, + "buildSpecification" to buildSpecification, + "runtimeSpecification" to runtimeSpecification, + "deploymentRetention" to deploymentRetention, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", diff --git a/src/main/kotlin/io/appwrite/services/TablesDB.kt b/src/main/kotlin/io/appwrite/services/TablesDB.kt index 83287e4..e100d06 100644 --- a/src/main/kotlin/io/appwrite/services/TablesDB.kt +++ b/src/main/kotlin/io/appwrite/services/TablesDB.kt @@ -2429,7 +2429,7 @@ class TablesDB(client: Client) : Service(client) { databaseId: String, tableId: String, key: String, - type: io.appwrite.enums.IndexType, + type: io.appwrite.enums.TablesDBIndexType, columns: List, orders: List? = null, lengths: List? = null, diff --git a/src/main/kotlin/io/appwrite/services/Users.kt b/src/main/kotlin/io/appwrite/services/Users.kt index 748a0ad..5c7ef35 100644 --- a/src/main/kotlin/io/appwrite/services/Users.kt +++ b/src/main/kotlin/io/appwrite/services/Users.kt @@ -16,7 +16,7 @@ class Users(client: Client) : Service(client) { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator * @param search Search term to filter your list results. Max length: 256 chars. * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.UserList] @@ -54,7 +54,7 @@ class Users(client: Client) : Service(client) { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator * @param search Search term to filter your list results. Max length: 256 chars. * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.UserList] @@ -848,6 +848,60 @@ class Users(client: Client) : Service(client) { nestedType = classOf(), ) + /** + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * + * + * @param userId User ID. + * @param impersonator Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data. + * @return [io.appwrite.models.User] + */ + @Throws(AppwriteException::class) + suspend fun updateImpersonator( + userId: String, + impersonator: Boolean, + nestedType: Class, + ): io.appwrite.models.User { + val apiPath = "/users/{userId}/impersonator" + .replace("{userId}", userId) + + val apiParams = mutableMapOf( + "impersonator" to impersonator, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.User = { + io.appwrite.models.User.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * + * + * @param userId User ID. + * @param impersonator Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data. + * @return [io.appwrite.models.User] + */ + @Throws(AppwriteException::class) + suspend fun updateImpersonator( + userId: String, + impersonator: Boolean, + ): io.appwrite.models.User> = updateImpersonator( + userId, + impersonator, + nestedType = classOf(), + ) + /** * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * diff --git a/src/main/kotlin/io/appwrite/services/VectorsDB.kt b/src/main/kotlin/io/appwrite/services/VectorsDB.kt new file mode 100644 index 0000000..4f33445 --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/VectorsDB.kt @@ -0,0 +1,1451 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * +**/ +class VectorsDB(client: Client) : Service(client) { + + /** + * + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name + * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.DatabaseList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + queries: List? = null, + search: String? = null, + total: Boolean? = null, + ): io.appwrite.models.DatabaseList { + val apiPath = "/vectorsdb" + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DatabaseList = { + io.appwrite.models.DatabaseList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.DatabaseList::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Database name. Max length: 128 chars. + * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun create( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/vectorsdb" + + val apiParams = mutableMapOf( + "databaseId" to databaseId, + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * + * + * @param texts Array of text to generate embeddings. + * @param model The embedding model to use for generating vector embeddings. + * @return [io.appwrite.models.EmbeddingList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createTextEmbeddings( + texts: List, + model: io.appwrite.enums.Model? = null, + ): io.appwrite.models.EmbeddingList { + val apiPath = "/vectorsdb/embeddings/text" + + val apiParams = mutableMapOf( + "texts" to texts, + "model" to model, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.EmbeddingList = { + io.appwrite.models.EmbeddingList.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.EmbeddingList::class.java, + converter, + ) + } + + /** + * + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). + * @return [io.appwrite.models.TransactionList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listTransactions( + queries: List? = null, + ): io.appwrite.models.TransactionList { + val apiPath = "/vectorsdb/transactions" + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.TransactionList = { + io.appwrite.models.TransactionList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.TransactionList::class.java, + converter, + ) + } + + /** + * + * + * @param ttl Seconds before the transaction expires. + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createTransaction( + ttl: Long? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/vectorsdb/transactions" + + val apiParams = mutableMapOf( + "ttl" to ttl, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @return [io.appwrite.models.Transaction] + */ + @Throws(AppwriteException::class) + suspend fun getTransaction( + transactionId: String, + ): io.appwrite.models.Transaction { + val apiPath = "/vectorsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @param commit Commit transaction? + * @param rollback Rollback transaction? + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateTransaction( + transactionId: String, + commit: Boolean? = null, + rollback: Boolean? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/vectorsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + "commit" to commit, + "rollback" to rollback, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteTransaction( + transactionId: String, + ): Any { + val apiPath = "/vectorsdb/transactions/{transactionId}" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * + * + * @param transactionId Transaction ID. + * @param operations Array of staged operations. + * @return [io.appwrite.models.Transaction] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createOperations( + transactionId: String, + operations: List? = null, + ): io.appwrite.models.Transaction { + val apiPath = "/vectorsdb/transactions/{transactionId}/operations" + .replace("{transactionId}", transactionId) + + val apiParams = mutableMapOf( + "operations" to operations, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Transaction = { + io.appwrite.models.Transaction.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Transaction::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @return [io.appwrite.models.Database] + */ + @Throws(AppwriteException::class) + suspend fun get( + databaseId: String, + ): io.appwrite.models.Database { + val apiPath = "/vectorsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param name Database name. Max length: 128 chars. + * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/vectorsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + databaseId: String, + ): Any { + val apiPath = "/vectorsdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.VectorsdbCollectionList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listCollections( + databaseId: String, + queries: List? = null, + search: String? = null, + total: Boolean? = null, + ): io.appwrite.models.VectorsdbCollectionList { + val apiPath = "/vectorsdb/{databaseId}/collections" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.VectorsdbCollectionList = { + io.appwrite.models.VectorsdbCollectionList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VectorsdbCollectionList::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Collection name. Max length: 128 chars. + * @param dimension Embedding dimension. + * @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @return [io.appwrite.models.VectorsdbCollection] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createCollection( + databaseId: String, + collectionId: String, + name: String, + dimension: Long, + permissions: List? = null, + documentSecurity: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.VectorsdbCollection { + val apiPath = "/vectorsdb/{databaseId}/collections" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "collectionId" to collectionId, + "name" to name, + "dimension" to dimension, + "permissions" to permissions, + "documentSecurity" to documentSecurity, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { + io.appwrite.models.VectorsdbCollection.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VectorsdbCollection::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @return [io.appwrite.models.VectorsdbCollection] + */ + @Throws(AppwriteException::class) + suspend fun getCollection( + databaseId: String, + collectionId: String, + ): io.appwrite.models.VectorsdbCollection { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { + io.appwrite.models.VectorsdbCollection.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VectorsdbCollection::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param name Collection name. Max length: 128 chars. + * @param dimension Embedding dimensions. + * @param permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @return [io.appwrite.models.VectorsdbCollection] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateCollection( + databaseId: String, + collectionId: String, + name: String, + dimension: Long? = null, + permissions: List? = null, + documentSecurity: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.VectorsdbCollection { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "name" to name, + "dimension" to dimension, + "permissions" to permissions, + "documentSecurity" to documentSecurity, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { + io.appwrite.models.VectorsdbCollection.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VectorsdbCollection::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteCollection( + databaseId: String, + collectionId: String, + ): Any { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + total: Boolean? = null, + ttl: Long? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + "total" to total, + "ttl" to ttl, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + total: Boolean? = null, + ttl: Long? = null, + ): io.appwrite.models.DocumentList> = listDocuments( + databaseId, + collectionId, + queries, + transactionId, + total, + ttl, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Document data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documentId" to documentId, + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Document data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + ): io.appwrite.models.Document> = createDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] + */ + @Throws(AppwriteException::class) + suspend fun createDocuments( + databaseId: String, + collectionId: String, + documents: List, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documents" to documents, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] + */ + @Throws(AppwriteException::class) + suspend fun createDocuments( + databaseId: String, + collectionId: String, + documents: List, + ): io.appwrite.models.DocumentList> = createDocuments( + databaseId, + collectionId, + documents, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documents Array of document data as JSON objects. May contain partial documents. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocuments( + databaseId: String, + collectionId: String, + documents: List, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "documents" to documents, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documents Array of document data as JSON objects. May contain partial documents. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocuments( + databaseId: String, + collectionId: String, + documents: List, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = upsertDocuments( + databaseId, + collectionId, + documents, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = null, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "data" to data, + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = null, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = updateDocuments( + databaseId, + collectionId, + data, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.DocumentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.DocumentList> = deleteDocuments( + databaseId, + collectionId, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "queries" to queries, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = getDocument( + databaseId, + collectionId, + documentId, + queries, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required fields of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required fields of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = upsertDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only fields and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only fields and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param transactionId Transaction ID for staging the operation. + * @return [io.appwrite.models.Document] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + transactionId: String? = null, + ): io.appwrite.models.Document> = updateDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + transactionId, + nestedType = classOf(), + ) + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param transactionId Transaction ID for staging the operation. + * @return [Any] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocument( + databaseId: String, + collectionId: String, + documentId: String, + transactionId: String? = null, + ): Any { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "transactionId" to transactionId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.IndexList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listIndexes( + databaseId: String, + collectionId: String, + queries: List? = null, + total: Boolean? = null, + ): io.appwrite.models.IndexList { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.IndexList = { + io.appwrite.models.IndexList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.IndexList::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @param type Index type. + * @param attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param orders Array of index orders. Maximum of 100 orders are allowed. + * @param lengths Length of index. Maximum of 100 + * @return [io.appwrite.models.Index] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createIndex( + databaseId: String, + collectionId: String, + key: String, + type: io.appwrite.enums.VectorsDBIndexType, + attributes: List, + orders: List? = null, + lengths: List? = null, + ): io.appwrite.models.Index { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "key" to key, + "type" to type, + "attributes" to attributes, + "orders" to orders, + "lengths" to lengths, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Index = { + io.appwrite.models.Index.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Index::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @return [io.appwrite.models.Index] + */ + @Throws(AppwriteException::class) + suspend fun getIndex( + databaseId: String, + collectionId: String, + key: String, + ): io.appwrite.models.Index { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Index = { + io.appwrite.models.Index.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Index::class.java, + converter, + ) + } + + /** + * + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param key Index Key. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteIndex( + databaseId: String, + collectionId: String, + key: String, + ): Any { + val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Webhooks.kt b/src/main/kotlin/io/appwrite/services/Webhooks.kt new file mode 100644 index 0000000..846a401 --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/Webhooks.kt @@ -0,0 +1,244 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * +**/ +class Webhooks(client: Client) : Service(client) { + + /** + * Get a list of all webhooks belonging to the project. You can use the query params to filter your results. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts + * @param total When set to false, the total count returned will be 0 and will not be calculated. + * @return [io.appwrite.models.WebhookList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + queries: List? = null, + total: Boolean? = null, + ): io.appwrite.models.WebhookList { + val apiPath = "/webhooks" + + val apiParams = mutableMapOf( + "queries" to queries, + "total" to total, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.WebhookList = { + io.appwrite.models.WebhookList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.WebhookList::class.java, + converter, + ) + } + + /** + * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. + * + * @param webhookId Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param url Webhook URL. + * @param name Webhook name. Max length: 128 chars. + * @param events Events list. Maximum of 100 events are allowed. + * @param enabled Enable or disable a webhook. + * @param security Certificate verification, false for disabled or true for enabled. + * @param httpUser Webhook HTTP user. Max length: 256 chars. + * @param httpPass Webhook HTTP password. Max length: 256 chars. + * @return [io.appwrite.models.Webhook] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun create( + webhookId: String, + url: String, + name: String, + events: List, + enabled: Boolean? = null, + security: Boolean? = null, + httpUser: String? = null, + httpPass: String? = null, + ): io.appwrite.models.Webhook { + val apiPath = "/webhooks" + + val apiParams = mutableMapOf( + "webhookId" to webhookId, + "url" to url, + "name" to name, + "events" to events, + "enabled" to enabled, + "security" to security, + "httpUser" to httpUser, + "httpPass" to httpPass, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Webhook = { + io.appwrite.models.Webhook.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Webhook::class.java, + converter, + ) + } + + /** + * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. + * + * @param webhookId Webhook ID. + * @return [io.appwrite.models.Webhook] + */ + @Throws(AppwriteException::class) + suspend fun get( + webhookId: String, + ): io.appwrite.models.Webhook { + val apiPath = "/webhooks/{webhookId}" + .replace("{webhookId}", webhookId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Webhook = { + io.appwrite.models.Webhook.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Webhook::class.java, + converter, + ) + } + + /** + * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. + * + * @param webhookId Webhook ID. + * @param name Webhook name. Max length: 128 chars. + * @param url Webhook URL. + * @param events Events list. Maximum of 100 events are allowed. + * @param enabled Enable or disable a webhook. + * @param security Certificate verification, false for disabled or true for enabled. + * @param httpUser Webhook HTTP user. Max length: 256 chars. + * @param httpPass Webhook HTTP password. Max length: 256 chars. + * @return [io.appwrite.models.Webhook] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + webhookId: String, + name: String, + url: String, + events: List, + enabled: Boolean? = null, + security: Boolean? = null, + httpUser: String? = null, + httpPass: String? = null, + ): io.appwrite.models.Webhook { + val apiPath = "/webhooks/{webhookId}" + .replace("{webhookId}", webhookId) + + val apiParams = mutableMapOf( + "name" to name, + "url" to url, + "events" to events, + "enabled" to enabled, + "security" to security, + "httpUser" to httpUser, + "httpPass" to httpPass, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Webhook = { + io.appwrite.models.Webhook.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Webhook::class.java, + converter, + ) + } + + /** + * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. + * + * @param webhookId Webhook ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + webhookId: String, + ): Any { + val apiPath = "/webhooks/{webhookId}" + .replace("{webhookId}", webhookId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. + * + * @param webhookId Webhook ID. + * @return [io.appwrite.models.Webhook] + */ + @Throws(AppwriteException::class) + suspend fun updateSignature( + webhookId: String, + ): io.appwrite.models.Webhook { + val apiPath = "/webhooks/{webhookId}/signature" + .replace("{webhookId}", webhookId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Webhook = { + io.appwrite.models.Webhook.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Webhook::class.java, + converter, + ) + } + +} \ No newline at end of file From 1605b26787cda73920f3eb6920c47d70b7294833 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 04:27:04 +0000 Subject: [PATCH 2/8] chore: update Kotlin SDK to 15.0.0 --- CHANGELOG.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c25b40..994d8eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,10 @@ ## 15.0.0 +* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents * Breaking: Renamed `IndexType` to `DatabasesIndexType` in docs. * Breaking: Replaced `.setKey()` with `.setSession()` in docs examples. -* Added: Added `DocumentsDB` service with document management methods. -* Updated: Updated docs to reflect new `DatabasesIndexType` and `DocumentsDB` examples. +* Updated: Updated docs to reflect new `DatabasesIndexType` examples. ## 14.0.1 diff --git a/README.md b/README.md index 6815572..d60bd31 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).** > This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android) From abd6cd7d119174d662c704f3c3dbcde5f81e816a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 05:28:52 +0000 Subject: [PATCH 3/8] chore: update Kotlin SDK to 15.0.0 --- .../java/documentsdb/create-collection.md | 34 - .../java/documentsdb/create-document.md | 37 - .../java/documentsdb/create-documents.md | 27 - .../examples/java/documentsdb/create-index.md | 33 - .../java/documentsdb/create-operations.md | 34 - .../java/documentsdb/create-transaction.md | 25 - docs/examples/java/documentsdb/create.md | 27 - .../decrement-document-attribute.md | 31 - .../java/documentsdb/delete-collection.md | 26 - .../java/documentsdb/delete-document.md | 28 - .../java/documentsdb/delete-documents.md | 28 - .../examples/java/documentsdb/delete-index.md | 27 - .../java/documentsdb/delete-transaction.md | 25 - docs/examples/java/documentsdb/delete.md | 25 - .../java/documentsdb/get-collection.md | 26 - .../examples/java/documentsdb/get-document.md | 29 - docs/examples/java/documentsdb/get-index.md | 27 - .../java/documentsdb/get-transaction.md | 25 - docs/examples/java/documentsdb/get.md | 25 - .../increment-document-attribute.md | 31 - .../java/documentsdb/list-collections.md | 28 - .../java/documentsdb/list-documents.md | 30 - .../examples/java/documentsdb/list-indexes.md | 28 - .../java/documentsdb/list-transactions.md | 25 - docs/examples/java/documentsdb/list.md | 27 - .../java/documentsdb/update-collection.md | 32 - .../java/documentsdb/update-document.md | 32 - .../java/documentsdb/update-documents.md | 29 - .../java/documentsdb/update-transaction.md | 27 - docs/examples/java/documentsdb/update.md | 27 - .../java/documentsdb/upsert-document.md | 32 - .../java/documentsdb/upsert-documents.md | 28 - .../java/vectorsdb/create-collection.md | 33 - .../java/vectorsdb/create-document.md | 36 - .../java/vectorsdb/create-documents.md | 27 - docs/examples/java/vectorsdb/create-index.md | 33 - .../java/vectorsdb/create-operations.md | 34 - .../java/vectorsdb/create-text-embeddings.md | 27 - .../java/vectorsdb/create-transaction.md | 25 - docs/examples/java/vectorsdb/create.md | 27 - .../java/vectorsdb/delete-collection.md | 26 - .../java/vectorsdb/delete-document.md | 28 - .../java/vectorsdb/delete-documents.md | 28 - docs/examples/java/vectorsdb/delete-index.md | 27 - .../java/vectorsdb/delete-transaction.md | 25 - docs/examples/java/vectorsdb/delete.md | 25 - .../examples/java/vectorsdb/get-collection.md | 26 - docs/examples/java/vectorsdb/get-document.md | 29 - docs/examples/java/vectorsdb/get-index.md | 27 - .../java/vectorsdb/get-transaction.md | 25 - docs/examples/java/vectorsdb/get.md | 25 - .../java/vectorsdb/list-collections.md | 28 - .../examples/java/vectorsdb/list-documents.md | 30 - docs/examples/java/vectorsdb/list-indexes.md | 28 - .../java/vectorsdb/list-transactions.md | 25 - docs/examples/java/vectorsdb/list.md | 27 - .../java/vectorsdb/update-collection.md | 33 - .../java/vectorsdb/update-document.md | 32 - .../java/vectorsdb/update-documents.md | 29 - .../java/vectorsdb/update-transaction.md | 27 - docs/examples/java/vectorsdb/update.md | 27 - .../java/vectorsdb/upsert-document.md | 32 - .../java/vectorsdb/upsert-documents.md | 28 - .../kotlin/documentsdb/create-collection.md | 25 - .../kotlin/documentsdb/create-document.md | 28 - .../kotlin/documentsdb/create-documents.md | 18 - .../kotlin/documentsdb/create-index.md | 24 - .../kotlin/documentsdb/create-operations.md | 25 - .../kotlin/documentsdb/create-transaction.md | 16 - docs/examples/kotlin/documentsdb/create.md | 18 - .../decrement-document-attribute.md | 22 - .../kotlin/documentsdb/delete-collection.md | 17 - .../kotlin/documentsdb/delete-document.md | 19 - .../kotlin/documentsdb/delete-documents.md | 19 - .../kotlin/documentsdb/delete-index.md | 18 - .../kotlin/documentsdb/delete-transaction.md | 16 - docs/examples/kotlin/documentsdb/delete.md | 16 - .../kotlin/documentsdb/get-collection.md | 17 - .../kotlin/documentsdb/get-document.md | 20 - docs/examples/kotlin/documentsdb/get-index.md | 18 - .../kotlin/documentsdb/get-transaction.md | 16 - docs/examples/kotlin/documentsdb/get.md | 16 - .../increment-document-attribute.md | 22 - .../kotlin/documentsdb/list-collections.md | 19 - .../kotlin/documentsdb/list-documents.md | 21 - .../kotlin/documentsdb/list-indexes.md | 19 - .../kotlin/documentsdb/list-transactions.md | 16 - docs/examples/kotlin/documentsdb/list.md | 18 - .../kotlin/documentsdb/update-collection.md | 23 - .../kotlin/documentsdb/update-document.md | 23 - .../kotlin/documentsdb/update-documents.md | 20 - .../kotlin/documentsdb/update-transaction.md | 18 - docs/examples/kotlin/documentsdb/update.md | 18 - .../kotlin/documentsdb/upsert-document.md | 23 - .../kotlin/documentsdb/upsert-documents.md | 19 - .../kotlin/vectorsdb/create-collection.md | 24 - .../kotlin/vectorsdb/create-document.md | 27 - .../kotlin/vectorsdb/create-documents.md | 18 - .../examples/kotlin/vectorsdb/create-index.md | 24 - .../kotlin/vectorsdb/create-operations.md | 25 - .../vectorsdb/create-text-embeddings.md | 18 - .../kotlin/vectorsdb/create-transaction.md | 16 - docs/examples/kotlin/vectorsdb/create.md | 18 - .../kotlin/vectorsdb/delete-collection.md | 17 - .../kotlin/vectorsdb/delete-document.md | 19 - .../kotlin/vectorsdb/delete-documents.md | 19 - .../examples/kotlin/vectorsdb/delete-index.md | 18 - .../kotlin/vectorsdb/delete-transaction.md | 16 - docs/examples/kotlin/vectorsdb/delete.md | 16 - .../kotlin/vectorsdb/get-collection.md | 17 - .../examples/kotlin/vectorsdb/get-document.md | 20 - docs/examples/kotlin/vectorsdb/get-index.md | 18 - .../kotlin/vectorsdb/get-transaction.md | 16 - docs/examples/kotlin/vectorsdb/get.md | 16 - .../kotlin/vectorsdb/list-collections.md | 19 - .../kotlin/vectorsdb/list-documents.md | 21 - .../examples/kotlin/vectorsdb/list-indexes.md | 19 - .../kotlin/vectorsdb/list-transactions.md | 16 - docs/examples/kotlin/vectorsdb/list.md | 18 - .../kotlin/vectorsdb/update-collection.md | 24 - .../kotlin/vectorsdb/update-document.md | 23 - .../kotlin/vectorsdb/update-documents.md | 20 - .../kotlin/vectorsdb/update-transaction.md | 18 - docs/examples/kotlin/vectorsdb/update.md | 18 - .../kotlin/vectorsdb/upsert-document.md | 23 - .../kotlin/vectorsdb/upsert-documents.md | 19 - .../io/appwrite/services/DocumentsDB.kt | 1588 ----------------- .../kotlin/io/appwrite/services/VectorsDB.kt | 1451 --------------- 128 files changed, 6060 deletions(-) delete mode 100644 docs/examples/java/documentsdb/create-collection.md delete mode 100644 docs/examples/java/documentsdb/create-document.md delete mode 100644 docs/examples/java/documentsdb/create-documents.md delete mode 100644 docs/examples/java/documentsdb/create-index.md delete mode 100644 docs/examples/java/documentsdb/create-operations.md delete mode 100644 docs/examples/java/documentsdb/create-transaction.md delete mode 100644 docs/examples/java/documentsdb/create.md delete mode 100644 docs/examples/java/documentsdb/decrement-document-attribute.md delete mode 100644 docs/examples/java/documentsdb/delete-collection.md delete mode 100644 docs/examples/java/documentsdb/delete-document.md delete mode 100644 docs/examples/java/documentsdb/delete-documents.md delete mode 100644 docs/examples/java/documentsdb/delete-index.md delete mode 100644 docs/examples/java/documentsdb/delete-transaction.md delete mode 100644 docs/examples/java/documentsdb/delete.md delete mode 100644 docs/examples/java/documentsdb/get-collection.md delete mode 100644 docs/examples/java/documentsdb/get-document.md delete mode 100644 docs/examples/java/documentsdb/get-index.md delete mode 100644 docs/examples/java/documentsdb/get-transaction.md delete mode 100644 docs/examples/java/documentsdb/get.md delete mode 100644 docs/examples/java/documentsdb/increment-document-attribute.md delete mode 100644 docs/examples/java/documentsdb/list-collections.md delete mode 100644 docs/examples/java/documentsdb/list-documents.md delete mode 100644 docs/examples/java/documentsdb/list-indexes.md delete mode 100644 docs/examples/java/documentsdb/list-transactions.md delete mode 100644 docs/examples/java/documentsdb/list.md delete mode 100644 docs/examples/java/documentsdb/update-collection.md delete mode 100644 docs/examples/java/documentsdb/update-document.md delete mode 100644 docs/examples/java/documentsdb/update-documents.md delete mode 100644 docs/examples/java/documentsdb/update-transaction.md delete mode 100644 docs/examples/java/documentsdb/update.md delete mode 100644 docs/examples/java/documentsdb/upsert-document.md delete mode 100644 docs/examples/java/documentsdb/upsert-documents.md delete mode 100644 docs/examples/java/vectorsdb/create-collection.md delete mode 100644 docs/examples/java/vectorsdb/create-document.md delete mode 100644 docs/examples/java/vectorsdb/create-documents.md delete mode 100644 docs/examples/java/vectorsdb/create-index.md delete mode 100644 docs/examples/java/vectorsdb/create-operations.md delete mode 100644 docs/examples/java/vectorsdb/create-text-embeddings.md delete mode 100644 docs/examples/java/vectorsdb/create-transaction.md delete mode 100644 docs/examples/java/vectorsdb/create.md delete mode 100644 docs/examples/java/vectorsdb/delete-collection.md delete mode 100644 docs/examples/java/vectorsdb/delete-document.md delete mode 100644 docs/examples/java/vectorsdb/delete-documents.md delete mode 100644 docs/examples/java/vectorsdb/delete-index.md delete mode 100644 docs/examples/java/vectorsdb/delete-transaction.md delete mode 100644 docs/examples/java/vectorsdb/delete.md delete mode 100644 docs/examples/java/vectorsdb/get-collection.md delete mode 100644 docs/examples/java/vectorsdb/get-document.md delete mode 100644 docs/examples/java/vectorsdb/get-index.md delete mode 100644 docs/examples/java/vectorsdb/get-transaction.md delete mode 100644 docs/examples/java/vectorsdb/get.md delete mode 100644 docs/examples/java/vectorsdb/list-collections.md delete mode 100644 docs/examples/java/vectorsdb/list-documents.md delete mode 100644 docs/examples/java/vectorsdb/list-indexes.md delete mode 100644 docs/examples/java/vectorsdb/list-transactions.md delete mode 100644 docs/examples/java/vectorsdb/list.md delete mode 100644 docs/examples/java/vectorsdb/update-collection.md delete mode 100644 docs/examples/java/vectorsdb/update-document.md delete mode 100644 docs/examples/java/vectorsdb/update-documents.md delete mode 100644 docs/examples/java/vectorsdb/update-transaction.md delete mode 100644 docs/examples/java/vectorsdb/update.md delete mode 100644 docs/examples/java/vectorsdb/upsert-document.md delete mode 100644 docs/examples/java/vectorsdb/upsert-documents.md delete mode 100644 docs/examples/kotlin/documentsdb/create-collection.md delete mode 100644 docs/examples/kotlin/documentsdb/create-document.md delete mode 100644 docs/examples/kotlin/documentsdb/create-documents.md delete mode 100644 docs/examples/kotlin/documentsdb/create-index.md delete mode 100644 docs/examples/kotlin/documentsdb/create-operations.md delete mode 100644 docs/examples/kotlin/documentsdb/create-transaction.md delete mode 100644 docs/examples/kotlin/documentsdb/create.md delete mode 100644 docs/examples/kotlin/documentsdb/decrement-document-attribute.md delete mode 100644 docs/examples/kotlin/documentsdb/delete-collection.md delete mode 100644 docs/examples/kotlin/documentsdb/delete-document.md delete mode 100644 docs/examples/kotlin/documentsdb/delete-documents.md delete mode 100644 docs/examples/kotlin/documentsdb/delete-index.md delete mode 100644 docs/examples/kotlin/documentsdb/delete-transaction.md delete mode 100644 docs/examples/kotlin/documentsdb/delete.md delete mode 100644 docs/examples/kotlin/documentsdb/get-collection.md delete mode 100644 docs/examples/kotlin/documentsdb/get-document.md delete mode 100644 docs/examples/kotlin/documentsdb/get-index.md delete mode 100644 docs/examples/kotlin/documentsdb/get-transaction.md delete mode 100644 docs/examples/kotlin/documentsdb/get.md delete mode 100644 docs/examples/kotlin/documentsdb/increment-document-attribute.md delete mode 100644 docs/examples/kotlin/documentsdb/list-collections.md delete mode 100644 docs/examples/kotlin/documentsdb/list-documents.md delete mode 100644 docs/examples/kotlin/documentsdb/list-indexes.md delete mode 100644 docs/examples/kotlin/documentsdb/list-transactions.md delete mode 100644 docs/examples/kotlin/documentsdb/list.md delete mode 100644 docs/examples/kotlin/documentsdb/update-collection.md delete mode 100644 docs/examples/kotlin/documentsdb/update-document.md delete mode 100644 docs/examples/kotlin/documentsdb/update-documents.md delete mode 100644 docs/examples/kotlin/documentsdb/update-transaction.md delete mode 100644 docs/examples/kotlin/documentsdb/update.md delete mode 100644 docs/examples/kotlin/documentsdb/upsert-document.md delete mode 100644 docs/examples/kotlin/documentsdb/upsert-documents.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-collection.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-document.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-documents.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-index.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-operations.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-text-embeddings.md delete mode 100644 docs/examples/kotlin/vectorsdb/create-transaction.md delete mode 100644 docs/examples/kotlin/vectorsdb/create.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete-collection.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete-document.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete-documents.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete-index.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete-transaction.md delete mode 100644 docs/examples/kotlin/vectorsdb/delete.md delete mode 100644 docs/examples/kotlin/vectorsdb/get-collection.md delete mode 100644 docs/examples/kotlin/vectorsdb/get-document.md delete mode 100644 docs/examples/kotlin/vectorsdb/get-index.md delete mode 100644 docs/examples/kotlin/vectorsdb/get-transaction.md delete mode 100644 docs/examples/kotlin/vectorsdb/get.md delete mode 100644 docs/examples/kotlin/vectorsdb/list-collections.md delete mode 100644 docs/examples/kotlin/vectorsdb/list-documents.md delete mode 100644 docs/examples/kotlin/vectorsdb/list-indexes.md delete mode 100644 docs/examples/kotlin/vectorsdb/list-transactions.md delete mode 100644 docs/examples/kotlin/vectorsdb/list.md delete mode 100644 docs/examples/kotlin/vectorsdb/update-collection.md delete mode 100644 docs/examples/kotlin/vectorsdb/update-document.md delete mode 100644 docs/examples/kotlin/vectorsdb/update-documents.md delete mode 100644 docs/examples/kotlin/vectorsdb/update-transaction.md delete mode 100644 docs/examples/kotlin/vectorsdb/update.md delete mode 100644 docs/examples/kotlin/vectorsdb/upsert-document.md delete mode 100644 docs/examples/kotlin/vectorsdb/upsert-documents.md delete mode 100644 src/main/kotlin/io/appwrite/services/DocumentsDB.kt delete mode 100644 src/main/kotlin/io/appwrite/services/VectorsDB.kt diff --git a/docs/examples/java/documentsdb/create-collection.md b/docs/examples/java/documentsdb/create-collection.md deleted file mode 100644 index 306abf6..0000000 --- a/docs/examples/java/documentsdb/create-collection.md +++ /dev/null @@ -1,34 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createCollection( - "", // databaseId - "", // collectionId - "", // name - List.of(Permission.read(Role.any())), // permissions (optional) - false, // documentSecurity (optional) - false, // enabled (optional) - List.of(), // attributes (optional) - List.of(), // indexes (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create-document.md b/docs/examples/java/documentsdb/create-document.md deleted file mode 100644 index d4ba188..0000000 --- a/docs/examples/java/documentsdb/create-document.md +++ /dev/null @@ -1,37 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of( - "username", "walter.obrien", - "email", "walter.obrien@example.com", - "fullName", "Walter O'Brien", - "age", 30, - "isAdmin", false - ), // data - List.of(Permission.read(Role.any())), // permissions (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create-documents.md b/docs/examples/java/documentsdb/create-documents.md deleted file mode 100644 index 6cc3e44..0000000 --- a/docs/examples/java/documentsdb/create-documents.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createDocuments( - "", // databaseId - "", // collectionId - List.of(), // documents - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create-index.md b/docs/examples/java/documentsdb/create-index.md deleted file mode 100644 index 95a2363..0000000 --- a/docs/examples/java/documentsdb/create-index.md +++ /dev/null @@ -1,33 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; -import io.appwrite.enums.DocumentsDBIndexType; -import io.appwrite.enums.OrderBy; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createIndex( - "", // databaseId - "", // collectionId - "", // key - DocumentsDBIndexType.KEY, // type - List.of(), // attributes - List.of(OrderBy.ASC), // orders (optional) - List.of(), // lengths (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create-operations.md b/docs/examples/java/documentsdb/create-operations.md deleted file mode 100644 index b7dc488..0000000 --- a/docs/examples/java/documentsdb/create-operations.md +++ /dev/null @@ -1,34 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createOperations( - "", // transactionId - List.of(Map.of( - "action", "create", - "databaseId", "", - "collectionId", "", - "documentId", "", - "data", Map.of( - "name", "Walter O'Brien" - ) - )), // operations (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create-transaction.md b/docs/examples/java/documentsdb/create-transaction.md deleted file mode 100644 index 1cd52e5..0000000 --- a/docs/examples/java/documentsdb/create-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.createTransaction( - 60, // ttl (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/create.md b/docs/examples/java/documentsdb/create.md deleted file mode 100644 index 8c433fe..0000000 --- a/docs/examples/java/documentsdb/create.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.create( - "", // databaseId - "", // name - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/decrement-document-attribute.md b/docs/examples/java/documentsdb/decrement-document-attribute.md deleted file mode 100644 index 640eccf..0000000 --- a/docs/examples/java/documentsdb/decrement-document-attribute.md +++ /dev/null @@ -1,31 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.decrementDocumentAttribute( - "", // databaseId - "", // collectionId - "", // documentId - "", // attribute - 0, // value (optional) - 0, // min (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete-collection.md b/docs/examples/java/documentsdb/delete-collection.md deleted file mode 100644 index 6953b7e..0000000 --- a/docs/examples/java/documentsdb/delete-collection.md +++ /dev/null @@ -1,26 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.deleteCollection( - "", // databaseId - "", // collectionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete-document.md b/docs/examples/java/documentsdb/delete-document.md deleted file mode 100644 index 4cda79c..0000000 --- a/docs/examples/java/documentsdb/delete-document.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.deleteDocument( - "", // databaseId - "", // collectionId - "", // documentId - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete-documents.md b/docs/examples/java/documentsdb/delete-documents.md deleted file mode 100644 index 38acb98..0000000 --- a/docs/examples/java/documentsdb/delete-documents.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.deleteDocuments( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete-index.md b/docs/examples/java/documentsdb/delete-index.md deleted file mode 100644 index a86ce3a..0000000 --- a/docs/examples/java/documentsdb/delete-index.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.deleteIndex( - "", // databaseId - "", // collectionId - "", // key - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete-transaction.md b/docs/examples/java/documentsdb/delete-transaction.md deleted file mode 100644 index e7f4252..0000000 --- a/docs/examples/java/documentsdb/delete-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.deleteTransaction( - "", // transactionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/delete.md b/docs/examples/java/documentsdb/delete.md deleted file mode 100644 index 31c3dd8..0000000 --- a/docs/examples/java/documentsdb/delete.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.delete( - "", // databaseId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/get-collection.md b/docs/examples/java/documentsdb/get-collection.md deleted file mode 100644 index 8622d6c..0000000 --- a/docs/examples/java/documentsdb/get-collection.md +++ /dev/null @@ -1,26 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.getCollection( - "", // databaseId - "", // collectionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/get-document.md b/docs/examples/java/documentsdb/get-document.md deleted file mode 100644 index 0e75f98..0000000 --- a/docs/examples/java/documentsdb/get-document.md +++ /dev/null @@ -1,29 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.getDocument( - "", // databaseId - "", // collectionId - "", // documentId - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/get-index.md b/docs/examples/java/documentsdb/get-index.md deleted file mode 100644 index f387418..0000000 --- a/docs/examples/java/documentsdb/get-index.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.getIndex( - "", // databaseId - "", // collectionId - "", // key - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/get-transaction.md b/docs/examples/java/documentsdb/get-transaction.md deleted file mode 100644 index e377bf0..0000000 --- a/docs/examples/java/documentsdb/get-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.getTransaction( - "", // transactionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/get.md b/docs/examples/java/documentsdb/get.md deleted file mode 100644 index 6aba548..0000000 --- a/docs/examples/java/documentsdb/get.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.get( - "", // databaseId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/increment-document-attribute.md b/docs/examples/java/documentsdb/increment-document-attribute.md deleted file mode 100644 index 096a495..0000000 --- a/docs/examples/java/documentsdb/increment-document-attribute.md +++ /dev/null @@ -1,31 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.incrementDocumentAttribute( - "", // databaseId - "", // collectionId - "", // documentId - "", // attribute - 0, // value (optional) - 0, // max (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/list-collections.md b/docs/examples/java/documentsdb/list-collections.md deleted file mode 100644 index bca8249..0000000 --- a/docs/examples/java/documentsdb/list-collections.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.listCollections( - "", // databaseId - List.of(), // queries (optional) - "", // search (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/list-documents.md b/docs/examples/java/documentsdb/list-documents.md deleted file mode 100644 index 8cbcd8a..0000000 --- a/docs/examples/java/documentsdb/list-documents.md +++ /dev/null @@ -1,30 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.listDocuments( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - "", // transactionId (optional) - false, // total (optional) - 0, // ttl (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/list-indexes.md b/docs/examples/java/documentsdb/list-indexes.md deleted file mode 100644 index 9544488..0000000 --- a/docs/examples/java/documentsdb/list-indexes.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.listIndexes( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/list-transactions.md b/docs/examples/java/documentsdb/list-transactions.md deleted file mode 100644 index cc56f53..0000000 --- a/docs/examples/java/documentsdb/list-transactions.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.listTransactions( - List.of(), // queries (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/list.md b/docs/examples/java/documentsdb/list.md deleted file mode 100644 index 0e7b2b4..0000000 --- a/docs/examples/java/documentsdb/list.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.list( - List.of(), // queries (optional) - "", // search (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/update-collection.md b/docs/examples/java/documentsdb/update-collection.md deleted file mode 100644 index f1c5f0d..0000000 --- a/docs/examples/java/documentsdb/update-collection.md +++ /dev/null @@ -1,32 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.updateCollection( - "", // databaseId - "", // collectionId - "", // name - List.of(Permission.read(Role.any())), // permissions (optional) - false, // documentSecurity (optional) - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/update-document.md b/docs/examples/java/documentsdb/update-document.md deleted file mode 100644 index c133292..0000000 --- a/docs/examples/java/documentsdb/update-document.md +++ /dev/null @@ -1,32 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.updateDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of("a", "b"), // data (optional) - List.of(Permission.read(Role.any())), // permissions (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/update-documents.md b/docs/examples/java/documentsdb/update-documents.md deleted file mode 100644 index 8b96274..0000000 --- a/docs/examples/java/documentsdb/update-documents.md +++ /dev/null @@ -1,29 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.updateDocuments( - "", // databaseId - "", // collectionId - Map.of("a", "b"), // data (optional) - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/update-transaction.md b/docs/examples/java/documentsdb/update-transaction.md deleted file mode 100644 index 17cd8f2..0000000 --- a/docs/examples/java/documentsdb/update-transaction.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.updateTransaction( - "", // transactionId - false, // commit (optional) - false, // rollback (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/update.md b/docs/examples/java/documentsdb/update.md deleted file mode 100644 index 09ba4ae..0000000 --- a/docs/examples/java/documentsdb/update.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.update( - "", // databaseId - "", // name - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/upsert-document.md b/docs/examples/java/documentsdb/upsert-document.md deleted file mode 100644 index 2c20c63..0000000 --- a/docs/examples/java/documentsdb/upsert-document.md +++ /dev/null @@ -1,32 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.upsertDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of("a", "b"), // data (optional) - List.of(Permission.read(Role.any())), // permissions (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/documentsdb/upsert-documents.md b/docs/examples/java/documentsdb/upsert-documents.md deleted file mode 100644 index 9758252..0000000 --- a/docs/examples/java/documentsdb/upsert-documents.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.DocumentsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -DocumentsDB documentsDB = new DocumentsDB(client); - -documentsDB.upsertDocuments( - "", // databaseId - "", // collectionId - List.of(), // documents - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-collection.md b/docs/examples/java/vectorsdb/create-collection.md deleted file mode 100644 index d3dc60b..0000000 --- a/docs/examples/java/vectorsdb/create-collection.md +++ /dev/null @@ -1,33 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createCollection( - "", // databaseId - "", // collectionId - "", // name - 1, // dimension - List.of(Permission.read(Role.any())), // permissions (optional) - false, // documentSecurity (optional) - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-document.md b/docs/examples/java/vectorsdb/create-document.md deleted file mode 100644 index 474a941..0000000 --- a/docs/examples/java/vectorsdb/create-document.md +++ /dev/null @@ -1,36 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of( - "embeddings", List.of(0.12, -0.55, 0.88, 1.02), - "metadata", Map.of( - "key", "value" - ) - ), // data - List.of(Permission.read(Role.any())), // permissions (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-documents.md b/docs/examples/java/vectorsdb/create-documents.md deleted file mode 100644 index 21090e6..0000000 --- a/docs/examples/java/vectorsdb/create-documents.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createDocuments( - "", // databaseId - "", // collectionId - List.of(), // documents - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-index.md b/docs/examples/java/vectorsdb/create-index.md deleted file mode 100644 index 3c5c572..0000000 --- a/docs/examples/java/vectorsdb/create-index.md +++ /dev/null @@ -1,33 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; -import io.appwrite.enums.VectorsDBIndexType; -import io.appwrite.enums.OrderBy; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createIndex( - "", // databaseId - "", // collectionId - "", // key - VectorsDBIndexType.HNSW_EUCLIDEAN, // type - List.of(), // attributes - List.of(OrderBy.ASC), // orders (optional) - List.of(), // lengths (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-operations.md b/docs/examples/java/vectorsdb/create-operations.md deleted file mode 100644 index bc2f85e..0000000 --- a/docs/examples/java/vectorsdb/create-operations.md +++ /dev/null @@ -1,34 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createOperations( - "", // transactionId - List.of(Map.of( - "action", "create", - "databaseId", "", - "collectionId", "", - "documentId", "", - "data", Map.of( - "name", "Walter O'Brien" - ) - )), // operations (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-text-embeddings.md b/docs/examples/java/vectorsdb/create-text-embeddings.md deleted file mode 100644 index 73e0fe5..0000000 --- a/docs/examples/java/vectorsdb/create-text-embeddings.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; -import io.appwrite.enums.Model; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createTextEmbeddings( - List.of(), // texts - Model.EMBEDDINGGEMMA, // model (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create-transaction.md b/docs/examples/java/vectorsdb/create-transaction.md deleted file mode 100644 index c855284..0000000 --- a/docs/examples/java/vectorsdb/create-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.createTransaction( - 60, // ttl (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/create.md b/docs/examples/java/vectorsdb/create.md deleted file mode 100644 index e9a1e42..0000000 --- a/docs/examples/java/vectorsdb/create.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.create( - "", // databaseId - "", // name - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete-collection.md b/docs/examples/java/vectorsdb/delete-collection.md deleted file mode 100644 index c0d9eec..0000000 --- a/docs/examples/java/vectorsdb/delete-collection.md +++ /dev/null @@ -1,26 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.deleteCollection( - "", // databaseId - "", // collectionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete-document.md b/docs/examples/java/vectorsdb/delete-document.md deleted file mode 100644 index 9ab5e57..0000000 --- a/docs/examples/java/vectorsdb/delete-document.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.deleteDocument( - "", // databaseId - "", // collectionId - "", // documentId - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete-documents.md b/docs/examples/java/vectorsdb/delete-documents.md deleted file mode 100644 index 31a425a..0000000 --- a/docs/examples/java/vectorsdb/delete-documents.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.deleteDocuments( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete-index.md b/docs/examples/java/vectorsdb/delete-index.md deleted file mode 100644 index a8c4b57..0000000 --- a/docs/examples/java/vectorsdb/delete-index.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.deleteIndex( - "", // databaseId - "", // collectionId - "", // key - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete-transaction.md b/docs/examples/java/vectorsdb/delete-transaction.md deleted file mode 100644 index b71ee2a..0000000 --- a/docs/examples/java/vectorsdb/delete-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.deleteTransaction( - "", // transactionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/delete.md b/docs/examples/java/vectorsdb/delete.md deleted file mode 100644 index 821dacf..0000000 --- a/docs/examples/java/vectorsdb/delete.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.delete( - "", // databaseId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/get-collection.md b/docs/examples/java/vectorsdb/get-collection.md deleted file mode 100644 index b158bd8..0000000 --- a/docs/examples/java/vectorsdb/get-collection.md +++ /dev/null @@ -1,26 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.getCollection( - "", // databaseId - "", // collectionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/get-document.md b/docs/examples/java/vectorsdb/get-document.md deleted file mode 100644 index 8a048ca..0000000 --- a/docs/examples/java/vectorsdb/get-document.md +++ /dev/null @@ -1,29 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.getDocument( - "", // databaseId - "", // collectionId - "", // documentId - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/get-index.md b/docs/examples/java/vectorsdb/get-index.md deleted file mode 100644 index 7470705..0000000 --- a/docs/examples/java/vectorsdb/get-index.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.getIndex( - "", // databaseId - "", // collectionId - "", // key - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/get-transaction.md b/docs/examples/java/vectorsdb/get-transaction.md deleted file mode 100644 index 8996a56..0000000 --- a/docs/examples/java/vectorsdb/get-transaction.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.getTransaction( - "", // transactionId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/get.md b/docs/examples/java/vectorsdb/get.md deleted file mode 100644 index 47c5494..0000000 --- a/docs/examples/java/vectorsdb/get.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.get( - "", // databaseId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/list-collections.md b/docs/examples/java/vectorsdb/list-collections.md deleted file mode 100644 index 39b35d5..0000000 --- a/docs/examples/java/vectorsdb/list-collections.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.listCollections( - "", // databaseId - List.of(), // queries (optional) - "", // search (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/list-documents.md b/docs/examples/java/vectorsdb/list-documents.md deleted file mode 100644 index 857d796..0000000 --- a/docs/examples/java/vectorsdb/list-documents.md +++ /dev/null @@ -1,30 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.listDocuments( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - "", // transactionId (optional) - false, // total (optional) - 0, // ttl (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/list-indexes.md b/docs/examples/java/vectorsdb/list-indexes.md deleted file mode 100644 index 40b4dbc..0000000 --- a/docs/examples/java/vectorsdb/list-indexes.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.listIndexes( - "", // databaseId - "", // collectionId - List.of(), // queries (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/list-transactions.md b/docs/examples/java/vectorsdb/list-transactions.md deleted file mode 100644 index 6b0890a..0000000 --- a/docs/examples/java/vectorsdb/list-transactions.md +++ /dev/null @@ -1,25 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.listTransactions( - List.of(), // queries (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/list.md b/docs/examples/java/vectorsdb/list.md deleted file mode 100644 index 80a20b6..0000000 --- a/docs/examples/java/vectorsdb/list.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.list( - List.of(), // queries (optional) - "", // search (optional) - false, // total (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/update-collection.md b/docs/examples/java/vectorsdb/update-collection.md deleted file mode 100644 index 9359c80..0000000 --- a/docs/examples/java/vectorsdb/update-collection.md +++ /dev/null @@ -1,33 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.updateCollection( - "", // databaseId - "", // collectionId - "", // name - 1, // dimension (optional) - List.of(Permission.read(Role.any())), // permissions (optional) - false, // documentSecurity (optional) - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/update-document.md b/docs/examples/java/vectorsdb/update-document.md deleted file mode 100644 index 1800ff4..0000000 --- a/docs/examples/java/vectorsdb/update-document.md +++ /dev/null @@ -1,32 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.updateDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of("a", "b"), // data (optional) - List.of(Permission.read(Role.any())), // permissions (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/update-documents.md b/docs/examples/java/vectorsdb/update-documents.md deleted file mode 100644 index 820cbe5..0000000 --- a/docs/examples/java/vectorsdb/update-documents.md +++ /dev/null @@ -1,29 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.updateDocuments( - "", // databaseId - "", // collectionId - Map.of("a", "b"), // data (optional) - List.of(), // queries (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/update-transaction.md b/docs/examples/java/vectorsdb/update-transaction.md deleted file mode 100644 index 6d648df..0000000 --- a/docs/examples/java/vectorsdb/update-transaction.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.updateTransaction( - "", // transactionId - false, // commit (optional) - false, // rollback (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/update.md b/docs/examples/java/vectorsdb/update.md deleted file mode 100644 index 4fc2abe..0000000 --- a/docs/examples/java/vectorsdb/update.md +++ /dev/null @@ -1,27 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.update( - "", // databaseId - "", // name - false, // enabled (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/upsert-document.md b/docs/examples/java/vectorsdb/upsert-document.md deleted file mode 100644 index cdefe63..0000000 --- a/docs/examples/java/vectorsdb/upsert-document.md +++ /dev/null @@ -1,32 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.Permission; -import io.appwrite.Role; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.upsertDocument( - "", // databaseId - "", // collectionId - "", // documentId - Map.of("a", "b"), // data (optional) - List.of(Permission.read(Role.any())), // permissions (optional) - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/java/vectorsdb/upsert-documents.md b/docs/examples/java/vectorsdb/upsert-documents.md deleted file mode 100644 index 6371a0c..0000000 --- a/docs/examples/java/vectorsdb/upsert-documents.md +++ /dev/null @@ -1,28 +0,0 @@ -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.VectorsDB; - -Client client = new Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey(""); // Your secret API key - -VectorsDB vectorsDB = new VectorsDB(client); - -vectorsDB.upsertDocuments( - "", // databaseId - "", // collectionId - List.of(), // documents - "", // transactionId (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); - -``` diff --git a/docs/examples/kotlin/documentsdb/create-collection.md b/docs/examples/kotlin/documentsdb/create-collection.md deleted file mode 100644 index 29974f2..0000000 --- a/docs/examples/kotlin/documentsdb/create-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createCollection( - databaseId = "", - collectionId = "", - name = "", - permissions = listOf(Permission.read(Role.any())), // optional - documentSecurity = false, // optional - enabled = false, // optional - attributes = listOf(), // optional - indexes = listOf() // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/create-document.md b/docs/examples/kotlin/documentsdb/create-document.md deleted file mode 100644 index 64c800a..0000000 --- a/docs/examples/kotlin/documentsdb/create-document.md +++ /dev/null @@ -1,28 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( - "username" to "walter.obrien", - "email" to "walter.obrien@example.com", - "fullName" to "Walter O'Brien", - "age" to 30, - "isAdmin" to false - ), - permissions = listOf(Permission.read(Role.any())) // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/create-documents.md b/docs/examples/kotlin/documentsdb/create-documents.md deleted file mode 100644 index ba73a05..0000000 --- a/docs/examples/kotlin/documentsdb/create-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createDocuments( - databaseId = "", - collectionId = "", - documents = listOf() -) -``` diff --git a/docs/examples/kotlin/documentsdb/create-index.md b/docs/examples/kotlin/documentsdb/create-index.md deleted file mode 100644 index 766066e..0000000 --- a/docs/examples/kotlin/documentsdb/create-index.md +++ /dev/null @@ -1,24 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.enums.DocumentsDBIndexType -import io.appwrite.enums.OrderBy - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createIndex( - databaseId = "", - collectionId = "", - key = "", - type = DocumentsDBIndexType.KEY, - attributes = listOf(), - orders = listOf(OrderBy.ASC), // optional - lengths = listOf() // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/create-operations.md b/docs/examples/kotlin/documentsdb/create-operations.md deleted file mode 100644 index 851b65c..0000000 --- a/docs/examples/kotlin/documentsdb/create-operations.md +++ /dev/null @@ -1,25 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createOperations( - transactionId = "", - operations = listOf(mapOf( - "action" to "create", - "databaseId" to "", - "collectionId" to "", - "documentId" to "", - "data" to mapOf( - "name" to "Walter O'Brien" - ) - )) // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/create-transaction.md b/docs/examples/kotlin/documentsdb/create-transaction.md deleted file mode 100644 index b695e53..0000000 --- a/docs/examples/kotlin/documentsdb/create-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.createTransaction( - ttl = 60 // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/create.md b/docs/examples/kotlin/documentsdb/create.md deleted file mode 100644 index 51bbf16..0000000 --- a/docs/examples/kotlin/documentsdb/create.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.create( - databaseId = "", - name = "", - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/decrement-document-attribute.md b/docs/examples/kotlin/documentsdb/decrement-document-attribute.md deleted file mode 100644 index dff032d..0000000 --- a/docs/examples/kotlin/documentsdb/decrement-document-attribute.md +++ /dev/null @@ -1,22 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.decrementDocumentAttribute( - databaseId = "", - collectionId = "", - documentId = "", - attribute = "", - value = 0, // optional - min = 0, // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete-collection.md b/docs/examples/kotlin/documentsdb/delete-collection.md deleted file mode 100644 index 9f57b18..0000000 --- a/docs/examples/kotlin/documentsdb/delete-collection.md +++ /dev/null @@ -1,17 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.deleteCollection( - databaseId = "", - collectionId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete-document.md b/docs/examples/kotlin/documentsdb/delete-document.md deleted file mode 100644 index 36624b6..0000000 --- a/docs/examples/kotlin/documentsdb/delete-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.deleteDocument( - databaseId = "", - collectionId = "", - documentId = "", - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete-documents.md b/docs/examples/kotlin/documentsdb/delete-documents.md deleted file mode 100644 index 9a5397c..0000000 --- a/docs/examples/kotlin/documentsdb/delete-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.deleteDocuments( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete-index.md b/docs/examples/kotlin/documentsdb/delete-index.md deleted file mode 100644 index 46eb726..0000000 --- a/docs/examples/kotlin/documentsdb/delete-index.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.deleteIndex( - databaseId = "", - collectionId = "", - key = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete-transaction.md b/docs/examples/kotlin/documentsdb/delete-transaction.md deleted file mode 100644 index 3adfb9a..0000000 --- a/docs/examples/kotlin/documentsdb/delete-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.deleteTransaction( - transactionId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/delete.md b/docs/examples/kotlin/documentsdb/delete.md deleted file mode 100644 index 63ef123..0000000 --- a/docs/examples/kotlin/documentsdb/delete.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.delete( - databaseId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/get-collection.md b/docs/examples/kotlin/documentsdb/get-collection.md deleted file mode 100644 index aee65b9..0000000 --- a/docs/examples/kotlin/documentsdb/get-collection.md +++ /dev/null @@ -1,17 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.getCollection( - databaseId = "", - collectionId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/get-document.md b/docs/examples/kotlin/documentsdb/get-document.md deleted file mode 100644 index eb2aad8..0000000 --- a/docs/examples/kotlin/documentsdb/get-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.getDocument( - databaseId = "", - collectionId = "", - documentId = "", - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/get-index.md b/docs/examples/kotlin/documentsdb/get-index.md deleted file mode 100644 index 5c83dbe..0000000 --- a/docs/examples/kotlin/documentsdb/get-index.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.getIndex( - databaseId = "", - collectionId = "", - key = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/get-transaction.md b/docs/examples/kotlin/documentsdb/get-transaction.md deleted file mode 100644 index 7ac55d4..0000000 --- a/docs/examples/kotlin/documentsdb/get-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.getTransaction( - transactionId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/get.md b/docs/examples/kotlin/documentsdb/get.md deleted file mode 100644 index aa24055..0000000 --- a/docs/examples/kotlin/documentsdb/get.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.get( - databaseId = "" -) -``` diff --git a/docs/examples/kotlin/documentsdb/increment-document-attribute.md b/docs/examples/kotlin/documentsdb/increment-document-attribute.md deleted file mode 100644 index a770461..0000000 --- a/docs/examples/kotlin/documentsdb/increment-document-attribute.md +++ /dev/null @@ -1,22 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.incrementDocumentAttribute( - databaseId = "", - collectionId = "", - documentId = "", - attribute = "", - value = 0, // optional - max = 0, // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/list-collections.md b/docs/examples/kotlin/documentsdb/list-collections.md deleted file mode 100644 index 0240c1d..0000000 --- a/docs/examples/kotlin/documentsdb/list-collections.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.listCollections( - databaseId = "", - queries = listOf(), // optional - search = "", // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/list-documents.md b/docs/examples/kotlin/documentsdb/list-documents.md deleted file mode 100644 index d1c688f..0000000 --- a/docs/examples/kotlin/documentsdb/list-documents.md +++ /dev/null @@ -1,21 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.listDocuments( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - transactionId = "", // optional - total = false, // optional - ttl = 0 // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/list-indexes.md b/docs/examples/kotlin/documentsdb/list-indexes.md deleted file mode 100644 index b83909e..0000000 --- a/docs/examples/kotlin/documentsdb/list-indexes.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.listIndexes( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/list-transactions.md b/docs/examples/kotlin/documentsdb/list-transactions.md deleted file mode 100644 index 00967cc..0000000 --- a/docs/examples/kotlin/documentsdb/list-transactions.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.listTransactions( - queries = listOf() // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/list.md b/docs/examples/kotlin/documentsdb/list.md deleted file mode 100644 index ec0f18b..0000000 --- a/docs/examples/kotlin/documentsdb/list.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.list( - queries = listOf(), // optional - search = "", // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/update-collection.md b/docs/examples/kotlin/documentsdb/update-collection.md deleted file mode 100644 index b8f7d56..0000000 --- a/docs/examples/kotlin/documentsdb/update-collection.md +++ /dev/null @@ -1,23 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.updateCollection( - databaseId = "", - collectionId = "", - name = "", - permissions = listOf(Permission.read(Role.any())), // optional - documentSecurity = false, // optional - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/update-document.md b/docs/examples/kotlin/documentsdb/update-document.md deleted file mode 100644 index e7bdba5..0000000 --- a/docs/examples/kotlin/documentsdb/update-document.md +++ /dev/null @@ -1,23 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.updateDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( "a" to "b" ), // optional - permissions = listOf(Permission.read(Role.any())), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/update-documents.md b/docs/examples/kotlin/documentsdb/update-documents.md deleted file mode 100644 index 175b6ee..0000000 --- a/docs/examples/kotlin/documentsdb/update-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.updateDocuments( - databaseId = "", - collectionId = "", - data = mapOf( "a" to "b" ), // optional - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/update-transaction.md b/docs/examples/kotlin/documentsdb/update-transaction.md deleted file mode 100644 index 99ace75..0000000 --- a/docs/examples/kotlin/documentsdb/update-transaction.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.updateTransaction( - transactionId = "", - commit = false, // optional - rollback = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/update.md b/docs/examples/kotlin/documentsdb/update.md deleted file mode 100644 index 4239c22..0000000 --- a/docs/examples/kotlin/documentsdb/update.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.update( - databaseId = "", - name = "", - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/upsert-document.md b/docs/examples/kotlin/documentsdb/upsert-document.md deleted file mode 100644 index 6b31df0..0000000 --- a/docs/examples/kotlin/documentsdb/upsert-document.md +++ /dev/null @@ -1,23 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.upsertDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( "a" to "b" ), // optional - permissions = listOf(Permission.read(Role.any())), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/documentsdb/upsert-documents.md b/docs/examples/kotlin/documentsdb/upsert-documents.md deleted file mode 100644 index abf4633..0000000 --- a/docs/examples/kotlin/documentsdb/upsert-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.DocumentsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val documentsDB = DocumentsDB(client) - -val response = documentsDB.upsertDocuments( - databaseId = "", - collectionId = "", - documents = listOf(), - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-collection.md b/docs/examples/kotlin/vectorsdb/create-collection.md deleted file mode 100644 index 0cd1e4a..0000000 --- a/docs/examples/kotlin/vectorsdb/create-collection.md +++ /dev/null @@ -1,24 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createCollection( - databaseId = "", - collectionId = "", - name = "", - dimension = 1, - permissions = listOf(Permission.read(Role.any())), // optional - documentSecurity = false, // optional - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-document.md b/docs/examples/kotlin/vectorsdb/create-document.md deleted file mode 100644 index 220d27a..0000000 --- a/docs/examples/kotlin/vectorsdb/create-document.md +++ /dev/null @@ -1,27 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( - "embeddings" to listOf(0.12, -0.55, 0.88, 1.02), - "metadata" to mapOf( - "key" to "value" - ) - ), - permissions = listOf(Permission.read(Role.any())) // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-documents.md b/docs/examples/kotlin/vectorsdb/create-documents.md deleted file mode 100644 index e5fe9a9..0000000 --- a/docs/examples/kotlin/vectorsdb/create-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createDocuments( - databaseId = "", - collectionId = "", - documents = listOf() -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-index.md b/docs/examples/kotlin/vectorsdb/create-index.md deleted file mode 100644 index c6c661e..0000000 --- a/docs/examples/kotlin/vectorsdb/create-index.md +++ /dev/null @@ -1,24 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.enums.VectorsDBIndexType -import io.appwrite.enums.OrderBy - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createIndex( - databaseId = "", - collectionId = "", - key = "", - type = VectorsDBIndexType.HNSW_EUCLIDEAN, - attributes = listOf(), - orders = listOf(OrderBy.ASC), // optional - lengths = listOf() // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-operations.md b/docs/examples/kotlin/vectorsdb/create-operations.md deleted file mode 100644 index f6bc636..0000000 --- a/docs/examples/kotlin/vectorsdb/create-operations.md +++ /dev/null @@ -1,25 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createOperations( - transactionId = "", - operations = listOf(mapOf( - "action" to "create", - "databaseId" to "", - "collectionId" to "", - "documentId" to "", - "data" to mapOf( - "name" to "Walter O'Brien" - ) - )) // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-text-embeddings.md b/docs/examples/kotlin/vectorsdb/create-text-embeddings.md deleted file mode 100644 index c722c66..0000000 --- a/docs/examples/kotlin/vectorsdb/create-text-embeddings.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.enums.Model - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createTextEmbeddings( - texts = listOf(), - model = Model.EMBEDDINGGEMMA // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create-transaction.md b/docs/examples/kotlin/vectorsdb/create-transaction.md deleted file mode 100644 index b2430a1..0000000 --- a/docs/examples/kotlin/vectorsdb/create-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.createTransaction( - ttl = 60 // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/create.md b/docs/examples/kotlin/vectorsdb/create.md deleted file mode 100644 index cff2ab1..0000000 --- a/docs/examples/kotlin/vectorsdb/create.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.create( - databaseId = "", - name = "", - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete-collection.md b/docs/examples/kotlin/vectorsdb/delete-collection.md deleted file mode 100644 index 4e929ca..0000000 --- a/docs/examples/kotlin/vectorsdb/delete-collection.md +++ /dev/null @@ -1,17 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.deleteCollection( - databaseId = "", - collectionId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete-document.md b/docs/examples/kotlin/vectorsdb/delete-document.md deleted file mode 100644 index 2fff745..0000000 --- a/docs/examples/kotlin/vectorsdb/delete-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.deleteDocument( - databaseId = "", - collectionId = "", - documentId = "", - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete-documents.md b/docs/examples/kotlin/vectorsdb/delete-documents.md deleted file mode 100644 index 53ecd50..0000000 --- a/docs/examples/kotlin/vectorsdb/delete-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.deleteDocuments( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete-index.md b/docs/examples/kotlin/vectorsdb/delete-index.md deleted file mode 100644 index d779381..0000000 --- a/docs/examples/kotlin/vectorsdb/delete-index.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.deleteIndex( - databaseId = "", - collectionId = "", - key = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete-transaction.md b/docs/examples/kotlin/vectorsdb/delete-transaction.md deleted file mode 100644 index f04bef2..0000000 --- a/docs/examples/kotlin/vectorsdb/delete-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.deleteTransaction( - transactionId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/delete.md b/docs/examples/kotlin/vectorsdb/delete.md deleted file mode 100644 index d4d480e..0000000 --- a/docs/examples/kotlin/vectorsdb/delete.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.delete( - databaseId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/get-collection.md b/docs/examples/kotlin/vectorsdb/get-collection.md deleted file mode 100644 index 68599a7..0000000 --- a/docs/examples/kotlin/vectorsdb/get-collection.md +++ /dev/null @@ -1,17 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.getCollection( - databaseId = "", - collectionId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/get-document.md b/docs/examples/kotlin/vectorsdb/get-document.md deleted file mode 100644 index 9a2fb13..0000000 --- a/docs/examples/kotlin/vectorsdb/get-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.getDocument( - databaseId = "", - collectionId = "", - documentId = "", - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/get-index.md b/docs/examples/kotlin/vectorsdb/get-index.md deleted file mode 100644 index 3844920..0000000 --- a/docs/examples/kotlin/vectorsdb/get-index.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.getIndex( - databaseId = "", - collectionId = "", - key = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/get-transaction.md b/docs/examples/kotlin/vectorsdb/get-transaction.md deleted file mode 100644 index 9fee449..0000000 --- a/docs/examples/kotlin/vectorsdb/get-transaction.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.getTransaction( - transactionId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/get.md b/docs/examples/kotlin/vectorsdb/get.md deleted file mode 100644 index fc9d6bd..0000000 --- a/docs/examples/kotlin/vectorsdb/get.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.get( - databaseId = "" -) -``` diff --git a/docs/examples/kotlin/vectorsdb/list-collections.md b/docs/examples/kotlin/vectorsdb/list-collections.md deleted file mode 100644 index 12250df..0000000 --- a/docs/examples/kotlin/vectorsdb/list-collections.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.listCollections( - databaseId = "", - queries = listOf(), // optional - search = "", // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/list-documents.md b/docs/examples/kotlin/vectorsdb/list-documents.md deleted file mode 100644 index ec74ab6..0000000 --- a/docs/examples/kotlin/vectorsdb/list-documents.md +++ /dev/null @@ -1,21 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.listDocuments( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - transactionId = "", // optional - total = false, // optional - ttl = 0 // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/list-indexes.md b/docs/examples/kotlin/vectorsdb/list-indexes.md deleted file mode 100644 index 28f0fc0..0000000 --- a/docs/examples/kotlin/vectorsdb/list-indexes.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.listIndexes( - databaseId = "", - collectionId = "", - queries = listOf(), // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/list-transactions.md b/docs/examples/kotlin/vectorsdb/list-transactions.md deleted file mode 100644 index 3801d18..0000000 --- a/docs/examples/kotlin/vectorsdb/list-transactions.md +++ /dev/null @@ -1,16 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.listTransactions( - queries = listOf() // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/list.md b/docs/examples/kotlin/vectorsdb/list.md deleted file mode 100644 index 4051f0f..0000000 --- a/docs/examples/kotlin/vectorsdb/list.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.list( - queries = listOf(), // optional - search = "", // optional - total = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/update-collection.md b/docs/examples/kotlin/vectorsdb/update-collection.md deleted file mode 100644 index 331c85c..0000000 --- a/docs/examples/kotlin/vectorsdb/update-collection.md +++ /dev/null @@ -1,24 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.updateCollection( - databaseId = "", - collectionId = "", - name = "", - dimension = 1, // optional - permissions = listOf(Permission.read(Role.any())), // optional - documentSecurity = false, // optional - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/update-document.md b/docs/examples/kotlin/vectorsdb/update-document.md deleted file mode 100644 index 5725757..0000000 --- a/docs/examples/kotlin/vectorsdb/update-document.md +++ /dev/null @@ -1,23 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.updateDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( "a" to "b" ), // optional - permissions = listOf(Permission.read(Role.any())), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/update-documents.md b/docs/examples/kotlin/vectorsdb/update-documents.md deleted file mode 100644 index 32aac30..0000000 --- a/docs/examples/kotlin/vectorsdb/update-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.updateDocuments( - databaseId = "", - collectionId = "", - data = mapOf( "a" to "b" ), // optional - queries = listOf(), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/update-transaction.md b/docs/examples/kotlin/vectorsdb/update-transaction.md deleted file mode 100644 index 5f34609..0000000 --- a/docs/examples/kotlin/vectorsdb/update-transaction.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.updateTransaction( - transactionId = "", - commit = false, // optional - rollback = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/update.md b/docs/examples/kotlin/vectorsdb/update.md deleted file mode 100644 index 1a42f4f..0000000 --- a/docs/examples/kotlin/vectorsdb/update.md +++ /dev/null @@ -1,18 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.update( - databaseId = "", - name = "", - enabled = false // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/upsert-document.md b/docs/examples/kotlin/vectorsdb/upsert-document.md deleted file mode 100644 index dd18e1d..0000000 --- a/docs/examples/kotlin/vectorsdb/upsert-document.md +++ /dev/null @@ -1,23 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB -import io.appwrite.Permission -import io.appwrite.Role - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setSession("") // The user session to authenticate with - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.upsertDocument( - databaseId = "", - collectionId = "", - documentId = "", - data = mapOf( "a" to "b" ), // optional - permissions = listOf(Permission.read(Role.any())), // optional - transactionId = "" // optional -) -``` diff --git a/docs/examples/kotlin/vectorsdb/upsert-documents.md b/docs/examples/kotlin/vectorsdb/upsert-documents.md deleted file mode 100644 index 7172222..0000000 --- a/docs/examples/kotlin/vectorsdb/upsert-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```kotlin -import io.appwrite.Client -import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.VectorsDB - -val client = Client() - .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setProject("") // Your project ID - .setKey("") // Your secret API key - -val vectorsDB = VectorsDB(client) - -val response = vectorsDB.upsertDocuments( - databaseId = "", - collectionId = "", - documents = listOf(), - transactionId = "" // optional -) -``` diff --git a/src/main/kotlin/io/appwrite/services/DocumentsDB.kt b/src/main/kotlin/io/appwrite/services/DocumentsDB.kt deleted file mode 100644 index 82a929d..0000000 --- a/src/main/kotlin/io/appwrite/services/DocumentsDB.kt +++ /dev/null @@ -1,1588 +0,0 @@ -package io.appwrite.services - -import io.appwrite.Client -import io.appwrite.models.* -import io.appwrite.enums.* -import io.appwrite.exceptions.AppwriteException -import io.appwrite.extensions.classOf -import okhttp3.Cookie -import java.io.File - -/** - * -**/ -class DocumentsDB(client: Client) : Service(client) { - - /** - * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name - * @param search Search term to filter your list results. Max length: 256 chars. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.DatabaseList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun list( - queries: List? = null, - search: String? = null, - total: Boolean? = null, - ): io.appwrite.models.DatabaseList { - val apiPath = "/documentsdb" - - val apiParams = mutableMapOf( - "queries" to queries, - "search" to search, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.DatabaseList = { - io.appwrite.models.DatabaseList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.DatabaseList::class.java, - converter, - ) - } - - /** - * Create a new Database. - * - * - * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param name Database name. Max length: 128 chars. - * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @return [io.appwrite.models.Database] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun create( - databaseId: String, - name: String, - enabled: Boolean? = null, - ): io.appwrite.models.Database { - val apiPath = "/documentsdb" - - val apiParams = mutableMapOf( - "databaseId" to databaseId, - "name" to name, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). - * @return [io.appwrite.models.TransactionList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listTransactions( - queries: List? = null, - ): io.appwrite.models.TransactionList { - val apiPath = "/documentsdb/transactions" - - val apiParams = mutableMapOf( - "queries" to queries, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.TransactionList = { - io.appwrite.models.TransactionList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.TransactionList::class.java, - converter, - ) - } - - /** - * - * - * @param ttl Seconds before the transaction expires. - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createTransaction( - ttl: Long? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/documentsdb/transactions" - - val apiParams = mutableMapOf( - "ttl" to ttl, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @return [io.appwrite.models.Transaction] - */ - @Throws(AppwriteException::class) - suspend fun getTransaction( - transactionId: String, - ): io.appwrite.models.Transaction { - val apiPath = "/documentsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @param commit Commit transaction? - * @param rollback Rollback transaction? - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateTransaction( - transactionId: String, - commit: Boolean? = null, - rollback: Boolean? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/documentsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - "commit" to commit, - "rollback" to rollback, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteTransaction( - transactionId: String, - ): Any { - val apiPath = "/documentsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @param operations Array of staged operations. - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createOperations( - transactionId: String, - operations: List? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/documentsdb/transactions/{transactionId}/operations" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - "operations" to operations, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. - * - * @param databaseId Database ID. - * @return [io.appwrite.models.Database] - */ - @Throws(AppwriteException::class) - suspend fun get( - databaseId: String, - ): io.appwrite.models.Database { - val apiPath = "/documentsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * Update a database by its unique ID. - * - * @param databaseId Database ID. - * @param name Database name. Max length: 128 chars. - * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @return [io.appwrite.models.Database] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun update( - databaseId: String, - name: String, - enabled: Boolean? = null, - ): io.appwrite.models.Database { - val apiPath = "/documentsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "name" to name, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. - * - * @param databaseId Database ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun delete( - databaseId: String, - ): Any { - val apiPath = "/documentsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. - * - * @param databaseId Database ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @param search Search term to filter your list results. Max length: 256 chars. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.CollectionList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listCollections( - databaseId: String, - queries: List? = null, - search: String? = null, - total: Boolean? = null, - ): io.appwrite.models.CollectionList { - val apiPath = "/documentsdb/{databaseId}/collections" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "queries" to queries, - "search" to search, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.CollectionList = { - io.appwrite.models.CollectionList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.CollectionList::class.java, - converter, - ) - } - - /** - * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param name Collection name. Max length: 128 chars. - * @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @param attributes Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. - * @param indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). - * @return [io.appwrite.models.Collection] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createCollection( - databaseId: String, - collectionId: String, - name: String, - permissions: List? = null, - documentSecurity: Boolean? = null, - enabled: Boolean? = null, - attributes: List? = null, - indexes: List? = null, - ): io.appwrite.models.Collection { - val apiPath = "/documentsdb/{databaseId}/collections" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "collectionId" to collectionId, - "name" to name, - "permissions" to permissions, - "documentSecurity" to documentSecurity, - "enabled" to enabled, - "attributes" to attributes, - "indexes" to indexes, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Collection = { - io.appwrite.models.Collection.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Collection::class.java, - converter, - ) - } - - /** - * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @return [io.appwrite.models.Collection] - */ - @Throws(AppwriteException::class) - suspend fun getCollection( - databaseId: String, - collectionId: String, - ): io.appwrite.models.Collection { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Collection = { - io.appwrite.models.Collection.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Collection::class.java, - converter, - ) - } - - /** - * Update a collection by its unique ID. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param name Collection name. Max length: 128 chars. - * @param permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @return [io.appwrite.models.Collection] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateCollection( - databaseId: String, - collectionId: String, - name: String, - permissions: List? = null, - documentSecurity: Boolean? = null, - enabled: Boolean? = null, - ): io.appwrite.models.Collection { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "name" to name, - "permissions" to permissions, - "documentSecurity" to documentSecurity, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Collection = { - io.appwrite.models.Collection.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Collection::class.java, - converter, - ) - } - - /** - * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteCollection( - databaseId: String, - collectionId: String, - ): Any { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - total: Boolean? = null, - ttl: Long? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - "total" to total, - "ttl" to ttl, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - total: Boolean? = null, - ttl: Long? = null, - ): io.appwrite.models.DocumentList> = listDocuments( - databaseId, - collectionId, - queries, - transactionId, - total, - ttl, - nestedType = classOf(), - ) - - /** - * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param data Document data as JSON object. - * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any, - permissions: List? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documentId" to documentId, - "data" to data, - "permissions" to permissions, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param data Document data as JSON object. - * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any, - permissions: List? = null, - ): io.appwrite.models.Document> = createDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - nestedType = classOf(), - ) - - /** - * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documents Array of documents data as JSON objects. - * @return [io.appwrite.models.DocumentList] - */ - @Throws(AppwriteException::class) - suspend fun createDocuments( - databaseId: String, - collectionId: String, - documents: List, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documents" to documents, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documents Array of documents data as JSON objects. - * @return [io.appwrite.models.DocumentList] - */ - @Throws(AppwriteException::class) - suspend fun createDocuments( - databaseId: String, - collectionId: String, - documents: List, - ): io.appwrite.models.DocumentList> = createDocuments( - databaseId, - collectionId, - documents, - nestedType = classOf(), - ) - - /** - * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documents Array of document data as JSON objects. May contain partial documents. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocuments( - databaseId: String, - collectionId: String, - documents: List, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documents" to documents, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documents Array of document data as JSON objects. May contain partial documents. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocuments( - databaseId: String, - collectionId: String, - documents: List, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = upsertDocuments( - databaseId, - collectionId, - documents, - transactionId, - nestedType = classOf(), - ) - - /** - * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocuments( - databaseId: String, - collectionId: String, - data: Any? = null, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "data" to data, - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocuments( - databaseId: String, - collectionId: String, - data: Any? = null, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = updateDocuments( - databaseId, - collectionId, - data, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * Bulk delete documents using queries, if no queries are passed then all documents are deleted. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Bulk delete documents using queries, if no queries are passed then all documents are deleted. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = deleteDocuments( - databaseId, - collectionId, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getDocument( - databaseId: String, - collectionId: String, - documentId: String, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getDocument( - databaseId: String, - collectionId: String, - documentId: String, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = getDocument( - databaseId, - collectionId, - documentId, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include all required fields of the document to be created or updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "data" to data, - "permissions" to permissions, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include all required fields of the document to be created or updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = upsertDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - transactionId, - nestedType = classOf(), - ) - - /** - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only fields and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "data" to data, - "permissions" to permissions, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only fields and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = updateDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - transactionId, - nestedType = classOf(), - ) - - /** - * Delete a document by its unique ID. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param transactionId Transaction ID for staging the operation. - * @return [Any] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocument( - databaseId: String, - collectionId: String, - documentId: String, - transactionId: String? = null, - ): Any { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * Decrement a specific column of a row by a given value. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param attribute Attribute key. - * @param value Value to decrement the attribute by. The value must be a number. - * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun decrementDocumentAttribute( - databaseId: String, - collectionId: String, - documentId: String, - attribute: String, - value: Double? = null, - min: Double? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - .replace("{attribute}", attribute) - - val apiParams = mutableMapOf( - "value" to value, - "min" to min, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Decrement a specific column of a row by a given value. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param attribute Attribute key. - * @param value Value to decrement the attribute by. The value must be a number. - * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun decrementDocumentAttribute( - databaseId: String, - collectionId: String, - documentId: String, - attribute: String, - value: Double? = null, - min: Double? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = decrementDocumentAttribute( - databaseId, - collectionId, - documentId, - attribute, - value, - min, - transactionId, - nestedType = classOf(), - ) - - /** - * Increment a specific column of a row by a given value. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param attribute Attribute key. - * @param value Value to increment the attribute by. The value must be a number. - * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun incrementDocumentAttribute( - databaseId: String, - collectionId: String, - documentId: String, - attribute: String, - value: Double? = null, - max: Double? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - .replace("{attribute}", attribute) - - val apiParams = mutableMapOf( - "value" to value, - "max" to max, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * Increment a specific column of a row by a given value. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param attribute Attribute key. - * @param value Value to increment the attribute by. The value must be a number. - * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun incrementDocumentAttribute( - databaseId: String, - collectionId: String, - documentId: String, - attribute: String, - value: Double? = null, - max: Double? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = incrementDocumentAttribute( - databaseId, - collectionId, - documentId, - attribute, - value, - max, - transactionId, - nestedType = classOf(), - ) - - /** - * List indexes in the collection. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.IndexList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listIndexes( - databaseId: String, - collectionId: String, - queries: List? = null, - total: Boolean? = null, - ): io.appwrite.models.IndexList { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.IndexList = { - io.appwrite.models.IndexList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.IndexList::class.java, - converter, - ) - } - - /** - * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. - * Attributes can be `key`, `fulltext`, and `unique`. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @param type Index type. - * @param attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param orders Array of index orders. Maximum of 100 orders are allowed. - * @param lengths Length of index. Maximum of 100 - * @return [io.appwrite.models.Index] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createIndex( - databaseId: String, - collectionId: String, - key: String, - type: io.appwrite.enums.DocumentsDBIndexType, - attributes: List, - orders: List? = null, - lengths: List? = null, - ): io.appwrite.models.Index { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "key" to key, - "type" to type, - "attributes" to attributes, - "orders" to orders, - "lengths" to lengths, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Index = { - io.appwrite.models.Index.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Index::class.java, - converter, - ) - } - - /** - * Get index by ID. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @return [io.appwrite.models.Index] - */ - @Throws(AppwriteException::class) - suspend fun getIndex( - databaseId: String, - collectionId: String, - key: String, - ): io.appwrite.models.Index { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{key}", key) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Index = { - io.appwrite.models.Index.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Index::class.java, - converter, - ) - } - - /** - * Delete an index. - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteIndex( - databaseId: String, - collectionId: String, - key: String, - ): Any { - val apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{key}", key) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/VectorsDB.kt b/src/main/kotlin/io/appwrite/services/VectorsDB.kt deleted file mode 100644 index 4f33445..0000000 --- a/src/main/kotlin/io/appwrite/services/VectorsDB.kt +++ /dev/null @@ -1,1451 +0,0 @@ -package io.appwrite.services - -import io.appwrite.Client -import io.appwrite.models.* -import io.appwrite.enums.* -import io.appwrite.exceptions.AppwriteException -import io.appwrite.extensions.classOf -import okhttp3.Cookie -import java.io.File - -/** - * -**/ -class VectorsDB(client: Client) : Service(client) { - - /** - * - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name - * @param search Search term to filter your list results. Max length: 256 chars. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.DatabaseList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun list( - queries: List? = null, - search: String? = null, - total: Boolean? = null, - ): io.appwrite.models.DatabaseList { - val apiPath = "/vectorsdb" - - val apiParams = mutableMapOf( - "queries" to queries, - "search" to search, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.DatabaseList = { - io.appwrite.models.DatabaseList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.DatabaseList::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param name Database name. Max length: 128 chars. - * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @return [io.appwrite.models.Database] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun create( - databaseId: String, - name: String, - enabled: Boolean? = null, - ): io.appwrite.models.Database { - val apiPath = "/vectorsdb" - - val apiParams = mutableMapOf( - "databaseId" to databaseId, - "name" to name, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * - * - * @param texts Array of text to generate embeddings. - * @param model The embedding model to use for generating vector embeddings. - * @return [io.appwrite.models.EmbeddingList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createTextEmbeddings( - texts: List, - model: io.appwrite.enums.Model? = null, - ): io.appwrite.models.EmbeddingList { - val apiPath = "/vectorsdb/embeddings/text" - - val apiParams = mutableMapOf( - "texts" to texts, - "model" to model, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.EmbeddingList = { - io.appwrite.models.EmbeddingList.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.EmbeddingList::class.java, - converter, - ) - } - - /** - * - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). - * @return [io.appwrite.models.TransactionList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listTransactions( - queries: List? = null, - ): io.appwrite.models.TransactionList { - val apiPath = "/vectorsdb/transactions" - - val apiParams = mutableMapOf( - "queries" to queries, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.TransactionList = { - io.appwrite.models.TransactionList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.TransactionList::class.java, - converter, - ) - } - - /** - * - * - * @param ttl Seconds before the transaction expires. - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createTransaction( - ttl: Long? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/vectorsdb/transactions" - - val apiParams = mutableMapOf( - "ttl" to ttl, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @return [io.appwrite.models.Transaction] - */ - @Throws(AppwriteException::class) - suspend fun getTransaction( - transactionId: String, - ): io.appwrite.models.Transaction { - val apiPath = "/vectorsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @param commit Commit transaction? - * @param rollback Rollback transaction? - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateTransaction( - transactionId: String, - commit: Boolean? = null, - rollback: Boolean? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/vectorsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - "commit" to commit, - "rollback" to rollback, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteTransaction( - transactionId: String, - ): Any { - val apiPath = "/vectorsdb/transactions/{transactionId}" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * - * - * @param transactionId Transaction ID. - * @param operations Array of staged operations. - * @return [io.appwrite.models.Transaction] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createOperations( - transactionId: String, - operations: List? = null, - ): io.appwrite.models.Transaction { - val apiPath = "/vectorsdb/transactions/{transactionId}/operations" - .replace("{transactionId}", transactionId) - - val apiParams = mutableMapOf( - "operations" to operations, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Transaction = { - io.appwrite.models.Transaction.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Transaction::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @return [io.appwrite.models.Database] - */ - @Throws(AppwriteException::class) - suspend fun get( - databaseId: String, - ): io.appwrite.models.Database { - val apiPath = "/vectorsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param name Database name. Max length: 128 chars. - * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @return [io.appwrite.models.Database] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun update( - databaseId: String, - name: String, - enabled: Boolean? = null, - ): io.appwrite.models.Database { - val apiPath = "/vectorsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "name" to name, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Database = { - io.appwrite.models.Database.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Database::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun delete( - databaseId: String, - ): Any { - val apiPath = "/vectorsdb/{databaseId}" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @param search Search term to filter your list results. Max length: 256 chars. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.VectorsdbCollectionList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listCollections( - databaseId: String, - queries: List? = null, - search: String? = null, - total: Boolean? = null, - ): io.appwrite.models.VectorsdbCollectionList { - val apiPath = "/vectorsdb/{databaseId}/collections" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "queries" to queries, - "search" to search, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.VectorsdbCollectionList = { - io.appwrite.models.VectorsdbCollectionList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.VectorsdbCollectionList::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param name Collection name. Max length: 128 chars. - * @param dimension Embedding dimension. - * @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @return [io.appwrite.models.VectorsdbCollection] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createCollection( - databaseId: String, - collectionId: String, - name: String, - dimension: Long, - permissions: List? = null, - documentSecurity: Boolean? = null, - enabled: Boolean? = null, - ): io.appwrite.models.VectorsdbCollection { - val apiPath = "/vectorsdb/{databaseId}/collections" - .replace("{databaseId}", databaseId) - - val apiParams = mutableMapOf( - "collectionId" to collectionId, - "name" to name, - "dimension" to dimension, - "permissions" to permissions, - "documentSecurity" to documentSecurity, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { - io.appwrite.models.VectorsdbCollection.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.VectorsdbCollection::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @return [io.appwrite.models.VectorsdbCollection] - */ - @Throws(AppwriteException::class) - suspend fun getCollection( - databaseId: String, - collectionId: String, - ): io.appwrite.models.VectorsdbCollection { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { - io.appwrite.models.VectorsdbCollection.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.VectorsdbCollection::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param name Collection name. Max length: 128 chars. - * @param dimension Embedding dimensions. - * @param permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @return [io.appwrite.models.VectorsdbCollection] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateCollection( - databaseId: String, - collectionId: String, - name: String, - dimension: Long? = null, - permissions: List? = null, - documentSecurity: Boolean? = null, - enabled: Boolean? = null, - ): io.appwrite.models.VectorsdbCollection { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "name" to name, - "dimension" to dimension, - "permissions" to permissions, - "documentSecurity" to documentSecurity, - "enabled" to enabled, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.VectorsdbCollection = { - io.appwrite.models.VectorsdbCollection.from(map = it as Map) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.VectorsdbCollection::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteCollection( - databaseId: String, - collectionId: String, - ): Any { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - total: Boolean? = null, - ttl: Long? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - "total" to total, - "ttl" to ttl, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - total: Boolean? = null, - ttl: Long? = null, - ): io.appwrite.models.DocumentList> = listDocuments( - databaseId, - collectionId, - queries, - transactionId, - total, - ttl, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param data Document data as JSON object. - * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any, - permissions: List? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documentId" to documentId, - "data" to data, - "permissions" to permissions, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param data Document data as JSON object. - * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any, - permissions: List? = null, - ): io.appwrite.models.Document> = createDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documents Array of documents data as JSON objects. - * @return [io.appwrite.models.DocumentList] - */ - @Throws(AppwriteException::class) - suspend fun createDocuments( - databaseId: String, - collectionId: String, - documents: List, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documents" to documents, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param documents Array of documents data as JSON objects. - * @return [io.appwrite.models.DocumentList] - */ - @Throws(AppwriteException::class) - suspend fun createDocuments( - databaseId: String, - collectionId: String, - documents: List, - ): io.appwrite.models.DocumentList> = createDocuments( - databaseId, - collectionId, - documents, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documents Array of document data as JSON objects. May contain partial documents. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocuments( - databaseId: String, - collectionId: String, - documents: List, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "documents" to documents, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documents Array of document data as JSON objects. May contain partial documents. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocuments( - databaseId: String, - collectionId: String, - documents: List, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = upsertDocuments( - databaseId, - collectionId, - documents, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocuments( - databaseId: String, - collectionId: String, - data: Any? = null, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "data" to data, - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocuments( - databaseId: String, - collectionId: String, - data: Any? = null, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = updateDocuments( - databaseId, - collectionId, - data, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.DocumentList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.DocumentList = { - io.appwrite.models.DocumentList.from(map = it as Map, nestedType) - } - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.DocumentList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocuments( - databaseId: String, - collectionId: String, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.DocumentList> = deleteDocuments( - databaseId, - collectionId, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getDocument( - databaseId: String, - collectionId: String, - documentId: String, - queries: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "queries" to queries, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param transactionId Transaction ID to read uncommitted changes within the transaction. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getDocument( - databaseId: String, - collectionId: String, - documentId: String, - queries: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = getDocument( - databaseId, - collectionId, - documentId, - queries, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include all required fields of the document to be created or updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "data" to data, - "permissions" to permissions, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PUT", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include all required fields of the document to be created or updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun upsertDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = upsertDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only fields and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "data" to data, - "permissions" to permissions, - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) - } - return client.call( - "PATCH", - apiPath, - apiHeaders, - apiParams, - responseType = classOf(), - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only fields and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param transactionId Transaction ID for staging the operation. - * @return [io.appwrite.models.Document] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun updateDocument( - databaseId: String, - collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - transactionId: String? = null, - ): io.appwrite.models.Document> = updateDocument( - databaseId, - collectionId, - documentId, - data, - permissions, - transactionId, - nestedType = classOf(), - ) - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param transactionId Transaction ID for staging the operation. - * @return [Any] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun deleteDocument( - databaseId: String, - collectionId: String, - documentId: String, - transactionId: String? = null, - ): Any { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) - - val apiParams = mutableMapOf( - "transactionId" to transactionId, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @param total When set to false, the total count returned will be 0 and will not be calculated. - * @return [io.appwrite.models.IndexList] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun listIndexes( - databaseId: String, - collectionId: String, - queries: List? = null, - total: Boolean? = null, - ): io.appwrite.models.IndexList { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "queries" to queries, - "total" to total, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.IndexList = { - io.appwrite.models.IndexList.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.IndexList::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @param type Index type. - * @param attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param orders Array of index orders. Maximum of 100 orders are allowed. - * @param lengths Length of index. Maximum of 100 - * @return [io.appwrite.models.Index] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun createIndex( - databaseId: String, - collectionId: String, - key: String, - type: io.appwrite.enums.VectorsDBIndexType, - attributes: List, - orders: List? = null, - lengths: List? = null, - ): io.appwrite.models.Index { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - - val apiParams = mutableMapOf( - "key" to key, - "type" to type, - "attributes" to attributes, - "orders" to orders, - "lengths" to lengths, - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.Index = { - io.appwrite.models.Index.from(map = it as Map) - } - return client.call( - "POST", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Index::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @return [io.appwrite.models.Index] - */ - @Throws(AppwriteException::class) - suspend fun getIndex( - databaseId: String, - collectionId: String, - key: String, - ): io.appwrite.models.Index { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{key}", key) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.Index = { - io.appwrite.models.Index.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.Index::class.java, - converter, - ) - } - - /** - * - * - * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param key Index Key. - * @return [Any] - */ - @Throws(AppwriteException::class) - suspend fun deleteIndex( - databaseId: String, - collectionId: String, - key: String, - ): Any { - val apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .replace("{databaseId}", databaseId) - .replace("{collectionId}", collectionId) - .replace("{key}", key) - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - return client.call( - "DELETE", - apiPath, - apiHeaders, - apiParams, - responseType = Any::class.java, - ) - } - -} \ No newline at end of file From 3f626360f11d5801b674ebc3e7c01313aa3ac9d6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 06:44:55 +0000 Subject: [PATCH 4/8] chore: update Kotlin SDK to 15.0.0 --- .../io/appwrite/enums/DocumentsDBIndexType.kt | 16 -- src/main/kotlin/io/appwrite/enums/Model.kt | 10 -- .../appwrite/enums/TemplateReferenceType.kt | 4 +- .../io/appwrite/enums/VCSReferenceType.kt | 4 +- .../io/appwrite/enums/VectorsDBIndexType.kt | 20 --- .../io/appwrite/models/AttributeObject.kt | 87 ---------- .../io/appwrite/models/AttributeVector.kt | 95 ----------- .../kotlin/io/appwrite/models/Embedding.kt | 54 ------ .../io/appwrite/models/EmbeddingList.kt | 38 ----- .../io/appwrite/models/VectorsdbCollection.kt | 126 -------------- .../models/VectorsdbCollectionList.kt | 38 ----- .../kotlin/io/appwrite/services/Health.kt | 155 ------------------ 12 files changed, 3 insertions(+), 644 deletions(-) delete mode 100644 src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt delete mode 100644 src/main/kotlin/io/appwrite/enums/Model.kt delete mode 100644 src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt delete mode 100644 src/main/kotlin/io/appwrite/models/AttributeObject.kt delete mode 100644 src/main/kotlin/io/appwrite/models/AttributeVector.kt delete mode 100644 src/main/kotlin/io/appwrite/models/Embedding.kt delete mode 100644 src/main/kotlin/io/appwrite/models/EmbeddingList.kt delete mode 100644 src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt delete mode 100644 src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt diff --git a/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt b/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt deleted file mode 100644 index 97ab70c..0000000 --- a/src/main/kotlin/io/appwrite/enums/DocumentsDBIndexType.kt +++ /dev/null @@ -1,16 +0,0 @@ -package io.appwrite.enums - -import com.google.gson.annotations.SerializedName - -enum class DocumentsDBIndexType(val value: String) { - @SerializedName("key") - KEY("key"), - @SerializedName("fulltext") - FULLTEXT("fulltext"), - @SerializedName("unique") - UNIQUE("unique"), - @SerializedName("spatial") - SPATIAL("spatial"); - - override fun toString() = value -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Model.kt b/src/main/kotlin/io/appwrite/enums/Model.kt deleted file mode 100644 index 7ec7ace..0000000 --- a/src/main/kotlin/io/appwrite/enums/Model.kt +++ /dev/null @@ -1,10 +0,0 @@ -package io.appwrite.enums - -import com.google.gson.annotations.SerializedName - -enum class Model(val value: String) { - @SerializedName("embeddinggemma") - EMBEDDINGGEMMA("embeddinggemma"); - - override fun toString() = value -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt b/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt index 1f258b7..2997c18 100644 --- a/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt +++ b/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt @@ -3,10 +3,10 @@ package io.appwrite.enums import com.google.gson.annotations.SerializedName enum class TemplateReferenceType(val value: String) { - @SerializedName("branch") - BRANCH("branch"), @SerializedName("commit") COMMIT("commit"), + @SerializedName("branch") + BRANCH("branch"), @SerializedName("tag") TAG("tag"); diff --git a/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt b/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt index 010b5e9..a6fbe92 100644 --- a/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt +++ b/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt @@ -6,9 +6,7 @@ enum class VCSReferenceType(val value: String) { @SerializedName("branch") BRANCH("branch"), @SerializedName("commit") - COMMIT("commit"), - @SerializedName("tag") - TAG("tag"); + COMMIT("commit"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt b/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt deleted file mode 100644 index 898f5ac..0000000 --- a/src/main/kotlin/io/appwrite/enums/VectorsDBIndexType.kt +++ /dev/null @@ -1,20 +0,0 @@ -package io.appwrite.enums - -import com.google.gson.annotations.SerializedName - -enum class VectorsDBIndexType(val value: String) { - @SerializedName("hnsw_euclidean") - HNSW_EUCLIDEAN("hnsw_euclidean"), - @SerializedName("hnsw_dot") - HNSW_DOT("hnsw_dot"), - @SerializedName("hnsw_cosine") - HNSW_COSINE("hnsw_cosine"), - @SerializedName("object") - OBJECT("object"), - @SerializedName("key") - KEY("key"), - @SerializedName("unique") - UNIQUE("unique"); - - override fun toString() = value -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeObject.kt b/src/main/kotlin/io/appwrite/models/AttributeObject.kt deleted file mode 100644 index 82d0292..0000000 --- a/src/main/kotlin/io/appwrite/models/AttributeObject.kt +++ /dev/null @@ -1,87 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast -import io.appwrite.enums.AttributeStatus - -/** - * AttributeObject - */ -data class AttributeObject( - /** - * Attribute Key. - */ - @SerializedName("key") - val key: String, - - /** - * Attribute type. - */ - @SerializedName("type") - val type: String, - - /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` - */ - @SerializedName("status") - val status: AttributeStatus, - - /** - * Error message. Displays error generated on failure of creating or deleting an attribute. - */ - @SerializedName("error") - val error: String, - - /** - * Is attribute required? - */ - @SerializedName("required") - val required: Boolean, - - /** - * Is attribute an array? - */ - @SerializedName("array") - var array: Boolean?, - - /** - * Attribute creation date in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Attribute update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - -) { - fun toMap(): Map = mapOf( - "key" to key as Any, - "type" to type as Any, - "status" to status.value as Any, - "error" to error as Any, - "required" to required as Any, - "array" to array as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = AttributeObject( - key = map["key"] as String, - type = map["type"] as String, - status = AttributeStatus.values().find { it.value == map["status"] as String }!!, - error = map["error"] as String, - required = map["required"] as Boolean, - array = map["array"] as? Boolean, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeVector.kt b/src/main/kotlin/io/appwrite/models/AttributeVector.kt deleted file mode 100644 index 96ffece..0000000 --- a/src/main/kotlin/io/appwrite/models/AttributeVector.kt +++ /dev/null @@ -1,95 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast -import io.appwrite.enums.AttributeStatus - -/** - * AttributeVector - */ -data class AttributeVector( - /** - * Attribute Key. - */ - @SerializedName("key") - val key: String, - - /** - * Attribute type. - */ - @SerializedName("type") - val type: String, - - /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` - */ - @SerializedName("status") - val status: AttributeStatus, - - /** - * Error message. Displays error generated on failure of creating or deleting an attribute. - */ - @SerializedName("error") - val error: String, - - /** - * Is attribute required? - */ - @SerializedName("required") - val required: Boolean, - - /** - * Is attribute an array? - */ - @SerializedName("array") - var array: Boolean?, - - /** - * Attribute creation date in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Attribute update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Vector dimensions. - */ - @SerializedName("size") - val size: Long, - -) { - fun toMap(): Map = mapOf( - "key" to key as Any, - "type" to type as Any, - "status" to status.value as Any, - "error" to error as Any, - "required" to required as Any, - "array" to array as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "size" to size as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = AttributeVector( - key = map["key"] as String, - type = map["type"] as String, - status = AttributeStatus.values().find { it.value == map["status"] as String }!!, - error = map["error"] as String, - required = map["required"] as Boolean, - array = map["array"] as? Boolean, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - size = (map["size"] as Number).toLong(), - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Embedding.kt b/src/main/kotlin/io/appwrite/models/Embedding.kt deleted file mode 100644 index 24d931f..0000000 --- a/src/main/kotlin/io/appwrite/models/Embedding.kt +++ /dev/null @@ -1,54 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Embedding - */ -data class Embedding( - /** - * Embedding model used to generate embeddings. - */ - @SerializedName("model") - val model: String, - - /** - * Number of dimensions for each embedding vector. - */ - @SerializedName("dimension") - val dimension: Long, - - /** - * Embedding vector values. If an error occurs, this will be an empty array. - */ - @SerializedName("embedding") - val embedding: List, - - /** - * Error message if embedding generation fails. Empty string if no error. - */ - @SerializedName("error") - val error: String, - -) { - fun toMap(): Map = mapOf( - "model" to model as Any, - "dimension" to dimension as Any, - "embedding" to embedding as Any, - "error" to error as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = Embedding( - model = map["model"] as String, - dimension = (map["dimension"] as Number).toLong(), - embedding = map["embedding"] as List, - error = map["error"] as String, - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/EmbeddingList.kt b/src/main/kotlin/io/appwrite/models/EmbeddingList.kt deleted file mode 100644 index cd6acbd..0000000 --- a/src/main/kotlin/io/appwrite/models/EmbeddingList.kt +++ /dev/null @@ -1,38 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Embedding list - */ -data class EmbeddingList( - /** - * Total number of embeddings that matched your query. - */ - @SerializedName("total") - val total: Long, - - /** - * List of embeddings. - */ - @SerializedName("embeddings") - val embeddings: List, - -) { - fun toMap(): Map = mapOf( - "total" to total as Any, - "embeddings" to embeddings.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = EmbeddingList( - total = (map["total"] as Number).toLong(), - embeddings = (map["embeddings"] as List>).map { Embedding.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt b/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt deleted file mode 100644 index 4c15f3e..0000000 --- a/src/main/kotlin/io/appwrite/models/VectorsdbCollection.kt +++ /dev/null @@ -1,126 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * VectorsDB Collection - */ -data class VectorsdbCollection( - /** - * Collection ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * Collection creation date in ISO 8601 format. - */ - @SerializedName("\$createdAt") - val createdAt: String, - - /** - * Collection update date in ISO 8601 format. - */ - @SerializedName("\$updatedAt") - val updatedAt: String, - - /** - * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ - @SerializedName("\$permissions") - val permissions: List, - - /** - * Database ID. - */ - @SerializedName("databaseId") - val databaseId: String, - - /** - * Collection name. - */ - @SerializedName("name") - val name: String, - - /** - * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. - */ - @SerializedName("enabled") - val enabled: Boolean, - - /** - * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ - @SerializedName("documentSecurity") - val documentSecurity: Boolean, - - /** - * Collection attributes. - */ - @SerializedName("attributes") - val attributes: List, - - /** - * Collection indexes. - */ - @SerializedName("indexes") - val indexes: List, - - /** - * Maximum document size in bytes. Returns 0 when no limit applies. - */ - @SerializedName("bytesMax") - val bytesMax: Long, - - /** - * Currently used document size in bytes based on defined attributes. - */ - @SerializedName("bytesUsed") - val bytesUsed: Long, - - /** - * Embedding dimension. - */ - @SerializedName("dimension") - val dimension: Long, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, - "\$permissions" to permissions as Any, - "databaseId" to databaseId as Any, - "name" to name as Any, - "enabled" to enabled as Any, - "documentSecurity" to documentSecurity as Any, - "attributes" to attributes as Any, - "indexes" to indexes.map { it.toMap() } as Any, - "bytesMax" to bytesMax as Any, - "bytesUsed" to bytesUsed as Any, - "dimension" to dimension as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = VectorsdbCollection( - id = map["\$id"] as String, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List, - databaseId = map["databaseId"] as String, - name = map["name"] as String, - enabled = map["enabled"] as Boolean, - documentSecurity = map["documentSecurity"] as Boolean, - attributes = map["attributes"] as List, - indexes = (map["indexes"] as List>).map { Index.from(map = it) }, - bytesMax = (map["bytesMax"] as Number).toLong(), - bytesUsed = (map["bytesUsed"] as Number).toLong(), - dimension = (map["dimension"] as Number).toLong(), - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt b/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt deleted file mode 100644 index 44f0285..0000000 --- a/src/main/kotlin/io/appwrite/models/VectorsdbCollectionList.kt +++ /dev/null @@ -1,38 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * VectorsDB Collections List - */ -data class VectorsdbCollectionList( - /** - * Total number of collections that matched your query. - */ - @SerializedName("total") - val total: Long, - - /** - * List of collections. - */ - @SerializedName("collections") - val collections: List, - -) { - fun toMap(): Map = mapOf( - "total" to total as Any, - "collections" to collections.map { it.toMap() } as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = VectorsdbCollectionList( - total = (map["total"] as Number).toLong(), - collections = (map["collections"] as List>).map { VectorsdbCollection.from(map = it) }, - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Health.kt b/src/main/kotlin/io/appwrite/services/Health.kt index 53231f6..dfee698 100644 --- a/src/main/kotlin/io/appwrite/services/Health.kt +++ b/src/main/kotlin/io/appwrite/services/Health.kt @@ -245,68 +245,6 @@ class Health(client: Client) : Service(client) { ) } - /** - * Get billing project aggregation queue. - * - * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @return [io.appwrite.models.HealthQueue] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getQueueBillingProjectAggregation( - threshold: Long? = null, - ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/billing-project-aggregation" - - val apiParams = mutableMapOf( - "threshold" to threshold, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.HealthQueue = { - io.appwrite.models.HealthQueue.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthQueue::class.java, - converter, - ) - } - - /** - * Get billing team aggregation queue. - * - * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @return [io.appwrite.models.HealthQueue] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getQueueBillingTeamAggregation( - threshold: Long? = null, - ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/billing-team-aggregation" - - val apiParams = mutableMapOf( - "threshold" to threshold, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.HealthQueue = { - io.appwrite.models.HealthQueue.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthQueue::class.java, - converter, - ) - } - /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * @@ -338,37 +276,6 @@ class Health(client: Client) : Service(client) { ) } - /** - * Get the priority builds queue size. - * - * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. - * @return [io.appwrite.models.HealthQueue] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getQueuePriorityBuilds( - threshold: Long? = null, - ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/builds-priority" - - val apiParams = mutableMapOf( - "threshold" to threshold, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.HealthQueue = { - io.appwrite.models.HealthQueue.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthQueue::class.java, - converter, - ) - } - /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * @@ -655,37 +562,6 @@ class Health(client: Client) : Service(client) { ) } - /** - * Get region manager queue. - * - * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @return [io.appwrite.models.HealthQueue] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getQueueRegionManager( - threshold: Long? = null, - ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/region-manager" - - val apiParams = mutableMapOf( - "threshold" to threshold, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.HealthQueue = { - io.appwrite.models.HealthQueue.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthQueue::class.java, - converter, - ) - } - /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * @@ -748,37 +624,6 @@ class Health(client: Client) : Service(client) { ) } - /** - * Get threats queue. - * - * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @return [io.appwrite.models.HealthQueue] - */ - @JvmOverloads - @Throws(AppwriteException::class) - suspend fun getQueueThreats( - threshold: Long? = null, - ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/threats" - - val apiParams = mutableMapOf( - "threshold" to threshold, - ) - val apiHeaders = mutableMapOf( - ) - val converter: (Any) -> io.appwrite.models.HealthQueue = { - io.appwrite.models.HealthQueue.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthQueue::class.java, - converter, - ) - } - /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * From aa16c6e07cd862fd3cd85db602046ebf95946936 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 07:21:12 +0000 Subject: [PATCH 5/8] chore: update Kotlin SDK to 15.0.0 --- src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt b/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt index a6fbe92..010b5e9 100644 --- a/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt +++ b/src/main/kotlin/io/appwrite/enums/VCSReferenceType.kt @@ -6,7 +6,9 @@ enum class VCSReferenceType(val value: String) { @SerializedName("branch") BRANCH("branch"), @SerializedName("commit") - COMMIT("commit"); + COMMIT("commit"), + @SerializedName("tag") + TAG("tag"); override fun toString() = value } \ No newline at end of file From ad4248bbcb57923b2912d6aaa0e53821360a9bb1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 04:23:34 +0000 Subject: [PATCH 6/8] chore: update Kotlin SDK to 15.0.0 --- .../kotlin/io/appwrite/enums/BuildRuntime.kt | 174 +----------------- src/main/kotlin/io/appwrite/enums/Runtime.kt | 174 +----------------- 2 files changed, 2 insertions(+), 346 deletions(-) diff --git a/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt index efab3af..ff8b115 100644 --- a/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt +++ b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt @@ -174,179 +174,7 @@ enum class BuildRuntime(val value: String) { @SerializedName("flutter-3.35") FLUTTER_3_35("flutter-3.35"), @SerializedName("flutter-3.38") - FLUTTER_3_38("flutter-3.38"), - @SerializedName("node-14.5-rc") - NODE_14_5_RC("node-14.5-rc"), - @SerializedName("node-16.0-rc") - NODE_16_0_RC("node-16.0-rc"), - @SerializedName("node-18.0-rc") - NODE_18_0_RC("node-18.0-rc"), - @SerializedName("node-19.0-rc") - NODE_19_0_RC("node-19.0-rc"), - @SerializedName("node-20.0-rc") - NODE_20_0_RC("node-20.0-rc"), - @SerializedName("node-21.0-rc") - NODE_21_0_RC("node-21.0-rc"), - @SerializedName("node-22-rc") - NODE_22_RC("node-22-rc"), - @SerializedName("node-23-rc") - NODE_23_RC("node-23-rc"), - @SerializedName("node-24-rc") - NODE_24_RC("node-24-rc"), - @SerializedName("node-25-rc") - NODE_25_RC("node-25-rc"), - @SerializedName("php-8.0-rc") - PHP_8_0_RC("php-8.0-rc"), - @SerializedName("php-8.1-rc") - PHP_8_1_RC("php-8.1-rc"), - @SerializedName("php-8.2-rc") - PHP_8_2_RC("php-8.2-rc"), - @SerializedName("php-8.3-rc") - PHP_8_3_RC("php-8.3-rc"), - @SerializedName("php-8.4-rc") - PHP_8_4_RC("php-8.4-rc"), - @SerializedName("ruby-3.0-rc") - RUBY_3_0_RC("ruby-3.0-rc"), - @SerializedName("ruby-3.1-rc") - RUBY_3_1_RC("ruby-3.1-rc"), - @SerializedName("ruby-3.2-rc") - RUBY_3_2_RC("ruby-3.2-rc"), - @SerializedName("ruby-3.3-rc") - RUBY_3_3_RC("ruby-3.3-rc"), - @SerializedName("ruby-3.4-rc") - RUBY_3_4_RC("ruby-3.4-rc"), - @SerializedName("ruby-4.0-rc") - RUBY_4_0_RC("ruby-4.0-rc"), - @SerializedName("python-3.8-rc") - PYTHON_3_8_RC("python-3.8-rc"), - @SerializedName("python-3.9-rc") - PYTHON_3_9_RC("python-3.9-rc"), - @SerializedName("python-3.10-rc") - PYTHON_3_10_RC("python-3.10-rc"), - @SerializedName("python-3.11-rc") - PYTHON_3_11_RC("python-3.11-rc"), - @SerializedName("python-3.12-rc") - PYTHON_3_12_RC("python-3.12-rc"), - @SerializedName("python-3.13-rc") - PYTHON_3_13_RC("python-3.13-rc"), - @SerializedName("python-3.14-rc") - PYTHON_3_14_RC("python-3.14-rc"), - @SerializedName("python-ml-3.11-rc") - PYTHON_ML_3_11_RC("python-ml-3.11-rc"), - @SerializedName("python-ml-3.12-rc") - PYTHON_ML_3_12_RC("python-ml-3.12-rc"), - @SerializedName("python-ml-3.13-rc") - PYTHON_ML_3_13_RC("python-ml-3.13-rc"), - @SerializedName("deno-1.40-rc") - DENO_1_40_RC("deno-1.40-rc"), - @SerializedName("deno-1.46-rc") - DENO_1_46_RC("deno-1.46-rc"), - @SerializedName("deno-2.0-rc") - DENO_2_0_RC("deno-2.0-rc"), - @SerializedName("deno-2.5-rc") - DENO_2_5_RC("deno-2.5-rc"), - @SerializedName("deno-2.6-rc") - DENO_2_6_RC("deno-2.6-rc"), - @SerializedName("dart-2.15-rc") - DART_2_15_RC("dart-2.15-rc"), - @SerializedName("dart-2.16-rc") - DART_2_16_RC("dart-2.16-rc"), - @SerializedName("dart-2.17-rc") - DART_2_17_RC("dart-2.17-rc"), - @SerializedName("dart-2.18-rc") - DART_2_18_RC("dart-2.18-rc"), - @SerializedName("dart-2.19-rc") - DART_2_19_RC("dart-2.19-rc"), - @SerializedName("dart-3.0-rc") - DART_3_0_RC("dart-3.0-rc"), - @SerializedName("dart-3.1-rc") - DART_3_1_RC("dart-3.1-rc"), - @SerializedName("dart-3.3-rc") - DART_3_3_RC("dart-3.3-rc"), - @SerializedName("dart-3.5-rc") - DART_3_5_RC("dart-3.5-rc"), - @SerializedName("dart-3.8-rc") - DART_3_8_RC("dart-3.8-rc"), - @SerializedName("dart-3.9-rc") - DART_3_9_RC("dart-3.9-rc"), - @SerializedName("dart-3.10-rc") - DART_3_10_RC("dart-3.10-rc"), - @SerializedName("dotnet-6.0-rc") - DOTNET_6_0_RC("dotnet-6.0-rc"), - @SerializedName("dotnet-7.0-rc") - DOTNET_7_0_RC("dotnet-7.0-rc"), - @SerializedName("dotnet-8.0-rc") - DOTNET_8_0_RC("dotnet-8.0-rc"), - @SerializedName("dotnet-10-rc") - DOTNET_10_RC("dotnet-10-rc"), - @SerializedName("java-8.0-rc") - JAVA_8_0_RC("java-8.0-rc"), - @SerializedName("java-11.0-rc") - JAVA_11_0_RC("java-11.0-rc"), - @SerializedName("java-17.0-rc") - JAVA_17_0_RC("java-17.0-rc"), - @SerializedName("java-18.0-rc") - JAVA_18_0_RC("java-18.0-rc"), - @SerializedName("java-21.0-rc") - JAVA_21_0_RC("java-21.0-rc"), - @SerializedName("java-22-rc") - JAVA_22_RC("java-22-rc"), - @SerializedName("java-25-rc") - JAVA_25_RC("java-25-rc"), - @SerializedName("swift-5.5-rc") - SWIFT_5_5_RC("swift-5.5-rc"), - @SerializedName("swift-5.8-rc") - SWIFT_5_8_RC("swift-5.8-rc"), - @SerializedName("swift-5.9-rc") - SWIFT_5_9_RC("swift-5.9-rc"), - @SerializedName("swift-5.10-rc") - SWIFT_5_10_RC("swift-5.10-rc"), - @SerializedName("swift-6.2-rc") - SWIFT_6_2_RC("swift-6.2-rc"), - @SerializedName("kotlin-1.6-rc") - KOTLIN_1_6_RC("kotlin-1.6-rc"), - @SerializedName("kotlin-1.8-rc") - KOTLIN_1_8_RC("kotlin-1.8-rc"), - @SerializedName("kotlin-1.9-rc") - KOTLIN_1_9_RC("kotlin-1.9-rc"), - @SerializedName("kotlin-2.0-rc") - KOTLIN_2_0_RC("kotlin-2.0-rc"), - @SerializedName("kotlin-2.3-rc") - KOTLIN_2_3_RC("kotlin-2.3-rc"), - @SerializedName("cpp-17-rc") - CPP_17_RC("cpp-17-rc"), - @SerializedName("cpp-20-rc") - CPP_20_RC("cpp-20-rc"), - @SerializedName("bun-1.0-rc") - BUN_1_0_RC("bun-1.0-rc"), - @SerializedName("bun-1.1-rc") - BUN_1_1_RC("bun-1.1-rc"), - @SerializedName("bun-1.2-rc") - BUN_1_2_RC("bun-1.2-rc"), - @SerializedName("bun-1.3-rc") - BUN_1_3_RC("bun-1.3-rc"), - @SerializedName("go-1.23-rc") - GO_1_23_RC("go-1.23-rc"), - @SerializedName("go-1.24-rc") - GO_1_24_RC("go-1.24-rc"), - @SerializedName("go-1.25-rc") - GO_1_25_RC("go-1.25-rc"), - @SerializedName("go-1.26-rc") - GO_1_26_RC("go-1.26-rc"), - @SerializedName("static-1-rc") - STATIC_1_RC("static-1-rc"), - @SerializedName("flutter-3.24-rc") - FLUTTER_3_24_RC("flutter-3.24-rc"), - @SerializedName("flutter-3.27-rc") - FLUTTER_3_27_RC("flutter-3.27-rc"), - @SerializedName("flutter-3.29-rc") - FLUTTER_3_29_RC("flutter-3.29-rc"), - @SerializedName("flutter-3.32-rc") - FLUTTER_3_32_RC("flutter-3.32-rc"), - @SerializedName("flutter-3.35-rc") - FLUTTER_3_35_RC("flutter-3.35-rc"), - @SerializedName("flutter-3.38-rc") - FLUTTER_3_38_RC("flutter-3.38-rc"); + FLUTTER_3_38("flutter-3.38"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Runtime.kt b/src/main/kotlin/io/appwrite/enums/Runtime.kt index 77d059d..4991836 100644 --- a/src/main/kotlin/io/appwrite/enums/Runtime.kt +++ b/src/main/kotlin/io/appwrite/enums/Runtime.kt @@ -174,179 +174,7 @@ enum class Runtime(val value: String) { @SerializedName("flutter-3.35") FLUTTER_3_35("flutter-3.35"), @SerializedName("flutter-3.38") - FLUTTER_3_38("flutter-3.38"), - @SerializedName("node-14.5-rc") - NODE_14_5_RC("node-14.5-rc"), - @SerializedName("node-16.0-rc") - NODE_16_0_RC("node-16.0-rc"), - @SerializedName("node-18.0-rc") - NODE_18_0_RC("node-18.0-rc"), - @SerializedName("node-19.0-rc") - NODE_19_0_RC("node-19.0-rc"), - @SerializedName("node-20.0-rc") - NODE_20_0_RC("node-20.0-rc"), - @SerializedName("node-21.0-rc") - NODE_21_0_RC("node-21.0-rc"), - @SerializedName("node-22-rc") - NODE_22_RC("node-22-rc"), - @SerializedName("node-23-rc") - NODE_23_RC("node-23-rc"), - @SerializedName("node-24-rc") - NODE_24_RC("node-24-rc"), - @SerializedName("node-25-rc") - NODE_25_RC("node-25-rc"), - @SerializedName("php-8.0-rc") - PHP_8_0_RC("php-8.0-rc"), - @SerializedName("php-8.1-rc") - PHP_8_1_RC("php-8.1-rc"), - @SerializedName("php-8.2-rc") - PHP_8_2_RC("php-8.2-rc"), - @SerializedName("php-8.3-rc") - PHP_8_3_RC("php-8.3-rc"), - @SerializedName("php-8.4-rc") - PHP_8_4_RC("php-8.4-rc"), - @SerializedName("ruby-3.0-rc") - RUBY_3_0_RC("ruby-3.0-rc"), - @SerializedName("ruby-3.1-rc") - RUBY_3_1_RC("ruby-3.1-rc"), - @SerializedName("ruby-3.2-rc") - RUBY_3_2_RC("ruby-3.2-rc"), - @SerializedName("ruby-3.3-rc") - RUBY_3_3_RC("ruby-3.3-rc"), - @SerializedName("ruby-3.4-rc") - RUBY_3_4_RC("ruby-3.4-rc"), - @SerializedName("ruby-4.0-rc") - RUBY_4_0_RC("ruby-4.0-rc"), - @SerializedName("python-3.8-rc") - PYTHON_3_8_RC("python-3.8-rc"), - @SerializedName("python-3.9-rc") - PYTHON_3_9_RC("python-3.9-rc"), - @SerializedName("python-3.10-rc") - PYTHON_3_10_RC("python-3.10-rc"), - @SerializedName("python-3.11-rc") - PYTHON_3_11_RC("python-3.11-rc"), - @SerializedName("python-3.12-rc") - PYTHON_3_12_RC("python-3.12-rc"), - @SerializedName("python-3.13-rc") - PYTHON_3_13_RC("python-3.13-rc"), - @SerializedName("python-3.14-rc") - PYTHON_3_14_RC("python-3.14-rc"), - @SerializedName("python-ml-3.11-rc") - PYTHON_ML_3_11_RC("python-ml-3.11-rc"), - @SerializedName("python-ml-3.12-rc") - PYTHON_ML_3_12_RC("python-ml-3.12-rc"), - @SerializedName("python-ml-3.13-rc") - PYTHON_ML_3_13_RC("python-ml-3.13-rc"), - @SerializedName("deno-1.40-rc") - DENO_1_40_RC("deno-1.40-rc"), - @SerializedName("deno-1.46-rc") - DENO_1_46_RC("deno-1.46-rc"), - @SerializedName("deno-2.0-rc") - DENO_2_0_RC("deno-2.0-rc"), - @SerializedName("deno-2.5-rc") - DENO_2_5_RC("deno-2.5-rc"), - @SerializedName("deno-2.6-rc") - DENO_2_6_RC("deno-2.6-rc"), - @SerializedName("dart-2.15-rc") - DART_2_15_RC("dart-2.15-rc"), - @SerializedName("dart-2.16-rc") - DART_2_16_RC("dart-2.16-rc"), - @SerializedName("dart-2.17-rc") - DART_2_17_RC("dart-2.17-rc"), - @SerializedName("dart-2.18-rc") - DART_2_18_RC("dart-2.18-rc"), - @SerializedName("dart-2.19-rc") - DART_2_19_RC("dart-2.19-rc"), - @SerializedName("dart-3.0-rc") - DART_3_0_RC("dart-3.0-rc"), - @SerializedName("dart-3.1-rc") - DART_3_1_RC("dart-3.1-rc"), - @SerializedName("dart-3.3-rc") - DART_3_3_RC("dart-3.3-rc"), - @SerializedName("dart-3.5-rc") - DART_3_5_RC("dart-3.5-rc"), - @SerializedName("dart-3.8-rc") - DART_3_8_RC("dart-3.8-rc"), - @SerializedName("dart-3.9-rc") - DART_3_9_RC("dart-3.9-rc"), - @SerializedName("dart-3.10-rc") - DART_3_10_RC("dart-3.10-rc"), - @SerializedName("dotnet-6.0-rc") - DOTNET_6_0_RC("dotnet-6.0-rc"), - @SerializedName("dotnet-7.0-rc") - DOTNET_7_0_RC("dotnet-7.0-rc"), - @SerializedName("dotnet-8.0-rc") - DOTNET_8_0_RC("dotnet-8.0-rc"), - @SerializedName("dotnet-10-rc") - DOTNET_10_RC("dotnet-10-rc"), - @SerializedName("java-8.0-rc") - JAVA_8_0_RC("java-8.0-rc"), - @SerializedName("java-11.0-rc") - JAVA_11_0_RC("java-11.0-rc"), - @SerializedName("java-17.0-rc") - JAVA_17_0_RC("java-17.0-rc"), - @SerializedName("java-18.0-rc") - JAVA_18_0_RC("java-18.0-rc"), - @SerializedName("java-21.0-rc") - JAVA_21_0_RC("java-21.0-rc"), - @SerializedName("java-22-rc") - JAVA_22_RC("java-22-rc"), - @SerializedName("java-25-rc") - JAVA_25_RC("java-25-rc"), - @SerializedName("swift-5.5-rc") - SWIFT_5_5_RC("swift-5.5-rc"), - @SerializedName("swift-5.8-rc") - SWIFT_5_8_RC("swift-5.8-rc"), - @SerializedName("swift-5.9-rc") - SWIFT_5_9_RC("swift-5.9-rc"), - @SerializedName("swift-5.10-rc") - SWIFT_5_10_RC("swift-5.10-rc"), - @SerializedName("swift-6.2-rc") - SWIFT_6_2_RC("swift-6.2-rc"), - @SerializedName("kotlin-1.6-rc") - KOTLIN_1_6_RC("kotlin-1.6-rc"), - @SerializedName("kotlin-1.8-rc") - KOTLIN_1_8_RC("kotlin-1.8-rc"), - @SerializedName("kotlin-1.9-rc") - KOTLIN_1_9_RC("kotlin-1.9-rc"), - @SerializedName("kotlin-2.0-rc") - KOTLIN_2_0_RC("kotlin-2.0-rc"), - @SerializedName("kotlin-2.3-rc") - KOTLIN_2_3_RC("kotlin-2.3-rc"), - @SerializedName("cpp-17-rc") - CPP_17_RC("cpp-17-rc"), - @SerializedName("cpp-20-rc") - CPP_20_RC("cpp-20-rc"), - @SerializedName("bun-1.0-rc") - BUN_1_0_RC("bun-1.0-rc"), - @SerializedName("bun-1.1-rc") - BUN_1_1_RC("bun-1.1-rc"), - @SerializedName("bun-1.2-rc") - BUN_1_2_RC("bun-1.2-rc"), - @SerializedName("bun-1.3-rc") - BUN_1_3_RC("bun-1.3-rc"), - @SerializedName("go-1.23-rc") - GO_1_23_RC("go-1.23-rc"), - @SerializedName("go-1.24-rc") - GO_1_24_RC("go-1.24-rc"), - @SerializedName("go-1.25-rc") - GO_1_25_RC("go-1.25-rc"), - @SerializedName("go-1.26-rc") - GO_1_26_RC("go-1.26-rc"), - @SerializedName("static-1-rc") - STATIC_1_RC("static-1-rc"), - @SerializedName("flutter-3.24-rc") - FLUTTER_3_24_RC("flutter-3.24-rc"), - @SerializedName("flutter-3.27-rc") - FLUTTER_3_27_RC("flutter-3.27-rc"), - @SerializedName("flutter-3.29-rc") - FLUTTER_3_29_RC("flutter-3.29-rc"), - @SerializedName("flutter-3.32-rc") - FLUTTER_3_32_RC("flutter-3.32-rc"), - @SerializedName("flutter-3.35-rc") - FLUTTER_3_35_RC("flutter-3.35-rc"), - @SerializedName("flutter-3.38-rc") - FLUTTER_3_38_RC("flutter-3.38-rc"); + FLUTTER_3_38("flutter-3.38"); override fun toString() = value } \ No newline at end of file From e04e64974db605082249c2033a7c0c954b5bd61e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:07:56 +0000 Subject: [PATCH 7/8] chore: update Kotlin SDK to 15.0.0 --- docs/examples/java/databases/upsert-documents.md | 2 +- docs/examples/kotlin/databases/upsert-documents.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/java/databases/upsert-documents.md b/docs/examples/java/databases/upsert-documents.md index eec131b..80e3862 100644 --- a/docs/examples/java/databases/upsert-documents.md +++ b/docs/examples/java/databases/upsert-documents.md @@ -6,7 +6,7 @@ import io.appwrite.services.Databases; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID - .setSession(""); // The user session to authenticate with + .setKey(""); // Your secret API key Databases databases = new Databases(client); diff --git a/docs/examples/kotlin/databases/upsert-documents.md b/docs/examples/kotlin/databases/upsert-documents.md index a2c0b93..a9e673c 100644 --- a/docs/examples/kotlin/databases/upsert-documents.md +++ b/docs/examples/kotlin/databases/upsert-documents.md @@ -6,7 +6,7 @@ import io.appwrite.services.Databases val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID - .setSession("") // The user session to authenticate with + .setKey("") // Your secret API key val databases = Databases(client) From bd978bd8c714fcb5a3833eda63b66b1864097b34 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:40:58 +0000 Subject: [PATCH 8/8] chore: update Kotlin SDK to 15.0.0 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 994d8eb..c2b36e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ * Breaking: Replaced `.setKey()` with `.setSession()` in docs examples. * Updated: Updated docs to reflect new `DatabasesIndexType` examples. +## 14.1.0 + +* Added getConsolePausing health status endpoint +* Added `ttl` parameter for cached list results (0-86400s) +* Added optional `activate` parameter to Sites.createDeployment +* Updated Document and Row sequence ID descriptions +* Updated Databases docs to refer to collections, not tables +* Added deprecated updateRelationshipAttribute public API; use TablesDB.updateRelationshipColumn instead + ## 14.0.1 * Documentation updates: Added new encrypt (optional) parameter to attribute and column creation examples in Java and Kotlin docs to support encryption for database fields.