From 642181b661d12eb4cd47f2b4faba1a0108748c5e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 Mar 2026 13:10:29 +0000 Subject: [PATCH 1/8] feat: update .NET SDK to 0.28.0 * Breaking: Removed `IndexType`; replaced with `DatabasesIndexType`, `TablesDBIndexType`, `DocumentsDBIndexType`, `VectorsDBIndexType` * Added `Model` class with `Embeddinggemma` value * Expanded runtime RCs in `BuildRuntime`/`Runtime` for multiple languages * Added impersonation support via `SetImpersonateUserId`, `SetImpersonateUserEmail`, `SetImpersonateUserPhone` * Added scopes `WebhooksRead`, `WebhooksWrite`, `ProjectRead`, `ProjectWrite` * Updated `Client` headers: `User-Agent` and `x-sdk-version` to 0.28.0 * Updated `X-Appwrite-Response-Format` to `1.9.0` --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 30 +- Appwrite/Enums/BackupServices.cs | 3 + Appwrite/Enums/BuildRuntime.cs | 86 ++ Appwrite/Enums/DatabaseType.cs | 2 + Appwrite/Enums/DatabasesIndexType.cs | 19 + Appwrite/Enums/DocumentsDBIndexType.cs | 19 + Appwrite/Enums/IndexType.cs | 19 - Appwrite/Enums/Model.cs | 16 + Appwrite/Enums/Runtime.cs | 86 ++ Appwrite/Enums/Scopes.cs | 4 + Appwrite/Enums/TablesDBIndexType.cs | 19 + Appwrite/Enums/VectorsDBIndexType.cs | 21 + Appwrite/Models/AttributeObject.cs | 81 ++ Appwrite/Models/AttributeVector.cs | 88 ++ Appwrite/Models/Document.cs | 6 +- Appwrite/Models/Embedding.cs | 53 + Appwrite/Models/EmbeddingList.cs | 39 + Appwrite/Models/Function.cs | 26 +- Appwrite/Models/Row.cs | 6 +- Appwrite/Models/Site.cs | 33 +- Appwrite/Models/User.cs | 20 +- Appwrite/Models/VectorsdbCollection.cs | 116 ++ Appwrite/Models/VectorsdbCollectionList.cs | 39 + Appwrite/Models/Webhook.cs | 116 ++ Appwrite/Models/WebhookList.cs | 39 + Appwrite/Services/Databases.cs | 2 +- Appwrite/Services/DocumentsDB.cs | 1087 +++++++++++++++++ Appwrite/Services/Functions.cs | 12 +- Appwrite/Services/Project.cs | 176 +++ Appwrite/Services/Sites.cs | 14 +- Appwrite/Services/TablesDB.cs | 2 +- Appwrite/Services/Users.cs | 37 + Appwrite/Services/VectorsDB.cs | 939 ++++++++++++++ Appwrite/Services/Webhooks.cs | 221 ++++ CHANGELOG.md | 16 +- README.md | 8 +- docs/examples/databases/create-index.md | 2 +- docs/examples/databases/upsert-documents.md | 2 +- .../examples/documentsdb/create-collection.md | 22 + docs/examples/documentsdb/create-document.md | 25 + docs/examples/documentsdb/create-documents.md | 17 + docs/examples/documentsdb/create-index.md | 22 + .../examples/documentsdb/create-operations.md | 26 + .../documentsdb/create-transaction.md | 15 + docs/examples/documentsdb/create.md | 17 + .../decrement-document-attribute.md | 21 + .../examples/documentsdb/delete-collection.md | 16 + docs/examples/documentsdb/delete-document.md | 18 + docs/examples/documentsdb/delete-documents.md | 18 + docs/examples/documentsdb/delete-index.md | 17 + .../documentsdb/delete-transaction.md | 15 + docs/examples/documentsdb/delete.md | 15 + docs/examples/documentsdb/get-collection.md | 16 + docs/examples/documentsdb/get-document.md | 19 + docs/examples/documentsdb/get-index.md | 17 + docs/examples/documentsdb/get-transaction.md | 15 + docs/examples/documentsdb/get.md | 15 + .../increment-document-attribute.md | 21 + docs/examples/documentsdb/list-collections.md | 18 + docs/examples/documentsdb/list-documents.md | 20 + docs/examples/documentsdb/list-indexes.md | 18 + .../examples/documentsdb/list-transactions.md | 15 + docs/examples/documentsdb/list.md | 17 + .../examples/documentsdb/update-collection.md | 20 + docs/examples/documentsdb/update-document.md | 20 + docs/examples/documentsdb/update-documents.md | 19 + .../documentsdb/update-transaction.md | 17 + docs/examples/documentsdb/update.md | 17 + docs/examples/documentsdb/upsert-document.md | 20 + docs/examples/documentsdb/upsert-documents.md | 18 + docs/examples/functions/create.md | 4 +- docs/examples/functions/update.md | 4 +- docs/examples/project/create-variable.md | 18 + docs/examples/project/delete-variable.md | 15 + docs/examples/project/get-variable.md | 15 + docs/examples/project/list-variables.md | 16 + docs/examples/project/update-variable.md | 18 + docs/examples/sites/create.md | 5 +- docs/examples/sites/update.md | 5 +- docs/examples/tablesdb/create-index.md | 2 +- docs/examples/users/update-impersonator.md | 16 + docs/examples/vectorsdb/create-collection.md | 21 + docs/examples/vectorsdb/create-document.md | 22 + docs/examples/vectorsdb/create-documents.md | 17 + docs/examples/vectorsdb/create-index.md | 22 + docs/examples/vectorsdb/create-operations.md | 26 + .../vectorsdb/create-text-embeddings.md | 17 + docs/examples/vectorsdb/create-transaction.md | 15 + docs/examples/vectorsdb/create.md | 17 + docs/examples/vectorsdb/delete-collection.md | 16 + docs/examples/vectorsdb/delete-document.md | 18 + docs/examples/vectorsdb/delete-documents.md | 18 + docs/examples/vectorsdb/delete-index.md | 17 + docs/examples/vectorsdb/delete-transaction.md | 15 + docs/examples/vectorsdb/delete.md | 15 + docs/examples/vectorsdb/get-collection.md | 16 + docs/examples/vectorsdb/get-document.md | 19 + docs/examples/vectorsdb/get-index.md | 17 + docs/examples/vectorsdb/get-transaction.md | 15 + docs/examples/vectorsdb/get.md | 15 + docs/examples/vectorsdb/list-collections.md | 18 + docs/examples/vectorsdb/list-documents.md | 20 + docs/examples/vectorsdb/list-indexes.md | 18 + docs/examples/vectorsdb/list-transactions.md | 15 + docs/examples/vectorsdb/list.md | 17 + docs/examples/vectorsdb/update-collection.md | 21 + docs/examples/vectorsdb/update-document.md | 20 + docs/examples/vectorsdb/update-documents.md | 19 + docs/examples/vectorsdb/update-transaction.md | 17 + docs/examples/vectorsdb/update.md | 17 + docs/examples/vectorsdb/upsert-document.md | 20 + docs/examples/vectorsdb/upsert-documents.md | 18 + docs/examples/webhooks/create.md | 22 + docs/examples/webhooks/delete.md | 15 + docs/examples/webhooks/get.md | 15 + docs/examples/webhooks/list.md | 16 + docs/examples/webhooks/update-signature.md | 15 + docs/examples/webhooks/update.md | 22 + 119 files changed, 4801 insertions(+), 72 deletions(-) create mode 100644 Appwrite/Enums/DatabasesIndexType.cs create mode 100644 Appwrite/Enums/DocumentsDBIndexType.cs delete mode 100644 Appwrite/Enums/IndexType.cs create mode 100644 Appwrite/Enums/Model.cs create mode 100644 Appwrite/Enums/TablesDBIndexType.cs create mode 100644 Appwrite/Enums/VectorsDBIndexType.cs create mode 100644 Appwrite/Models/AttributeObject.cs create mode 100644 Appwrite/Models/AttributeVector.cs create mode 100644 Appwrite/Models/Embedding.cs create mode 100644 Appwrite/Models/EmbeddingList.cs create mode 100644 Appwrite/Models/VectorsdbCollection.cs create mode 100644 Appwrite/Models/VectorsdbCollectionList.cs create mode 100644 Appwrite/Models/Webhook.cs create mode 100644 Appwrite/Models/WebhookList.cs create mode 100644 Appwrite/Services/DocumentsDB.cs create mode 100644 Appwrite/Services/Project.cs create mode 100644 Appwrite/Services/VectorsDB.cs create mode 100644 Appwrite/Services/Webhooks.cs create mode 100644 docs/examples/documentsdb/create-collection.md create mode 100644 docs/examples/documentsdb/create-document.md create mode 100644 docs/examples/documentsdb/create-documents.md create mode 100644 docs/examples/documentsdb/create-index.md create mode 100644 docs/examples/documentsdb/create-operations.md create mode 100644 docs/examples/documentsdb/create-transaction.md create mode 100644 docs/examples/documentsdb/create.md create mode 100644 docs/examples/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/documentsdb/delete-collection.md create mode 100644 docs/examples/documentsdb/delete-document.md create mode 100644 docs/examples/documentsdb/delete-documents.md create mode 100644 docs/examples/documentsdb/delete-index.md create mode 100644 docs/examples/documentsdb/delete-transaction.md create mode 100644 docs/examples/documentsdb/delete.md create mode 100644 docs/examples/documentsdb/get-collection.md create mode 100644 docs/examples/documentsdb/get-document.md create mode 100644 docs/examples/documentsdb/get-index.md create mode 100644 docs/examples/documentsdb/get-transaction.md create mode 100644 docs/examples/documentsdb/get.md create mode 100644 docs/examples/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/documentsdb/list-collections.md create mode 100644 docs/examples/documentsdb/list-documents.md create mode 100644 docs/examples/documentsdb/list-indexes.md create mode 100644 docs/examples/documentsdb/list-transactions.md create mode 100644 docs/examples/documentsdb/list.md create mode 100644 docs/examples/documentsdb/update-collection.md create mode 100644 docs/examples/documentsdb/update-document.md create mode 100644 docs/examples/documentsdb/update-documents.md create mode 100644 docs/examples/documentsdb/update-transaction.md create mode 100644 docs/examples/documentsdb/update.md create mode 100644 docs/examples/documentsdb/upsert-document.md create mode 100644 docs/examples/documentsdb/upsert-documents.md create mode 100644 docs/examples/project/create-variable.md create mode 100644 docs/examples/project/delete-variable.md create mode 100644 docs/examples/project/get-variable.md create mode 100644 docs/examples/project/list-variables.md create mode 100644 docs/examples/project/update-variable.md create mode 100644 docs/examples/users/update-impersonator.md create mode 100644 docs/examples/vectorsdb/create-collection.md create mode 100644 docs/examples/vectorsdb/create-document.md create mode 100644 docs/examples/vectorsdb/create-documents.md create mode 100644 docs/examples/vectorsdb/create-index.md create mode 100644 docs/examples/vectorsdb/create-operations.md create mode 100644 docs/examples/vectorsdb/create-text-embeddings.md create mode 100644 docs/examples/vectorsdb/create-transaction.md create mode 100644 docs/examples/vectorsdb/create.md create mode 100644 docs/examples/vectorsdb/delete-collection.md create mode 100644 docs/examples/vectorsdb/delete-document.md create mode 100644 docs/examples/vectorsdb/delete-documents.md create mode 100644 docs/examples/vectorsdb/delete-index.md create mode 100644 docs/examples/vectorsdb/delete-transaction.md create mode 100644 docs/examples/vectorsdb/delete.md create mode 100644 docs/examples/vectorsdb/get-collection.md create mode 100644 docs/examples/vectorsdb/get-document.md create mode 100644 docs/examples/vectorsdb/get-index.md create mode 100644 docs/examples/vectorsdb/get-transaction.md create mode 100644 docs/examples/vectorsdb/get.md create mode 100644 docs/examples/vectorsdb/list-collections.md create mode 100644 docs/examples/vectorsdb/list-documents.md create mode 100644 docs/examples/vectorsdb/list-indexes.md create mode 100644 docs/examples/vectorsdb/list-transactions.md create mode 100644 docs/examples/vectorsdb/list.md create mode 100644 docs/examples/vectorsdb/update-collection.md create mode 100644 docs/examples/vectorsdb/update-document.md create mode 100644 docs/examples/vectorsdb/update-documents.md create mode 100644 docs/examples/vectorsdb/update-transaction.md create mode 100644 docs/examples/vectorsdb/update.md create mode 100644 docs/examples/vectorsdb/upsert-document.md create mode 100644 docs/examples/vectorsdb/upsert-documents.md create mode 100644 docs/examples/webhooks/create.md create mode 100644 docs/examples/webhooks/delete.md create mode 100644 docs/examples/webhooks/get.md create mode 100644 docs/examples/webhooks/list.md create mode 100644 docs/examples/webhooks/update-signature.md create mode 100644 docs/examples/webhooks/update.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 0f4eba21..924e7b01 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 1.0.0 + 0.28.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 5fa902be..970fa21e 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,12 +69,12 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/1.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.28.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "1.0.0"}, - { "X-Appwrite-Response-Format", "1.8.0" } + { "x-sdk-version", "0.28.0"}, + { "X-Appwrite-Response-Format", "1.9.0" } }; _config = new Dictionary(); @@ -156,6 +156,30 @@ public Client SetForwardedUserAgent(string value) { return this; } + /// 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. + public Client SetImpersonateUserId(string value) { + _config.Add("impersonateUserId", value); + AddHeader("X-Appwrite-Impersonate-User-Id", value); + + return this; + } + + /// 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. + public Client SetImpersonateUserEmail(string value) { + _config.Add("impersonateUserEmail", value); + AddHeader("X-Appwrite-Impersonate-User-Email", value); + + return this; + } + + /// 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. + public Client SetImpersonateUserPhone(string value) { + _config.Add("impersonateUserPhone", value); + AddHeader("X-Appwrite-Impersonate-User-Phone", value); + + return this; + } + public Client AddHeader(string key, string value) { _headers.Add(key, value); diff --git a/Appwrite/Enums/BackupServices.cs b/Appwrite/Enums/BackupServices.cs index ef9d1a17..b211334b 100644 --- a/Appwrite/Enums/BackupServices.cs +++ b/Appwrite/Enums/BackupServices.cs @@ -12,6 +12,9 @@ public BackupServices(string value) } public static BackupServices Databases => new BackupServices("databases"); + public static BackupServices Tablesdb => new BackupServices("tablesdb"); + public static BackupServices Documentsdb => new BackupServices("documentsdb"); + public static BackupServices Vectorsdb => new BackupServices("vectorsdb"); public static BackupServices Functions => new BackupServices("functions"); public static BackupServices Storage => new BackupServices("storage"); } diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index 1617eceb..b517a556 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -97,5 +97,91 @@ public BuildRuntime(string value) public static BuildRuntime Flutter332 => new BuildRuntime("flutter-3.32"); public static BuildRuntime Flutter335 => new BuildRuntime("flutter-3.35"); public static BuildRuntime Flutter338 => new BuildRuntime("flutter-3.38"); + public static BuildRuntime Node145Rc => new BuildRuntime("node-14.5-rc"); + public static BuildRuntime Node160Rc => new BuildRuntime("node-16.0-rc"); + public static BuildRuntime Node180Rc => new BuildRuntime("node-18.0-rc"); + public static BuildRuntime Node190Rc => new BuildRuntime("node-19.0-rc"); + public static BuildRuntime Node200Rc => new BuildRuntime("node-20.0-rc"); + public static BuildRuntime Node210Rc => new BuildRuntime("node-21.0-rc"); + public static BuildRuntime Node22Rc => new BuildRuntime("node-22-rc"); + public static BuildRuntime Node23Rc => new BuildRuntime("node-23-rc"); + public static BuildRuntime Node24Rc => new BuildRuntime("node-24-rc"); + public static BuildRuntime Node25Rc => new BuildRuntime("node-25-rc"); + public static BuildRuntime Php80Rc => new BuildRuntime("php-8.0-rc"); + public static BuildRuntime Php81Rc => new BuildRuntime("php-8.1-rc"); + public static BuildRuntime Php82Rc => new BuildRuntime("php-8.2-rc"); + public static BuildRuntime Php83Rc => new BuildRuntime("php-8.3-rc"); + public static BuildRuntime Php84Rc => new BuildRuntime("php-8.4-rc"); + public static BuildRuntime Ruby30Rc => new BuildRuntime("ruby-3.0-rc"); + public static BuildRuntime Ruby31Rc => new BuildRuntime("ruby-3.1-rc"); + public static BuildRuntime Ruby32Rc => new BuildRuntime("ruby-3.2-rc"); + public static BuildRuntime Ruby33Rc => new BuildRuntime("ruby-3.3-rc"); + public static BuildRuntime Ruby34Rc => new BuildRuntime("ruby-3.4-rc"); + public static BuildRuntime Ruby40Rc => new BuildRuntime("ruby-4.0-rc"); + public static BuildRuntime Python38Rc => new BuildRuntime("python-3.8-rc"); + public static BuildRuntime Python39Rc => new BuildRuntime("python-3.9-rc"); + public static BuildRuntime Python310Rc => new BuildRuntime("python-3.10-rc"); + public static BuildRuntime Python311Rc => new BuildRuntime("python-3.11-rc"); + public static BuildRuntime Python312Rc => new BuildRuntime("python-3.12-rc"); + public static BuildRuntime Python313Rc => new BuildRuntime("python-3.13-rc"); + public static BuildRuntime Python314Rc => new BuildRuntime("python-3.14-rc"); + public static BuildRuntime PythonMl311Rc => new BuildRuntime("python-ml-3.11-rc"); + public static BuildRuntime PythonMl312Rc => new BuildRuntime("python-ml-3.12-rc"); + public static BuildRuntime PythonMl313Rc => new BuildRuntime("python-ml-3.13-rc"); + public static BuildRuntime Deno140Rc => new BuildRuntime("deno-1.40-rc"); + public static BuildRuntime Deno146Rc => new BuildRuntime("deno-1.46-rc"); + public static BuildRuntime Deno20Rc => new BuildRuntime("deno-2.0-rc"); + public static BuildRuntime Deno25Rc => new BuildRuntime("deno-2.5-rc"); + public static BuildRuntime Deno26Rc => new BuildRuntime("deno-2.6-rc"); + public static BuildRuntime Dart215Rc => new BuildRuntime("dart-2.15-rc"); + public static BuildRuntime Dart216Rc => new BuildRuntime("dart-2.16-rc"); + public static BuildRuntime Dart217Rc => new BuildRuntime("dart-2.17-rc"); + public static BuildRuntime Dart218Rc => new BuildRuntime("dart-2.18-rc"); + public static BuildRuntime Dart219Rc => new BuildRuntime("dart-2.19-rc"); + public static BuildRuntime Dart30Rc => new BuildRuntime("dart-3.0-rc"); + public static BuildRuntime Dart31Rc => new BuildRuntime("dart-3.1-rc"); + public static BuildRuntime Dart33Rc => new BuildRuntime("dart-3.3-rc"); + public static BuildRuntime Dart35Rc => new BuildRuntime("dart-3.5-rc"); + public static BuildRuntime Dart38Rc => new BuildRuntime("dart-3.8-rc"); + public static BuildRuntime Dart39Rc => new BuildRuntime("dart-3.9-rc"); + public static BuildRuntime Dart310Rc => new BuildRuntime("dart-3.10-rc"); + public static BuildRuntime Dotnet60Rc => new BuildRuntime("dotnet-6.0-rc"); + public static BuildRuntime Dotnet70Rc => new BuildRuntime("dotnet-7.0-rc"); + public static BuildRuntime Dotnet80Rc => new BuildRuntime("dotnet-8.0-rc"); + public static BuildRuntime Dotnet10Rc => new BuildRuntime("dotnet-10-rc"); + public static BuildRuntime Java80Rc => new BuildRuntime("java-8.0-rc"); + public static BuildRuntime Java110Rc => new BuildRuntime("java-11.0-rc"); + public static BuildRuntime Java170Rc => new BuildRuntime("java-17.0-rc"); + public static BuildRuntime Java180Rc => new BuildRuntime("java-18.0-rc"); + public static BuildRuntime Java210Rc => new BuildRuntime("java-21.0-rc"); + public static BuildRuntime Java22Rc => new BuildRuntime("java-22-rc"); + public static BuildRuntime Java25Rc => new BuildRuntime("java-25-rc"); + public static BuildRuntime Swift55Rc => new BuildRuntime("swift-5.5-rc"); + public static BuildRuntime Swift58Rc => new BuildRuntime("swift-5.8-rc"); + public static BuildRuntime Swift59Rc => new BuildRuntime("swift-5.9-rc"); + public static BuildRuntime Swift510Rc => new BuildRuntime("swift-5.10-rc"); + public static BuildRuntime Swift62Rc => new BuildRuntime("swift-6.2-rc"); + public static BuildRuntime Kotlin16Rc => new BuildRuntime("kotlin-1.6-rc"); + public static BuildRuntime Kotlin18Rc => new BuildRuntime("kotlin-1.8-rc"); + public static BuildRuntime Kotlin19Rc => new BuildRuntime("kotlin-1.9-rc"); + public static BuildRuntime Kotlin20Rc => new BuildRuntime("kotlin-2.0-rc"); + public static BuildRuntime Kotlin23Rc => new BuildRuntime("kotlin-2.3-rc"); + public static BuildRuntime Cpp17Rc => new BuildRuntime("cpp-17-rc"); + public static BuildRuntime Cpp20Rc => new BuildRuntime("cpp-20-rc"); + public static BuildRuntime Bun10Rc => new BuildRuntime("bun-1.0-rc"); + public static BuildRuntime Bun11Rc => new BuildRuntime("bun-1.1-rc"); + public static BuildRuntime Bun12Rc => new BuildRuntime("bun-1.2-rc"); + public static BuildRuntime Bun13Rc => new BuildRuntime("bun-1.3-rc"); + public static BuildRuntime Go123Rc => new BuildRuntime("go-1.23-rc"); + public static BuildRuntime Go124Rc => new BuildRuntime("go-1.24-rc"); + public static BuildRuntime Go125Rc => new BuildRuntime("go-1.25-rc"); + public static BuildRuntime Go126Rc => new BuildRuntime("go-1.26-rc"); + public static BuildRuntime Static1Rc => new BuildRuntime("static-1-rc"); + public static BuildRuntime Flutter324Rc => new BuildRuntime("flutter-3.24-rc"); + public static BuildRuntime Flutter327Rc => new BuildRuntime("flutter-3.27-rc"); + public static BuildRuntime Flutter329Rc => new BuildRuntime("flutter-3.29-rc"); + public static BuildRuntime Flutter332Rc => new BuildRuntime("flutter-3.32-rc"); + public static BuildRuntime Flutter335Rc => new BuildRuntime("flutter-3.35-rc"); + public static BuildRuntime Flutter338Rc => new BuildRuntime("flutter-3.38-rc"); } } diff --git a/Appwrite/Enums/DatabaseType.cs b/Appwrite/Enums/DatabaseType.cs index bcbe1d91..11b4916b 100644 --- a/Appwrite/Enums/DatabaseType.cs +++ b/Appwrite/Enums/DatabaseType.cs @@ -13,5 +13,7 @@ public DatabaseType(string value) public static DatabaseType Legacy => new DatabaseType("legacy"); public static DatabaseType Tablesdb => new DatabaseType("tablesdb"); + public static DatabaseType Documentsdb => new DatabaseType("documentsdb"); + public static DatabaseType Vectorsdb => new DatabaseType("vectorsdb"); } } diff --git a/Appwrite/Enums/DatabasesIndexType.cs b/Appwrite/Enums/DatabasesIndexType.cs new file mode 100644 index 00000000..71494c99 --- /dev/null +++ b/Appwrite/Enums/DatabasesIndexType.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class DatabasesIndexType : IEnum + { + public string Value { get; private set; } + + public DatabasesIndexType(string value) + { + Value = value; + } + + public static DatabasesIndexType Key => new DatabasesIndexType("key"); + public static DatabasesIndexType Fulltext => new DatabasesIndexType("fulltext"); + public static DatabasesIndexType Unique => new DatabasesIndexType("unique"); + public static DatabasesIndexType Spatial => new DatabasesIndexType("spatial"); + } +} diff --git a/Appwrite/Enums/DocumentsDBIndexType.cs b/Appwrite/Enums/DocumentsDBIndexType.cs new file mode 100644 index 00000000..3fd0585c --- /dev/null +++ b/Appwrite/Enums/DocumentsDBIndexType.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class DocumentsDBIndexType : IEnum + { + public string Value { get; private set; } + + public DocumentsDBIndexType(string value) + { + Value = value; + } + + public static DocumentsDBIndexType Key => new DocumentsDBIndexType("key"); + public static DocumentsDBIndexType Fulltext => new DocumentsDBIndexType("fulltext"); + public static DocumentsDBIndexType Unique => new DocumentsDBIndexType("unique"); + public static DocumentsDBIndexType Spatial => new DocumentsDBIndexType("spatial"); + } +} diff --git a/Appwrite/Enums/IndexType.cs b/Appwrite/Enums/IndexType.cs deleted file mode 100644 index eee4618f..00000000 --- a/Appwrite/Enums/IndexType.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class IndexType : IEnum - { - public string Value { get; private set; } - - public IndexType(string value) - { - Value = value; - } - - public static IndexType Key => new IndexType("key"); - public static IndexType Fulltext => new IndexType("fulltext"); - public static IndexType Unique => new IndexType("unique"); - public static IndexType Spatial => new IndexType("spatial"); - } -} diff --git a/Appwrite/Enums/Model.cs b/Appwrite/Enums/Model.cs new file mode 100644 index 00000000..9fbb1b73 --- /dev/null +++ b/Appwrite/Enums/Model.cs @@ -0,0 +1,16 @@ +using System; + +namespace Appwrite.Enums +{ + public class Model : IEnum + { + public string Value { get; private set; } + + public Model(string value) + { + Value = value; + } + + public static Model Embeddinggemma => new Model("embeddinggemma"); + } +} diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index 6c5f4f4d..6941e08b 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -97,5 +97,91 @@ public Runtime(string value) public static Runtime Flutter332 => new Runtime("flutter-3.32"); public static Runtime Flutter335 => new Runtime("flutter-3.35"); public static Runtime Flutter338 => new Runtime("flutter-3.38"); + public static Runtime Node145Rc => new Runtime("node-14.5-rc"); + public static Runtime Node160Rc => new Runtime("node-16.0-rc"); + public static Runtime Node180Rc => new Runtime("node-18.0-rc"); + public static Runtime Node190Rc => new Runtime("node-19.0-rc"); + public static Runtime Node200Rc => new Runtime("node-20.0-rc"); + public static Runtime Node210Rc => new Runtime("node-21.0-rc"); + public static Runtime Node22Rc => new Runtime("node-22-rc"); + public static Runtime Node23Rc => new Runtime("node-23-rc"); + public static Runtime Node24Rc => new Runtime("node-24-rc"); + public static Runtime Node25Rc => new Runtime("node-25-rc"); + public static Runtime Php80Rc => new Runtime("php-8.0-rc"); + public static Runtime Php81Rc => new Runtime("php-8.1-rc"); + public static Runtime Php82Rc => new Runtime("php-8.2-rc"); + public static Runtime Php83Rc => new Runtime("php-8.3-rc"); + public static Runtime Php84Rc => new Runtime("php-8.4-rc"); + public static Runtime Ruby30Rc => new Runtime("ruby-3.0-rc"); + public static Runtime Ruby31Rc => new Runtime("ruby-3.1-rc"); + public static Runtime Ruby32Rc => new Runtime("ruby-3.2-rc"); + public static Runtime Ruby33Rc => new Runtime("ruby-3.3-rc"); + public static Runtime Ruby34Rc => new Runtime("ruby-3.4-rc"); + public static Runtime Ruby40Rc => new Runtime("ruby-4.0-rc"); + public static Runtime Python38Rc => new Runtime("python-3.8-rc"); + public static Runtime Python39Rc => new Runtime("python-3.9-rc"); + public static Runtime Python310Rc => new Runtime("python-3.10-rc"); + public static Runtime Python311Rc => new Runtime("python-3.11-rc"); + public static Runtime Python312Rc => new Runtime("python-3.12-rc"); + public static Runtime Python313Rc => new Runtime("python-3.13-rc"); + public static Runtime Python314Rc => new Runtime("python-3.14-rc"); + public static Runtime PythonMl311Rc => new Runtime("python-ml-3.11-rc"); + public static Runtime PythonMl312Rc => new Runtime("python-ml-3.12-rc"); + public static Runtime PythonMl313Rc => new Runtime("python-ml-3.13-rc"); + public static Runtime Deno140Rc => new Runtime("deno-1.40-rc"); + public static Runtime Deno146Rc => new Runtime("deno-1.46-rc"); + public static Runtime Deno20Rc => new Runtime("deno-2.0-rc"); + public static Runtime Deno25Rc => new Runtime("deno-2.5-rc"); + public static Runtime Deno26Rc => new Runtime("deno-2.6-rc"); + public static Runtime Dart215Rc => new Runtime("dart-2.15-rc"); + public static Runtime Dart216Rc => new Runtime("dart-2.16-rc"); + public static Runtime Dart217Rc => new Runtime("dart-2.17-rc"); + public static Runtime Dart218Rc => new Runtime("dart-2.18-rc"); + public static Runtime Dart219Rc => new Runtime("dart-2.19-rc"); + public static Runtime Dart30Rc => new Runtime("dart-3.0-rc"); + public static Runtime Dart31Rc => new Runtime("dart-3.1-rc"); + public static Runtime Dart33Rc => new Runtime("dart-3.3-rc"); + public static Runtime Dart35Rc => new Runtime("dart-3.5-rc"); + public static Runtime Dart38Rc => new Runtime("dart-3.8-rc"); + public static Runtime Dart39Rc => new Runtime("dart-3.9-rc"); + public static Runtime Dart310Rc => new Runtime("dart-3.10-rc"); + public static Runtime Dotnet60Rc => new Runtime("dotnet-6.0-rc"); + public static Runtime Dotnet70Rc => new Runtime("dotnet-7.0-rc"); + public static Runtime Dotnet80Rc => new Runtime("dotnet-8.0-rc"); + public static Runtime Dotnet10Rc => new Runtime("dotnet-10-rc"); + public static Runtime Java80Rc => new Runtime("java-8.0-rc"); + public static Runtime Java110Rc => new Runtime("java-11.0-rc"); + public static Runtime Java170Rc => new Runtime("java-17.0-rc"); + public static Runtime Java180Rc => new Runtime("java-18.0-rc"); + public static Runtime Java210Rc => new Runtime("java-21.0-rc"); + public static Runtime Java22Rc => new Runtime("java-22-rc"); + public static Runtime Java25Rc => new Runtime("java-25-rc"); + public static Runtime Swift55Rc => new Runtime("swift-5.5-rc"); + public static Runtime Swift58Rc => new Runtime("swift-5.8-rc"); + public static Runtime Swift59Rc => new Runtime("swift-5.9-rc"); + public static Runtime Swift510Rc => new Runtime("swift-5.10-rc"); + public static Runtime Swift62Rc => new Runtime("swift-6.2-rc"); + public static Runtime Kotlin16Rc => new Runtime("kotlin-1.6-rc"); + public static Runtime Kotlin18Rc => new Runtime("kotlin-1.8-rc"); + public static Runtime Kotlin19Rc => new Runtime("kotlin-1.9-rc"); + public static Runtime Kotlin20Rc => new Runtime("kotlin-2.0-rc"); + public static Runtime Kotlin23Rc => new Runtime("kotlin-2.3-rc"); + public static Runtime Cpp17Rc => new Runtime("cpp-17-rc"); + public static Runtime Cpp20Rc => new Runtime("cpp-20-rc"); + public static Runtime Bun10Rc => new Runtime("bun-1.0-rc"); + public static Runtime Bun11Rc => new Runtime("bun-1.1-rc"); + public static Runtime Bun12Rc => new Runtime("bun-1.2-rc"); + public static Runtime Bun13Rc => new Runtime("bun-1.3-rc"); + public static Runtime Go123Rc => new Runtime("go-1.23-rc"); + public static Runtime Go124Rc => new Runtime("go-1.24-rc"); + public static Runtime Go125Rc => new Runtime("go-1.25-rc"); + public static Runtime Go126Rc => new Runtime("go-1.26-rc"); + public static Runtime Static1Rc => new Runtime("static-1-rc"); + public static Runtime Flutter324Rc => new Runtime("flutter-3.24-rc"); + public static Runtime Flutter327Rc => new Runtime("flutter-3.27-rc"); + public static Runtime Flutter329Rc => new Runtime("flutter-3.29-rc"); + public static Runtime Flutter332Rc => new Runtime("flutter-3.32-rc"); + public static Runtime Flutter335Rc => new Runtime("flutter-3.35-rc"); + public static Runtime Flutter338Rc => new Runtime("flutter-3.38-rc"); } } diff --git a/Appwrite/Enums/Scopes.cs b/Appwrite/Enums/Scopes.cs index 813361dd..3f4e8bb3 100644 --- a/Appwrite/Enums/Scopes.cs +++ b/Appwrite/Enums/Scopes.cs @@ -68,6 +68,10 @@ public Scopes(string value) public static Scopes AssistantRead => new Scopes("assistant.read"); public static Scopes TokensRead => new Scopes("tokens.read"); public static Scopes TokensWrite => new Scopes("tokens.write"); + public static Scopes WebhooksRead => new Scopes("webhooks.read"); + public static Scopes WebhooksWrite => new Scopes("webhooks.write"); + public static Scopes ProjectRead => new Scopes("project.read"); + public static Scopes ProjectWrite => new Scopes("project.write"); public static Scopes PoliciesWrite => new Scopes("policies.write"); public static Scopes PoliciesRead => new Scopes("policies.read"); public static Scopes ArchivesRead => new Scopes("archives.read"); diff --git a/Appwrite/Enums/TablesDBIndexType.cs b/Appwrite/Enums/TablesDBIndexType.cs new file mode 100644 index 00000000..859d5fdd --- /dev/null +++ b/Appwrite/Enums/TablesDBIndexType.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class TablesDBIndexType : IEnum + { + public string Value { get; private set; } + + public TablesDBIndexType(string value) + { + Value = value; + } + + public static TablesDBIndexType Key => new TablesDBIndexType("key"); + public static TablesDBIndexType Fulltext => new TablesDBIndexType("fulltext"); + public static TablesDBIndexType Unique => new TablesDBIndexType("unique"); + public static TablesDBIndexType Spatial => new TablesDBIndexType("spatial"); + } +} diff --git a/Appwrite/Enums/VectorsDBIndexType.cs b/Appwrite/Enums/VectorsDBIndexType.cs new file mode 100644 index 00000000..82a39739 --- /dev/null +++ b/Appwrite/Enums/VectorsDBIndexType.cs @@ -0,0 +1,21 @@ +using System; + +namespace Appwrite.Enums +{ + public class VectorsDBIndexType : IEnum + { + public string Value { get; private set; } + + public VectorsDBIndexType(string value) + { + Value = value; + } + + public static VectorsDBIndexType HnswEuclidean => new VectorsDBIndexType("hnsw_euclidean"); + public static VectorsDBIndexType HnswDot => new VectorsDBIndexType("hnsw_dot"); + public static VectorsDBIndexType HnswCosine => new VectorsDBIndexType("hnsw_cosine"); + public static VectorsDBIndexType Object => new VectorsDBIndexType("object"); + public static VectorsDBIndexType Key => new VectorsDBIndexType("key"); + public static VectorsDBIndexType Unique => new VectorsDBIndexType("unique"); + } +} diff --git a/Appwrite/Models/AttributeObject.cs b/Appwrite/Models/AttributeObject.cs new file mode 100644 index 00000000..6e8edd08 --- /dev/null +++ b/Appwrite/Models/AttributeObject.cs @@ -0,0 +1,81 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class AttributeObject + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + public AttributeObject( + string key, + string type, + AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + } + + public static AttributeObject From(Dictionary map) => new AttributeObject( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt } + }; + } +} diff --git a/Appwrite/Models/AttributeVector.cs b/Appwrite/Models/AttributeVector.cs new file mode 100644 index 00000000..604a4149 --- /dev/null +++ b/Appwrite/Models/AttributeVector.cs @@ -0,0 +1,88 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class AttributeVector + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("size")] + public long Size { get; private set; } + + public AttributeVector( + string key, + string type, + AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + long size + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Size = size; + } + + public static AttributeVector From(Dictionary map) => new AttributeVector( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + size: Convert.ToInt64(map["size"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "size", Size } + }; + } +} diff --git a/Appwrite/Models/Document.cs b/Appwrite/Models/Document.cs index d23dd352..1bc72c8b 100644 --- a/Appwrite/Models/Document.cs +++ b/Appwrite/Models/Document.cs @@ -15,7 +15,7 @@ public class Document public string Id { get; private set; } [JsonPropertyName("$sequence")] - public long Sequence { get; private set; } + public string Sequence { get; private set; } [JsonPropertyName("$collectionId")] public string CollectionId { get; private set; } @@ -36,7 +36,7 @@ public class Document public Document( string id, - long sequence, + string sequence, string collectionId, string databaseId, string createdAt, @@ -56,7 +56,7 @@ Dictionary data public static Document From(Dictionary map) => new Document( id: map["$id"].ToString(), - sequence: Convert.ToInt64(map["$sequence"]), + sequence: map["$sequence"].ToString(), collectionId: map["$collectionId"].ToString(), databaseId: map["$databaseId"].ToString(), createdAt: map["$createdAt"].ToString(), diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs new file mode 100644 index 00000000..ae48c1de --- /dev/null +++ b/Appwrite/Models/Embedding.cs @@ -0,0 +1,53 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class Embedding + { + [JsonPropertyName("model")] + public string Model { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + [JsonPropertyName("embedding")] + public List Embedding { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public Embedding( + string model, + long dimension, + List embedding, + string error + ) { + Model = model; + Dimension = dimension; + Embedding = embedding; + Error = error; + } + + public static Embedding From(Dictionary map) => new Embedding( + model: map["model"].ToString(), + dimension: Convert.ToInt64(map["dimension"]), + embedding: map["embedding"].ConvertToList(), + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "model", Model }, + { "dimension", Dimension }, + { "embedding", Embedding }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs new file mode 100644 index 00000000..c00bc6c7 --- /dev/null +++ b/Appwrite/Models/EmbeddingList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class EmbeddingList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("embeddings")] + public List Embeddings { get; private set; } + + public EmbeddingList( + long total, + List embeddings + ) { + Total = total; + Embeddings = embeddings; + } + + public static EmbeddingList From(Dictionary map) => new EmbeddingList( + total: Convert.ToInt64(map["total"]), + embeddings: map["embeddings"].ConvertToList>().Select(it => Embedding.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "embeddings", Embeddings.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/Function.cs b/Appwrite/Models/Function.cs index 7673f0ee..b9ee4c3b 100644 --- a/Appwrite/Models/Function.cs +++ b/Appwrite/Models/Function.cs @@ -38,6 +38,9 @@ public class Function [JsonPropertyName("runtime")] public string Runtime { get; private set; } + [JsonPropertyName("deploymentRetention")] + public long DeploymentRetention { get; private set; } + [JsonPropertyName("deploymentId")] public string DeploymentId { get; private set; } @@ -92,8 +95,11 @@ public class Function [JsonPropertyName("providerSilentMode")] public bool ProviderSilentMode { get; private set; } - [JsonPropertyName("specification")] - public string Specification { get; private set; } + [JsonPropertyName("buildSpecification")] + public string BuildSpecification { get; private set; } + + [JsonPropertyName("runtimeSpecification")] + public string RuntimeSpecification { get; private set; } public Function( string id, @@ -105,6 +111,7 @@ public Function( bool live, bool logging, string runtime, + long deploymentRetention, string deploymentId, string deploymentCreatedAt, string latestDeploymentId, @@ -123,7 +130,8 @@ public Function( string providerBranch, string providerRootDirectory, bool providerSilentMode, - string specification + string buildSpecification, + string runtimeSpecification ) { Id = id; CreatedAt = createdAt; @@ -134,6 +142,7 @@ string specification Live = live; Logging = logging; Runtime = runtime; + DeploymentRetention = deploymentRetention; DeploymentId = deploymentId; DeploymentCreatedAt = deploymentCreatedAt; LatestDeploymentId = latestDeploymentId; @@ -152,7 +161,8 @@ string specification ProviderBranch = providerBranch; ProviderRootDirectory = providerRootDirectory; ProviderSilentMode = providerSilentMode; - Specification = specification; + BuildSpecification = buildSpecification; + RuntimeSpecification = runtimeSpecification; } public static Function From(Dictionary map) => new Function( @@ -165,6 +175,7 @@ string specification live: (bool)map["live"], logging: (bool)map["logging"], runtime: map["runtime"].ToString(), + deploymentRetention: Convert.ToInt64(map["deploymentRetention"]), deploymentId: map["deploymentId"].ToString(), deploymentCreatedAt: map["deploymentCreatedAt"].ToString(), latestDeploymentId: map["latestDeploymentId"].ToString(), @@ -183,7 +194,8 @@ string specification providerBranch: map["providerBranch"].ToString(), providerRootDirectory: map["providerRootDirectory"].ToString(), providerSilentMode: (bool)map["providerSilentMode"], - specification: map["specification"].ToString() + buildSpecification: map["buildSpecification"].ToString(), + runtimeSpecification: map["runtimeSpecification"].ToString() ); public Dictionary ToMap() => new Dictionary() @@ -197,6 +209,7 @@ string specification { "live", Live }, { "logging", Logging }, { "runtime", Runtime }, + { "deploymentRetention", DeploymentRetention }, { "deploymentId", DeploymentId }, { "deploymentCreatedAt", DeploymentCreatedAt }, { "latestDeploymentId", LatestDeploymentId }, @@ -215,7 +228,8 @@ string specification { "providerBranch", ProviderBranch }, { "providerRootDirectory", ProviderRootDirectory }, { "providerSilentMode", ProviderSilentMode }, - { "specification", Specification } + { "buildSpecification", BuildSpecification }, + { "runtimeSpecification", RuntimeSpecification } }; } } diff --git a/Appwrite/Models/Row.cs b/Appwrite/Models/Row.cs index 075e0a6e..d2e4b05c 100644 --- a/Appwrite/Models/Row.cs +++ b/Appwrite/Models/Row.cs @@ -15,7 +15,7 @@ public class Row public string Id { get; private set; } [JsonPropertyName("$sequence")] - public long Sequence { get; private set; } + public string Sequence { get; private set; } [JsonPropertyName("$tableId")] public string TableId { get; private set; } @@ -36,7 +36,7 @@ public class Row public Row( string id, - long sequence, + string sequence, string tableId, string databaseId, string createdAt, @@ -56,7 +56,7 @@ Dictionary data public static Row From(Dictionary map) => new Row( id: map["$id"].ToString(), - sequence: Convert.ToInt64(map["$sequence"]), + sequence: map["$sequence"].ToString(), tableId: map["$tableId"].ToString(), databaseId: map["$databaseId"].ToString(), createdAt: map["$createdAt"].ToString(), diff --git a/Appwrite/Models/Site.cs b/Appwrite/Models/Site.cs index 0b9ca5b8..79958dff 100644 --- a/Appwrite/Models/Site.cs +++ b/Appwrite/Models/Site.cs @@ -35,6 +35,9 @@ public class Site [JsonPropertyName("framework")] public string Framework { get; private set; } + [JsonPropertyName("deploymentRetention")] + public long DeploymentRetention { get; private set; } + [JsonPropertyName("deploymentId")] public string DeploymentId { get; private set; } @@ -68,6 +71,9 @@ public class Site [JsonPropertyName("buildCommand")] public string BuildCommand { get; private set; } + [JsonPropertyName("startCommand")] + public string StartCommand { get; private set; } + [JsonPropertyName("outputDirectory")] public string OutputDirectory { get; private set; } @@ -86,8 +92,11 @@ public class Site [JsonPropertyName("providerSilentMode")] public bool ProviderSilentMode { get; private set; } - [JsonPropertyName("specification")] - public string Specification { get; private set; } + [JsonPropertyName("buildSpecification")] + public string BuildSpecification { get; private set; } + + [JsonPropertyName("runtimeSpecification")] + public string RuntimeSpecification { get; private set; } [JsonPropertyName("buildRuntime")] public string BuildRuntime { get; private set; } @@ -107,6 +116,7 @@ public Site( bool live, bool logging, string framework, + long deploymentRetention, string deploymentId, string deploymentCreatedAt, string deploymentScreenshotLight, @@ -118,13 +128,15 @@ public Site( long timeout, string installCommand, string buildCommand, + string startCommand, string outputDirectory, string installationId, string providerRepositoryId, string providerBranch, string providerRootDirectory, bool providerSilentMode, - string specification, + string buildSpecification, + string runtimeSpecification, string buildRuntime, string adapter, string fallbackFile @@ -137,6 +149,7 @@ string fallbackFile Live = live; Logging = logging; Framework = framework; + DeploymentRetention = deploymentRetention; DeploymentId = deploymentId; DeploymentCreatedAt = deploymentCreatedAt; DeploymentScreenshotLight = deploymentScreenshotLight; @@ -148,13 +161,15 @@ string fallbackFile Timeout = timeout; InstallCommand = installCommand; BuildCommand = buildCommand; + StartCommand = startCommand; OutputDirectory = outputDirectory; InstallationId = installationId; ProviderRepositoryId = providerRepositoryId; ProviderBranch = providerBranch; ProviderRootDirectory = providerRootDirectory; ProviderSilentMode = providerSilentMode; - Specification = specification; + BuildSpecification = buildSpecification; + RuntimeSpecification = runtimeSpecification; BuildRuntime = buildRuntime; Adapter = adapter; FallbackFile = fallbackFile; @@ -169,6 +184,7 @@ string fallbackFile live: (bool)map["live"], logging: (bool)map["logging"], framework: map["framework"].ToString(), + deploymentRetention: Convert.ToInt64(map["deploymentRetention"]), deploymentId: map["deploymentId"].ToString(), deploymentCreatedAt: map["deploymentCreatedAt"].ToString(), deploymentScreenshotLight: map["deploymentScreenshotLight"].ToString(), @@ -180,13 +196,15 @@ string fallbackFile timeout: Convert.ToInt64(map["timeout"]), installCommand: map["installCommand"].ToString(), buildCommand: map["buildCommand"].ToString(), + startCommand: map["startCommand"].ToString(), outputDirectory: map["outputDirectory"].ToString(), installationId: map["installationId"].ToString(), providerRepositoryId: map["providerRepositoryId"].ToString(), providerBranch: map["providerBranch"].ToString(), providerRootDirectory: map["providerRootDirectory"].ToString(), providerSilentMode: (bool)map["providerSilentMode"], - specification: map["specification"].ToString(), + buildSpecification: map["buildSpecification"].ToString(), + runtimeSpecification: map["runtimeSpecification"].ToString(), buildRuntime: map["buildRuntime"].ToString(), adapter: map["adapter"].ToString(), fallbackFile: map["fallbackFile"].ToString() @@ -202,6 +220,7 @@ string fallbackFile { "live", Live }, { "logging", Logging }, { "framework", Framework }, + { "deploymentRetention", DeploymentRetention }, { "deploymentId", DeploymentId }, { "deploymentCreatedAt", DeploymentCreatedAt }, { "deploymentScreenshotLight", DeploymentScreenshotLight }, @@ -213,13 +232,15 @@ string fallbackFile { "timeout", Timeout }, { "installCommand", InstallCommand }, { "buildCommand", BuildCommand }, + { "startCommand", StartCommand }, { "outputDirectory", OutputDirectory }, { "installationId", InstallationId }, { "providerRepositoryId", ProviderRepositoryId }, { "providerBranch", ProviderBranch }, { "providerRootDirectory", ProviderRootDirectory }, { "providerSilentMode", ProviderSilentMode }, - { "specification", Specification }, + { "buildSpecification", BuildSpecification }, + { "runtimeSpecification", RuntimeSpecification }, { "buildRuntime", BuildRuntime }, { "adapter", Adapter }, { "fallbackFile", FallbackFile } diff --git a/Appwrite/Models/User.cs b/Appwrite/Models/User.cs index 480ede9b..4a2bd7a7 100644 --- a/Appwrite/Models/User.cs +++ b/Appwrite/Models/User.cs @@ -68,6 +68,12 @@ public class User [JsonPropertyName("accessedAt")] public string AccessedAt { get; private set; } + [JsonPropertyName("impersonator")] + public bool? Impersonator { get; private set; } + + [JsonPropertyName("impersonatorUserId")] + public string? ImpersonatorUserId { get; private set; } + public User( string id, string createdAt, @@ -87,7 +93,9 @@ public User( bool mfa, Preferences prefs, List targets, - string accessedAt + string accessedAt, + bool? impersonator, + string? impersonatorUserId ) { Id = id; CreatedAt = createdAt; @@ -108,6 +116,8 @@ string accessedAt Prefs = prefs; Targets = targets; AccessedAt = accessedAt; + Impersonator = impersonator; + ImpersonatorUserId = impersonatorUserId; } public static User From(Dictionary map) => new User( @@ -129,7 +139,9 @@ string accessedAt mfa: (bool)map["mfa"], prefs: Preferences.From(map: map["prefs"] is JsonElement jsonObj17 ? jsonObj17.Deserialize>()! : (Dictionary)map["prefs"]), targets: map["targets"].ConvertToList>().Select(it => Target.From(map: it)).ToList(), - accessedAt: map["accessedAt"].ToString() + accessedAt: map["accessedAt"].ToString(), + impersonator: (bool?)map["impersonator"], + impersonatorUserId: map.TryGetValue("impersonatorUserId", out var impersonatorUserId) ? impersonatorUserId?.ToString() : null ); public Dictionary ToMap() => new Dictionary() @@ -152,7 +164,9 @@ string accessedAt { "mfa", Mfa }, { "prefs", Prefs.ToMap() }, { "targets", Targets.Select(it => it.ToMap()) }, - { "accessedAt", AccessedAt } + { "accessedAt", AccessedAt }, + { "impersonator", Impersonator }, + { "impersonatorUserId", ImpersonatorUserId } }; } } diff --git a/Appwrite/Models/VectorsdbCollection.cs b/Appwrite/Models/VectorsdbCollection.cs new file mode 100644 index 00000000..270890f3 --- /dev/null +++ b/Appwrite/Models/VectorsdbCollection.cs @@ -0,0 +1,116 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class VectorsdbCollection + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("$permissions")] + public List Permissions { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("documentSecurity")] + public bool DocumentSecurity { get; private set; } + + [JsonPropertyName("attributes")] + public List Attributes { get; private set; } + + [JsonPropertyName("indexes")] + public List Indexes { get; private set; } + + [JsonPropertyName("bytesMax")] + public long BytesMax { get; private set; } + + [JsonPropertyName("bytesUsed")] + public long BytesUsed { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + public VectorsdbCollection( + string id, + string createdAt, + string updatedAt, + List permissions, + string databaseId, + string name, + bool enabled, + bool documentSecurity, + List attributes, + List indexes, + long bytesMax, + long bytesUsed, + long dimension + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Permissions = permissions; + DatabaseId = databaseId; + Name = name; + Enabled = enabled; + DocumentSecurity = documentSecurity; + Attributes = attributes; + Indexes = indexes; + BytesMax = bytesMax; + BytesUsed = bytesUsed; + Dimension = dimension; + } + + public static VectorsdbCollection From(Dictionary map) => new VectorsdbCollection( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + permissions: map["$permissions"].ConvertToList(), + databaseId: map["databaseId"].ToString(), + name: map["name"].ToString(), + enabled: (bool)map["enabled"], + documentSecurity: (bool)map["documentSecurity"], + attributes: map["attributes"].ConvertToList(), + indexes: map["indexes"].ConvertToList>().Select(it => Index.From(map: it)).ToList(), + bytesMax: Convert.ToInt64(map["bytesMax"]), + bytesUsed: Convert.ToInt64(map["bytesUsed"]), + dimension: Convert.ToInt64(map["dimension"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "$permissions", Permissions }, + { "databaseId", DatabaseId }, + { "name", Name }, + { "enabled", Enabled }, + { "documentSecurity", DocumentSecurity }, + { "attributes", Attributes }, + { "indexes", Indexes.Select(it => it.ToMap()) }, + { "bytesMax", BytesMax }, + { "bytesUsed", BytesUsed }, + { "dimension", Dimension } + }; + } +} diff --git a/Appwrite/Models/VectorsdbCollectionList.cs b/Appwrite/Models/VectorsdbCollectionList.cs new file mode 100644 index 00000000..b9204522 --- /dev/null +++ b/Appwrite/Models/VectorsdbCollectionList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class VectorsdbCollectionList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("collections")] + public List Collections { get; private set; } + + public VectorsdbCollectionList( + long total, + List collections + ) { + Total = total; + Collections = collections; + } + + public static VectorsdbCollectionList From(Dictionary map) => new VectorsdbCollectionList( + total: Convert.ToInt64(map["total"]), + collections: map["collections"].ConvertToList>().Select(it => VectorsdbCollection.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "collections", Collections.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/Webhook.cs b/Appwrite/Models/Webhook.cs new file mode 100644 index 00000000..c1c319b9 --- /dev/null +++ b/Appwrite/Models/Webhook.cs @@ -0,0 +1,116 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class Webhook + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("url")] + public string Url { get; private set; } + + [JsonPropertyName("events")] + public List Events { get; private set; } + + [JsonPropertyName("security")] + public bool Security { get; private set; } + + [JsonPropertyName("httpUser")] + public string HttpUser { get; private set; } + + [JsonPropertyName("httpPass")] + public string HttpPass { get; private set; } + + [JsonPropertyName("signatureKey")] + public string SignatureKey { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("logs")] + public string Logs { get; private set; } + + [JsonPropertyName("attempts")] + public long Attempts { get; private set; } + + public Webhook( + string id, + string createdAt, + string updatedAt, + string name, + string url, + List events, + bool security, + string httpUser, + string httpPass, + string signatureKey, + bool enabled, + string logs, + long attempts + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Url = url; + Events = events; + Security = security; + HttpUser = httpUser; + HttpPass = httpPass; + SignatureKey = signatureKey; + Enabled = enabled; + Logs = logs; + Attempts = attempts; + } + + public static Webhook From(Dictionary map) => new Webhook( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + name: map["name"].ToString(), + url: map["url"].ToString(), + events: map["events"].ConvertToList(), + security: (bool)map["security"], + httpUser: map["httpUser"].ToString(), + httpPass: map["httpPass"].ToString(), + signatureKey: map["signatureKey"].ToString(), + enabled: (bool)map["enabled"], + logs: map["logs"].ToString(), + attempts: Convert.ToInt64(map["attempts"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "url", Url }, + { "events", Events }, + { "security", Security }, + { "httpUser", HttpUser }, + { "httpPass", HttpPass }, + { "signatureKey", SignatureKey }, + { "enabled", Enabled }, + { "logs", Logs }, + { "attempts", Attempts } + }; + } +} diff --git a/Appwrite/Models/WebhookList.cs b/Appwrite/Models/WebhookList.cs new file mode 100644 index 00000000..fe46416a --- /dev/null +++ b/Appwrite/Models/WebhookList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class WebhookList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("webhooks")] + public List Webhooks { get; private set; } + + public WebhookList( + long total, + List webhooks + ) { + Total = total; + Webhooks = webhooks; + } + + public static WebhookList From(Dictionary map) => new WebhookList( + total: Convert.ToInt64(map["total"]), + webhooks: map["webhooks"].ConvertToList>().Select(it => Webhook.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "webhooks", Webhooks.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 24faf620..05c9e4b1 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -2443,7 +2443,7 @@ static Models.IndexList Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.")] - public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.IndexType type, List attributes, List? orders = null, List? lengths = null) + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DatabasesIndexType type, List attributes, List? orders = null, List? lengths = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" .Replace("{databaseId}", databaseId) diff --git a/Appwrite/Services/DocumentsDB.cs b/Appwrite/Services/DocumentsDB.cs new file mode 100644 index 00000000..85a7964f --- /dev/null +++ b/Appwrite/Services/DocumentsDB.cs @@ -0,0 +1,1087 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class DocumentsDB : Service + { + public DocumentsDB(Client client) : base(client) + { + } + + /// + /// Get a list of all databases from the current Appwrite project. You can use + /// the search parameter to filter your results. + /// + /// + public Task List(List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.DatabaseList Convert(Dictionary it) => + Models.DatabaseList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new Database. + /// + /// + /// + public Task Create(string databaseId, string name, bool? enabled = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.TransactionList Convert(Dictionary it) => + Models.TransactionList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a database by its unique ID. This endpoint response returns a JSON + /// object with the database metadata. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a database by its unique ID. + /// + /// + public Task Update(string databaseId, string name, bool? enabled = null) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a database by its unique ID. Only API keys with with databases.write + /// scope can delete a database. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Get a list of all collections that belong to the provided databaseId. You + /// can use the search parameter to filter your results. + /// + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.CollectionList Convert(Dictionary it) => + Models.CollectionList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled }, + { "attributes", attributes }, + { "indexes", indexes } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) => + Models.Collection.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a collection by its unique ID. This endpoint response returns a JSON + /// object with the collection metadata. + /// + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Collection Convert(Dictionary it) => + Models.Collection.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a collection by its unique ID. + /// + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) => + Models.Collection.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a collection by its unique ID. Only users with write permissions + /// have access to delete this resource. + /// + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Get a list of all the user's documents in a given collection. You can use + /// the query params to filter your results. + /// + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a document by its unique ID. This endpoint response returns a JSON + /// object with the document data. + /// + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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. + /// + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a document by its unique ID. Using the patch method you can pass + /// only specific fields that will get updated. + /// + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a document by its unique ID. + /// + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Decrement a specific column of a row by a given value. + /// + /// + public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? min = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", xvalue }, + { "min", min }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Increment a specific column of a row by a given value. + /// + /// + public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? max = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", xvalue }, + { "max", max }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List indexes in the collection. + /// + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.IndexList Convert(Dictionary it) => + Models.IndexList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// 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`. + /// + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DocumentsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) => + Models.Index.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get index by ID. + /// + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Index Convert(Dictionary it) => + Models.Index.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete an index. + /// + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + } +} diff --git a/Appwrite/Services/Functions.cs b/Appwrite/Services/Functions.cs index 12e6b4e6..8e168c65 100644 --- a/Appwrite/Services/Functions.cs +++ b/Appwrite/Services/Functions.cs @@ -54,7 +54,7 @@ static Models.FunctionList Convert(Dictionary it) => /// API. /// /// - public Task Create(string functionId, string name, Appwrite.Enums.Runtime runtime, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, List? scopes = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? specification = null) + public Task Create(string functionId, string name, Appwrite.Enums.Runtime runtime, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, List? scopes = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) { var apiPath = "/functions"; @@ -77,7 +77,9 @@ static Models.FunctionList Convert(Dictionary it) => { "providerBranch", providerBranch }, { "providerSilentMode", providerSilentMode }, { "providerRootDirectory", providerRootDirectory }, - { "specification", specification } + { "buildSpecification", buildSpecification }, + { "runtimeSpecification", runtimeSpecification }, + { "deploymentRetention", deploymentRetention } }; var apiHeaders = new Dictionary() @@ -190,7 +192,7 @@ static Models.Function Convert(Dictionary it) => /// Update function by its unique ID. /// /// - public Task Update(string functionId, string name, Appwrite.Enums.Runtime? runtime = null, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, List? scopes = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? specification = null) + public Task Update(string functionId, string name, Appwrite.Enums.Runtime? runtime = null, List? execute = null, List? events = null, string? schedule = null, long? timeout = null, bool? enabled = null, bool? logging = null, string? entrypoint = null, string? commands = null, List? scopes = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) { var apiPath = "/functions/{functionId}" .Replace("{functionId}", functionId); @@ -213,7 +215,9 @@ static Models.Function Convert(Dictionary it) => { "providerBranch", providerBranch }, { "providerSilentMode", providerSilentMode }, { "providerRootDirectory", providerRootDirectory }, - { "specification", specification } + { "buildSpecification", buildSpecification }, + { "runtimeSpecification", runtimeSpecification }, + { "deploymentRetention", deploymentRetention } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs new file mode 100644 index 00000000..fd9fea72 --- /dev/null +++ b/Appwrite/Services/Project.cs @@ -0,0 +1,176 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Project : Service + { + public Project(Client client) : base(client) + { + } + + /// + /// Get a list of all project environment variables. + /// + /// + public Task ListVariables(List? queries = null, bool? total = null) + { + var apiPath = "/project/variables"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.VariableList Convert(Dictionary it) => + Models.VariableList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new project environment variable. These variables can be accessed + /// by all functions and sites in the project. + /// + /// + public Task CreateVariable(string variableId, string key, string xvalue, bool? secret = null) + { + var apiPath = "/project/variables"; + + var apiParameters = new Dictionary() + { + { "variableId", variableId }, + { "key", key }, + { "value", xvalue }, + { "secret", secret } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Variable Convert(Dictionary it) => + Models.Variable.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a variable by its unique ID. + /// + /// + public Task GetVariable(string variableId) + { + var apiPath = "/project/variables/{variableId}" + .Replace("{variableId}", variableId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Variable Convert(Dictionary it) => + Models.Variable.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update variable by its unique ID. + /// + /// + public Task UpdateVariable(string variableId, string? key = null, string? xvalue = null, bool? secret = null) + { + var apiPath = "/project/variables/{variableId}" + .Replace("{variableId}", variableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "value", xvalue }, + { "secret", secret } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Variable Convert(Dictionary it) => + Models.Variable.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a variable by its unique ID. + /// + /// + public Task DeleteVariable(string variableId) + { + var apiPath = "/project/variables/{variableId}" + .Replace("{variableId}", variableId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + } +} diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index 5f12bd3f..2dc8d8bf 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -51,7 +51,7 @@ static Models.SiteList Convert(Dictionary it) => /// Create a new site. /// /// - public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? specification = null) + public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) { var apiPath = "/sites"; @@ -65,6 +65,7 @@ static Models.SiteList Convert(Dictionary it) => { "timeout", timeout }, { "installCommand", installCommand }, { "buildCommand", buildCommand }, + { "startCommand", startCommand }, { "outputDirectory", outputDirectory }, { "buildRuntime", buildRuntime?.Value }, { "adapter", adapter?.Value }, @@ -74,7 +75,9 @@ static Models.SiteList Convert(Dictionary it) => { "providerBranch", providerBranch }, { "providerSilentMode", providerSilentMode }, { "providerRootDirectory", providerRootDirectory }, - { "specification", specification } + { "buildSpecification", buildSpecification }, + { "runtimeSpecification", runtimeSpecification }, + { "deploymentRetention", deploymentRetention } }; var apiHeaders = new Dictionary() @@ -188,7 +191,7 @@ static Models.Site Convert(Dictionary it) => /// Update site by its unique ID. /// /// - public Task Update(string siteId, string name, Appwrite.Enums.Framework framework, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, Appwrite.Enums.BuildRuntime? buildRuntime = null, Appwrite.Enums.Adapter? adapter = null, string? fallbackFile = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? specification = null) + public Task Update(string siteId, string name, Appwrite.Enums.Framework framework, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.BuildRuntime? buildRuntime = null, Appwrite.Enums.Adapter? adapter = null, string? fallbackFile = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) { var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -202,6 +205,7 @@ static Models.Site Convert(Dictionary it) => { "timeout", timeout }, { "installCommand", installCommand }, { "buildCommand", buildCommand }, + { "startCommand", startCommand }, { "outputDirectory", outputDirectory }, { "buildRuntime", buildRuntime?.Value }, { "adapter", adapter?.Value }, @@ -211,7 +215,9 @@ static Models.Site Convert(Dictionary it) => { "providerBranch", providerBranch }, { "providerSilentMode", providerSilentMode }, { "providerRootDirectory", providerRootDirectory }, - { "specification", specification } + { "buildSpecification", buildSpecification }, + { "runtimeSpecification", runtimeSpecification }, + { "deploymentRetention", deploymentRetention } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index 2e49c22b..acd49529 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -1953,7 +1953,7 @@ static Models.ColumnIndexList Convert(Dictionary it) => /// Type can be `key`, `fulltext`, or `unique`. /// /// - public Task CreateIndex(string databaseId, string tableId, string key, Appwrite.Enums.IndexType type, List columns, List? orders = null, List? lengths = null) + public Task CreateIndex(string databaseId, string tableId, string key, Appwrite.Enums.TablesDBIndexType type, List columns, List? orders = null, List? lengths = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" .Replace("{databaseId}", databaseId) diff --git a/Appwrite/Services/Users.cs b/Appwrite/Services/Users.cs index 36ebadfb..4e8c6c58 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -506,6 +506,43 @@ static Models.User Convert(Dictionary it) => } + /// + /// 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. + /// + /// + /// + public Task UpdateImpersonator(string userId, bool impersonator) + { + var apiPath = "/users/{userId}/impersonator" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + { "impersonator", impersonator } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.User Convert(Dictionary it) => + Models.User.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// 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 diff --git a/Appwrite/Services/VectorsDB.cs b/Appwrite/Services/VectorsDB.cs new file mode 100644 index 00000000..5e2c59c2 --- /dev/null +++ b/Appwrite/Services/VectorsDB.cs @@ -0,0 +1,939 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class VectorsDB : Service + { + public VectorsDB(Client client) : base(client) + { + } + + /// + public Task List(List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.DatabaseList Convert(Dictionary it) => + Models.DatabaseList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task Create(string databaseId, string name, bool? enabled = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateTextEmbeddings(List texts, Appwrite.Enums.Model? model = null) + { + var apiPath = "/vectorsdb/embeddings/text"; + + var apiParameters = new Dictionary() + { + { "texts", texts }, + { "model", model?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.EmbeddingList Convert(Dictionary it) => + Models.EmbeddingList.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.TransactionList Convert(Dictionary it) => + Models.TransactionList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) => + Models.Transaction.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task Get(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task Update(string databaseId, string name, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) => + Models.Database.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task Delete(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.VectorsdbCollectionList Convert(Dictionary it) => + Models.VectorsdbCollectionList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateCollection(string databaseId, string collectionId, string name, long dimension, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) => + Models.VectorsdbCollection.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) => + Models.VectorsdbCollection.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, long? dimension = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) => + Models.VectorsdbCollection.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) => + Models.DocumentList.From(map: it); + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) => + Models.Document.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.IndexList Convert(Dictionary it) => + Models.IndexList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.VectorsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) => + Models.Index.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Index Convert(Dictionary it) => + Models.Index.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + } +} diff --git a/Appwrite/Services/Webhooks.cs b/Appwrite/Services/Webhooks.cs new file mode 100644 index 00000000..5a6d5292 --- /dev/null +++ b/Appwrite/Services/Webhooks.cs @@ -0,0 +1,221 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Webhooks : Service + { + public Webhooks(Client client) : base(client) + { + } + + /// + /// Get a list of all webhooks belonging to the project. You can use the query + /// params to filter your results. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/webhooks"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.WebhookList Convert(Dictionary it) => + Models.WebhookList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new webhook. Use this endpoint to configure a URL that will + /// receive events from Appwrite when specific events occur. + /// + /// + public Task Create(string webhookId, string url, string name, List events, bool? enabled = null, bool? security = null, string? httpUser = null, string? httpPass = null) + { + var apiPath = "/webhooks"; + + var apiParameters = new Dictionary() + { + { "webhookId", webhookId }, + { "url", url }, + { "name", name }, + { "events", events }, + { "enabled", enabled }, + { "security", security }, + { "httpUser", httpUser }, + { "httpPass", httpPass } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Webhook Convert(Dictionary it) => + Models.Webhook.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a webhook by its unique ID. This endpoint returns details about a + /// specific webhook configured for a project. + /// + /// + public Task Get(string webhookId) + { + var apiPath = "/webhooks/{webhookId}" + .Replace("{webhookId}", webhookId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Webhook Convert(Dictionary it) => + Models.Webhook.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a webhook by its unique ID. Use this endpoint to update the URL, + /// events, or status of an existing webhook. + /// + /// + public Task Update(string webhookId, string name, string url, List events, bool? enabled = null, bool? security = null, string? httpUser = null, string? httpPass = null) + { + var apiPath = "/webhooks/{webhookId}" + .Replace("{webhookId}", webhookId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "url", url }, + { "events", events }, + { "enabled", enabled }, + { "security", security }, + { "httpUser", httpUser }, + { "httpPass", httpPass } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Webhook Convert(Dictionary it) => + Models.Webhook.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a webhook by its unique ID. Once deleted, the webhook will no longer + /// receive project events. + /// + /// + public Task Delete(string webhookId) + { + var apiPath = "/webhooks/{webhookId}" + .Replace("{webhookId}", webhookId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// 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. + /// + /// + public Task UpdateSignature(string webhookId) + { + var apiPath = "/webhooks/{webhookId}/signature" + .Replace("{webhookId}", webhookId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Webhook Convert(Dictionary it) => + Models.Webhook.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6637c1ef..752c82b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ # Change Log -## 1.0.0 - -* Breaking: Sites.CreateDeployment signature changed; 'activate' moved after outputDirectory. -* Breaking: Relationship API path updated; old path deprecated. -* Added GetConsolePausing health check method. -* Added ttl parameter to ListDocuments and ListRows. -* Updated deployment example to show activate parameter placement. +## 0.28.0 + +* Breaking: Removed `IndexType`; replaced with `DatabasesIndexType`, `TablesDBIndexType`, `DocumentsDBIndexType`, `VectorsDBIndexType` +* Added `Model` class with `Embeddinggemma` value +* Expanded runtime RCs in `BuildRuntime`/`Runtime` for multiple languages +* Added impersonation support via `SetImpersonateUserId`, `SetImpersonateUserEmail`, `SetImpersonateUserPhone` +* Added scopes `WebhooksRead`, `WebhooksWrite`, `ProjectRead`, `ProjectWrite` +* Updated `Client` headers: `User-Agent` and `x-sdk-version` to 0.28.0 +* Updated `X-Appwrite-Response-Format` to `1.9.0` ## 0.27.0 diff --git a/README.md b/README.md index 30f17fca..cf216b5b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite .NET SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-dotnet.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) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![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) @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstracts and simpli Add this reference to your project's `.csproj` file: ```xml - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 1.0.0 +Install-Package Appwrite -Version 0.28.0 # or .NET CLI -dotnet add package Appwrite --version 1.0.0 +dotnet add package Appwrite --version 0.28.0 ``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 7f0e22af..3d653021 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -15,7 +15,7 @@ Index result = await databases.CreateIndex( databaseId: "", collectionId: "", key: "", - type: IndexType.Key, + type: DatabasesIndexType.Key, attributes: new List(), orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 8223f8ab..72d7c8e2 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -6,7 +6,7 @@ using Appwrite.Services; 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/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md new file mode 100644 index 00000000..1335a533 --- /dev/null +++ b/docs/examples/documentsdb/create-collection.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Collection result = await documentsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: new List(), // optional + indexes: new List() // optional +);``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md new file mode 100644 index 00000000..60919257 --- /dev/null +++ b/docs/examples/documentsdb/create-document.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +);``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md new file mode 100644 index 00000000..ee9a2395 --- /dev/null +++ b/docs/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await documentsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +);``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md new file mode 100644 index 00000000..6abfd50d --- /dev/null +++ b/docs/examples/documentsdb/create-index.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Index result = await documentsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: DocumentsDBIndexType.Key, + attributes: new List(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List() // optional +);``` diff --git a/docs/examples/documentsdb/create-operations.md b/docs/examples/documentsdb/create-operations.md new file mode 100644 index 00000000..cd2158fe --- /dev/null +++ b/docs/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await documentsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +);``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md new file mode 100644 index 00000000..4a2efa43 --- /dev/null +++ b/docs/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await documentsDB.CreateTransaction( + ttl: 60 // optional +);``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md new file mode 100644 index 00000000..f9f75689 --- /dev/null +++ b/docs/examples/documentsdb/create.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await documentsDB.Create( + databaseId: "", + name: "", + enabled: false // optional +);``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 00000000..2b6f4d30 --- /dev/null +++ b/docs/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.DecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + min: 0, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md new file mode 100644 index 00000000..e18d995d --- /dev/null +++ b/docs/examples/documentsdb/delete-collection.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.DeleteCollection( + databaseId: "", + collectionId: "" +);``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md new file mode 100644 index 00000000..535615b9 --- /dev/null +++ b/docs/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md new file mode 100644 index 00000000..63516aae --- /dev/null +++ b/docs/examples/documentsdb/delete-documents.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md new file mode 100644 index 00000000..713f50fd --- /dev/null +++ b/docs/examples/documentsdb/delete-index.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +);``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md new file mode 100644 index 00000000..cd48372b --- /dev/null +++ b/docs/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.DeleteTransaction( + transactionId: "" +);``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md new file mode 100644 index 00000000..65eeaf83 --- /dev/null +++ b/docs/examples/documentsdb/delete.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await documentsDB.Delete( + databaseId: "" +);``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md new file mode 100644 index 00000000..bf41939e --- /dev/null +++ b/docs/examples/documentsdb/get-collection.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Collection result = await documentsDB.GetCollection( + databaseId: "", + collectionId: "" +);``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md new file mode 100644 index 00000000..d5bbe0f0 --- /dev/null +++ b/docs/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md new file mode 100644 index 00000000..0b006b28 --- /dev/null +++ b/docs/examples/documentsdb/get-index.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Index result = await documentsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +);``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md new file mode 100644 index 00000000..d24bee71 --- /dev/null +++ b/docs/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await documentsDB.GetTransaction( + transactionId: "" +);``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md new file mode 100644 index 00000000..37d884a7 --- /dev/null +++ b/docs/examples/documentsdb/get.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await documentsDB.Get( + databaseId: "" +);``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 00000000..c07238c6 --- /dev/null +++ b/docs/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.IncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + max: 0, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md new file mode 100644 index 00000000..958308ba --- /dev/null +++ b/docs/examples/documentsdb/list-collections.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +CollectionList result = await documentsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +);``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md new file mode 100644 index 00000000..44dadea0 --- /dev/null +++ b/docs/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await documentsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +);``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md new file mode 100644 index 00000000..fdfc7960 --- /dev/null +++ b/docs/examples/documentsdb/list-indexes.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +IndexList result = await documentsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md new file mode 100644 index 00000000..7db4c682 --- /dev/null +++ b/docs/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +TransactionList result = await documentsDB.ListTransactions( + queries: new List() // optional +);``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md new file mode 100644 index 00000000..73ab2edd --- /dev/null +++ b/docs/examples/documentsdb/list.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DatabaseList result = await documentsDB.List( + queries: new List(), // optional + search: "", // optional + total: false // optional +);``` diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md new file mode 100644 index 00000000..b15f2848 --- /dev/null +++ b/docs/examples/documentsdb/update-collection.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Collection result = await documentsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +);``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md new file mode 100644 index 00000000..3aa6be84 --- /dev/null +++ b/docs/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md new file mode 100644 index 00000000..85fda47f --- /dev/null +++ b/docs/examples/documentsdb/update-documents.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await documentsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md new file mode 100644 index 00000000..2988ea7b --- /dev/null +++ b/docs/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await documentsDB.UpdateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +);``` diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md new file mode 100644 index 00000000..7ffb9be8 --- /dev/null +++ b/docs/examples/documentsdb/update.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await documentsDB.Update( + databaseId: "", + name: "", + enabled: false // optional +);``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md new file mode 100644 index 00000000..4b716f21 --- /dev/null +++ b/docs/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await documentsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md new file mode 100644 index 00000000..c91cbcb6 --- /dev/null +++ b/docs/examples/documentsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await documentsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +);``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 5032fc38..3a68fda7 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -29,5 +29,7 @@ Function result = await functions.Create( providerBranch: "", // optional providerSilentMode: false, // optional providerRootDirectory: "", // optional - specification: "" // optional + buildSpecification: "", // optional + runtimeSpecification: "", // optional + deploymentRetention: 0 // optional );``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4f9df255..953417f8 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -29,5 +29,7 @@ Function result = await functions.Update( providerBranch: "", // optional providerSilentMode: false, // optional providerRootDirectory: "", // optional - specification: "" // optional + buildSpecification: "", // optional + runtimeSpecification: "", // optional + deploymentRetention: 0 // optional );``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md new file mode 100644 index 00000000..a49aa454 --- /dev/null +++ b/docs/examples/project/create-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Variable result = await project.CreateVariable( + variableId: "", + key: "", + value: "", + secret: false // optional +);``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md new file mode 100644 index 00000000..83762d9b --- /dev/null +++ b/docs/examples/project/delete-variable.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await project.DeleteVariable( + variableId: "" +);``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md new file mode 100644 index 00000000..d1283ed3 --- /dev/null +++ b/docs/examples/project/get-variable.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Variable result = await project.GetVariable( + variableId: "" +);``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md new file mode 100644 index 00000000..5f6f00cc --- /dev/null +++ b/docs/examples/project/list-variables.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +VariableList result = await project.ListVariables( + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md new file mode 100644 index 00000000..cfdf56bd --- /dev/null +++ b/docs/examples/project/update-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Variable result = await project.UpdateVariable( + variableId: "", + key: "", // optional + value: "", // optional + secret: false // optional +);``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index ac31e244..391a56c3 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -21,6 +21,7 @@ Site result = await sites.Create( timeout: 1, // optional installCommand: "", // optional buildCommand: "", // optional + startCommand: "", // optional outputDirectory: "", // optional adapter: Adapter.Static, // optional installationId: "", // optional @@ -29,5 +30,7 @@ Site result = await sites.Create( providerBranch: "", // optional providerSilentMode: false, // optional providerRootDirectory: "", // optional - specification: "" // optional + buildSpecification: "", // optional + runtimeSpecification: "", // optional + deploymentRetention: 0 // optional );``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index bd65e36d..69662fe0 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -20,6 +20,7 @@ Site result = await sites.Update( timeout: 1, // optional installCommand: "", // optional buildCommand: "", // optional + startCommand: "", // optional outputDirectory: "", // optional buildRuntime: BuildRuntime.Node145, // optional adapter: Adapter.Static, // optional @@ -29,5 +30,7 @@ Site result = await sites.Update( providerBranch: "", // optional providerSilentMode: false, // optional providerRootDirectory: "", // optional - specification: "" // optional + buildSpecification: "", // optional + runtimeSpecification: "", // optional + deploymentRetention: 0 // optional );``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index ec486577..46bfcd27 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -15,7 +15,7 @@ ColumnIndex result = await tablesDB.CreateIndex( databaseId: "", tableId: "", key: "", - type: IndexType.Key, + type: TablesDBIndexType.Key, columns: new List(), orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md new file mode 100644 index 00000000..908bad5f --- /dev/null +++ b/docs/examples/users/update-impersonator.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +User result = await users.UpdateImpersonator( + userId: "", + impersonator: false +);``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md new file mode 100644 index 00000000..d9d42682 --- /dev/null +++ b/docs/examples/vectorsdb/create-collection.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +VectorsdbCollection result = await vectorsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +);``` diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md new file mode 100644 index 00000000..a2df215b --- /dev/null +++ b/docs/examples/vectorsdb/create-document.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await vectorsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + embeddings = new[] { 0.12, -0.55, 0.88, 1.02 }, + metadata = { key = "value" } + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +);``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md new file mode 100644 index 00000000..ee725394 --- /dev/null +++ b/docs/examples/vectorsdb/create-documents.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await vectorsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +);``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md new file mode 100644 index 00000000..73501d52 --- /dev/null +++ b/docs/examples/vectorsdb/create-index.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Index result = await vectorsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: VectorsDBIndexType.HnswEuclidean, + attributes: new List(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List() // optional +);``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md new file mode 100644 index 00000000..df055e97 --- /dev/null +++ b/docs/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await vectorsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +);``` diff --git a/docs/examples/vectorsdb/create-text-embeddings.md b/docs/examples/vectorsdb/create-text-embeddings.md new file mode 100644 index 00000000..c8d7e837 --- /dev/null +++ b/docs/examples/vectorsdb/create-text-embeddings.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +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); + +EmbeddingList result = await vectorsDB.CreateTextEmbeddings( + texts: new List(), + model: Model.Embeddinggemma // optional +);``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md new file mode 100644 index 00000000..1fa4fa73 --- /dev/null +++ b/docs/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await vectorsDB.CreateTransaction( + ttl: 60 // optional +);``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md new file mode 100644 index 00000000..8b25057c --- /dev/null +++ b/docs/examples/vectorsdb/create.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await vectorsDB.Create( + databaseId: "", + name: "", + enabled: false // optional +);``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md new file mode 100644 index 00000000..b57b1101 --- /dev/null +++ b/docs/examples/vectorsdb/delete-collection.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.DeleteCollection( + databaseId: "", + collectionId: "" +);``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md new file mode 100644 index 00000000..29984fa9 --- /dev/null +++ b/docs/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md new file mode 100644 index 00000000..89e7aba5 --- /dev/null +++ b/docs/examples/vectorsdb/delete-documents.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md new file mode 100644 index 00000000..aca6faf3 --- /dev/null +++ b/docs/examples/vectorsdb/delete-index.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +);``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 00000000..8c49e7e2 --- /dev/null +++ b/docs/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.DeleteTransaction( + transactionId: "" +);``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md new file mode 100644 index 00000000..8d7fd317 --- /dev/null +++ b/docs/examples/vectorsdb/delete.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await vectorsDB.Delete( + databaseId: "" +);``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md new file mode 100644 index 00000000..0f949214 --- /dev/null +++ b/docs/examples/vectorsdb/get-collection.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +VectorsdbCollection result = await vectorsDB.GetCollection( + databaseId: "", + collectionId: "" +);``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md new file mode 100644 index 00000000..74843f40 --- /dev/null +++ b/docs/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await vectorsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md new file mode 100644 index 00000000..b3d8b5d1 --- /dev/null +++ b/docs/examples/vectorsdb/get-index.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Index result = await vectorsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +);``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md new file mode 100644 index 00000000..6e0bdb0f --- /dev/null +++ b/docs/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await vectorsDB.GetTransaction( + transactionId: "" +);``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md new file mode 100644 index 00000000..89d041c5 --- /dev/null +++ b/docs/examples/vectorsdb/get.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await vectorsDB.Get( + databaseId: "" +);``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md new file mode 100644 index 00000000..6e6e8167 --- /dev/null +++ b/docs/examples/vectorsdb/list-collections.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +VectorsdbCollectionList result = await vectorsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +);``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md new file mode 100644 index 00000000..4b800ce4 --- /dev/null +++ b/docs/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await vectorsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +);``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md new file mode 100644 index 00000000..187f6754 --- /dev/null +++ b/docs/examples/vectorsdb/list-indexes.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +IndexList result = await vectorsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md new file mode 100644 index 00000000..35d27547 --- /dev/null +++ b/docs/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +TransactionList result = await vectorsDB.ListTransactions( + queries: new List() // optional +);``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md new file mode 100644 index 00000000..20e582d5 --- /dev/null +++ b/docs/examples/vectorsdb/list.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DatabaseList result = await vectorsDB.List( + queries: new List(), // optional + search: "", // optional + total: false // optional +);``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md new file mode 100644 index 00000000..2ce560cd --- /dev/null +++ b/docs/examples/vectorsdb/update-collection.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +VectorsdbCollection result = await vectorsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +);``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md new file mode 100644 index 00000000..ec5963de --- /dev/null +++ b/docs/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await vectorsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md new file mode 100644 index 00000000..ba4c5e9d --- /dev/null +++ b/docs/examples/vectorsdb/update-documents.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await vectorsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md new file mode 100644 index 00000000..aa6adb41 --- /dev/null +++ b/docs/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Transaction result = await vectorsDB.UpdateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +);``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md new file mode 100644 index 00000000..8d962808 --- /dev/null +++ b/docs/examples/vectorsdb/update.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Database result = await vectorsDB.Update( + databaseId: "", + name: "", + enabled: false // optional +);``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md new file mode 100644 index 00000000..7b223591 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Document result = await vectorsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +);``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md new file mode 100644 index 00000000..5217a978 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +DocumentList result = await vectorsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +);``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md new file mode 100644 index 00000000..53ccc0a3 --- /dev/null +++ b/docs/examples/webhooks/create.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Webhook result = await webhooks.Create( + webhookId: "", + url: "", + name: "", + events: new List(), + enabled: false, // optional + security: false, // optional + httpUser: "", // optional + httpPass: "" // optional +);``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md new file mode 100644 index 00000000..a9aac880 --- /dev/null +++ b/docs/examples/webhooks/delete.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +await webhooks.Delete( + webhookId: "" +);``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md new file mode 100644 index 00000000..f9c6835a --- /dev/null +++ b/docs/examples/webhooks/get.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Webhook result = await webhooks.Get( + webhookId: "" +);``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md new file mode 100644 index 00000000..94db7d62 --- /dev/null +++ b/docs/examples/webhooks/list.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +WebhookList result = await webhooks.List( + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/webhooks/update-signature.md b/docs/examples/webhooks/update-signature.md new file mode 100644 index 00000000..3e5d1531 --- /dev/null +++ b/docs/examples/webhooks/update-signature.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Webhook result = await webhooks.UpdateSignature( + webhookId: "" +);``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md new file mode 100644 index 00000000..cce5da7c --- /dev/null +++ b/docs/examples/webhooks/update.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +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); + +Webhook result = await webhooks.Update( + webhookId: "", + name: "", + url: "", + events: new List(), + enabled: false, // optional + security: false, // optional + httpUser: "", // optional + httpPass: "" // optional +);``` From 2bdda14b0dc4196ba1284de9e83bfb104ac4713a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 04:26:23 +0000 Subject: [PATCH 2/8] chore: update .NET SDK to 0.28.0 --- CHANGELOG.md | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 752c82b9..8fccaa02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 0.28.0 -* Breaking: Removed `IndexType`; replaced with `DatabasesIndexType`, `TablesDBIndexType`, `DocumentsDBIndexType`, `VectorsDBIndexType` +* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents +* Breaking: Removed `IndexType`; replaced with `DatabasesIndexType`, `TablesDBIndexType` * Added `Model` class with `Embeddinggemma` value * Expanded runtime RCs in `BuildRuntime`/`Runtime` for multiple languages * Added impersonation support via `SetImpersonateUserId`, `SetImpersonateUserEmail`, `SetImpersonateUserPhone` diff --git a/README.md b/README.md index cf216b5b..7fb10782 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-dotnet/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-dotnet/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the .NET SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From e93ff52fb7f945ba0e4c69897d1efa94ac9680b4 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 05:28:12 +0000 Subject: [PATCH 3/8] chore: update .NET SDK to 0.28.0 --- Appwrite/Services/DocumentsDB.cs | 1087 ----------------- Appwrite/Services/VectorsDB.cs | 939 -------------- .../examples/documentsdb/create-collection.md | 22 - docs/examples/documentsdb/create-document.md | 25 - docs/examples/documentsdb/create-documents.md | 17 - docs/examples/documentsdb/create-index.md | 22 - .../examples/documentsdb/create-operations.md | 26 - .../documentsdb/create-transaction.md | 15 - docs/examples/documentsdb/create.md | 17 - .../decrement-document-attribute.md | 21 - .../examples/documentsdb/delete-collection.md | 16 - docs/examples/documentsdb/delete-document.md | 18 - docs/examples/documentsdb/delete-documents.md | 18 - docs/examples/documentsdb/delete-index.md | 17 - .../documentsdb/delete-transaction.md | 15 - docs/examples/documentsdb/delete.md | 15 - docs/examples/documentsdb/get-collection.md | 16 - docs/examples/documentsdb/get-document.md | 19 - docs/examples/documentsdb/get-index.md | 17 - docs/examples/documentsdb/get-transaction.md | 15 - docs/examples/documentsdb/get.md | 15 - .../increment-document-attribute.md | 21 - docs/examples/documentsdb/list-collections.md | 18 - docs/examples/documentsdb/list-documents.md | 20 - docs/examples/documentsdb/list-indexes.md | 18 - .../examples/documentsdb/list-transactions.md | 15 - docs/examples/documentsdb/list.md | 17 - .../examples/documentsdb/update-collection.md | 20 - docs/examples/documentsdb/update-document.md | 20 - docs/examples/documentsdb/update-documents.md | 19 - .../documentsdb/update-transaction.md | 17 - docs/examples/documentsdb/update.md | 17 - docs/examples/documentsdb/upsert-document.md | 20 - docs/examples/documentsdb/upsert-documents.md | 18 - docs/examples/vectorsdb/create-collection.md | 21 - docs/examples/vectorsdb/create-document.md | 22 - docs/examples/vectorsdb/create-documents.md | 17 - docs/examples/vectorsdb/create-index.md | 22 - docs/examples/vectorsdb/create-operations.md | 26 - .../vectorsdb/create-text-embeddings.md | 17 - docs/examples/vectorsdb/create-transaction.md | 15 - docs/examples/vectorsdb/create.md | 17 - docs/examples/vectorsdb/delete-collection.md | 16 - docs/examples/vectorsdb/delete-document.md | 18 - docs/examples/vectorsdb/delete-documents.md | 18 - docs/examples/vectorsdb/delete-index.md | 17 - docs/examples/vectorsdb/delete-transaction.md | 15 - docs/examples/vectorsdb/delete.md | 15 - docs/examples/vectorsdb/get-collection.md | 16 - docs/examples/vectorsdb/get-document.md | 19 - docs/examples/vectorsdb/get-index.md | 17 - docs/examples/vectorsdb/get-transaction.md | 15 - docs/examples/vectorsdb/get.md | 15 - docs/examples/vectorsdb/list-collections.md | 18 - docs/examples/vectorsdb/list-documents.md | 20 - docs/examples/vectorsdb/list-indexes.md | 18 - docs/examples/vectorsdb/list-transactions.md | 15 - docs/examples/vectorsdb/list.md | 17 - docs/examples/vectorsdb/update-collection.md | 21 - docs/examples/vectorsdb/update-document.md | 20 - docs/examples/vectorsdb/update-documents.md | 19 - docs/examples/vectorsdb/update-transaction.md | 17 - docs/examples/vectorsdb/update.md | 17 - docs/examples/vectorsdb/upsert-document.md | 20 - docs/examples/vectorsdb/upsert-documents.md | 18 - 65 files changed, 3170 deletions(-) delete mode 100644 Appwrite/Services/DocumentsDB.cs delete mode 100644 Appwrite/Services/VectorsDB.cs delete mode 100644 docs/examples/documentsdb/create-collection.md delete mode 100644 docs/examples/documentsdb/create-document.md delete mode 100644 docs/examples/documentsdb/create-documents.md delete mode 100644 docs/examples/documentsdb/create-index.md delete mode 100644 docs/examples/documentsdb/create-operations.md delete mode 100644 docs/examples/documentsdb/create-transaction.md delete mode 100644 docs/examples/documentsdb/create.md delete mode 100644 docs/examples/documentsdb/decrement-document-attribute.md delete mode 100644 docs/examples/documentsdb/delete-collection.md delete mode 100644 docs/examples/documentsdb/delete-document.md delete mode 100644 docs/examples/documentsdb/delete-documents.md delete mode 100644 docs/examples/documentsdb/delete-index.md delete mode 100644 docs/examples/documentsdb/delete-transaction.md delete mode 100644 docs/examples/documentsdb/delete.md delete mode 100644 docs/examples/documentsdb/get-collection.md delete mode 100644 docs/examples/documentsdb/get-document.md delete mode 100644 docs/examples/documentsdb/get-index.md delete mode 100644 docs/examples/documentsdb/get-transaction.md delete mode 100644 docs/examples/documentsdb/get.md delete mode 100644 docs/examples/documentsdb/increment-document-attribute.md delete mode 100644 docs/examples/documentsdb/list-collections.md delete mode 100644 docs/examples/documentsdb/list-documents.md delete mode 100644 docs/examples/documentsdb/list-indexes.md delete mode 100644 docs/examples/documentsdb/list-transactions.md delete mode 100644 docs/examples/documentsdb/list.md delete mode 100644 docs/examples/documentsdb/update-collection.md delete mode 100644 docs/examples/documentsdb/update-document.md delete mode 100644 docs/examples/documentsdb/update-documents.md delete mode 100644 docs/examples/documentsdb/update-transaction.md delete mode 100644 docs/examples/documentsdb/update.md delete mode 100644 docs/examples/documentsdb/upsert-document.md delete mode 100644 docs/examples/documentsdb/upsert-documents.md delete mode 100644 docs/examples/vectorsdb/create-collection.md delete mode 100644 docs/examples/vectorsdb/create-document.md delete mode 100644 docs/examples/vectorsdb/create-documents.md delete mode 100644 docs/examples/vectorsdb/create-index.md delete mode 100644 docs/examples/vectorsdb/create-operations.md delete mode 100644 docs/examples/vectorsdb/create-text-embeddings.md delete mode 100644 docs/examples/vectorsdb/create-transaction.md delete mode 100644 docs/examples/vectorsdb/create.md delete mode 100644 docs/examples/vectorsdb/delete-collection.md delete mode 100644 docs/examples/vectorsdb/delete-document.md delete mode 100644 docs/examples/vectorsdb/delete-documents.md delete mode 100644 docs/examples/vectorsdb/delete-index.md delete mode 100644 docs/examples/vectorsdb/delete-transaction.md delete mode 100644 docs/examples/vectorsdb/delete.md delete mode 100644 docs/examples/vectorsdb/get-collection.md delete mode 100644 docs/examples/vectorsdb/get-document.md delete mode 100644 docs/examples/vectorsdb/get-index.md delete mode 100644 docs/examples/vectorsdb/get-transaction.md delete mode 100644 docs/examples/vectorsdb/get.md delete mode 100644 docs/examples/vectorsdb/list-collections.md delete mode 100644 docs/examples/vectorsdb/list-documents.md delete mode 100644 docs/examples/vectorsdb/list-indexes.md delete mode 100644 docs/examples/vectorsdb/list-transactions.md delete mode 100644 docs/examples/vectorsdb/list.md delete mode 100644 docs/examples/vectorsdb/update-collection.md delete mode 100644 docs/examples/vectorsdb/update-document.md delete mode 100644 docs/examples/vectorsdb/update-documents.md delete mode 100644 docs/examples/vectorsdb/update-transaction.md delete mode 100644 docs/examples/vectorsdb/update.md delete mode 100644 docs/examples/vectorsdb/upsert-document.md delete mode 100644 docs/examples/vectorsdb/upsert-documents.md diff --git a/Appwrite/Services/DocumentsDB.cs b/Appwrite/Services/DocumentsDB.cs deleted file mode 100644 index 85a7964f..00000000 --- a/Appwrite/Services/DocumentsDB.cs +++ /dev/null @@ -1,1087 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Appwrite.Models; -using Appwrite.Enums; - -namespace Appwrite.Services -{ - public class DocumentsDB : Service - { - public DocumentsDB(Client client) : base(client) - { - } - - /// - /// Get a list of all databases from the current Appwrite project. You can use - /// the search parameter to filter your results. - /// - /// - public Task List(List? queries = null, string? search = null, bool? total = null) - { - var apiPath = "/documentsdb"; - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "search", search }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.DatabaseList Convert(Dictionary it) => - Models.DatabaseList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Create a new Database. - /// - /// - /// - public Task Create(string databaseId, string name, bool? enabled = null) - { - var apiPath = "/documentsdb"; - - var apiParameters = new Dictionary() - { - { "databaseId", databaseId }, - { "name", name }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task ListTransactions(List? queries = null) - { - var apiPath = "/documentsdb/transactions"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.TransactionList Convert(Dictionary it) => - Models.TransactionList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateTransaction(long? ttl = null) - { - var apiPath = "/documentsdb/transactions"; - - var apiParameters = new Dictionary() - { - { "ttl", ttl } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task GetTransaction(string transactionId) - { - var apiPath = "/documentsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) - { - var apiPath = "/documentsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - { "commit", commit }, - { "rollback", rollback } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteTransaction(string transactionId) - { - var apiPath = "/documentsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - public Task CreateOperations(string transactionId, List? operations = null) - { - var apiPath = "/documentsdb/transactions/{transactionId}/operations" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - { "operations", operations } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get a database by its unique ID. This endpoint response returns a JSON - /// object with the database metadata. - /// - /// - public Task Get(string databaseId) - { - var apiPath = "/documentsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Update a database by its unique ID. - /// - /// - public Task Update(string databaseId, string name, bool? enabled = null) - { - var apiPath = "/documentsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "name", name }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete a database by its unique ID. Only API keys with with databases.write - /// scope can delete a database. - /// - /// - public Task Delete(string databaseId) - { - var apiPath = "/documentsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - /// Get a list of all collections that belong to the provided databaseId. You - /// can use the search parameter to filter your results. - /// - /// - public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) - { - var apiPath = "/documentsdb/{databaseId}/collections" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "search", search }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.CollectionList Convert(Dictionary it) => - Models.CollectionList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) - { - var apiPath = "/documentsdb/{databaseId}/collections" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "collectionId", collectionId }, - { "name", name }, - { "permissions", permissions }, - { "documentSecurity", documentSecurity }, - { "enabled", enabled }, - { "attributes", attributes }, - { "indexes", indexes } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Collection Convert(Dictionary it) => - Models.Collection.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get a collection by its unique ID. This endpoint response returns a JSON - /// object with the collection metadata. - /// - /// - public Task GetCollection(string databaseId, string collectionId) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Collection Convert(Dictionary it) => - Models.Collection.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Update a collection by its unique ID. - /// - /// - public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "name", name }, - { "permissions", permissions }, - { "documentSecurity", documentSecurity }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Collection Convert(Dictionary it) => - Models.Collection.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete a collection by its unique ID. Only users with write permissions - /// have access to delete this resource. - /// - /// - public Task DeleteCollection(string databaseId, string collectionId) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - /// Get a list of all the user's documents in a given collection. You can use - /// the query params to filter your results. - /// - /// - public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId }, - { "total", total }, - { "ttl", ttl } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documentId", documentId }, - { "data", data }, - { "permissions", permissions } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - public Task CreateDocuments(string databaseId, string collectionId, List documents) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documents", documents } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - /// - public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documents", documents }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Bulk delete documents using queries, if no queries are passed then all - /// documents are deleted. - /// - /// - public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get a document by its unique ID. This endpoint response returns a JSON - /// object with the document data. - /// - /// - public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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. - /// - /// - public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "permissions", permissions }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Update a document by its unique ID. Using the patch method you can pass - /// only specific fields that will get updated. - /// - /// - public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "permissions", permissions }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete a document by its unique ID. - /// - /// - public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - /// Decrement a specific column of a row by a given value. - /// - /// - public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? min = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId) - .Replace("{attribute}", attribute); - - var apiParameters = new Dictionary() - { - { "value", xvalue }, - { "min", min }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Increment a specific column of a row by a given value. - /// - /// - public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? max = null, string? transactionId = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId) - .Replace("{attribute}", attribute); - - var apiParameters = new Dictionary() - { - { "value", xvalue }, - { "max", max }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// List indexes in the collection. - /// - /// - public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.IndexList Convert(Dictionary it) => - Models.IndexList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// 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`. - /// - /// - public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DocumentsDBIndexType type, List attributes, List? orders = null, List? lengths = null) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "key", key }, - { "type", type?.Value }, - { "attributes", attributes }, - { "orders", orders?.Select(e => e.Value).ToList() }, - { "lengths", lengths } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Index Convert(Dictionary it) => - Models.Index.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get index by ID. - /// - /// - public Task GetIndex(string databaseId, string collectionId, string key) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{key}", key); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Index Convert(Dictionary it) => - Models.Index.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete an index. - /// - /// - public Task DeleteIndex(string databaseId, string collectionId, string key) - { - var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{key}", key); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - } -} diff --git a/Appwrite/Services/VectorsDB.cs b/Appwrite/Services/VectorsDB.cs deleted file mode 100644 index 5e2c59c2..00000000 --- a/Appwrite/Services/VectorsDB.cs +++ /dev/null @@ -1,939 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Appwrite.Models; -using Appwrite.Enums; - -namespace Appwrite.Services -{ - public class VectorsDB : Service - { - public VectorsDB(Client client) : base(client) - { - } - - /// - public Task List(List? queries = null, string? search = null, bool? total = null) - { - var apiPath = "/vectorsdb"; - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "search", search }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.DatabaseList Convert(Dictionary it) => - Models.DatabaseList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task Create(string databaseId, string name, bool? enabled = null) - { - var apiPath = "/vectorsdb"; - - var apiParameters = new Dictionary() - { - { "databaseId", databaseId }, - { "name", name }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateTextEmbeddings(List texts, Appwrite.Enums.Model? model = null) - { - var apiPath = "/vectorsdb/embeddings/text"; - - var apiParameters = new Dictionary() - { - { "texts", texts }, - { "model", model?.Value } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.EmbeddingList Convert(Dictionary it) => - Models.EmbeddingList.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task ListTransactions(List? queries = null) - { - var apiPath = "/vectorsdb/transactions"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.TransactionList Convert(Dictionary it) => - Models.TransactionList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateTransaction(long? ttl = null) - { - var apiPath = "/vectorsdb/transactions"; - - var apiParameters = new Dictionary() - { - { "ttl", ttl } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task GetTransaction(string transactionId) - { - var apiPath = "/vectorsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) - { - var apiPath = "/vectorsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - { "commit", commit }, - { "rollback", rollback } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteTransaction(string transactionId) - { - var apiPath = "/vectorsdb/transactions/{transactionId}" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - public Task CreateOperations(string transactionId, List? operations = null) - { - var apiPath = "/vectorsdb/transactions/{transactionId}/operations" - .Replace("{transactionId}", transactionId); - - var apiParameters = new Dictionary() - { - { "operations", operations } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Transaction Convert(Dictionary it) => - Models.Transaction.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task Get(string databaseId) - { - var apiPath = "/vectorsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task Update(string databaseId, string name, bool? enabled = null) - { - var apiPath = "/vectorsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "name", name }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Database Convert(Dictionary it) => - Models.Database.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task Delete(string databaseId) - { - var apiPath = "/vectorsdb/{databaseId}" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "search", search }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.VectorsdbCollectionList Convert(Dictionary it) => - Models.VectorsdbCollectionList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateCollection(string databaseId, string collectionId, string name, long dimension, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections" - .Replace("{databaseId}", databaseId); - - var apiParameters = new Dictionary() - { - { "collectionId", collectionId }, - { "name", name }, - { "dimension", dimension }, - { "permissions", permissions }, - { "documentSecurity", documentSecurity }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.VectorsdbCollection Convert(Dictionary it) => - Models.VectorsdbCollection.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task GetCollection(string databaseId, string collectionId) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.VectorsdbCollection Convert(Dictionary it) => - Models.VectorsdbCollection.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpdateCollection(string databaseId, string collectionId, string name, long? dimension = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "name", name }, - { "dimension", dimension }, - { "permissions", permissions }, - { "documentSecurity", documentSecurity }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.VectorsdbCollection Convert(Dictionary it) => - Models.VectorsdbCollection.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteCollection(string databaseId, string collectionId) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId }, - { "total", total }, - { "ttl", ttl } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documentId", documentId }, - { "data", data }, - { "permissions", permissions } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateDocuments(string databaseId, string collectionId, List documents) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documents", documents } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "documents", documents }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.DocumentList Convert(Dictionary it) => - Models.DocumentList.From(map: it); - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "permissions", permissions }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PUT", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "data", data }, - { "permissions", permissions }, - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Document Convert(Dictionary it) => - Models.Document.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{documentId}", documentId); - - var apiParameters = new Dictionary() - { - { "transactionId", transactionId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.IndexList Convert(Dictionary it) => - Models.IndexList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.VectorsDBIndexType type, List attributes, List? orders = null, List? lengths = null) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId); - - var apiParameters = new Dictionary() - { - { "key", key }, - { "type", type?.Value }, - { "attributes", attributes }, - { "orders", orders?.Select(e => e.Value).ToList() }, - { "lengths", lengths } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.Index Convert(Dictionary it) => - Models.Index.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task GetIndex(string databaseId, string collectionId, string key) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{key}", key); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.Index Convert(Dictionary it) => - Models.Index.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - public Task DeleteIndex(string databaseId, string collectionId, string key) - { - var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" - .Replace("{databaseId}", databaseId) - .Replace("{collectionId}", collectionId) - .Replace("{key}", key); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - } -} diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md deleted file mode 100644 index 1335a533..00000000 --- a/docs/examples/documentsdb/create-collection.md +++ /dev/null @@ -1,22 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Collection result = await documentsDB.CreateCollection( - databaseId: "", - collectionId: "", - name: "", - permissions: new List { Permission.Read(Role.Any()) }, // optional - documentSecurity: false, // optional - enabled: false, // optional - attributes: new List(), // optional - indexes: new List() // optional -);``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md deleted file mode 100644 index 60919257..00000000 --- a/docs/examples/documentsdb/create-document.md +++ /dev/null @@ -1,25 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.CreateDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: new { - username = "walter.obrien", - email = "walter.obrien@example.com", - fullName = "Walter O'Brien", - age = 30, - isAdmin = false - }, - permissions: new List { Permission.Read(Role.Any()) } // optional -);``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md deleted file mode 100644 index ee9a2395..00000000 --- a/docs/examples/documentsdb/create-documents.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await documentsDB.CreateDocuments( - databaseId: "", - collectionId: "", - documents: new List() -);``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md deleted file mode 100644 index 6abfd50d..00000000 --- a/docs/examples/documentsdb/create-index.md +++ /dev/null @@ -1,22 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Index result = await documentsDB.CreateIndex( - databaseId: "", - collectionId: "", - key: "", - type: DocumentsDBIndexType.Key, - attributes: new List(), - orders: new List<OrderBy> { OrderBy.Asc }, // optional - lengths: new List() // optional -);``` diff --git a/docs/examples/documentsdb/create-operations.md b/docs/examples/documentsdb/create-operations.md deleted file mode 100644 index cd2158fe..00000000 --- a/docs/examples/documentsdb/create-operations.md +++ /dev/null @@ -1,26 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await documentsDB.CreateOperations( - transactionId: "", - operations: [ - { - "action": "create", - "databaseId": "", - "collectionId": "", - "documentId": "", - "data": { - "name": "Walter O'Brien" - } - } - ] // optional -);``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md deleted file mode 100644 index 4a2efa43..00000000 --- a/docs/examples/documentsdb/create-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await documentsDB.CreateTransaction( - ttl: 60 // optional -);``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md deleted file mode 100644 index f9f75689..00000000 --- a/docs/examples/documentsdb/create.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await documentsDB.Create( - databaseId: "", - name: "", - enabled: false // optional -);``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md deleted file mode 100644 index 2b6f4d30..00000000 --- a/docs/examples/documentsdb/decrement-document-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.DecrementDocumentAttribute( - databaseId: "", - collectionId: "", - documentId: "", - attribute: "", - value: 0, // optional - min: 0, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md deleted file mode 100644 index e18d995d..00000000 --- a/docs/examples/documentsdb/delete-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.DeleteCollection( - databaseId: "", - collectionId: "" -);``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md deleted file mode 100644 index 535615b9..00000000 --- a/docs/examples/documentsdb/delete-document.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.DeleteDocument( - databaseId: "", - collectionId: "", - documentId: "", - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md deleted file mode 100644 index 63516aae..00000000 --- a/docs/examples/documentsdb/delete-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.DeleteDocuments( - databaseId: "", - collectionId: "", - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md deleted file mode 100644 index 713f50fd..00000000 --- a/docs/examples/documentsdb/delete-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.DeleteIndex( - databaseId: "", - collectionId: "", - key: "" -);``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md deleted file mode 100644 index cd48372b..00000000 --- a/docs/examples/documentsdb/delete-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.DeleteTransaction( - transactionId: "" -);``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md deleted file mode 100644 index 65eeaf83..00000000 --- a/docs/examples/documentsdb/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await documentsDB.Delete( - databaseId: "" -);``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md deleted file mode 100644 index bf41939e..00000000 --- a/docs/examples/documentsdb/get-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Collection result = await documentsDB.GetCollection( - databaseId: "", - collectionId: "" -);``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md deleted file mode 100644 index d5bbe0f0..00000000 --- a/docs/examples/documentsdb/get-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.GetDocument( - databaseId: "", - collectionId: "", - documentId: "", - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md deleted file mode 100644 index 0b006b28..00000000 --- a/docs/examples/documentsdb/get-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Index result = await documentsDB.GetIndex( - databaseId: "", - collectionId: "", - key: "" -);``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md deleted file mode 100644 index d24bee71..00000000 --- a/docs/examples/documentsdb/get-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await documentsDB.GetTransaction( - transactionId: "" -);``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md deleted file mode 100644 index 37d884a7..00000000 --- a/docs/examples/documentsdb/get.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await documentsDB.Get( - databaseId: "" -);``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md deleted file mode 100644 index c07238c6..00000000 --- a/docs/examples/documentsdb/increment-document-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.IncrementDocumentAttribute( - databaseId: "", - collectionId: "", - documentId: "", - attribute: "", - value: 0, // optional - max: 0, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md deleted file mode 100644 index 958308ba..00000000 --- a/docs/examples/documentsdb/list-collections.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -CollectionList result = await documentsDB.ListCollections( - databaseId: "", - queries: new List(), // optional - search: "", // optional - total: false // optional -);``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md deleted file mode 100644 index 44dadea0..00000000 --- a/docs/examples/documentsdb/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await documentsDB.ListDocuments( - databaseId: "", - collectionId: "", - queries: new List(), // optional - transactionId: "", // optional - total: false, // optional - ttl: 0 // optional -);``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md deleted file mode 100644 index fdfc7960..00000000 --- a/docs/examples/documentsdb/list-indexes.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -IndexList result = await documentsDB.ListIndexes( - databaseId: "", - collectionId: "", - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md deleted file mode 100644 index 7db4c682..00000000 --- a/docs/examples/documentsdb/list-transactions.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -TransactionList result = await documentsDB.ListTransactions( - queries: new List() // optional -);``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md deleted file mode 100644 index 73ab2edd..00000000 --- a/docs/examples/documentsdb/list.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DatabaseList result = await documentsDB.List( - queries: new List(), // optional - search: "", // optional - total: false // optional -);``` diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md deleted file mode 100644 index b15f2848..00000000 --- a/docs/examples/documentsdb/update-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Collection result = await documentsDB.UpdateCollection( - databaseId: "", - collectionId: "", - name: "", - permissions: new List { Permission.Read(Role.Any()) }, // optional - documentSecurity: false, // optional - enabled: false // optional -);``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md deleted file mode 100644 index 3aa6be84..00000000 --- a/docs/examples/documentsdb/update-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.UpdateDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: [object], // optional - permissions: new List { Permission.Read(Role.Any()) }, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md deleted file mode 100644 index 85fda47f..00000000 --- a/docs/examples/documentsdb/update-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await documentsDB.UpdateDocuments( - databaseId: "", - collectionId: "", - data: [object], // optional - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md deleted file mode 100644 index 2988ea7b..00000000 --- a/docs/examples/documentsdb/update-transaction.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await documentsDB.UpdateTransaction( - transactionId: "", - commit: false, // optional - rollback: false // optional -);``` diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md deleted file mode 100644 index 7ffb9be8..00000000 --- a/docs/examples/documentsdb/update.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await documentsDB.Update( - databaseId: "", - name: "", - enabled: false // optional -);``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md deleted file mode 100644 index 4b716f21..00000000 --- a/docs/examples/documentsdb/upsert-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await documentsDB.UpsertDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: [object], // optional - permissions: new List { Permission.Read(Role.Any()) }, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md deleted file mode 100644 index c91cbcb6..00000000 --- a/docs/examples/documentsdb/upsert-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await documentsDB.UpsertDocuments( - databaseId: "", - collectionId: "", - documents: new List(), - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md deleted file mode 100644 index d9d42682..00000000 --- a/docs/examples/vectorsdb/create-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -VectorsdbCollection result = await vectorsDB.CreateCollection( - databaseId: "", - collectionId: "", - name: "", - dimension: 1, - permissions: new List { Permission.Read(Role.Any()) }, // optional - documentSecurity: false, // optional - enabled: false // optional -);``` diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md deleted file mode 100644 index a2df215b..00000000 --- a/docs/examples/vectorsdb/create-document.md +++ /dev/null @@ -1,22 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await vectorsDB.CreateDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: new { - embeddings = new[] { 0.12, -0.55, 0.88, 1.02 }, - metadata = { key = "value" } - }, - permissions: new List { Permission.Read(Role.Any()) } // optional -);``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md deleted file mode 100644 index ee725394..00000000 --- a/docs/examples/vectorsdb/create-documents.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await vectorsDB.CreateDocuments( - databaseId: "", - collectionId: "", - documents: new List() -);``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md deleted file mode 100644 index 73501d52..00000000 --- a/docs/examples/vectorsdb/create-index.md +++ /dev/null @@ -1,22 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Index result = await vectorsDB.CreateIndex( - databaseId: "", - collectionId: "", - key: "", - type: VectorsDBIndexType.HnswEuclidean, - attributes: new List(), - orders: new List<OrderBy> { OrderBy.Asc }, // optional - lengths: new List() // optional -);``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md deleted file mode 100644 index df055e97..00000000 --- a/docs/examples/vectorsdb/create-operations.md +++ /dev/null @@ -1,26 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await vectorsDB.CreateOperations( - transactionId: "", - operations: [ - { - "action": "create", - "databaseId": "", - "collectionId": "", - "documentId": "", - "data": { - "name": "Walter O'Brien" - } - } - ] // optional -);``` diff --git a/docs/examples/vectorsdb/create-text-embeddings.md b/docs/examples/vectorsdb/create-text-embeddings.md deleted file mode 100644 index c8d7e837..00000000 --- a/docs/examples/vectorsdb/create-text-embeddings.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -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); - -EmbeddingList result = await vectorsDB.CreateTextEmbeddings( - texts: new List(), - model: Model.Embeddinggemma // optional -);``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md deleted file mode 100644 index 1fa4fa73..00000000 --- a/docs/examples/vectorsdb/create-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await vectorsDB.CreateTransaction( - ttl: 60 // optional -);``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md deleted file mode 100644 index 8b25057c..00000000 --- a/docs/examples/vectorsdb/create.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await vectorsDB.Create( - databaseId: "", - name: "", - enabled: false // optional -);``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md deleted file mode 100644 index b57b1101..00000000 --- a/docs/examples/vectorsdb/delete-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.DeleteCollection( - databaseId: "", - collectionId: "" -);``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md deleted file mode 100644 index 29984fa9..00000000 --- a/docs/examples/vectorsdb/delete-document.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.DeleteDocument( - databaseId: "", - collectionId: "", - documentId: "", - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md deleted file mode 100644 index 89e7aba5..00000000 --- a/docs/examples/vectorsdb/delete-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.DeleteDocuments( - databaseId: "", - collectionId: "", - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md deleted file mode 100644 index aca6faf3..00000000 --- a/docs/examples/vectorsdb/delete-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.DeleteIndex( - databaseId: "", - collectionId: "", - key: "" -);``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md deleted file mode 100644 index 8c49e7e2..00000000 --- a/docs/examples/vectorsdb/delete-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.DeleteTransaction( - transactionId: "" -);``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md deleted file mode 100644 index 8d7fd317..00000000 --- a/docs/examples/vectorsdb/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -await vectorsDB.Delete( - databaseId: "" -);``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md deleted file mode 100644 index 0f949214..00000000 --- a/docs/examples/vectorsdb/get-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -VectorsdbCollection result = await vectorsDB.GetCollection( - databaseId: "", - collectionId: "" -);``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md deleted file mode 100644 index 74843f40..00000000 --- a/docs/examples/vectorsdb/get-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await vectorsDB.GetDocument( - databaseId: "", - collectionId: "", - documentId: "", - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md deleted file mode 100644 index b3d8b5d1..00000000 --- a/docs/examples/vectorsdb/get-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Index result = await vectorsDB.GetIndex( - databaseId: "", - collectionId: "", - key: "" -);``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md deleted file mode 100644 index 6e0bdb0f..00000000 --- a/docs/examples/vectorsdb/get-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await vectorsDB.GetTransaction( - transactionId: "" -);``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md deleted file mode 100644 index 89d041c5..00000000 --- a/docs/examples/vectorsdb/get.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await vectorsDB.Get( - databaseId: "" -);``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md deleted file mode 100644 index 6e6e8167..00000000 --- a/docs/examples/vectorsdb/list-collections.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -VectorsdbCollectionList result = await vectorsDB.ListCollections( - databaseId: "", - queries: new List(), // optional - search: "", // optional - total: false // optional -);``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md deleted file mode 100644 index 4b800ce4..00000000 --- a/docs/examples/vectorsdb/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await vectorsDB.ListDocuments( - databaseId: "", - collectionId: "", - queries: new List(), // optional - transactionId: "", // optional - total: false, // optional - ttl: 0 // optional -);``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md deleted file mode 100644 index 187f6754..00000000 --- a/docs/examples/vectorsdb/list-indexes.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -IndexList result = await vectorsDB.ListIndexes( - databaseId: "", - collectionId: "", - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md deleted file mode 100644 index 35d27547..00000000 --- a/docs/examples/vectorsdb/list-transactions.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -TransactionList result = await vectorsDB.ListTransactions( - queries: new List() // optional -);``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md deleted file mode 100644 index 20e582d5..00000000 --- a/docs/examples/vectorsdb/list.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DatabaseList result = await vectorsDB.List( - queries: new List(), // optional - search: "", // optional - total: false // optional -);``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md deleted file mode 100644 index 2ce560cd..00000000 --- a/docs/examples/vectorsdb/update-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -VectorsdbCollection result = await vectorsDB.UpdateCollection( - databaseId: "", - collectionId: "", - name: "", - dimension: 1, // optional - permissions: new List { Permission.Read(Role.Any()) }, // optional - documentSecurity: false, // optional - enabled: false // optional -);``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md deleted file mode 100644 index ec5963de..00000000 --- a/docs/examples/vectorsdb/update-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await vectorsDB.UpdateDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: [object], // optional - permissions: new List { Permission.Read(Role.Any()) }, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md deleted file mode 100644 index ba4c5e9d..00000000 --- a/docs/examples/vectorsdb/update-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await vectorsDB.UpdateDocuments( - databaseId: "", - collectionId: "", - data: [object], // optional - queries: new List(), // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md deleted file mode 100644 index aa6adb41..00000000 --- a/docs/examples/vectorsdb/update-transaction.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Transaction result = await vectorsDB.UpdateTransaction( - transactionId: "", - commit: false, // optional - rollback: false // optional -);``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md deleted file mode 100644 index 8d962808..00000000 --- a/docs/examples/vectorsdb/update.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Database result = await vectorsDB.Update( - databaseId: "", - name: "", - enabled: false // optional -);``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md deleted file mode 100644 index 7b223591..00000000 --- a/docs/examples/vectorsdb/upsert-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -Document result = await vectorsDB.UpsertDocument( - databaseId: "", - collectionId: "", - documentId: "", - data: [object], // optional - permissions: new List { Permission.Read(Role.Any()) }, // optional - transactionId: "" // optional -);``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md deleted file mode 100644 index 5217a978..00000000 --- a/docs/examples/vectorsdb/upsert-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -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); - -DocumentList result = await vectorsDB.UpsertDocuments( - databaseId: "", - collectionId: "", - documents: new List(), - transactionId: "" // optional -);``` From e97c5cd9df6107f6ee2eb71705ca926dfe014d11 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 06:44:13 +0000 Subject: [PATCH 4/8] chore: update .NET SDK to 0.28.0 --- Appwrite/Enums/DocumentsDBIndexType.cs | 19 --- Appwrite/Enums/Model.cs | 16 --- Appwrite/Enums/TemplateReferenceType.cs | 2 +- Appwrite/Enums/VCSReferenceType.cs | 1 - Appwrite/Enums/VectorsDBIndexType.cs | 21 --- Appwrite/Models/AttributeObject.cs | 81 ----------- Appwrite/Models/AttributeVector.cs | 88 ------------ Appwrite/Models/Embedding.cs | 53 -------- Appwrite/Models/EmbeddingList.cs | 39 ------ Appwrite/Models/VectorsdbCollection.cs | 116 ---------------- Appwrite/Models/VectorsdbCollectionList.cs | 39 ------ Appwrite/Services/Health.cs | 150 --------------------- 12 files changed, 1 insertion(+), 624 deletions(-) delete mode 100644 Appwrite/Enums/DocumentsDBIndexType.cs delete mode 100644 Appwrite/Enums/Model.cs delete mode 100644 Appwrite/Enums/VectorsDBIndexType.cs delete mode 100644 Appwrite/Models/AttributeObject.cs delete mode 100644 Appwrite/Models/AttributeVector.cs delete mode 100644 Appwrite/Models/Embedding.cs delete mode 100644 Appwrite/Models/EmbeddingList.cs delete mode 100644 Appwrite/Models/VectorsdbCollection.cs delete mode 100644 Appwrite/Models/VectorsdbCollectionList.cs diff --git a/Appwrite/Enums/DocumentsDBIndexType.cs b/Appwrite/Enums/DocumentsDBIndexType.cs deleted file mode 100644 index 3fd0585c..00000000 --- a/Appwrite/Enums/DocumentsDBIndexType.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class DocumentsDBIndexType : IEnum - { - public string Value { get; private set; } - - public DocumentsDBIndexType(string value) - { - Value = value; - } - - public static DocumentsDBIndexType Key => new DocumentsDBIndexType("key"); - public static DocumentsDBIndexType Fulltext => new DocumentsDBIndexType("fulltext"); - public static DocumentsDBIndexType Unique => new DocumentsDBIndexType("unique"); - public static DocumentsDBIndexType Spatial => new DocumentsDBIndexType("spatial"); - } -} diff --git a/Appwrite/Enums/Model.cs b/Appwrite/Enums/Model.cs deleted file mode 100644 index 9fbb1b73..00000000 --- a/Appwrite/Enums/Model.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class Model : IEnum - { - public string Value { get; private set; } - - public Model(string value) - { - Value = value; - } - - public static Model Embeddinggemma => new Model("embeddinggemma"); - } -} diff --git a/Appwrite/Enums/TemplateReferenceType.cs b/Appwrite/Enums/TemplateReferenceType.cs index 36b1f7d7..4c09d4f8 100644 --- a/Appwrite/Enums/TemplateReferenceType.cs +++ b/Appwrite/Enums/TemplateReferenceType.cs @@ -11,8 +11,8 @@ public TemplateReferenceType(string value) Value = value; } - public static TemplateReferenceType Branch => new TemplateReferenceType("branch"); public static TemplateReferenceType Commit => new TemplateReferenceType("commit"); + public static TemplateReferenceType Branch => new TemplateReferenceType("branch"); public static TemplateReferenceType Tag => new TemplateReferenceType("tag"); } } diff --git a/Appwrite/Enums/VCSReferenceType.cs b/Appwrite/Enums/VCSReferenceType.cs index 5f5f60ec..e52d094d 100644 --- a/Appwrite/Enums/VCSReferenceType.cs +++ b/Appwrite/Enums/VCSReferenceType.cs @@ -13,6 +13,5 @@ public VCSReferenceType(string value) public static VCSReferenceType Branch => new VCSReferenceType("branch"); public static VCSReferenceType Commit => new VCSReferenceType("commit"); - public static VCSReferenceType Tag => new VCSReferenceType("tag"); } } diff --git a/Appwrite/Enums/VectorsDBIndexType.cs b/Appwrite/Enums/VectorsDBIndexType.cs deleted file mode 100644 index 82a39739..00000000 --- a/Appwrite/Enums/VectorsDBIndexType.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class VectorsDBIndexType : IEnum - { - public string Value { get; private set; } - - public VectorsDBIndexType(string value) - { - Value = value; - } - - public static VectorsDBIndexType HnswEuclidean => new VectorsDBIndexType("hnsw_euclidean"); - public static VectorsDBIndexType HnswDot => new VectorsDBIndexType("hnsw_dot"); - public static VectorsDBIndexType HnswCosine => new VectorsDBIndexType("hnsw_cosine"); - public static VectorsDBIndexType Object => new VectorsDBIndexType("object"); - public static VectorsDBIndexType Key => new VectorsDBIndexType("key"); - public static VectorsDBIndexType Unique => new VectorsDBIndexType("unique"); - } -} diff --git a/Appwrite/Models/AttributeObject.cs b/Appwrite/Models/AttributeObject.cs deleted file mode 100644 index 6e8edd08..00000000 --- a/Appwrite/Models/AttributeObject.cs +++ /dev/null @@ -1,81 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class AttributeObject - { - [JsonPropertyName("key")] - public string Key { get; private set; } - - [JsonPropertyName("type")] - public string Type { get; private set; } - - [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } - - [JsonPropertyName("error")] - public string Error { get; private set; } - - [JsonPropertyName("required")] - public bool Required { get; private set; } - - [JsonPropertyName("array")] - public bool? Array { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - public AttributeObject( - string key, - string type, - AttributeStatus status, - string error, - bool required, - bool? array, - string createdAt, - string updatedAt - ) { - Key = key; - Type = type; - Status = status; - Error = error; - Required = required; - Array = array; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - } - - public static AttributeObject From(Dictionary map) => new AttributeObject( - key: map["key"].ToString(), - type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], - array: (bool?)map["array"], - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "key", Key }, - { "type", Type }, - { "status", Status.Value }, - { "error", Error }, - { "required", Required }, - { "array", Array }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt } - }; - } -} diff --git a/Appwrite/Models/AttributeVector.cs b/Appwrite/Models/AttributeVector.cs deleted file mode 100644 index 604a4149..00000000 --- a/Appwrite/Models/AttributeVector.cs +++ /dev/null @@ -1,88 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class AttributeVector - { - [JsonPropertyName("key")] - public string Key { get; private set; } - - [JsonPropertyName("type")] - public string Type { get; private set; } - - [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } - - [JsonPropertyName("error")] - public string Error { get; private set; } - - [JsonPropertyName("required")] - public bool Required { get; private set; } - - [JsonPropertyName("array")] - public bool? Array { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - [JsonPropertyName("size")] - public long Size { get; private set; } - - public AttributeVector( - string key, - string type, - AttributeStatus status, - string error, - bool required, - bool? array, - string createdAt, - string updatedAt, - long size - ) { - Key = key; - Type = type; - Status = status; - Error = error; - Required = required; - Array = array; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - Size = size; - } - - public static AttributeVector From(Dictionary map) => new AttributeVector( - key: map["key"].ToString(), - type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), - error: map["error"].ToString(), - required: (bool)map["required"], - array: (bool?)map["array"], - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - size: Convert.ToInt64(map["size"]) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "key", Key }, - { "type", Type }, - { "status", Status.Value }, - { "error", Error }, - { "required", Required }, - { "array", Array }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt }, - { "size", Size } - }; - } -} diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs deleted file mode 100644 index ae48c1de..00000000 --- a/Appwrite/Models/Embedding.cs +++ /dev/null @@ -1,53 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class Embedding - { - [JsonPropertyName("model")] - public string Model { get; private set; } - - [JsonPropertyName("dimension")] - public long Dimension { get; private set; } - - [JsonPropertyName("embedding")] - public List Embedding { get; private set; } - - [JsonPropertyName("error")] - public string Error { get; private set; } - - public Embedding( - string model, - long dimension, - List embedding, - string error - ) { - Model = model; - Dimension = dimension; - Embedding = embedding; - Error = error; - } - - public static Embedding From(Dictionary map) => new Embedding( - model: map["model"].ToString(), - dimension: Convert.ToInt64(map["dimension"]), - embedding: map["embedding"].ConvertToList(), - error: map["error"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "model", Model }, - { "dimension", Dimension }, - { "embedding", Embedding }, - { "error", Error } - }; - } -} diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs deleted file mode 100644 index c00bc6c7..00000000 --- a/Appwrite/Models/EmbeddingList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class EmbeddingList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("embeddings")] - public List Embeddings { get; private set; } - - public EmbeddingList( - long total, - List embeddings - ) { - Total = total; - Embeddings = embeddings; - } - - public static EmbeddingList From(Dictionary map) => new EmbeddingList( - total: Convert.ToInt64(map["total"]), - embeddings: map["embeddings"].ConvertToList>().Select(it => Embedding.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "embeddings", Embeddings.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Models/VectorsdbCollection.cs b/Appwrite/Models/VectorsdbCollection.cs deleted file mode 100644 index 270890f3..00000000 --- a/Appwrite/Models/VectorsdbCollection.cs +++ /dev/null @@ -1,116 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class VectorsdbCollection - { - [JsonPropertyName("$id")] - public string Id { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - [JsonPropertyName("$permissions")] - public List Permissions { get; private set; } - - [JsonPropertyName("databaseId")] - public string DatabaseId { get; private set; } - - [JsonPropertyName("name")] - public string Name { get; private set; } - - [JsonPropertyName("enabled")] - public bool Enabled { get; private set; } - - [JsonPropertyName("documentSecurity")] - public bool DocumentSecurity { get; private set; } - - [JsonPropertyName("attributes")] - public List Attributes { get; private set; } - - [JsonPropertyName("indexes")] - public List Indexes { get; private set; } - - [JsonPropertyName("bytesMax")] - public long BytesMax { get; private set; } - - [JsonPropertyName("bytesUsed")] - public long BytesUsed { get; private set; } - - [JsonPropertyName("dimension")] - public long Dimension { get; private set; } - - public VectorsdbCollection( - string id, - string createdAt, - string updatedAt, - List permissions, - string databaseId, - string name, - bool enabled, - bool documentSecurity, - List attributes, - List indexes, - long bytesMax, - long bytesUsed, - long dimension - ) { - Id = id; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - Permissions = permissions; - DatabaseId = databaseId; - Name = name; - Enabled = enabled; - DocumentSecurity = documentSecurity; - Attributes = attributes; - Indexes = indexes; - BytesMax = bytesMax; - BytesUsed = bytesUsed; - Dimension = dimension; - } - - public static VectorsdbCollection From(Dictionary map) => new VectorsdbCollection( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - permissions: map["$permissions"].ConvertToList(), - databaseId: map["databaseId"].ToString(), - name: map["name"].ToString(), - enabled: (bool)map["enabled"], - documentSecurity: (bool)map["documentSecurity"], - attributes: map["attributes"].ConvertToList(), - indexes: map["indexes"].ConvertToList>().Select(it => Index.From(map: it)).ToList(), - bytesMax: Convert.ToInt64(map["bytesMax"]), - bytesUsed: Convert.ToInt64(map["bytesUsed"]), - dimension: Convert.ToInt64(map["dimension"]) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "$id", Id }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt }, - { "$permissions", Permissions }, - { "databaseId", DatabaseId }, - { "name", Name }, - { "enabled", Enabled }, - { "documentSecurity", DocumentSecurity }, - { "attributes", Attributes }, - { "indexes", Indexes.Select(it => it.ToMap()) }, - { "bytesMax", BytesMax }, - { "bytesUsed", BytesUsed }, - { "dimension", Dimension } - }; - } -} diff --git a/Appwrite/Models/VectorsdbCollectionList.cs b/Appwrite/Models/VectorsdbCollectionList.cs deleted file mode 100644 index b9204522..00000000 --- a/Appwrite/Models/VectorsdbCollectionList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class VectorsdbCollectionList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("collections")] - public List Collections { get; private set; } - - public VectorsdbCollectionList( - long total, - List collections - ) { - Total = total; - Collections = collections; - } - - public static VectorsdbCollectionList From(Dictionary map) => new VectorsdbCollectionList( - total: Convert.ToInt64(map["total"]), - collections: map["collections"].ConvertToList>().Select(it => VectorsdbCollection.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "collections", Collections.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Services/Health.cs b/Appwrite/Services/Health.cs index 20b5901a..529b9b54 100644 --- a/Appwrite/Services/Health.cs +++ b/Appwrite/Services/Health.cs @@ -254,66 +254,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get billing project aggregation queue. - /// - /// - public Task GetQueueBillingProjectAggregation(long? threshold = null) - { - var apiPath = "/health/queue/billing-project-aggregation"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get billing team aggregation queue. - /// - /// - public Task GetQueueBillingTeamAggregation(long? threshold = null) - { - var apiPath = "/health/queue/billing-team-aggregation"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of builds that are waiting to be processed in the Appwrite /// internal queue server. @@ -345,36 +285,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get the priority builds queue size. - /// - /// - public Task GetQueuePriorityBuilds(long? threshold = null) - { - var apiPath = "/health/queue/builds-priority"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of certificates that are waiting to be issued against /// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -657,36 +567,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get region manager queue. - /// - /// - public Task GetQueueRegionManager(long? threshold = null) - { - var apiPath = "/health/queue/region-manager"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of metrics that are waiting to be processed in the Appwrite /// stats resources queue. @@ -749,36 +629,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get threats queue. - /// - /// - public Task GetQueueThreats(long? threshold = null) - { - var apiPath = "/health/queue/threats"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of webhooks that are waiting to be processed in the Appwrite /// internal queue server. From e0ec26ca7636727090af3f40a24cbd74d2674ba5 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 07:20:32 +0000 Subject: [PATCH 5/8] chore: update .NET SDK to 0.28.0 --- Appwrite/Enums/VCSReferenceType.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Appwrite/Enums/VCSReferenceType.cs b/Appwrite/Enums/VCSReferenceType.cs index e52d094d..5f5f60ec 100644 --- a/Appwrite/Enums/VCSReferenceType.cs +++ b/Appwrite/Enums/VCSReferenceType.cs @@ -13,5 +13,6 @@ public VCSReferenceType(string value) public static VCSReferenceType Branch => new VCSReferenceType("branch"); public static VCSReferenceType Commit => new VCSReferenceType("commit"); + public static VCSReferenceType Tag => new VCSReferenceType("tag"); } } From 16005fef933ce54a1071ae4be90f7055b710dc38 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 04:23:00 +0000 Subject: [PATCH 6/8] chore: update .NET SDK to 0.28.0 --- Appwrite/Enums/BuildRuntime.cs | 86 ---------------------------------- Appwrite/Enums/Runtime.cs | 86 ---------------------------------- 2 files changed, 172 deletions(-) diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index b517a556..1617eceb 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -97,91 +97,5 @@ public BuildRuntime(string value) public static BuildRuntime Flutter332 => new BuildRuntime("flutter-3.32"); public static BuildRuntime Flutter335 => new BuildRuntime("flutter-3.35"); public static BuildRuntime Flutter338 => new BuildRuntime("flutter-3.38"); - public static BuildRuntime Node145Rc => new BuildRuntime("node-14.5-rc"); - public static BuildRuntime Node160Rc => new BuildRuntime("node-16.0-rc"); - public static BuildRuntime Node180Rc => new BuildRuntime("node-18.0-rc"); - public static BuildRuntime Node190Rc => new BuildRuntime("node-19.0-rc"); - public static BuildRuntime Node200Rc => new BuildRuntime("node-20.0-rc"); - public static BuildRuntime Node210Rc => new BuildRuntime("node-21.0-rc"); - public static BuildRuntime Node22Rc => new BuildRuntime("node-22-rc"); - public static BuildRuntime Node23Rc => new BuildRuntime("node-23-rc"); - public static BuildRuntime Node24Rc => new BuildRuntime("node-24-rc"); - public static BuildRuntime Node25Rc => new BuildRuntime("node-25-rc"); - public static BuildRuntime Php80Rc => new BuildRuntime("php-8.0-rc"); - public static BuildRuntime Php81Rc => new BuildRuntime("php-8.1-rc"); - public static BuildRuntime Php82Rc => new BuildRuntime("php-8.2-rc"); - public static BuildRuntime Php83Rc => new BuildRuntime("php-8.3-rc"); - public static BuildRuntime Php84Rc => new BuildRuntime("php-8.4-rc"); - public static BuildRuntime Ruby30Rc => new BuildRuntime("ruby-3.0-rc"); - public static BuildRuntime Ruby31Rc => new BuildRuntime("ruby-3.1-rc"); - public static BuildRuntime Ruby32Rc => new BuildRuntime("ruby-3.2-rc"); - public static BuildRuntime Ruby33Rc => new BuildRuntime("ruby-3.3-rc"); - public static BuildRuntime Ruby34Rc => new BuildRuntime("ruby-3.4-rc"); - public static BuildRuntime Ruby40Rc => new BuildRuntime("ruby-4.0-rc"); - public static BuildRuntime Python38Rc => new BuildRuntime("python-3.8-rc"); - public static BuildRuntime Python39Rc => new BuildRuntime("python-3.9-rc"); - public static BuildRuntime Python310Rc => new BuildRuntime("python-3.10-rc"); - public static BuildRuntime Python311Rc => new BuildRuntime("python-3.11-rc"); - public static BuildRuntime Python312Rc => new BuildRuntime("python-3.12-rc"); - public static BuildRuntime Python313Rc => new BuildRuntime("python-3.13-rc"); - public static BuildRuntime Python314Rc => new BuildRuntime("python-3.14-rc"); - public static BuildRuntime PythonMl311Rc => new BuildRuntime("python-ml-3.11-rc"); - public static BuildRuntime PythonMl312Rc => new BuildRuntime("python-ml-3.12-rc"); - public static BuildRuntime PythonMl313Rc => new BuildRuntime("python-ml-3.13-rc"); - public static BuildRuntime Deno140Rc => new BuildRuntime("deno-1.40-rc"); - public static BuildRuntime Deno146Rc => new BuildRuntime("deno-1.46-rc"); - public static BuildRuntime Deno20Rc => new BuildRuntime("deno-2.0-rc"); - public static BuildRuntime Deno25Rc => new BuildRuntime("deno-2.5-rc"); - public static BuildRuntime Deno26Rc => new BuildRuntime("deno-2.6-rc"); - public static BuildRuntime Dart215Rc => new BuildRuntime("dart-2.15-rc"); - public static BuildRuntime Dart216Rc => new BuildRuntime("dart-2.16-rc"); - public static BuildRuntime Dart217Rc => new BuildRuntime("dart-2.17-rc"); - public static BuildRuntime Dart218Rc => new BuildRuntime("dart-2.18-rc"); - public static BuildRuntime Dart219Rc => new BuildRuntime("dart-2.19-rc"); - public static BuildRuntime Dart30Rc => new BuildRuntime("dart-3.0-rc"); - public static BuildRuntime Dart31Rc => new BuildRuntime("dart-3.1-rc"); - public static BuildRuntime Dart33Rc => new BuildRuntime("dart-3.3-rc"); - public static BuildRuntime Dart35Rc => new BuildRuntime("dart-3.5-rc"); - public static BuildRuntime Dart38Rc => new BuildRuntime("dart-3.8-rc"); - public static BuildRuntime Dart39Rc => new BuildRuntime("dart-3.9-rc"); - public static BuildRuntime Dart310Rc => new BuildRuntime("dart-3.10-rc"); - public static BuildRuntime Dotnet60Rc => new BuildRuntime("dotnet-6.0-rc"); - public static BuildRuntime Dotnet70Rc => new BuildRuntime("dotnet-7.0-rc"); - public static BuildRuntime Dotnet80Rc => new BuildRuntime("dotnet-8.0-rc"); - public static BuildRuntime Dotnet10Rc => new BuildRuntime("dotnet-10-rc"); - public static BuildRuntime Java80Rc => new BuildRuntime("java-8.0-rc"); - public static BuildRuntime Java110Rc => new BuildRuntime("java-11.0-rc"); - public static BuildRuntime Java170Rc => new BuildRuntime("java-17.0-rc"); - public static BuildRuntime Java180Rc => new BuildRuntime("java-18.0-rc"); - public static BuildRuntime Java210Rc => new BuildRuntime("java-21.0-rc"); - public static BuildRuntime Java22Rc => new BuildRuntime("java-22-rc"); - public static BuildRuntime Java25Rc => new BuildRuntime("java-25-rc"); - public static BuildRuntime Swift55Rc => new BuildRuntime("swift-5.5-rc"); - public static BuildRuntime Swift58Rc => new BuildRuntime("swift-5.8-rc"); - public static BuildRuntime Swift59Rc => new BuildRuntime("swift-5.9-rc"); - public static BuildRuntime Swift510Rc => new BuildRuntime("swift-5.10-rc"); - public static BuildRuntime Swift62Rc => new BuildRuntime("swift-6.2-rc"); - public static BuildRuntime Kotlin16Rc => new BuildRuntime("kotlin-1.6-rc"); - public static BuildRuntime Kotlin18Rc => new BuildRuntime("kotlin-1.8-rc"); - public static BuildRuntime Kotlin19Rc => new BuildRuntime("kotlin-1.9-rc"); - public static BuildRuntime Kotlin20Rc => new BuildRuntime("kotlin-2.0-rc"); - public static BuildRuntime Kotlin23Rc => new BuildRuntime("kotlin-2.3-rc"); - public static BuildRuntime Cpp17Rc => new BuildRuntime("cpp-17-rc"); - public static BuildRuntime Cpp20Rc => new BuildRuntime("cpp-20-rc"); - public static BuildRuntime Bun10Rc => new BuildRuntime("bun-1.0-rc"); - public static BuildRuntime Bun11Rc => new BuildRuntime("bun-1.1-rc"); - public static BuildRuntime Bun12Rc => new BuildRuntime("bun-1.2-rc"); - public static BuildRuntime Bun13Rc => new BuildRuntime("bun-1.3-rc"); - public static BuildRuntime Go123Rc => new BuildRuntime("go-1.23-rc"); - public static BuildRuntime Go124Rc => new BuildRuntime("go-1.24-rc"); - public static BuildRuntime Go125Rc => new BuildRuntime("go-1.25-rc"); - public static BuildRuntime Go126Rc => new BuildRuntime("go-1.26-rc"); - public static BuildRuntime Static1Rc => new BuildRuntime("static-1-rc"); - public static BuildRuntime Flutter324Rc => new BuildRuntime("flutter-3.24-rc"); - public static BuildRuntime Flutter327Rc => new BuildRuntime("flutter-3.27-rc"); - public static BuildRuntime Flutter329Rc => new BuildRuntime("flutter-3.29-rc"); - public static BuildRuntime Flutter332Rc => new BuildRuntime("flutter-3.32-rc"); - public static BuildRuntime Flutter335Rc => new BuildRuntime("flutter-3.35-rc"); - public static BuildRuntime Flutter338Rc => new BuildRuntime("flutter-3.38-rc"); } } diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index 6941e08b..6c5f4f4d 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -97,91 +97,5 @@ public Runtime(string value) public static Runtime Flutter332 => new Runtime("flutter-3.32"); public static Runtime Flutter335 => new Runtime("flutter-3.35"); public static Runtime Flutter338 => new Runtime("flutter-3.38"); - public static Runtime Node145Rc => new Runtime("node-14.5-rc"); - public static Runtime Node160Rc => new Runtime("node-16.0-rc"); - public static Runtime Node180Rc => new Runtime("node-18.0-rc"); - public static Runtime Node190Rc => new Runtime("node-19.0-rc"); - public static Runtime Node200Rc => new Runtime("node-20.0-rc"); - public static Runtime Node210Rc => new Runtime("node-21.0-rc"); - public static Runtime Node22Rc => new Runtime("node-22-rc"); - public static Runtime Node23Rc => new Runtime("node-23-rc"); - public static Runtime Node24Rc => new Runtime("node-24-rc"); - public static Runtime Node25Rc => new Runtime("node-25-rc"); - public static Runtime Php80Rc => new Runtime("php-8.0-rc"); - public static Runtime Php81Rc => new Runtime("php-8.1-rc"); - public static Runtime Php82Rc => new Runtime("php-8.2-rc"); - public static Runtime Php83Rc => new Runtime("php-8.3-rc"); - public static Runtime Php84Rc => new Runtime("php-8.4-rc"); - public static Runtime Ruby30Rc => new Runtime("ruby-3.0-rc"); - public static Runtime Ruby31Rc => new Runtime("ruby-3.1-rc"); - public static Runtime Ruby32Rc => new Runtime("ruby-3.2-rc"); - public static Runtime Ruby33Rc => new Runtime("ruby-3.3-rc"); - public static Runtime Ruby34Rc => new Runtime("ruby-3.4-rc"); - public static Runtime Ruby40Rc => new Runtime("ruby-4.0-rc"); - public static Runtime Python38Rc => new Runtime("python-3.8-rc"); - public static Runtime Python39Rc => new Runtime("python-3.9-rc"); - public static Runtime Python310Rc => new Runtime("python-3.10-rc"); - public static Runtime Python311Rc => new Runtime("python-3.11-rc"); - public static Runtime Python312Rc => new Runtime("python-3.12-rc"); - public static Runtime Python313Rc => new Runtime("python-3.13-rc"); - public static Runtime Python314Rc => new Runtime("python-3.14-rc"); - public static Runtime PythonMl311Rc => new Runtime("python-ml-3.11-rc"); - public static Runtime PythonMl312Rc => new Runtime("python-ml-3.12-rc"); - public static Runtime PythonMl313Rc => new Runtime("python-ml-3.13-rc"); - public static Runtime Deno140Rc => new Runtime("deno-1.40-rc"); - public static Runtime Deno146Rc => new Runtime("deno-1.46-rc"); - public static Runtime Deno20Rc => new Runtime("deno-2.0-rc"); - public static Runtime Deno25Rc => new Runtime("deno-2.5-rc"); - public static Runtime Deno26Rc => new Runtime("deno-2.6-rc"); - public static Runtime Dart215Rc => new Runtime("dart-2.15-rc"); - public static Runtime Dart216Rc => new Runtime("dart-2.16-rc"); - public static Runtime Dart217Rc => new Runtime("dart-2.17-rc"); - public static Runtime Dart218Rc => new Runtime("dart-2.18-rc"); - public static Runtime Dart219Rc => new Runtime("dart-2.19-rc"); - public static Runtime Dart30Rc => new Runtime("dart-3.0-rc"); - public static Runtime Dart31Rc => new Runtime("dart-3.1-rc"); - public static Runtime Dart33Rc => new Runtime("dart-3.3-rc"); - public static Runtime Dart35Rc => new Runtime("dart-3.5-rc"); - public static Runtime Dart38Rc => new Runtime("dart-3.8-rc"); - public static Runtime Dart39Rc => new Runtime("dart-3.9-rc"); - public static Runtime Dart310Rc => new Runtime("dart-3.10-rc"); - public static Runtime Dotnet60Rc => new Runtime("dotnet-6.0-rc"); - public static Runtime Dotnet70Rc => new Runtime("dotnet-7.0-rc"); - public static Runtime Dotnet80Rc => new Runtime("dotnet-8.0-rc"); - public static Runtime Dotnet10Rc => new Runtime("dotnet-10-rc"); - public static Runtime Java80Rc => new Runtime("java-8.0-rc"); - public static Runtime Java110Rc => new Runtime("java-11.0-rc"); - public static Runtime Java170Rc => new Runtime("java-17.0-rc"); - public static Runtime Java180Rc => new Runtime("java-18.0-rc"); - public static Runtime Java210Rc => new Runtime("java-21.0-rc"); - public static Runtime Java22Rc => new Runtime("java-22-rc"); - public static Runtime Java25Rc => new Runtime("java-25-rc"); - public static Runtime Swift55Rc => new Runtime("swift-5.5-rc"); - public static Runtime Swift58Rc => new Runtime("swift-5.8-rc"); - public static Runtime Swift59Rc => new Runtime("swift-5.9-rc"); - public static Runtime Swift510Rc => new Runtime("swift-5.10-rc"); - public static Runtime Swift62Rc => new Runtime("swift-6.2-rc"); - public static Runtime Kotlin16Rc => new Runtime("kotlin-1.6-rc"); - public static Runtime Kotlin18Rc => new Runtime("kotlin-1.8-rc"); - public static Runtime Kotlin19Rc => new Runtime("kotlin-1.9-rc"); - public static Runtime Kotlin20Rc => new Runtime("kotlin-2.0-rc"); - public static Runtime Kotlin23Rc => new Runtime("kotlin-2.3-rc"); - public static Runtime Cpp17Rc => new Runtime("cpp-17-rc"); - public static Runtime Cpp20Rc => new Runtime("cpp-20-rc"); - public static Runtime Bun10Rc => new Runtime("bun-1.0-rc"); - public static Runtime Bun11Rc => new Runtime("bun-1.1-rc"); - public static Runtime Bun12Rc => new Runtime("bun-1.2-rc"); - public static Runtime Bun13Rc => new Runtime("bun-1.3-rc"); - public static Runtime Go123Rc => new Runtime("go-1.23-rc"); - public static Runtime Go124Rc => new Runtime("go-1.24-rc"); - public static Runtime Go125Rc => new Runtime("go-1.25-rc"); - public static Runtime Go126Rc => new Runtime("go-1.26-rc"); - public static Runtime Static1Rc => new Runtime("static-1-rc"); - public static Runtime Flutter324Rc => new Runtime("flutter-3.24-rc"); - public static Runtime Flutter327Rc => new Runtime("flutter-3.27-rc"); - public static Runtime Flutter329Rc => new Runtime("flutter-3.29-rc"); - public static Runtime Flutter332Rc => new Runtime("flutter-3.32-rc"); - public static Runtime Flutter335Rc => new Runtime("flutter-3.35-rc"); - public static Runtime Flutter338Rc => new Runtime("flutter-3.38-rc"); } } From 4e1f578fa8c38f955f93ad55e47c7e4f97907127 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:07:21 +0000 Subject: [PATCH 7/8] chore: update .NET SDK to 0.28.0 --- docs/examples/databases/upsert-documents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 72d7c8e2..8223f8ab 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -6,7 +6,7 @@ using Appwrite.Services; 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); From 618cff68595f34178472d7f3e02212a4141dc420 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:40:22 +0000 Subject: [PATCH 8/8] chore: update .NET SDK to 2.0.0 --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 ++-- CHANGELOG.md | 10 +++++++++- README.md | 6 +++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 924e7b01..581c122a 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.28.0 + 2.0.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 970fa21e..90cf4908 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.28.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/2.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.28.0"}, + { "x-sdk-version", "2.0.0"}, { "X-Appwrite-Response-Format", "1.9.0" } }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fccaa02..85687a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## 0.28.0 +## 2.0.0 * [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents * Breaking: Removed `IndexType`; replaced with `DatabasesIndexType`, `TablesDBIndexType` @@ -11,6 +11,14 @@ * Updated `Client` headers: `User-Agent` and `x-sdk-version` to 0.28.0 * Updated `X-Appwrite-Response-Format` to `1.9.0` +## 1.0.0 + +* Breaking: Sites.CreateDeployment signature changed; 'activate' moved after outputDirectory. +* Breaking: Relationship API path updated; old path deprecated. +* Added GetConsolePausing health check method. +* Added ttl parameter to ListDocuments and ListRows. +* Updated deployment example to show activate parameter placement. + ## 0.27.0 * Added broad new runtime options across multiple languages (Node 23, 24, 25; PHP 8.4; Ruby 3.4 and 4.0; Python 3.13 and 3.14; Python ML 3.13 and 3.14; Deno 2.5 and 2.6; Go 1.23–1.26; Bun 1.2 and 1.3; Java 25; Kotlin 2.3; Swift 6.2; and Dotnet 10). diff --git a/README.md b/README.md index 7fb10782..b813e0f4 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstracts and simpli Add this reference to your project's `.csproj` file: ```xml - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 0.28.0 +Install-Package Appwrite -Version 2.0.0 # or .NET CLI -dotnet add package Appwrite --version 0.28.0 +dotnet add package Appwrite --version 2.0.0 ```