From 33ef9a67deb33f26b7195f21e38bf3e47f4cd699 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 03:12:33 +1200 Subject: [PATCH 1/7] Add 1.8.x support --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 6 +- Appwrite/Enums/Type.cs | 17 + Appwrite/Models/ColumnBoolean.cs | 86 + Appwrite/Models/ColumnDatetime.cs | 93 + Appwrite/Models/ColumnEmail.cs | 93 + Appwrite/Models/ColumnEnum.cs | 100 + Appwrite/Models/ColumnFloat.cs | 100 + Appwrite/Models/ColumnIndex.cs | 93 + Appwrite/Models/ColumnIndexList.cs | 37 + Appwrite/Models/ColumnInteger.cs | 100 + Appwrite/Models/ColumnIp.cs | 93 + Appwrite/Models/ColumnList.cs | 37 + Appwrite/Models/ColumnRelationship.cs | 121 ++ Appwrite/Models/ColumnString.cs | 100 + Appwrite/Models/ColumnUrl.cs | 93 + Appwrite/Models/Database.cs | 13 +- Appwrite/Models/Index.cs | 45 +- Appwrite/Models/Row.cs | 81 + Appwrite/Models/RowList.cs | 41 + Appwrite/Models/Table.cs | 93 + Appwrite/Models/TableList.cs | 37 + Appwrite/Query.cs | 44 + Appwrite/Services/Account.cs | 2 + Appwrite/Services/Databases.cs | 78 +- Appwrite/Services/TablesDb.cs | 1759 +++++++++++++++++ README.md | 10 +- docs/examples/databases/create.md | 4 +- docs/examples/functions/create-execution.md | 2 +- .../tablesdb/create-boolean-column.md | 19 + .../tablesdb/create-datetime-column.md | 19 + docs/examples/tablesdb/create-email-column.md | 19 + docs/examples/tablesdb/create-enum-column.md | 20 + docs/examples/tablesdb/create-float-column.md | 21 + docs/examples/tablesdb/create-index.md | 21 + .../tablesdb/create-integer-column.md | 21 + docs/examples/tablesdb/create-ip-column.md | 19 + .../tablesdb/create-relationship-column.md | 22 + docs/examples/tablesdb/create-row.md | 18 + docs/examples/tablesdb/create-rows.md | 16 + .../examples/tablesdb/create-string-column.md | 21 + docs/examples/tablesdb/create-table.md | 19 + docs/examples/tablesdb/create-url-column.md | 19 + docs/examples/tablesdb/create.md | 18 + .../examples/tablesdb/decrement-row-column.md | 19 + docs/examples/tablesdb/delete-column.md | 16 + docs/examples/tablesdb/delete-index.md | 16 + docs/examples/tablesdb/delete-row.md | 16 + docs/examples/tablesdb/delete-rows.md | 16 + docs/examples/tablesdb/delete-table.md | 15 + docs/examples/tablesdb/delete.md | 14 + docs/examples/tablesdb/get-column.md | 16 + docs/examples/tablesdb/get-index.md | 16 + docs/examples/tablesdb/get-row.md | 17 + docs/examples/tablesdb/get-table.md | 15 + docs/examples/tablesdb/get.md | 14 + .../examples/tablesdb/increment-row-column.md | 19 + docs/examples/tablesdb/list-columns.md | 16 + docs/examples/tablesdb/list-indexes.md | 16 + docs/examples/tablesdb/list-rows.md | 16 + docs/examples/tablesdb/list-tables.md | 16 + docs/examples/tablesdb/list.md | 15 + .../tablesdb/update-boolean-column.md | 19 + .../tablesdb/update-datetime-column.md | 19 + docs/examples/tablesdb/update-email-column.md | 19 + docs/examples/tablesdb/update-enum-column.md | 20 + docs/examples/tablesdb/update-float-column.md | 21 + .../tablesdb/update-integer-column.md | 21 + docs/examples/tablesdb/update-ip-column.md | 19 + .../tablesdb/update-relationship-column.md | 19 + docs/examples/tablesdb/update-row.md | 18 + docs/examples/tablesdb/update-rows.md | 17 + .../examples/tablesdb/update-string-column.md | 20 + docs/examples/tablesdb/update-table.md | 19 + docs/examples/tablesdb/update-url-column.md | 19 + docs/examples/tablesdb/update.md | 16 + docs/examples/tablesdb/upsert-row.md | 18 + docs/examples/tablesdb/upsert-rows.md | 16 + 78 files changed, 4203 insertions(+), 57 deletions(-) create mode 100644 Appwrite/Enums/Type.cs create mode 100644 Appwrite/Models/ColumnBoolean.cs create mode 100644 Appwrite/Models/ColumnDatetime.cs create mode 100644 Appwrite/Models/ColumnEmail.cs create mode 100644 Appwrite/Models/ColumnEnum.cs create mode 100644 Appwrite/Models/ColumnFloat.cs create mode 100644 Appwrite/Models/ColumnIndex.cs create mode 100644 Appwrite/Models/ColumnIndexList.cs create mode 100644 Appwrite/Models/ColumnInteger.cs create mode 100644 Appwrite/Models/ColumnIp.cs create mode 100644 Appwrite/Models/ColumnList.cs create mode 100644 Appwrite/Models/ColumnRelationship.cs create mode 100644 Appwrite/Models/ColumnString.cs create mode 100644 Appwrite/Models/ColumnUrl.cs create mode 100644 Appwrite/Models/Row.cs create mode 100644 Appwrite/Models/RowList.cs create mode 100644 Appwrite/Models/Table.cs create mode 100644 Appwrite/Models/TableList.cs create mode 100644 Appwrite/Services/TablesDb.cs create mode 100644 docs/examples/tablesdb/create-boolean-column.md create mode 100644 docs/examples/tablesdb/create-datetime-column.md create mode 100644 docs/examples/tablesdb/create-email-column.md create mode 100644 docs/examples/tablesdb/create-enum-column.md create mode 100644 docs/examples/tablesdb/create-float-column.md create mode 100644 docs/examples/tablesdb/create-index.md create mode 100644 docs/examples/tablesdb/create-integer-column.md create mode 100644 docs/examples/tablesdb/create-ip-column.md create mode 100644 docs/examples/tablesdb/create-relationship-column.md create mode 100644 docs/examples/tablesdb/create-row.md create mode 100644 docs/examples/tablesdb/create-rows.md create mode 100644 docs/examples/tablesdb/create-string-column.md create mode 100644 docs/examples/tablesdb/create-table.md create mode 100644 docs/examples/tablesdb/create-url-column.md create mode 100644 docs/examples/tablesdb/create.md create mode 100644 docs/examples/tablesdb/decrement-row-column.md create mode 100644 docs/examples/tablesdb/delete-column.md create mode 100644 docs/examples/tablesdb/delete-index.md create mode 100644 docs/examples/tablesdb/delete-row.md create mode 100644 docs/examples/tablesdb/delete-rows.md create mode 100644 docs/examples/tablesdb/delete-table.md create mode 100644 docs/examples/tablesdb/delete.md create mode 100644 docs/examples/tablesdb/get-column.md create mode 100644 docs/examples/tablesdb/get-index.md create mode 100644 docs/examples/tablesdb/get-row.md create mode 100644 docs/examples/tablesdb/get-table.md create mode 100644 docs/examples/tablesdb/get.md create mode 100644 docs/examples/tablesdb/increment-row-column.md create mode 100644 docs/examples/tablesdb/list-columns.md create mode 100644 docs/examples/tablesdb/list-indexes.md create mode 100644 docs/examples/tablesdb/list-rows.md create mode 100644 docs/examples/tablesdb/list-tables.md create mode 100644 docs/examples/tablesdb/list.md create mode 100644 docs/examples/tablesdb/update-boolean-column.md create mode 100644 docs/examples/tablesdb/update-datetime-column.md create mode 100644 docs/examples/tablesdb/update-email-column.md create mode 100644 docs/examples/tablesdb/update-enum-column.md create mode 100644 docs/examples/tablesdb/update-float-column.md create mode 100644 docs/examples/tablesdb/update-integer-column.md create mode 100644 docs/examples/tablesdb/update-ip-column.md create mode 100644 docs/examples/tablesdb/update-relationship-column.md create mode 100644 docs/examples/tablesdb/update-row.md create mode 100644 docs/examples/tablesdb/update-rows.md create mode 100644 docs/examples/tablesdb/update-string-column.md create mode 100644 docs/examples/tablesdb/update-table.md create mode 100644 docs/examples/tablesdb/update-url-column.md create mode 100644 docs/examples/tablesdb/update.md create mode 100644 docs/examples/tablesdb/upsert-row.md create mode 100644 docs/examples/tablesdb/upsert-rows.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index e4f78ec5..2d5e714f 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.15.0 + 0.16.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 902dfec5..82cef553 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/0.15.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.16.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.15.0"}, - { "X-Appwrite-Response-Format", "1.7.0" } + { "x-sdk-version", "0.16.0"}, + { "X-Appwrite-Response-Format", "1.8.0" } }; _config = new Dictionary(); diff --git a/Appwrite/Enums/Type.cs b/Appwrite/Enums/Type.cs new file mode 100644 index 00000000..a9e6d544 --- /dev/null +++ b/Appwrite/Enums/Type.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class Type : IEnum + { + public string Value { get; private set; } + + public Type(string value) + { + Value = value; + } + + public static Type Tablesdb => new Type("tablesdb"); + public static Type Legacy => new Type("legacy"); + } +} diff --git a/Appwrite/Models/ColumnBoolean.cs b/Appwrite/Models/ColumnBoolean.cs new file mode 100644 index 00000000..485e4a2c --- /dev/null +++ b/Appwrite/Models/ColumnBoolean.cs @@ -0,0 +1,86 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnBoolean + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("default")] + public bool? Default { get; private set; } + + public ColumnBoolean( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + bool? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static ColumnBoolean From(Dictionary map) => new ColumnBoolean( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + xdefault: (bool?)map["default"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnDatetime.cs b/Appwrite/Models/ColumnDatetime.cs new file mode 100644 index 00000000..5116f1fa --- /dev/null +++ b/Appwrite/Models/ColumnDatetime.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnDatetime + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("format")] + public string Format { get; private set; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + public ColumnDatetime( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + string format, + string? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Format = format; + Default = xdefault; + } + + public static ColumnDatetime From(Dictionary map) => new ColumnDatetime( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + format: map["format"].ToString(), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "format", Format }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnEmail.cs b/Appwrite/Models/ColumnEmail.cs new file mode 100644 index 00000000..1bb41450 --- /dev/null +++ b/Appwrite/Models/ColumnEmail.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnEmail + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("format")] + public string Format { get; private set; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + public ColumnEmail( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + string format, + string? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Format = format; + Default = xdefault; + } + + public static ColumnEmail From(Dictionary map) => new ColumnEmail( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + format: map["format"].ToString(), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "format", Format }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnEnum.cs b/Appwrite/Models/ColumnEnum.cs new file mode 100644 index 00000000..beb6ac85 --- /dev/null +++ b/Appwrite/Models/ColumnEnum.cs @@ -0,0 +1,100 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnEnum + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("elements")] + public List Elements { get; private set; } + + [JsonPropertyName("format")] + public string Format { get; private set; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + public ColumnEnum( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + List elements, + string format, + string? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Elements = elements; + Format = format; + Default = xdefault; + } + + public static ColumnEnum From(Dictionary map) => new ColumnEnum( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + elements: map["elements"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["elements"], + format: map["format"].ToString(), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "elements", Elements }, + { "format", Format }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnFloat.cs b/Appwrite/Models/ColumnFloat.cs new file mode 100644 index 00000000..595134c9 --- /dev/null +++ b/Appwrite/Models/ColumnFloat.cs @@ -0,0 +1,100 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnFloat + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("min")] + public double? Min { get; private set; } + + [JsonPropertyName("max")] + public double? Max { get; private set; } + + [JsonPropertyName("default")] + public double? Default { get; private set; } + + public ColumnFloat( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + double? min, + double? max, + double? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Min = min; + Max = max; + Default = xdefault; + } + + public static ColumnFloat From(Dictionary map) => new ColumnFloat( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + min: map["min"] == null ? null :Convert.ToDouble(map["min"]), + max: map["max"] == null ? null :Convert.ToDouble(map["max"]), + xdefault: map["default"] == null ? null :Convert.ToDouble(map["default"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "min", Min }, + { "max", Max }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnIndex.cs b/Appwrite/Models/ColumnIndex.cs new file mode 100644 index 00000000..ac2e683e --- /dev/null +++ b/Appwrite/Models/ColumnIndex.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnIndex + { + [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("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("columns")] + public List Columns { get; private set; } + + [JsonPropertyName("lengths")] + public List Lengths { get; private set; } + + [JsonPropertyName("orders")] + public List? Orders { get; private set; } + + public ColumnIndex( + string id, + string createdAt, + string updatedAt, + string key, + string type, + string status, + string error, + List columns, + List lengths, + List? orders + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Key = key; + Type = type; + Status = status; + Error = error; + Columns = columns; + Lengths = lengths; + Orders = orders; + } + + public static ColumnIndex From(Dictionary map) => new ColumnIndex( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + columns: map["columns"] is JsonElement jsonArrayProp8 ? jsonArrayProp8.Deserialize>()! : (List)map["columns"], + lengths: map["lengths"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["lengths"], + orders: map["orders"] is JsonElement jsonArrayProp10 ? jsonArrayProp10.Deserialize>()! : (List)map["orders"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "columns", Columns }, + { "lengths", Lengths }, + { "orders", Orders } + }; + } +} diff --git a/Appwrite/Models/ColumnIndexList.cs b/Appwrite/Models/ColumnIndexList.cs new file mode 100644 index 00000000..d1de7587 --- /dev/null +++ b/Appwrite/Models/ColumnIndexList.cs @@ -0,0 +1,37 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnIndexList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("indexes")] + public List Indexes { get; private set; } + + public ColumnIndexList( + long total, + List indexes + ) { + Total = total; + Indexes = indexes; + } + + public static ColumnIndexList From(Dictionary map) => new ColumnIndexList( + total: Convert.ToInt64(map["total"]), + indexes: map["indexes"] is JsonElement jsonArray2 ? jsonArray2.Deserialize>>()!.Select(it => ColumnIndex.From(map: it)).ToList() : ((IEnumerable>)map["indexes"]).Select(it => ColumnIndex.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "indexes", Indexes.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/ColumnInteger.cs b/Appwrite/Models/ColumnInteger.cs new file mode 100644 index 00000000..1637e11c --- /dev/null +++ b/Appwrite/Models/ColumnInteger.cs @@ -0,0 +1,100 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnInteger + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("min")] + public long? Min { get; private set; } + + [JsonPropertyName("max")] + public long? Max { get; private set; } + + [JsonPropertyName("default")] + public long? Default { get; private set; } + + public ColumnInteger( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + long? min, + long? max, + long? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Min = min; + Max = max; + Default = xdefault; + } + + public static ColumnInteger From(Dictionary map) => new ColumnInteger( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + min: map["min"] == null ? null :Convert.ToInt64(map["min"]), + max: map["max"] == null ? null :Convert.ToInt64(map["max"]), + xdefault: map["default"] == null ? null :Convert.ToInt64(map["default"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "min", Min }, + { "max", Max }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnIp.cs b/Appwrite/Models/ColumnIp.cs new file mode 100644 index 00000000..31ae3340 --- /dev/null +++ b/Appwrite/Models/ColumnIp.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnIp + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("format")] + public string Format { get; private set; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + public ColumnIp( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + string format, + string? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Format = format; + Default = xdefault; + } + + public static ColumnIp From(Dictionary map) => new ColumnIp( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + format: map["format"].ToString(), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "format", Format }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnList.cs b/Appwrite/Models/ColumnList.cs new file mode 100644 index 00000000..f98fcd03 --- /dev/null +++ b/Appwrite/Models/ColumnList.cs @@ -0,0 +1,37 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("columns")] + public List Columns { get; private set; } + + public ColumnList( + long total, + List columns + ) { + Total = total; + Columns = columns; + } + + public static ColumnList From(Dictionary map) => new ColumnList( + total: Convert.ToInt64(map["total"]), + columns: map["columns"] is JsonElement jsonArrayProp2 ? jsonArrayProp2.Deserialize>()! : (List)map["columns"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "columns", Columns } + }; + } +} diff --git a/Appwrite/Models/ColumnRelationship.cs b/Appwrite/Models/ColumnRelationship.cs new file mode 100644 index 00000000..7748dea3 --- /dev/null +++ b/Appwrite/Models/ColumnRelationship.cs @@ -0,0 +1,121 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnRelationship + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("relatedTable")] + public string RelatedTable { get; private set; } + + [JsonPropertyName("relationType")] + public string RelationType { get; private set; } + + [JsonPropertyName("twoWay")] + public bool TwoWay { get; private set; } + + [JsonPropertyName("twoWayKey")] + public string TwoWayKey { get; private set; } + + [JsonPropertyName("onDelete")] + public string OnDelete { get; private set; } + + [JsonPropertyName("side")] + public string Side { get; private set; } + + public ColumnRelationship( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + string relatedTable, + string relationType, + bool twoWay, + string twoWayKey, + string onDelete, + string side + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + RelatedTable = relatedTable; + RelationType = relationType; + TwoWay = twoWay; + TwoWayKey = twoWayKey; + OnDelete = onDelete; + Side = side; + } + + public static ColumnRelationship From(Dictionary map) => new ColumnRelationship( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + relatedTable: map["relatedTable"].ToString(), + relationType: map["relationType"].ToString(), + twoWay: (bool)map["twoWay"], + twoWayKey: map["twoWayKey"].ToString(), + onDelete: map["onDelete"].ToString(), + side: map["side"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "relatedTable", RelatedTable }, + { "relationType", RelationType }, + { "twoWay", TwoWay }, + { "twoWayKey", TwoWayKey }, + { "onDelete", OnDelete }, + { "side", Side } + }; + } +} diff --git a/Appwrite/Models/ColumnString.cs b/Appwrite/Models/ColumnString.cs new file mode 100644 index 00000000..cc6dfbe1 --- /dev/null +++ b/Appwrite/Models/ColumnString.cs @@ -0,0 +1,100 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnString + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + [JsonPropertyName("encrypt")] + public bool? Encrypt { get; private set; } + + public ColumnString( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + long size, + string? xdefault, + bool? encrypt + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Size = size; + Default = xdefault; + Encrypt = encrypt; + } + + public static ColumnString From(Dictionary map) => new ColumnString( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: 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"]), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null, + encrypt: (bool?)map["encrypt"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "size", Size }, + { "default", Default }, + { "encrypt", Encrypt } + }; + } +} diff --git a/Appwrite/Models/ColumnUrl.cs b/Appwrite/Models/ColumnUrl.cs new file mode 100644 index 00000000..14d1aabf --- /dev/null +++ b/Appwrite/Models/ColumnUrl.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class ColumnUrl + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string 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("format")] + public string Format { get; private set; } + + [JsonPropertyName("default")] + public string? Default { get; private set; } + + public ColumnUrl( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + string format, + string? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Format = format; + Default = xdefault; + } + + public static ColumnUrl From(Dictionary map) => new ColumnUrl( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + error: map["error"].ToString(), + required: (bool)map["required"], + array: (bool?)map["array"], + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + format: map["format"].ToString(), + xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "format", Format }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 22b16b55..d2f23f22 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -24,18 +24,23 @@ public class Database [JsonPropertyName("enabled")] public bool Enabled { get; private set; } + [JsonPropertyName("type")] + public string Type { get; private set; } + public Database( string id, string name, string createdAt, string updatedAt, - bool enabled + bool enabled, + string type ) { Id = id; Name = name; CreatedAt = createdAt; UpdatedAt = updatedAt; Enabled = enabled; + Type = type; } public static Database From(Dictionary map) => new Database( @@ -43,7 +48,8 @@ bool enabled name: map["name"].ToString(), createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - enabled: (bool)map["enabled"] + enabled: (bool)map["enabled"], + type: map["type"].ToString() ); public Dictionary ToMap() => new Dictionary() @@ -52,7 +58,8 @@ bool enabled { "name", Name }, { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, - { "enabled", Enabled } + { "enabled", Enabled }, + { "type", Type } }; } } diff --git a/Appwrite/Models/Index.cs b/Appwrite/Models/Index.cs index ed5e9ae6..e481210a 100644 --- a/Appwrite/Models/Index.cs +++ b/Appwrite/Models/Index.cs @@ -9,6 +9,15 @@ namespace Appwrite.Models { public class Index { + [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("key")] public string Key { get; private set; } @@ -30,23 +39,21 @@ public class Index [JsonPropertyName("orders")] public List? Orders { get; private set; } - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - public Index( + string id, + string createdAt, + string updatedAt, string key, string type, string status, string error, List attributes, List lengths, - List? orders, - string createdAt, - string updatedAt + List? orders ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; Key = key; Type = type; Status = status; @@ -54,33 +61,33 @@ string updatedAt Attributes = attributes; Lengths = lengths; Orders = orders; - CreatedAt = createdAt; - UpdatedAt = updatedAt; } public static Index From(Dictionary map) => new Index( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), key: map["key"].ToString(), type: map["type"].ToString(), status: map["status"].ToString(), error: map["error"].ToString(), - attributes: map["attributes"] is JsonElement jsonArrayProp5 ? jsonArrayProp5.Deserialize>()! : (List)map["attributes"], - lengths: map["lengths"] is JsonElement jsonArrayProp6 ? jsonArrayProp6.Deserialize>()! : (List)map["lengths"], - orders: map["orders"] is JsonElement jsonArrayProp7 ? jsonArrayProp7.Deserialize>()! : (List)map["orders"], - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString() + attributes: map["attributes"] is JsonElement jsonArrayProp8 ? jsonArrayProp8.Deserialize>()! : (List)map["attributes"], + lengths: map["lengths"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["lengths"], + orders: map["orders"] is JsonElement jsonArrayProp10 ? jsonArrayProp10.Deserialize>()! : (List)map["orders"] ); public Dictionary ToMap() => new Dictionary() { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, { "key", Key }, { "type", Type }, { "status", Status }, { "error", Error }, { "attributes", Attributes }, { "lengths", Lengths }, - { "orders", Orders }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt } + { "orders", Orders } }; } } diff --git a/Appwrite/Models/Row.cs b/Appwrite/Models/Row.cs new file mode 100644 index 00000000..4477c6b0 --- /dev/null +++ b/Appwrite/Models/Row.cs @@ -0,0 +1,81 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class Row + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$sequence")] + public long Sequence { get; private set; } + + [JsonPropertyName("$tableId")] + public string TableId { get; private set; } + + [JsonPropertyName("$databaseId")] + public string DatabaseId { 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; } + + public Dictionary Data { get; private set; } + + public Row( + string id, + long sequence, + string tableId, + string databaseId, + string createdAt, + string updatedAt, + List permissions, + Dictionary data + ) { + Id = id; + Sequence = sequence; + TableId = tableId; + DatabaseId = databaseId; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Permissions = permissions; + Data = data; + } + + public static Row From(Dictionary map) => new Row( + id: map["$id"].ToString(), + sequence: Convert.ToInt64(map["$sequence"]), + tableId: map["$tableId"].ToString(), + databaseId: map["$databaseId"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + permissions: map["$permissions"] is JsonElement jsonArrayProp7 ? jsonArrayProp7.Deserialize>()! : (List)map["$permissions"], + data: map + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$sequence", Sequence }, + { "$tableId", TableId }, + { "$databaseId", DatabaseId }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "$permissions", Permissions }, + { "data", Data } + }; + + public T ConvertTo(Func, T> fromJson) => + fromJson.Invoke(Data); + } +} diff --git a/Appwrite/Models/RowList.cs b/Appwrite/Models/RowList.cs new file mode 100644 index 00000000..0362db52 --- /dev/null +++ b/Appwrite/Models/RowList.cs @@ -0,0 +1,41 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class RowList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("rows")] + public List Rows { get; private set; } + + public RowList( + long total, + List rows + ) { + Total = total; + Rows = rows; + } + + public static RowList From(Dictionary map) => new RowList( + total: Convert.ToInt64(map["total"]), + rows: map["rows"] is JsonElement jsonArray2 ? jsonArray2.Deserialize>>()!.Select(it => Row.From(map: it)).ToList() : ((IEnumerable>)map["rows"]).Select(it => Row.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "rows", Rows.Select(it => it.ToMap()) } + }; + + public T ConvertTo(Func, T> fromJson) => + (T)Rows.Select(it => it.ConvertTo(fromJson)); + + } +} diff --git a/Appwrite/Models/Table.cs b/Appwrite/Models/Table.cs new file mode 100644 index 00000000..b290163f --- /dev/null +++ b/Appwrite/Models/Table.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class Table + { + [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("rowSecurity")] + public bool RowSecurity { get; private set; } + + [JsonPropertyName("columns")] + public List Columns { get; private set; } + + [JsonPropertyName("indexes")] + public List Indexes { get; private set; } + + public Table( + string id, + string createdAt, + string updatedAt, + List permissions, + string databaseId, + string name, + bool enabled, + bool rowSecurity, + List columns, + List indexes + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Permissions = permissions; + DatabaseId = databaseId; + Name = name; + Enabled = enabled; + RowSecurity = rowSecurity; + Columns = columns; + Indexes = indexes; + } + + public static Table From(Dictionary map) => new Table( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + permissions: map["$permissions"] is JsonElement jsonArrayProp4 ? jsonArrayProp4.Deserialize>()! : (List)map["$permissions"], + databaseId: map["databaseId"].ToString(), + name: map["name"].ToString(), + enabled: (bool)map["enabled"], + rowSecurity: (bool)map["rowSecurity"], + columns: map["columns"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["columns"], + indexes: map["indexes"] is JsonElement jsonArray10 ? jsonArray10.Deserialize>>()!.Select(it => ColumnIndex.From(map: it)).ToList() : ((IEnumerable>)map["indexes"]).Select(it => ColumnIndex.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "$permissions", Permissions }, + { "databaseId", DatabaseId }, + { "name", Name }, + { "enabled", Enabled }, + { "rowSecurity", RowSecurity }, + { "columns", Columns }, + { "indexes", Indexes.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/TableList.cs b/Appwrite/Models/TableList.cs new file mode 100644 index 00000000..68d7cf3c --- /dev/null +++ b/Appwrite/Models/TableList.cs @@ -0,0 +1,37 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Appwrite.Models +{ + public class TableList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("tables")] + public List Tables { get; private set; } + + public TableList( + long total, + List
tables + ) { + Total = total; + Tables = tables; + } + + public static TableList From(Dictionary map) => new TableList( + total: Convert.ToInt64(map["total"]), + tables: map["tables"] is JsonElement jsonArray2 ? jsonArray2.Deserialize>>()!.Select(it => Table.From(map: it)).ToList() : ((IEnumerable>)map["tables"]).Select(it => Table.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "tables", Tables.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index 7d2cdf2e..bc8bef98 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -150,6 +150,50 @@ public static string Contains(string attribute, object value) { return new Query("contains", attribute, value).ToString(); } + public static string NotContains(string attribute, object value) { + return new Query("notContains", attribute, value).ToString(); + } + + public static string NotSearch(string attribute, string value) { + return new Query("notSearch", attribute, value).ToString(); + } + + public static string NotBetween(string attribute, string start, string end) { + return new Query("notBetween", attribute, new List { start, end }).ToString(); + } + + public static string NotBetween(string attribute, int start, int end) { + return new Query("notBetween", attribute, new List { start, end }).ToString(); + } + + public static string NotBetween(string attribute, double start, double end) { + return new Query("notBetween", attribute, new List { start, end }).ToString(); + } + + public static string NotStartsWith(string attribute, string value) { + return new Query("notStartsWith", attribute, value).ToString(); + } + + public static string NotEndsWith(string attribute, string value) { + return new Query("notEndsWith", attribute, value).ToString(); + } + + public static string CreatedBefore(string value) { + return new Query("createdBefore", null, value).ToString(); + } + + public static string CreatedAfter(string value) { + return new Query("createdAfter", null, value).ToString(); + } + + public static string UpdatedBefore(string value) { + return new Query("updatedBefore", null, value).ToString(); + } + + public static string UpdatedAfter(string value) { + return new Query("updatedAfter", null, value).ToString(); + } + public static string Or(List queries) { return new Query("or", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 41cc6433..d0fc6f0e 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -950,6 +950,7 @@ static Models.Session Convert(Dictionary it) => /// flows initiated by token creation. For example, magic URL and phone login. /// /// + [Obsolete("This API has been deprecated.")] public Task UpdateMagicURLSession(string userId, string secret) { var apiPath = "/account/sessions/magic-url"; @@ -984,6 +985,7 @@ static Models.Session Convert(Dictionary it) => /// flows initiated by token creation. For example, magic URL and phone login. /// /// + [Obsolete("This API has been deprecated.")] public Task UpdatePhoneSession(string userId, string secret) { var apiPath = "/account/sessions/phone"; diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 0c203fbb..408752d1 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -19,6 +19,7 @@ public Databases(Client client) : base(client) /// the search parameter to filter your results. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.list` instead.")] public Task List(List? queries = null, string? search = null) { var apiPath = "/databases"; @@ -51,7 +52,8 @@ static Models.DatabaseList Convert(Dictionary it) => /// /// /// - public Task Create(string databaseId, string name, bool? enabled = null) + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead.")] + public Task Create(string databaseId, string name, bool? enabled = null, Appwrite.Enums.Type? type = null) { var apiPath = "/databases"; @@ -59,7 +61,8 @@ static Models.DatabaseList Convert(Dictionary it) => { { "databaseId", databaseId }, { "name", name }, - { "enabled", enabled } + { "enabled", enabled }, + { "type", type?.Value } }; var apiHeaders = new Dictionary() @@ -85,6 +88,7 @@ static Models.Database Convert(Dictionary it) => /// object with the database metadata. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.get` instead.")] public Task Get(string databaseId) { var apiPath = "/databases/{databaseId}" @@ -115,6 +119,7 @@ static Models.Database Convert(Dictionary it) => /// Update a database by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.update` instead.")] public Task Update(string databaseId, string name, bool? enabled = null) { var apiPath = "/databases/{databaseId}" @@ -149,6 +154,7 @@ static Models.Database Convert(Dictionary it) => /// scope can delete a database. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.delete` instead.")] public Task Delete(string databaseId) { var apiPath = "/databases/{databaseId}" @@ -178,6 +184,7 @@ public Task Delete(string databaseId) /// can use the search parameter to filter your results. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listTables` instead.")] public Task ListCollections(string databaseId, List? queries = null, string? search = null) { var apiPath = "/databases/{databaseId}/collections" @@ -213,6 +220,7 @@ static Models.CollectionList Convert(Dictionary it) => /// API or directly from your database console. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createTable` instead.")] public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { var apiPath = "/databases/{databaseId}/collections" @@ -250,6 +258,7 @@ static Models.Collection Convert(Dictionary it) => /// object with the collection metadata. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getTable` instead.")] public Task GetCollection(string databaseId, string collectionId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -281,6 +290,7 @@ static Models.Collection Convert(Dictionary it) => /// Update a collection by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateTable` instead.")] public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -318,6 +328,7 @@ static Models.Collection Convert(Dictionary it) => /// have access to delete this resource. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteTable` instead.")] public Task DeleteCollection(string databaseId, string collectionId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -347,6 +358,7 @@ public Task DeleteCollection(string databaseId, string collectionId) /// List attributes in the collection. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listColumns` instead.")] public Task ListAttributes(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes" @@ -380,6 +392,7 @@ static Models.AttributeList Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createBooleanColumn` instead.")] public Task CreateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean" @@ -417,6 +430,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => /// already existing documents. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateBooleanColumn` instead.")] public Task UpdateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}" @@ -453,6 +467,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => /// Create a date time attribute according to the ISO 8601 standard. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createDatetimeColumn` instead.")] public Task CreateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime" @@ -490,6 +505,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => /// already existing documents. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateDatetimeColumn` instead.")] public Task UpdateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}" @@ -527,6 +543,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createEmailColumn` instead.")] public Task CreateEmailAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email" @@ -565,6 +582,7 @@ static Models.AttributeEmail Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateEmailColumn` instead.")] public Task UpdateEmailAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}" @@ -598,11 +616,12 @@ static Models.AttributeEmail Convert(Dictionary it) => } /// - /// Create an enumeration attribute. The `elements` param acts as a white-list - /// of accepted values for this attribute. + /// Create an enum attribute. The `elements` param acts as a white-list of + /// accepted values for this attribute. /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createEnumColumn` instead.")] public Task CreateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum" @@ -642,6 +661,7 @@ static Models.AttributeEnum Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateEnumColumn` instead.")] public Task UpdateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}" @@ -681,6 +701,7 @@ static Models.AttributeEnum Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createFloatColumn` instead.")] public Task CreateFloatAttribute(string databaseId, string collectionId, string key, bool required, double? min = null, double? max = null, double? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float" @@ -721,6 +742,7 @@ static Models.AttributeFloat Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateFloatColumn` instead.")] public Task UpdateFloatAttribute(string databaseId, string collectionId, string key, bool required, double xdefault, double? min = null, double? max = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}" @@ -761,6 +783,7 @@ static Models.AttributeFloat Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createIntegerColumn` instead.")] public Task CreateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long? min = null, long? max = null, long? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer" @@ -801,6 +824,7 @@ static Models.AttributeInteger Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateIntegerColumn` instead.")] public Task UpdateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long xdefault, long? min = null, long? max = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}" @@ -840,6 +864,7 @@ static Models.AttributeInteger Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createIpColumn` instead.")] public Task CreateIpAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip" @@ -878,6 +903,7 @@ static Models.AttributeIp Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateIpColumn` instead.")] public Task UpdateIpAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}" @@ -916,6 +942,7 @@ static Models.AttributeIp Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRelationshipColumn` instead.")] public Task CreateRelationshipAttribute(string databaseId, string collectionId, string relatedCollectionId, Appwrite.Enums.RelationshipType type, bool? twoWay = null, string? key = null, string? twoWayKey = null, Appwrite.Enums.RelationMutate? onDelete = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship" @@ -955,6 +982,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createStringColumn` instead.")] public Task CreateStringAttribute(string databaseId, string collectionId, string key, long size, bool required, string? xdefault = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string" @@ -995,6 +1023,7 @@ static Models.AttributeString Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateStringColumn` instead.")] public Task UpdateStringAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, long? size = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}" @@ -1033,6 +1062,7 @@ static Models.AttributeString Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createUrlColumn` instead.")] public Task CreateUrlAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url" @@ -1071,6 +1101,7 @@ static Models.AttributeUrl Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateUrlColumn` instead.")] public Task UpdateUrlAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}" @@ -1107,6 +1138,7 @@ static Models.AttributeUrl Convert(Dictionary it) => /// Get attribute by ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getColumn` instead.")] public Task GetAttribute(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" @@ -1136,6 +1168,7 @@ public Task GetAttribute(string databaseId, string collectionId, string /// Deletes an attribute. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteColumn` instead.")] public Task DeleteAttribute(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" @@ -1168,6 +1201,7 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRelationshipColumn` instead.")] public Task UpdateRelationshipAttribute(string databaseId, string collectionId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship" @@ -1204,6 +1238,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => /// the query params to filter your results. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listRows` instead.")] public Task ListDocuments(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1239,6 +1274,7 @@ static Models.DocumentList Convert(Dictionary it) => /// API or directly from your database console. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRow` instead.")] public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1271,16 +1307,13 @@ static Models.Document Convert(Dictionary it) => } /// - /// **WARNING: Experimental Feature** - This endpoint is experimental and not - /// yet officially supported. It may be subject to breaking changes or removal - /// in future versions. - /// /// 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#databasesCreateCollection) /// API or directly from your database console. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRows` instead.")] public Task CreateDocuments(string databaseId, string collectionId, List documents) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1311,10 +1344,6 @@ static Models.DocumentList Convert(Dictionary it) => } /// - /// **WARNING: Experimental Feature** - This endpoint is experimental and not - /// yet officially supported. It may be subject to breaking changes or removal - /// in future versions. - /// /// 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#databasesCreateCollection) @@ -1322,6 +1351,7 @@ static Models.DocumentList Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRows` instead.")] public Task UpsertDocuments(string databaseId, string collectionId, List documents) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1352,15 +1382,12 @@ static Models.DocumentList Convert(Dictionary it) => } /// - /// **WARNING: Experimental Feature** - This endpoint is experimental and not - /// yet officially supported. It may be subject to breaking changes or removal - /// in future versions. - /// /// 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. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRows` instead.")] public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1392,14 +1419,11 @@ static Models.DocumentList Convert(Dictionary it) => } /// - /// **WARNING: Experimental Feature** - This endpoint is experimental and not - /// yet officially supported. It may be subject to breaking changes or removal - /// in future versions. - /// /// Bulk delete documents using queries, if no queries are passed then all /// documents are deleted. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRows` instead.")] public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1434,6 +1458,7 @@ static Models.DocumentList Convert(Dictionary it) => /// object with the document data. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getRow` instead.")] public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1464,16 +1489,13 @@ static Models.Document Convert(Dictionary it) => } /// - /// **WARNING: Experimental Feature** - This endpoint is experimental and not - /// yet officially supported. It may be subject to breaking changes or removal - /// in future versions. - /// /// 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#databasesCreateCollection) /// API or directly from your database console. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRow` instead.")] public Task UpsertDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1510,6 +1532,7 @@ static Models.Document Convert(Dictionary it) => /// only specific fields that will get updated. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRow` instead.")] public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1545,6 +1568,7 @@ static Models.Document Convert(Dictionary it) => /// Delete a document by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRow` instead.")] public Task DeleteDocument(string databaseId, string collectionId, string documentId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1575,6 +1599,7 @@ public Task DeleteDocument(string databaseId, string collectionId, strin /// Decrement a specific attribute of a document by a given value. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.decrementRowColumn` instead.")] public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? min = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" @@ -1611,6 +1636,7 @@ static Models.Document Convert(Dictionary it) => /// Increment a specific attribute of a document by a given value. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.incrementRowColumn` instead.")] public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? max = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" @@ -1647,6 +1673,7 @@ static Models.Document Convert(Dictionary it) => /// List indexes in the collection. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listIndexes` instead.")] public Task ListIndexes(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" @@ -1681,6 +1708,7 @@ static Models.IndexList Convert(Dictionary it) => /// Attributes can be `key`, `fulltext`, and `unique`. /// /// + [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) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" @@ -1718,6 +1746,7 @@ static Models.Index Convert(Dictionary it) => /// Get index by ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getIndex` instead.")] public Task GetIndex(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" @@ -1750,6 +1779,7 @@ static Models.Index Convert(Dictionary it) => /// Delete an index. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteIndex` instead.")] public Task DeleteIndex(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs new file mode 100644 index 00000000..fa9f0f7e --- /dev/null +++ b/Appwrite/Services/TablesDb.cs @@ -0,0 +1,1759 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class TablesDb : Service + { + public TablesDb(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) + { + var apiPath = "/tablesdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search } + }; + + 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, Appwrite.Enums.Type? type = null) + { + var apiPath = "/tablesdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled }, + { "type", type?.Value } + }; + + 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); + + } + + /// + /// 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 = "/tablesdb/{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 = "/tablesdb/{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 = "/tablesdb/{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 tables that belong to the provided databaseId. You can + /// use the search parameter to filter your results. + /// + /// + public Task ListTables(string databaseId, List? queries = null, string? search = null) + { + var apiPath = "/tablesdb/{databaseId}/tables" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.TableList Convert(Dictionary it) => + Models.TableList.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 Table. Before using this route, you should create a new + /// database resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// API or directly from your database console. + /// + /// + public Task CreateTable(string databaseId, string tableId, string name, List? permissions = null, bool? rowSecurity = null, bool? enabled = null) + { + var apiPath = "/tablesdb/{databaseId}/tables" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "tableId", tableId }, + { "name", name }, + { "permissions", permissions }, + { "rowSecurity", rowSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Table Convert(Dictionary it) => + Models.Table.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 table by its unique ID. This endpoint response returns a JSON object + /// with the table metadata. + /// + /// + public Task GetTable(string databaseId, string tableId) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Table Convert(Dictionary it) => + Models.Table.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 table by its unique ID. + /// + /// + public Task UpdateTable(string databaseId, string tableId, string name, List? permissions = null, bool? rowSecurity = null, bool? enabled = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "permissions", permissions }, + { "rowSecurity", rowSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Table Convert(Dictionary it) => + Models.Table.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 table by its unique ID. Only users with write permissions have + /// access to delete this resource. + /// + /// + public Task DeleteTable(string databaseId, string tableId) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + 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)!); + + } + + /// + /// List columns in the table. + /// + /// + public Task ListColumns(string databaseId, string tableId, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.ColumnList Convert(Dictionary it) => + Models.ColumnList.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 boolean column. + /// + /// + /// + public Task CreateBooleanColumn(string databaseId, string tableId, string key, bool required, bool? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnBoolean Convert(Dictionary it) => + Models.ColumnBoolean.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); + + } + + /// + /// Update a boolean column. Changing the `default` value will not update + /// already existing rows. + /// + /// + public Task UpdateBooleanColumn(string databaseId, string tableId, string key, bool required, bool xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnBoolean Convert(Dictionary it) => + Models.ColumnBoolean.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); + + } + + /// + /// Create a date time column according to the ISO 8601 standard. + /// + /// + public Task CreateDatetimeColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnDatetime Convert(Dictionary it) => + Models.ColumnDatetime.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); + + } + + /// + /// Update a date time column. Changing the `default` value will not update + /// already existing rows. + /// + /// + public Task UpdateDatetimeColumn(string databaseId, string tableId, string key, bool required, string xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnDatetime Convert(Dictionary it) => + Models.ColumnDatetime.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); + + } + + /// + /// Create an email column. + /// + /// + /// + public Task CreateEmailColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnEmail Convert(Dictionary it) => + Models.ColumnEmail.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); + + } + + /// + /// Update an email column. Changing the `default` value will not update + /// already existing rows. + /// + /// + /// + public Task UpdateEmailColumn(string databaseId, string tableId, string key, bool required, string xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnEmail Convert(Dictionary it) => + Models.ColumnEmail.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); + + } + + /// + /// Create an enumeration column. The `elements` param acts as a white-list of + /// accepted values for this column. + /// + /// + public Task CreateEnumColumn(string databaseId, string tableId, string key, List elements, bool required, string? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "elements", elements }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnEnum Convert(Dictionary it) => + Models.ColumnEnum.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); + + } + + /// + /// Update an enum column. Changing the `default` value will not update already + /// existing rows. + /// + /// + /// + public Task UpdateEnumColumn(string databaseId, string tableId, string key, List elements, bool required, string xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "elements", elements }, + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnEnum Convert(Dictionary it) => + Models.ColumnEnum.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); + + } + + /// + /// Create a float column. Optionally, minimum and maximum values can be + /// provided. + /// + /// + /// + public Task CreateFloatColumn(string databaseId, string tableId, string key, bool required, double? min = null, double? max = null, double? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "min", min }, + { "max", max }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnFloat Convert(Dictionary it) => + Models.ColumnFloat.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); + + } + + /// + /// Update a float column. Changing the `default` value will not update already + /// existing rows. + /// + /// + /// + public Task UpdateFloatColumn(string databaseId, string tableId, string key, bool required, double xdefault, double? min = null, double? max = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "min", min }, + { "max", max }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnFloat Convert(Dictionary it) => + Models.ColumnFloat.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); + + } + + /// + /// Create an integer column. Optionally, minimum and maximum values can be + /// provided. + /// + /// + /// + public Task CreateIntegerColumn(string databaseId, string tableId, string key, bool required, long? min = null, long? max = null, long? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "min", min }, + { "max", max }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnInteger Convert(Dictionary it) => + Models.ColumnInteger.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); + + } + + /// + /// Update an integer column. Changing the `default` value will not update + /// already existing rows. + /// + /// + /// + public Task UpdateIntegerColumn(string databaseId, string tableId, string key, bool required, long xdefault, long? min = null, long? max = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "min", min }, + { "max", max }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnInteger Convert(Dictionary it) => + Models.ColumnInteger.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); + + } + + /// + /// Create IP address column. + /// + /// + /// + public Task CreateIpColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnIp Convert(Dictionary it) => + Models.ColumnIp.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); + + } + + /// + /// Update an ip column. Changing the `default` value will not update already + /// existing rows. + /// + /// + /// + public Task UpdateIpColumn(string databaseId, string tableId, string key, bool required, string xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnIp Convert(Dictionary it) => + Models.ColumnIp.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); + + } + + /// + /// Create relationship column. [Learn more about relationship + /// columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + /// + /// + /// + public Task CreateRelationshipColumn(string databaseId, string tableId, string relatedTableId, Appwrite.Enums.RelationshipType type, bool? twoWay = null, string? key = null, string? twoWayKey = null, Appwrite.Enums.RelationMutate? onDelete = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "relatedTableId", relatedTableId }, + { "type", type?.Value }, + { "twoWay", twoWay }, + { "key", key }, + { "twoWayKey", twoWayKey }, + { "onDelete", onDelete?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnRelationship Convert(Dictionary it) => + Models.ColumnRelationship.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 a string column. + /// + /// + /// + public Task CreateStringColumn(string databaseId, string tableId, string key, long size, bool required, string? xdefault = null, bool? array = null, bool? encrypt = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "size", size }, + { "required", required }, + { "default", xdefault }, + { "array", array }, + { "encrypt", encrypt } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnString Convert(Dictionary it) => + Models.ColumnString.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); + + } + + /// + /// Update a string column. Changing the `default` value will not update + /// already existing rows. + /// + /// + /// + public Task UpdateStringColumn(string databaseId, string tableId, string key, bool required, string xdefault, long? size = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "size", size }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnString Convert(Dictionary it) => + Models.ColumnString.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); + + } + + /// + /// Create a URL column. + /// + /// + /// + public Task CreateUrlColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, bool? array = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault }, + { "array", array } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnUrl Convert(Dictionary it) => + Models.ColumnUrl.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); + + } + + /// + /// Update an url column. Changing the `default` value will not update already + /// existing rows. + /// + /// + /// + public Task UpdateUrlColumn(string databaseId, string tableId, string key, bool required, string xdefault, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnUrl Convert(Dictionary it) => + Models.ColumnUrl.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); + + } + + /// + /// Get column by ID. + /// + /// + public Task GetColumn(string databaseId, string tableId, string key) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Deletes a column. + /// + /// + public Task DeleteColumn(string databaseId, string tableId, string key) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .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)!); + + } + + /// + /// Update relationship column. [Learn more about relationship + /// columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + /// + /// + /// + public Task UpdateRelationshipColumn(string databaseId, string tableId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "onDelete", onDelete?.Value }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnRelationship Convert(Dictionary it) => + Models.ColumnRelationship.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 tableId, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.ColumnIndexList Convert(Dictionary it) => + Models.ColumnIndexList.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 columns listed. Your index should include all the + /// columns you will query in a single request. + /// Attributes can be `key`, `fulltext`, and `unique`. + /// + /// + public Task CreateIndex(string databaseId, string tableId, string key, Appwrite.Enums.IndexType type, List columns, List? orders = null, List? lengths = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "columns", columns }, + { "orders", orders }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnIndex Convert(Dictionary it) => + Models.ColumnIndex.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 tableId, string key) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.ColumnIndex Convert(Dictionary it) => + Models.ColumnIndex.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 tableId, string key) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .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)!); + + } + + /// + /// Get a list of all the user's rows in a given table. You can use the query + /// params to filter your results. + /// + /// + public Task ListRows(string databaseId, string tableId, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.RowList Convert(Dictionary it) => + Models.RowList.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 Row. Before using this route, you should create a new table + /// resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// API or directly from your database console. + /// + /// + public Task CreateRow(string databaseId, string tableId, string rowId, object data, List? permissions = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "rowId", rowId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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 Rows. Before using this route, you should create a new table + /// resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// API or directly from your database console. + /// + /// + public Task CreateRows(string databaseId, string tableId, List rows) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "rows", rows } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.RowList Convert(Dictionary it) => + Models.RowList.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 Rows. Before using this route, you should create a new + /// table resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// API or directly from your database console. + /// + /// + /// + public Task UpsertRows(string databaseId, string tableId, List rows) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "rows", rows } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.RowList Convert(Dictionary it) => + Models.RowList.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 rows that match your queries, if no queries are submitted then + /// all rows are updated. You can pass only specific fields to be updated. + /// + /// + public Task UpdateRows(string databaseId, string tableId, object? data = null, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.RowList Convert(Dictionary it) => + Models.RowList.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 rows using queries, if no queries are passed then all rows are + /// deleted. + /// + /// + public Task DeleteRows(string databaseId, string tableId, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.RowList Convert(Dictionary it) => + Models.RowList.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 row by its unique ID. This endpoint response returns a JSON object + /// with the row data. + /// + /// + public Task GetRow(string databaseId, string tableId, string rowId, List? queries = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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 Row. Before using this route, you should create a new + /// table resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// API or directly from your database console. + /// + /// + public Task UpsertRow(string databaseId, string tableId, string rowId, object? data = null, List? permissions = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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 row by its unique ID. Using the patch method you can pass only + /// specific fields that will get updated. + /// + /// + public Task UpdateRow(string databaseId, string tableId, string rowId, object? data = null, List? permissions = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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 row by its unique ID. + /// + /// + public Task DeleteRow(string databaseId, string tableId, string rowId) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId); + + 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)!); + + } + + /// + /// Decrement a specific column of a row by a given value. + /// + /// + public Task DecrementRowColumn(string databaseId, string tableId, string rowId, string column, double? xvalue = null, double? min = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId) + .Replace("{column}", column); + + var apiParameters = new Dictionary() + { + { "value", xvalue }, + { "min", min } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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 IncrementRowColumn(string databaseId, string tableId, string rowId, string column, double? xvalue = null, double? max = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId) + .Replace("{rowId}", rowId) + .Replace("{column}", column); + + var apiParameters = new Dictionary() + { + { "value", xvalue }, + { "max", max } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Row Convert(Dictionary it) => + Models.Row.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/README.md b/README.md index 541fc6af..4c5bb227 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # 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.7.4-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.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) -**This SDK is compatible with Appwrite server version 1.7.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.8.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 abstract and simplify 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) @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif 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.15.0 +Install-Package Appwrite -Version 0.16.0 # or .NET CLI -dotnet add package Appwrite --version 0.15.0 +dotnet add package Appwrite --version 0.16.0 ``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 9b66c15c..523d367b 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,5 @@ using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -12,5 +13,6 @@ Databases databases = new Databases(client); Database result = await databases.Create( databaseId: "", name: "", - enabled: false // optional + enabled: false, // optional + type: .Tablesdb // optional ); \ No newline at end of file diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index c8fd5595..98d1b2f3 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -17,5 +17,5 @@ Execution result = await functions.CreateExecution( path: "", // optional method: ExecutionMethod.GET, // optional headers: [object], // optional - scheduledAt: "" // optional + scheduledAt: "" // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md new file mode 100644 index 00000000..06bc07a8 --- /dev/null +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnBoolean result = await tablesDb.CreateBooleanColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: false, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md new file mode 100644 index 00000000..d8105179 --- /dev/null +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnDatetime result = await tablesDb.CreateDatetimeColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md new file mode 100644 index 00000000..d57f858a --- /dev/null +++ b/docs/examples/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnEmail result = await tablesDb.CreateEmailColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "email@example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md new file mode 100644 index 00000000..149ae861 --- /dev/null +++ b/docs/examples/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnEnum result = await tablesDb.CreateEnumColumn( + databaseId: "", + tableId: "", + key: "", + elements: new List(), + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md new file mode 100644 index 00000000..41dd45ed --- /dev/null +++ b/docs/examples/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnFloat result = await tablesDb.CreateFloatColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md new file mode 100644 index 00000000..380a0705 --- /dev/null +++ b/docs/examples/tablesdb/create-index.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnIndex result = await tablesDb.CreateIndex( + databaseId: "", + tableId: "", + key: "", + type: IndexType.Key, + columns: new List(), + orders: new List(), // optional + lengths: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md new file mode 100644 index 00000000..2bae4eae --- /dev/null +++ b/docs/examples/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnInteger result = await tablesDb.CreateIntegerColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md new file mode 100644 index 00000000..4f94fd9d --- /dev/null +++ b/docs/examples/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnIp result = await tablesDb.CreateIpColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md new file mode 100644 index 00000000..e3b22f1d --- /dev/null +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnRelationship result = await tablesDb.CreateRelationshipColumn( + databaseId: "", + tableId: "", + relatedTableId: "", + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: "", // optional + twoWayKey: "", // optional + onDelete: RelationMutate.Cascade // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md new file mode 100644 index 00000000..5bf1e0fe --- /dev/null +++ b/docs/examples/tablesdb/create-row.md @@ -0,0 +1,18 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.CreateRow( + databaseId: "", + tableId: "", + rowId: "", + data: [object], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md new file mode 100644 index 00000000..889437e0 --- /dev/null +++ b/docs/examples/tablesdb/create-rows.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +RowList result = await tablesDb.CreateRows( + databaseId: "", + tableId: "", + rows: new List() +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md new file mode 100644 index 00000000..97ce907d --- /dev/null +++ b/docs/examples/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnString result = await tablesDb.CreateStringColumn( + databaseId: "", + tableId: "", + key: "", + size: 1, + required: false, + default: "", // optional + array: false, // optional + encrypt: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md new file mode 100644 index 00000000..8d1dbc96 --- /dev/null +++ b/docs/examples/tablesdb/create-table.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Table result = await tablesDb.CreateTable( + databaseId: "", + tableId: "", + name: "", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md new file mode 100644 index 00000000..d89ebd33 --- /dev/null +++ b/docs/examples/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnUrl result = await tablesDb.CreateUrlColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "https://example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md new file mode 100644 index 00000000..4d80e370 --- /dev/null +++ b/docs/examples/tablesdb/create.md @@ -0,0 +1,18 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Database result = await tablesDb.Create( + databaseId: "", + name: "", + enabled: false, // optional + type: .Tablesdb // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md new file mode 100644 index 00000000..bcdfc231 --- /dev/null +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.DecrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 0, // optional + min: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md new file mode 100644 index 00000000..e95f483f --- /dev/null +++ b/docs/examples/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.DeleteColumn( + databaseId: "", + tableId: "", + key: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md new file mode 100644 index 00000000..da86a942 --- /dev/null +++ b/docs/examples/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.DeleteIndex( + databaseId: "", + tableId: "", + key: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md new file mode 100644 index 00000000..77a79bb9 --- /dev/null +++ b/docs/examples/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.DeleteRow( + databaseId: "", + tableId: "", + rowId: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md new file mode 100644 index 00000000..f703ebb3 --- /dev/null +++ b/docs/examples/tablesdb/delete-rows.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.DeleteRows( + databaseId: "", + tableId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md new file mode 100644 index 00000000..9be80ed0 --- /dev/null +++ b/docs/examples/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.DeleteTable( + databaseId: "", + tableId: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md new file mode 100644 index 00000000..50c36501 --- /dev/null +++ b/docs/examples/tablesdb/delete.md @@ -0,0 +1,14 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +await tablesDb.Delete( + databaseId: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md new file mode 100644 index 00000000..55b17c29 --- /dev/null +++ b/docs/examples/tablesdb/get-column.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + + result = await tablesDb.GetColumn( + databaseId: "", + tableId: "", + key: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md new file mode 100644 index 00000000..724e38d1 --- /dev/null +++ b/docs/examples/tablesdb/get-index.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnIndex result = await tablesDb.GetIndex( + databaseId: "", + tableId: "", + key: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md new file mode 100644 index 00000000..4cc4ca82 --- /dev/null +++ b/docs/examples/tablesdb/get-row.md @@ -0,0 +1,17 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.GetRow( + databaseId: "", + tableId: "", + rowId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md new file mode 100644 index 00000000..59554e3b --- /dev/null +++ b/docs/examples/tablesdb/get-table.md @@ -0,0 +1,15 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Table result = await tablesDb.GetTable( + databaseId: "", + tableId: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md new file mode 100644 index 00000000..2d9c8080 --- /dev/null +++ b/docs/examples/tablesdb/get.md @@ -0,0 +1,14 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Database result = await tablesDb.Get( + databaseId: "" +); \ No newline at end of file diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md new file mode 100644 index 00000000..42190513 --- /dev/null +++ b/docs/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.IncrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 0, // optional + max: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md new file mode 100644 index 00000000..9505574e --- /dev/null +++ b/docs/examples/tablesdb/list-columns.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnList result = await tablesDb.ListColumns( + databaseId: "", + tableId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md new file mode 100644 index 00000000..4284d120 --- /dev/null +++ b/docs/examples/tablesdb/list-indexes.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnIndexList result = await tablesDb.ListIndexes( + databaseId: "", + tableId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md new file mode 100644 index 00000000..596c167a --- /dev/null +++ b/docs/examples/tablesdb/list-rows.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +RowList result = await tablesDb.ListRows( + databaseId: "", + tableId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md new file mode 100644 index 00000000..2c74b3b6 --- /dev/null +++ b/docs/examples/tablesdb/list-tables.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +TableList result = await tablesDb.ListTables( + databaseId: "", + queries: new List(), // optional + search: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md new file mode 100644 index 00000000..916d004e --- /dev/null +++ b/docs/examples/tablesdb/list.md @@ -0,0 +1,15 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +DatabaseList result = await tablesDb.List( + queries: new List(), // optional + search: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md new file mode 100644 index 00000000..3c0de4cb --- /dev/null +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnBoolean result = await tablesDb.UpdateBooleanColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: false, + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md new file mode 100644 index 00000000..ebbf61a7 --- /dev/null +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnDatetime result = await tablesDb.UpdateDatetimeColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md new file mode 100644 index 00000000..1cf3efff --- /dev/null +++ b/docs/examples/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnEmail result = await tablesDb.UpdateEmailColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "email@example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md new file mode 100644 index 00000000..82d1dd81 --- /dev/null +++ b/docs/examples/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnEnum result = await tablesDb.UpdateEnumColumn( + databaseId: "", + tableId: "", + key: "", + elements: new List(), + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md new file mode 100644 index 00000000..598c117b --- /dev/null +++ b/docs/examples/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnFloat result = await tablesDb.UpdateFloatColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md new file mode 100644 index 00000000..4c6da922 --- /dev/null +++ b/docs/examples/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnInteger result = await tablesDb.UpdateIntegerColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md new file mode 100644 index 00000000..1ab4930f --- /dev/null +++ b/docs/examples/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnIp result = await tablesDb.UpdateIpColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md new file mode 100644 index 00000000..cac13422 --- /dev/null +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnRelationship result = await tablesDb.UpdateRelationshipColumn( + databaseId: "", + tableId: "", + key: "", + onDelete: RelationMutate.Cascade, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md new file mode 100644 index 00000000..13465195 --- /dev/null +++ b/docs/examples/tablesdb/update-row.md @@ -0,0 +1,18 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.UpdateRow( + databaseId: "", + tableId: "", + rowId: "", + data: [object], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md new file mode 100644 index 00000000..67f7a62e --- /dev/null +++ b/docs/examples/tablesdb/update-rows.md @@ -0,0 +1,17 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +RowList result = await tablesDb.UpdateRows( + databaseId: "", + tableId: "", + data: [object], // optional + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md new file mode 100644 index 00000000..aa6c0665 --- /dev/null +++ b/docs/examples/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnString result = await tablesDb.UpdateStringColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", + size: 1, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md new file mode 100644 index 00000000..cedf3992 --- /dev/null +++ b/docs/examples/tablesdb/update-table.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Table result = await tablesDb.UpdateTable( + databaseId: "", + tableId: "", + name: "", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md new file mode 100644 index 00000000..55dc4731 --- /dev/null +++ b/docs/examples/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +ColumnUrl result = await tablesDb.UpdateUrlColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "https://example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md new file mode 100644 index 00000000..eb041d4c --- /dev/null +++ b/docs/examples/tablesdb/update.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Database result = await tablesDb.Update( + databaseId: "", + name: "", + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md new file mode 100644 index 00000000..4de18264 --- /dev/null +++ b/docs/examples/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +Row result = await tablesDb.UpsertRow( + databaseId: "", + tableId: "", + rowId: "", + data: [object], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md new file mode 100644 index 00000000..cf9076c7 --- /dev/null +++ b/docs/examples/tablesdb/upsert-rows.md @@ -0,0 +1,16 @@ +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 + +TablesDb tablesDb = new TablesDb(client); + +RowList result = await tablesDb.UpsertRows( + databaseId: "", + tableId: "", + rows: new List() +); \ No newline at end of file From 95c4d278c6e4f3d5b5246fee7159d6211ba7fc70 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 18:25:51 +1200 Subject: [PATCH 2/7] Add 1.8.x support --- Appwrite/Enums/Type.cs | 17 ----------------- Appwrite/Services/Databases.cs | 5 ++--- Appwrite/Services/TablesDb.cs | 9 ++++----- docs/examples/databases/create.md | 4 +--- docs/examples/tablesdb/create.md | 4 +--- 5 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 Appwrite/Enums/Type.cs diff --git a/Appwrite/Enums/Type.cs b/Appwrite/Enums/Type.cs deleted file mode 100644 index a9e6d544..00000000 --- a/Appwrite/Enums/Type.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class Type : IEnum - { - public string Value { get; private set; } - - public Type(string value) - { - Value = value; - } - - public static Type Tablesdb => new Type("tablesdb"); - public static Type Legacy => new Type("legacy"); - } -} diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 408752d1..475bd605 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -53,7 +53,7 @@ static Models.DatabaseList Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead.")] - public Task Create(string databaseId, string name, bool? enabled = null, Appwrite.Enums.Type? type = null) + public Task Create(string databaseId, string name, bool? enabled = null) { var apiPath = "/databases"; @@ -61,8 +61,7 @@ static Models.DatabaseList Convert(Dictionary it) => { { "databaseId", databaseId }, { "name", name }, - { "enabled", enabled }, - { "type", type?.Value } + { "enabled", enabled } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index fa9f0f7e..2ed2d338 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -51,7 +51,7 @@ static Models.DatabaseList Convert(Dictionary it) => /// /// /// - public Task Create(string databaseId, string name, bool? enabled = null, Appwrite.Enums.Type? type = null) + public Task Create(string databaseId, string name, bool? enabled = null) { var apiPath = "/tablesdb"; @@ -59,8 +59,7 @@ static Models.DatabaseList Convert(Dictionary it) => { { "databaseId", databaseId }, { "name", name }, - { "enabled", enabled }, - { "type", type?.Value } + { "enabled", enabled } }; var apiHeaders = new Dictionary() @@ -1200,7 +1199,7 @@ static Models.ColumnRelationship Convert(Dictionary it) => } /// - /// List indexes in the collection. + /// List indexes on the table. /// /// public Task ListIndexes(string databaseId, string tableId, List? queries = null) @@ -1234,7 +1233,7 @@ static Models.ColumnIndexList Convert(Dictionary it) => /// /// Creates an index on the columns listed. Your index should include all the /// columns you will query in a single request. - /// Attributes can be `key`, `fulltext`, and `unique`. + /// 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) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 523d367b..9b66c15c 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,5 +1,4 @@ using Appwrite; -using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -13,6 +12,5 @@ Databases databases = new Databases(client); Database result = await databases.Create( databaseId: "", name: "", - enabled: false, // optional - type: .Tablesdb // optional + enabled: false // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 4d80e370..a1fc21fb 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -1,5 +1,4 @@ using Appwrite; -using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -13,6 +12,5 @@ TablesDb tablesDb = new TablesDb(client); Database result = await tablesDb.Create( databaseId: "", name: "", - enabled: false, // optional - type: .Tablesdb // optional + enabled: false // optional ); \ No newline at end of file From c204ae6d8903c1a68be012035acffb433a618eca Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 20 Aug 2025 19:20:30 +1200 Subject: [PATCH 3/7] Add 1.8.x support --- docs/examples/databases/decrement-document-attribute.md | 2 +- docs/examples/databases/increment-document-attribute.md | 2 +- docs/examples/tablesdb/decrement-row-column.md | 2 +- docs/examples/tablesdb/increment-row-column.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index c327458f..2e48d457 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -5,7 +5,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/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index be52584a..923c8d63 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -5,7 +5,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/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index bcdfc231..77ebbf77 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -5,7 +5,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 TablesDb tablesDb = new TablesDb(client); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 42190513..6d9ce27e 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -5,7 +5,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 TablesDb tablesDb = new TablesDb(client); From d7c6804a8fdca20189d15aa6798c0879ec19a2a5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 21 Aug 2025 22:19:30 +1200 Subject: [PATCH 4/7] Fix casing --- Appwrite/Services/Account.cs | 302 +++++++++++++++++ Appwrite/Services/Databases.cs | 98 +++--- Appwrite/Services/Messaging.cs | 317 ++++++++++++++++++ Appwrite/Services/TablesDb.cs | 14 +- Appwrite/Services/Users.cs | 198 +++++++++++ .../account/create-m-f-a-authenticator.md | 15 + .../account/create-m-f-a-challenge.md | 14 + .../account/create-m-f-a-recovery-codes.md | 12 + .../account/delete-m-f-a-authenticator.md | 15 + .../account/get-m-f-a-recovery-codes.md | 12 + docs/examples/account/list-m-f-a-factors.md | 12 + .../account/update-m-f-a-authenticator.md | 16 + .../account/update-m-f-a-challenge.md | 15 + .../account/update-m-f-a-recovery-codes.md | 12 + .../messaging/create-a-p-n-s-provider.md | 21 ++ .../messaging/create-f-c-m-provider.md | 17 + docs/examples/messaging/create-s-m-s.md | 20 ++ .../messaging/create-s-m-t-p-provider.md | 28 ++ .../messaging/update-a-p-n-s-provider.md | 21 ++ .../messaging/update-f-c-m-provider.md | 17 + docs/examples/messaging/update-s-m-s.md | 20 ++ .../messaging/update-s-m-t-p-provider.md | 28 ++ .../tablesdb/create-boolean-column.md | 4 +- .../tablesdb/create-datetime-column.md | 4 +- docs/examples/tablesdb/create-email-column.md | 4 +- docs/examples/tablesdb/create-enum-column.md | 4 +- docs/examples/tablesdb/create-float-column.md | 4 +- docs/examples/tablesdb/create-index.md | 4 +- .../tablesdb/create-integer-column.md | 4 +- docs/examples/tablesdb/create-ip-column.md | 4 +- .../tablesdb/create-relationship-column.md | 4 +- docs/examples/tablesdb/create-row.md | 4 +- docs/examples/tablesdb/create-rows.md | 4 +- .../examples/tablesdb/create-string-column.md | 4 +- docs/examples/tablesdb/create-table.md | 4 +- docs/examples/tablesdb/create-url-column.md | 4 +- docs/examples/tablesdb/create.md | 4 +- .../examples/tablesdb/decrement-row-column.md | 4 +- docs/examples/tablesdb/delete-column.md | 4 +- docs/examples/tablesdb/delete-index.md | 4 +- docs/examples/tablesdb/delete-row.md | 4 +- docs/examples/tablesdb/delete-rows.md | 4 +- docs/examples/tablesdb/delete-table.md | 4 +- docs/examples/tablesdb/delete.md | 4 +- docs/examples/tablesdb/get-column.md | 4 +- docs/examples/tablesdb/get-index.md | 4 +- docs/examples/tablesdb/get-row.md | 4 +- docs/examples/tablesdb/get-table.md | 4 +- docs/examples/tablesdb/get.md | 4 +- .../examples/tablesdb/increment-row-column.md | 4 +- docs/examples/tablesdb/list-columns.md | 4 +- docs/examples/tablesdb/list-indexes.md | 4 +- docs/examples/tablesdb/list-rows.md | 4 +- docs/examples/tablesdb/list-tables.md | 4 +- docs/examples/tablesdb/list.md | 4 +- .../tablesdb/update-boolean-column.md | 4 +- .../tablesdb/update-datetime-column.md | 4 +- docs/examples/tablesdb/update-email-column.md | 4 +- docs/examples/tablesdb/update-enum-column.md | 4 +- docs/examples/tablesdb/update-float-column.md | 4 +- .../tablesdb/update-integer-column.md | 4 +- docs/examples/tablesdb/update-ip-column.md | 4 +- .../tablesdb/update-relationship-column.md | 4 +- docs/examples/tablesdb/update-row.md | 4 +- docs/examples/tablesdb/update-rows.md | 4 +- .../examples/tablesdb/update-string-column.md | 4 +- docs/examples/tablesdb/update-table.md | 4 +- docs/examples/tablesdb/update-url-column.md | 4 +- docs/examples/tablesdb/update.md | 4 +- docs/examples/tablesdb/upsert-row.md | 4 +- docs/examples/tablesdb/upsert-rows.md | 4 +- .../users/create-m-f-a-recovery-codes.md | 14 + .../users/delete-m-f-a-authenticator.md | 16 + .../users/get-m-f-a-recovery-codes.md | 14 + docs/examples/users/list-m-f-a-factors.md | 14 + .../users/update-m-f-a-recovery-codes.md | 14 + docs/examples/users/update-m-f-a.md | 15 + 77 files changed, 1353 insertions(+), 154 deletions(-) create mode 100644 docs/examples/account/create-m-f-a-authenticator.md create mode 100644 docs/examples/account/create-m-f-a-challenge.md create mode 100644 docs/examples/account/create-m-f-a-recovery-codes.md create mode 100644 docs/examples/account/delete-m-f-a-authenticator.md create mode 100644 docs/examples/account/get-m-f-a-recovery-codes.md create mode 100644 docs/examples/account/list-m-f-a-factors.md create mode 100644 docs/examples/account/update-m-f-a-authenticator.md create mode 100644 docs/examples/account/update-m-f-a-challenge.md create mode 100644 docs/examples/account/update-m-f-a-recovery-codes.md create mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/create-f-c-m-provider.md create mode 100644 docs/examples/messaging/create-s-m-s.md create mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md create mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md create mode 100644 docs/examples/messaging/update-f-c-m-provider.md create mode 100644 docs/examples/messaging/update-s-m-s.md create mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md create mode 100644 docs/examples/users/create-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/delete-m-f-a-authenticator.md create mode 100644 docs/examples/users/get-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/list-m-f-a-factors.md create mode 100644 docs/examples/users/update-m-f-a-recovery-codes.md create mode 100644 docs/examples/users/update-m-f-a.md diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index d0fc6f0e..63454e3a 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -283,6 +283,7 @@ static Models.User Convert(Dictionary it) => /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFAAuthenticator` instead.")] public Task CreateMfaAuthenticator(Appwrite.Enums.AuthenticatorType type) { var apiPath = "/account/mfa/authenticators/{type}" @@ -310,12 +311,47 @@ static Models.MfaType Convert(Dictionary it) => } + /// + /// Add an authenticator app to be used as an MFA factor. Verify the + /// authenticator using the [verify + /// authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) + /// method. + /// + /// + public Task CreateMFAAuthenticator(Appwrite.Enums.AuthenticatorType type) + { + var apiPath = "/account/mfa/authenticators/{type}" + .Replace("{type}", type.Value); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaType Convert(Dictionary it) => + Models.MfaType.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); + + } + /// /// Verify an authenticator app after adding it using the [add /// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFAAuthenticator` instead.")] public Task UpdateMfaAuthenticator(Appwrite.Enums.AuthenticatorType type, string otp) { var apiPath = "/account/mfa/authenticators/{type}" @@ -344,10 +380,45 @@ static Models.User Convert(Dictionary it) => } + /// + /// Verify an authenticator app after adding it using the [add + /// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) + /// method. + /// + /// + public Task UpdateMFAAuthenticator(Appwrite.Enums.AuthenticatorType type, string otp) + { + var apiPath = "/account/mfa/authenticators/{type}" + .Replace("{type}", type.Value); + + var apiParameters = new Dictionary() + { + { "otp", otp } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.User Convert(Dictionary it) => + Models.User.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 an authenticator for a user by ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead.")] public Task DeleteMfaAuthenticator(Appwrite.Enums.AuthenticatorType type) { var apiPath = "/account/mfa/authenticators/{type}" @@ -364,6 +435,34 @@ public Task DeleteMfaAuthenticator(Appwrite.Enums.AuthenticatorType type + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Delete an authenticator for a user by ID. + /// + /// + public Task DeleteMFAAuthenticator(Appwrite.Enums.AuthenticatorType type) + { + var apiPath = "/account/mfa/authenticators/{type}" + .Replace("{type}", type.Value); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + return _client.Call( method: "DELETE", path: apiPath, @@ -378,6 +477,7 @@ public Task DeleteMfaAuthenticator(Appwrite.Enums.AuthenticatorType type /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFAChallenge` instead.")] public Task CreateMfaChallenge(Appwrite.Enums.AuthenticationFactor factor) { var apiPath = "/account/mfa/challenge"; @@ -405,6 +505,39 @@ static Models.MfaChallenge Convert(Dictionary it) => } + /// + /// Begin the process of MFA verification after sign-in. Finish the flow with + /// [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) + /// method. + /// + /// + public Task CreateMFAChallenge(Appwrite.Enums.AuthenticationFactor factor) + { + var apiPath = "/account/mfa/challenge"; + + var apiParameters = new Dictionary() + { + { "factor", factor?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaChallenge Convert(Dictionary it) => + Models.MfaChallenge.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); + + } + /// /// Complete the MFA challenge by providing the one-time password. Finish the /// process of MFA verification by providing the one-time password. To begin @@ -413,6 +546,7 @@ static Models.MfaChallenge Convert(Dictionary it) => /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFAChallenge` instead.")] public Task UpdateMfaChallenge(string challengeId, string otp) { var apiPath = "/account/mfa/challenge"; @@ -441,10 +575,47 @@ static Models.Session Convert(Dictionary it) => } + /// + /// Complete the MFA challenge by providing the one-time password. Finish the + /// process of MFA verification by providing the one-time password. To begin + /// the flow, use + /// [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + /// method. + /// + /// + public Task UpdateMFAChallenge(string challengeId, string otp) + { + var apiPath = "/account/mfa/challenge"; + + var apiParameters = new Dictionary() + { + { "challengeId", challengeId }, + { "otp", otp } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Session Convert(Dictionary it) => + Models.Session.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); + + } + /// /// List the factors available on the account to be used as a MFA challange. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead.")] public Task ListMfaFactors() { var apiPath = "/account/mfa/factors"; @@ -470,6 +641,35 @@ static Models.MfaFactors Convert(Dictionary it) => } + /// + /// List the factors available on the account to be used as a MFA challange. + /// + /// + public Task ListMFAFactors() + { + var apiPath = "/account/mfa/factors"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.MfaFactors Convert(Dictionary it) => + Models.MfaFactors.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 recovery codes that can be used as backup for MFA flow. Before getting /// codes, they must be generated using @@ -477,6 +677,7 @@ static Models.MfaFactors Convert(Dictionary it) => /// method. An OTP challenge is required to read recovery codes. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead.")] public Task GetMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; @@ -502,6 +703,38 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Get recovery codes that can be used as backup for MFA flow. Before getting + /// codes, they must be generated using + /// [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + /// method. An OTP challenge is required to read recovery codes. + /// + /// + public Task GetMFARecoveryCodes() + { + var apiPath = "/account/mfa/recovery-codes"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Generate recovery codes as backup for MFA flow. It's recommended to /// generate and show then immediately after user successfully adds their @@ -510,6 +743,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead.")] public Task CreateMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; @@ -536,6 +770,40 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Generate recovery codes as backup for MFA flow. It's recommended to + /// generate and show then immediately after user successfully adds their + /// authehticator. Recovery codes can be used as a MFA verification type in + /// [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + /// method. + /// + /// + public Task CreateMFARecoveryCodes() + { + var apiPath = "/account/mfa/recovery-codes"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Regenerate recovery codes that can be used as backup for MFA flow. Before /// regenerating codes, they must be first generated using @@ -543,6 +811,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. An OTP challenge is required to regenreate recovery codes. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead.")] public Task UpdateMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; @@ -569,6 +838,39 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Regenerate recovery codes that can be used as backup for MFA flow. Before + /// regenerating codes, they must be first generated using + /// [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + /// method. An OTP challenge is required to regenreate recovery codes. + /// + /// + public Task UpdateMFARecoveryCodes() + { + var apiPath = "/account/mfa/recovery-codes"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Update currently logged in user account name. /// diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 475bd605..7fdee327 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -19,7 +19,7 @@ public Databases(Client client) : base(client) /// the search parameter to filter your results. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.list` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead.")] public Task List(List? queries = null, string? search = null) { var apiPath = "/databases"; @@ -52,7 +52,7 @@ static Models.DatabaseList Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createDatabase` instead.")] public Task Create(string databaseId, string name, bool? enabled = null) { var apiPath = "/databases"; @@ -87,7 +87,7 @@ static Models.Database Convert(Dictionary it) => /// object with the database metadata. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.get` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead.")] public Task Get(string databaseId) { var apiPath = "/databases/{databaseId}" @@ -118,7 +118,7 @@ static Models.Database Convert(Dictionary it) => /// Update a database by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.update` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.")] public Task Update(string databaseId, string name, bool? enabled = null) { var apiPath = "/databases/{databaseId}" @@ -153,7 +153,7 @@ static Models.Database Convert(Dictionary it) => /// scope can delete a database. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.delete` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead.")] public Task Delete(string databaseId) { var apiPath = "/databases/{databaseId}" @@ -183,7 +183,7 @@ public Task Delete(string databaseId) /// can use the search parameter to filter your results. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listTables` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead.")] public Task ListCollections(string databaseId, List? queries = null, string? search = null) { var apiPath = "/databases/{databaseId}/collections" @@ -219,7 +219,7 @@ static Models.CollectionList Convert(Dictionary it) => /// API or directly from your database console. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createTable` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.")] public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { var apiPath = "/databases/{databaseId}/collections" @@ -257,7 +257,7 @@ static Models.Collection Convert(Dictionary it) => /// object with the collection metadata. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getTable` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead.")] public Task GetCollection(string databaseId, string collectionId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -289,7 +289,7 @@ static Models.Collection Convert(Dictionary it) => /// Update a collection by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateTable` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead.")] public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -327,7 +327,7 @@ static Models.Collection Convert(Dictionary it) => /// have access to delete this resource. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteTable` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead.")] public Task DeleteCollection(string databaseId, string collectionId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}" @@ -357,7 +357,7 @@ public Task DeleteCollection(string databaseId, string collectionId) /// List attributes in the collection. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listColumns` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead.")] public Task ListAttributes(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes" @@ -391,7 +391,7 @@ static Models.AttributeList Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createBooleanColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead.")] public Task CreateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean" @@ -429,7 +429,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => /// already existing documents. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateBooleanColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead.")] public Task UpdateBooleanAttribute(string databaseId, string collectionId, string key, bool required, bool xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}" @@ -466,7 +466,7 @@ static Models.AttributeBoolean Convert(Dictionary it) => /// Create a date time attribute according to the ISO 8601 standard. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createDatetimeColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead.")] public Task CreateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime" @@ -504,7 +504,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => /// already existing documents. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateDatetimeColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead.")] public Task UpdateDatetimeAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}" @@ -542,7 +542,7 @@ static Models.AttributeDatetime Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createEmailColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead.")] public Task CreateEmailAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email" @@ -581,7 +581,7 @@ static Models.AttributeEmail Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateEmailColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead.")] public Task UpdateEmailAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}" @@ -620,7 +620,7 @@ static Models.AttributeEmail Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createEnumColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead.")] public Task CreateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum" @@ -660,7 +660,7 @@ static Models.AttributeEnum Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateEnumColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead.")] public Task UpdateEnumAttribute(string databaseId, string collectionId, string key, List elements, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}" @@ -700,7 +700,7 @@ static Models.AttributeEnum Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createFloatColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead.")] public Task CreateFloatAttribute(string databaseId, string collectionId, string key, bool required, double? min = null, double? max = null, double? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float" @@ -741,7 +741,7 @@ static Models.AttributeFloat Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateFloatColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead.")] public Task UpdateFloatAttribute(string databaseId, string collectionId, string key, bool required, double xdefault, double? min = null, double? max = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}" @@ -782,7 +782,7 @@ static Models.AttributeFloat Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createIntegerColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.")] public Task CreateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long? min = null, long? max = null, long? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer" @@ -823,7 +823,7 @@ static Models.AttributeInteger Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateIntegerColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.")] public Task UpdateIntegerAttribute(string databaseId, string collectionId, string key, bool required, long xdefault, long? min = null, long? max = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}" @@ -863,7 +863,7 @@ static Models.AttributeInteger Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createIpColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead.")] public Task CreateIpAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip" @@ -902,7 +902,7 @@ static Models.AttributeIp Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateIpColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead.")] public Task UpdateIpAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}" @@ -941,7 +941,7 @@ static Models.AttributeIp Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRelationshipColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.")] public Task CreateRelationshipAttribute(string databaseId, string collectionId, string relatedCollectionId, Appwrite.Enums.RelationshipType type, bool? twoWay = null, string? key = null, string? twoWayKey = null, Appwrite.Enums.RelationMutate? onDelete = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship" @@ -981,7 +981,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createStringColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.")] public Task CreateStringAttribute(string databaseId, string collectionId, string key, long size, bool required, string? xdefault = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string" @@ -1022,7 +1022,7 @@ static Models.AttributeString Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateStringColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.")] public Task UpdateStringAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, long? size = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}" @@ -1061,7 +1061,7 @@ static Models.AttributeString Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createUrlColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead.")] public Task CreateUrlAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, bool? array = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url" @@ -1100,7 +1100,7 @@ static Models.AttributeUrl Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateUrlColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead.")] public Task UpdateUrlAttribute(string databaseId, string collectionId, string key, bool required, string xdefault, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}" @@ -1137,7 +1137,7 @@ static Models.AttributeUrl Convert(Dictionary it) => /// Get attribute by ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.")] public Task GetAttribute(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" @@ -1167,7 +1167,7 @@ public Task GetAttribute(string databaseId, string collectionId, string /// Deletes an attribute. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead.")] public Task DeleteAttribute(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}" @@ -1200,7 +1200,7 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRelationshipColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")] public Task UpdateRelationshipAttribute(string databaseId, string collectionId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship" @@ -1237,7 +1237,7 @@ static Models.AttributeRelationship Convert(Dictionary it) => /// the query params to filter your results. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listRows` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.")] public Task ListDocuments(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1273,7 +1273,7 @@ static Models.DocumentList Convert(Dictionary it) => /// API or directly from your database console. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRow` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.")] public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1312,7 +1312,7 @@ static Models.Document Convert(Dictionary it) => /// API or directly from your database console. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createRows` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.")] public Task CreateDocuments(string databaseId, string collectionId, List documents) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1350,7 +1350,7 @@ static Models.DocumentList Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRows` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.")] public Task UpsertDocuments(string databaseId, string collectionId, List documents) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1386,7 +1386,7 @@ static Models.DocumentList Convert(Dictionary it) => /// updated. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRows` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.")] public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1422,7 +1422,7 @@ static Models.DocumentList Convert(Dictionary it) => /// documents are deleted. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRows` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.")] public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -1457,7 +1457,7 @@ static Models.DocumentList Convert(Dictionary it) => /// object with the document data. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getRow` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.")] public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1494,7 +1494,7 @@ static Models.Document Convert(Dictionary it) => /// API or directly from your database console. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.upsertRow` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.")] public Task UpsertDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1531,7 +1531,7 @@ static Models.Document Convert(Dictionary it) => /// only specific fields that will get updated. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.updateRow` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.")] public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1567,7 +1567,7 @@ static Models.Document Convert(Dictionary it) => /// Delete a document by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteRow` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.")] public Task DeleteDocument(string databaseId, string collectionId, string documentId) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" @@ -1598,7 +1598,7 @@ public Task DeleteDocument(string databaseId, string collectionId, strin /// Decrement a specific attribute of a document by a given value. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.decrementRowColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.")] public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? min = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" @@ -1635,7 +1635,7 @@ static Models.Document Convert(Dictionary it) => /// Increment a specific attribute of a document by a given value. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.incrementRowColumn` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.")] public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? xvalue = null, double? max = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" @@ -1672,7 +1672,7 @@ static Models.Document Convert(Dictionary it) => /// List indexes in the collection. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.listIndexes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead.")] public Task ListIndexes(string databaseId, string collectionId, List? queries = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" @@ -1707,7 +1707,7 @@ static Models.IndexList Convert(Dictionary it) => /// Attributes can be `key`, `fulltext`, and `unique`. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.createIndex` instead.")] + [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) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" @@ -1745,7 +1745,7 @@ static Models.Index Convert(Dictionary it) => /// Get index by ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.getIndex` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead.")] public Task GetIndex(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" @@ -1778,7 +1778,7 @@ static Models.Index Convert(Dictionary it) => /// Delete an index. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDb.deleteIndex` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead.")] public Task DeleteIndex(string databaseId, string collectionId, string key) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}" diff --git a/Appwrite/Services/Messaging.cs b/Appwrite/Services/Messaging.cs index ade6e70c..5e8f8fa7 100644 --- a/Appwrite/Services/Messaging.cs +++ b/Appwrite/Services/Messaging.cs @@ -237,6 +237,7 @@ static Models.Message Convert(Dictionary it) => /// Create a new SMS message. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateSMS` instead.")] public Task CreateSms(string messageId, string content, List? topics = null, List? users = null, List? targets = null, bool? draft = null, string? scheduledAt = null) { var apiPath = "/messaging/messages/sms"; @@ -270,6 +271,43 @@ static Models.Message Convert(Dictionary it) => } + /// + /// Create a new SMS message. + /// + /// + public Task CreateSMS(string messageId, string content, List? topics = null, List? users = null, List? targets = null, bool? draft = null, string? scheduledAt = null) + { + var apiPath = "/messaging/messages/sms"; + + var apiParameters = new Dictionary() + { + { "messageId", messageId }, + { "content", content }, + { "topics", topics }, + { "users", users }, + { "targets", targets }, + { "draft", draft }, + { "scheduledAt", scheduledAt } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Message Convert(Dictionary it) => + Models.Message.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); + + } + /// /// Update an SMS message by its unique ID. This endpoint only works on /// messages that are in draft status. Messages that are already processing, @@ -277,6 +315,7 @@ static Models.Message Convert(Dictionary it) => /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateSMS` instead.")] public Task UpdateSms(string messageId, List? topics = null, List? users = null, List? targets = null, string? content = null, bool? draft = null, string? scheduledAt = null) { var apiPath = "/messaging/messages/sms/{messageId}" @@ -310,6 +349,46 @@ static Models.Message Convert(Dictionary it) => } + /// + /// Update an SMS message by its unique ID. This endpoint only works on + /// messages that are in draft status. Messages that are already processing, + /// sent, or failed cannot be updated. + /// + /// + /// + public Task UpdateSMS(string messageId, List? topics = null, List? users = null, List? targets = null, string? content = null, bool? draft = null, string? scheduledAt = null) + { + var apiPath = "/messaging/messages/sms/{messageId}" + .Replace("{messageId}", messageId); + + var apiParameters = new Dictionary() + { + { "topics", topics }, + { "users", users }, + { "targets", targets }, + { "content", content }, + { "draft", draft }, + { "scheduledAt", scheduledAt } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Message Convert(Dictionary it) => + Models.Message.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); + + } + /// /// Get a message by its unique ID. /// @@ -467,6 +546,7 @@ static Models.ProviderList Convert(Dictionary it) => /// Create a new Apple Push Notification service provider. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateAPNSProvider` instead.")] public Task CreateApnsProvider(string providerId, string name, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null, bool? enabled = null) { var apiPath = "/messaging/providers/apns"; @@ -501,10 +581,49 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Create a new Apple Push Notification service provider. + /// + /// + public Task CreateAPNSProvider(string providerId, string name, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null, bool? enabled = null) + { + var apiPath = "/messaging/providers/apns"; + + var apiParameters = new Dictionary() + { + { "providerId", providerId }, + { "name", name }, + { "authKey", authKey }, + { "authKeyId", authKeyId }, + { "teamId", teamId }, + { "bundleId", bundleId }, + { "sandbox", sandbox }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Update a Apple Push Notification service provider by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateAPNSProvider` instead.")] public Task UpdateApnsProvider(string providerId, string? name = null, bool? enabled = null, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null) { var apiPath = "/messaging/providers/apns/{providerId}" @@ -539,10 +658,49 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Update a Apple Push Notification service provider by its unique ID. + /// + /// + public Task UpdateAPNSProvider(string providerId, string? name = null, bool? enabled = null, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null) + { + var apiPath = "/messaging/providers/apns/{providerId}" + .Replace("{providerId}", providerId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "authKey", authKey }, + { "authKeyId", authKeyId }, + { "teamId", teamId }, + { "bundleId", bundleId }, + { "sandbox", sandbox } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Create a new Firebase Cloud Messaging provider. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateFCMProvider` instead.")] public Task CreateFcmProvider(string providerId, string name, object? serviceAccountJSON = null, bool? enabled = null) { var apiPath = "/messaging/providers/fcm"; @@ -573,10 +731,45 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Create a new Firebase Cloud Messaging provider. + /// + /// + public Task CreateFCMProvider(string providerId, string name, object? serviceAccountJSON = null, bool? enabled = null) + { + var apiPath = "/messaging/providers/fcm"; + + var apiParameters = new Dictionary() + { + { "providerId", providerId }, + { "name", name }, + { "serviceAccountJSON", serviceAccountJSON }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Update a Firebase Cloud Messaging provider by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateFCMProvider` instead.")] public Task UpdateFcmProvider(string providerId, string? name = null, bool? enabled = null, object? serviceAccountJSON = null) { var apiPath = "/messaging/providers/fcm/{providerId}" @@ -607,6 +800,40 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Update a Firebase Cloud Messaging provider by its unique ID. + /// + /// + public Task UpdateFCMProvider(string providerId, string? name = null, bool? enabled = null, object? serviceAccountJSON = null) + { + var apiPath = "/messaging/providers/fcm/{providerId}" + .Replace("{providerId}", providerId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "serviceAccountJSON", serviceAccountJSON } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Create a new Mailgun provider. /// @@ -839,6 +1066,7 @@ static Models.Provider Convert(Dictionary it) => /// Create a new SMTP provider. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateSMTPProvider` instead.")] public Task CreateSmtpProvider(string providerId, string name, string host, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { var apiPath = "/messaging/providers/smtp"; @@ -879,10 +1107,55 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Create a new SMTP provider. + /// + /// + public Task CreateSMTPProvider(string providerId, string name, string host, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) + { + var apiPath = "/messaging/providers/smtp"; + + var apiParameters = new Dictionary() + { + { "providerId", providerId }, + { "name", name }, + { "host", host }, + { "port", port }, + { "username", username }, + { "password", password }, + { "encryption", encryption?.Value }, + { "autoTLS", autoTLS }, + { "mailer", mailer }, + { "fromName", fromName }, + { "fromEmail", fromEmail }, + { "replyToName", replyToName }, + { "replyToEmail", replyToEmail }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Update a SMTP provider by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateSMTPProvider` instead.")] public Task UpdateSmtpProvider(string providerId, string? name = null, string? host = null, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { var apiPath = "/messaging/providers/smtp/{providerId}" @@ -923,6 +1196,50 @@ static Models.Provider Convert(Dictionary it) => } + /// + /// Update a SMTP provider by its unique ID. + /// + /// + public Task UpdateSMTPProvider(string providerId, string? name = null, string? host = null, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) + { + var apiPath = "/messaging/providers/smtp/{providerId}" + .Replace("{providerId}", providerId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "host", host }, + { "port", port }, + { "username", username }, + { "password", password }, + { "encryption", encryption?.Value }, + { "autoTLS", autoTLS }, + { "mailer", mailer }, + { "fromName", fromName }, + { "fromEmail", fromEmail }, + { "replyToName", replyToName }, + { "replyToEmail", replyToEmail }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Provider Convert(Dictionary it) => + Models.Provider.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); + + } + /// /// Create a new Telesign provider. /// diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index 2ed2d338..bda4b8fe 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -8,9 +8,9 @@ namespace Appwrite.Services { - public class TablesDb : Service + public class TablesDB : Service { - public TablesDb(Client client) : base(client) + public TablesDB(Client client) : base(client) { } @@ -209,7 +209,7 @@ static Models.TableList Convert(Dictionary it) => /// /// Create a new Table. Before using this route, you should create a new /// database resource using either a [server - /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) /// API or directly from your database console. /// /// @@ -1367,7 +1367,7 @@ static Models.RowList Convert(Dictionary it) => /// /// Create a new Row. Before using this route, you should create a new table /// resource using either a [server - /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) /// API or directly from your database console. /// /// @@ -1405,7 +1405,7 @@ static Models.Row Convert(Dictionary it) => /// /// Create new Rows. Before using this route, you should create a new table /// resource using either a [server - /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) /// API or directly from your database console. /// /// @@ -1441,7 +1441,7 @@ static Models.RowList Convert(Dictionary it) => /// /// Create or update Rows. Before using this route, you should create a new /// table resource using either a [server - /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) /// API or directly from your database console. /// /// @@ -1581,7 +1581,7 @@ static Models.Row Convert(Dictionary it) => /// /// Create or update a Row. Before using this route, you should create a new /// table resource using either a [server - /// integration](https://appwrite.io/docs/server/databases#databasesCreateTable) + /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) /// API or directly from your database console. /// /// diff --git a/Appwrite/Services/Users.cs b/Appwrite/Services/Users.cs index 646c4db3..b9b05fd7 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -643,6 +643,7 @@ static Models.MembershipList Convert(Dictionary it) => /// Enable or disable MFA on a user account. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFA` instead.")] public Task UpdateMfa(string userId, bool mfa) { var apiPath = "/users/{userId}/mfa" @@ -671,10 +672,43 @@ static Models.User Convert(Dictionary it) => } + /// + /// Enable or disable MFA on a user account. + /// + /// + public Task UpdateMFA(string userId, bool mfa) + { + var apiPath = "/users/{userId}/mfa" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + { "mfa", mfa } + }; + + 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); + + } + /// /// Delete an authenticator app. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead.")] public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.AuthenticatorType type) { var apiPath = "/users/{userId}/mfa/authenticators/{type}" @@ -692,6 +726,35 @@ public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.Authent + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Delete an authenticator app. + /// + /// + public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.AuthenticatorType type) + { + var apiPath = "/users/{userId}/mfa/authenticators/{type}" + .Replace("{userId}", userId) + .Replace("{type}", type.Value); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + return _client.Call( method: "DELETE", path: apiPath, @@ -704,6 +767,7 @@ public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.Authent /// List the factors available on the account to be used as a MFA challange. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead.")] public Task ListMfaFactors(string userId) { var apiPath = "/users/{userId}/mfa/factors" @@ -730,6 +794,36 @@ static Models.MfaFactors Convert(Dictionary it) => } + /// + /// List the factors available on the account to be used as a MFA challange. + /// + /// + public Task ListMFAFactors(string userId) + { + var apiPath = "/users/{userId}/mfa/factors" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.MfaFactors Convert(Dictionary it) => + Models.MfaFactors.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 recovery codes that can be used as backup for MFA flow by User ID. /// Before getting codes, they must be generated using @@ -737,6 +831,7 @@ static Models.MfaFactors Convert(Dictionary it) => /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead.")] public Task GetMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" @@ -763,6 +858,39 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Get recovery codes that can be used as backup for MFA flow by User ID. + /// Before getting codes, they must be generated using + /// [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + /// method. + /// + /// + public Task GetMFARecoveryCodes(string userId) + { + var apiPath = "/users/{userId}/mfa/recovery-codes" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Regenerate recovery codes that can be used as backup for MFA flow by User /// ID. Before regenerating codes, they must be first generated using @@ -770,6 +898,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead.")] public Task UpdateMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" @@ -797,6 +926,40 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Regenerate recovery codes that can be used as backup for MFA flow by User + /// ID. Before regenerating codes, they must be first generated using + /// [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) + /// method. + /// + /// + public Task UpdateMFARecoveryCodes(string userId) + { + var apiPath = "/users/{userId}/mfa/recovery-codes" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Generate recovery codes used as backup for MFA flow for User ID. Recovery /// codes can be used as a MFA verification type in @@ -804,6 +967,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method by client SDK. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead.")] public Task CreateMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" @@ -831,6 +995,40 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => } + /// + /// Generate recovery codes used as backup for MFA flow for User ID. Recovery + /// codes can be used as a MFA verification type in + /// [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) + /// method by client SDK. + /// + /// + public Task CreateMFARecoveryCodes(string userId) + { + var apiPath = "/users/{userId}/mfa/recovery-codes" + .Replace("{userId}", userId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.MfaRecoveryCodes Convert(Dictionary it) => + Models.MfaRecoveryCodes.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); + + } + /// /// Update the user name by its unique ID. /// diff --git a/docs/examples/account/create-m-f-a-authenticator.md b/docs/examples/account/create-m-f-a-authenticator.md new file mode 100644 index 00000000..9076fcd0 --- /dev/null +++ b/docs/examples/account/create-m-f-a-authenticator.md @@ -0,0 +1,15 @@ +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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaType result = await account.CreateMFAAuthenticator( + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/account/create-m-f-a-challenge.md b/docs/examples/account/create-m-f-a-challenge.md new file mode 100644 index 00000000..32497b4e --- /dev/null +++ b/docs/examples/account/create-m-f-a-challenge.md @@ -0,0 +1,14 @@ +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 + +Account account = new Account(client); + +MfaChallenge result = await account.CreateMFAChallenge( + factor: AuthenticationFactor.Email +); \ No newline at end of file diff --git a/docs/examples/account/create-m-f-a-recovery-codes.md b/docs/examples/account/create-m-f-a-recovery-codes.md new file mode 100644 index 00000000..406fd449 --- /dev/null +++ b/docs/examples/account/create-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +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 + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); diff --git a/docs/examples/account/delete-m-f-a-authenticator.md b/docs/examples/account/delete-m-f-a-authenticator.md new file mode 100644 index 00000000..c695de29 --- /dev/null +++ b/docs/examples/account/delete-m-f-a-authenticator.md @@ -0,0 +1,15 @@ +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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteMFAAuthenticator( + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/account/get-m-f-a-recovery-codes.md b/docs/examples/account/get-m-f-a-recovery-codes.md new file mode 100644 index 00000000..2e5468ad --- /dev/null +++ b/docs/examples/account/get-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +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 + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); diff --git a/docs/examples/account/list-m-f-a-factors.md b/docs/examples/account/list-m-f-a-factors.md new file mode 100644 index 00000000..f284f6f2 --- /dev/null +++ b/docs/examples/account/list-m-f-a-factors.md @@ -0,0 +1,12 @@ +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 + +Account account = new Account(client); + +MfaFactors result = await account.ListMFAFactors(); diff --git a/docs/examples/account/update-m-f-a-authenticator.md b/docs/examples/account/update-m-f-a-authenticator.md new file mode 100644 index 00000000..f5dd5c50 --- /dev/null +++ b/docs/examples/account/update-m-f-a-authenticator.md @@ -0,0 +1,16 @@ +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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateMFAAuthenticator( + type: AuthenticatorType.Totp, + otp: "" +); \ No newline at end of file diff --git a/docs/examples/account/update-m-f-a-challenge.md b/docs/examples/account/update-m-f-a-challenge.md new file mode 100644 index 00000000..f9a9db46 --- /dev/null +++ b/docs/examples/account/update-m-f-a-challenge.md @@ -0,0 +1,15 @@ +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 + +Account account = new Account(client); + +Session result = await account.UpdateMFAChallenge( + challengeId: "", + otp: "" +); \ No newline at end of file diff --git a/docs/examples/account/update-m-f-a-recovery-codes.md b/docs/examples/account/update-m-f-a-recovery-codes.md new file mode 100644 index 00000000..bfc6c876 --- /dev/null +++ b/docs/examples/account/update-m-f-a-recovery-codes.md @@ -0,0 +1,12 @@ +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 + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md new file mode 100644 index 00000000..74bfe5ec --- /dev/null +++ b/docs/examples/messaging/create-a-p-n-s-provider.md @@ -0,0 +1,21 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateAPNSProvider( + providerId: "", + name: "", + authKey: "", // optional + authKeyId: "", // optional + teamId: "", // optional + bundleId: "", // optional + sandbox: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md new file mode 100644 index 00000000..0b72bb3f --- /dev/null +++ b/docs/examples/messaging/create-f-c-m-provider.md @@ -0,0 +1,17 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateFCMProvider( + providerId: "", + name: "", + serviceAccountJSON: [object], // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md new file mode 100644 index 00000000..f67a4316 --- /dev/null +++ b/docs/examples/messaging/create-s-m-s.md @@ -0,0 +1,20 @@ +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 + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreateSMS( + messageId: "", + content: "", + topics: new List(), // optional + users: new List(), // optional + targets: new List(), // optional + draft: false, // optional + scheduledAt: "" // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md new file mode 100644 index 00000000..d29826dd --- /dev/null +++ b/docs/examples/messaging/create-s-m-t-p-provider.md @@ -0,0 +1,28 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSMTPProvider( + providerId: "", + name: "", + host: "", + port: 1, // optional + username: "", // optional + password: "", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "", // optional + fromName: "", // optional + fromEmail: "email@example.com", // optional + replyToName: "", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md new file mode 100644 index 00000000..24cd49da --- /dev/null +++ b/docs/examples/messaging/update-a-p-n-s-provider.md @@ -0,0 +1,21 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateAPNSProvider( + providerId: "", + name: "", // optional + enabled: false, // optional + authKey: "", // optional + authKeyId: "", // optional + teamId: "", // optional + bundleId: "", // optional + sandbox: false // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md new file mode 100644 index 00000000..df1ce204 --- /dev/null +++ b/docs/examples/messaging/update-f-c-m-provider.md @@ -0,0 +1,17 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateFCMProvider( + providerId: "", + name: "", // optional + enabled: false, // optional + serviceAccountJSON: [object] // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md new file mode 100644 index 00000000..3216fcff --- /dev/null +++ b/docs/examples/messaging/update-s-m-s.md @@ -0,0 +1,20 @@ +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 + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdateSMS( + messageId: "", + topics: new List(), // optional + users: new List(), // optional + targets: new List(), // optional + content: "", // optional + draft: false, // optional + scheduledAt: "" // optional +); \ No newline at end of file diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md new file mode 100644 index 00000000..29553887 --- /dev/null +++ b/docs/examples/messaging/update-s-m-t-p-provider.md @@ -0,0 +1,28 @@ +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 + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSMTPProvider( + providerId: "", + name: "", // optional + host: "", // optional + port: 1, // optional + username: "", // optional + password: "", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "", // optional + fromName: "", // optional + fromEmail: "email@example.com", // optional + replyToName: "", // optional + replyToEmail: "", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 06bc07a8..ff7b647f 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnBoolean result = await tablesDb.CreateBooleanColumn( +ColumnBoolean result = await tablesDB.CreateBooleanColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index d8105179..c03ba361 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnDatetime result = await tablesDb.CreateDatetimeColumn( +ColumnDatetime result = await tablesDB.CreateDatetimeColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index d57f858a..309db628 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnEmail result = await tablesDb.CreateEmailColumn( +ColumnEmail result = await tablesDB.CreateEmailColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 149ae861..632bbef5 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnEnum result = await tablesDb.CreateEnumColumn( +ColumnEnum result = await tablesDB.CreateEnumColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 41dd45ed..e7da5323 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnFloat result = await tablesDb.CreateFloatColumn( +ColumnFloat result = await tablesDB.CreateFloatColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 380a0705..3b19981e 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -8,9 +8,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnIndex result = await tablesDb.CreateIndex( +ColumnIndex result = await tablesDB.CreateIndex( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 2bae4eae..7bdb971a 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnInteger result = await tablesDb.CreateIntegerColumn( +ColumnInteger result = await tablesDB.CreateIntegerColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index 4f94fd9d..9359b289 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnIp result = await tablesDb.CreateIpColumn( +ColumnIp result = await tablesDB.CreateIpColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index e3b22f1d..95b34d02 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -8,9 +8,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnRelationship result = await tablesDb.CreateRelationshipColumn( +ColumnRelationship result = await tablesDB.CreateRelationshipColumn( databaseId: "", tableId: "", relatedTableId: "", diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 5bf1e0fe..ec6255a1 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.CreateRow( +Row result = await tablesDB.CreateRow( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 889437e0..c23e795a 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDb.CreateRows( +RowList result = await tablesDB.CreateRows( databaseId: "", tableId: "", rows: new List() diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 97ce907d..ab77d4da 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnString result = await tablesDb.CreateStringColumn( +ColumnString result = await tablesDB.CreateStringColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 8d1dbc96..7085b9a0 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDb.CreateTable( +Table result = await tablesDB.CreateTable( databaseId: "", tableId: "", name: "", diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index d89ebd33..bfae1ccd 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnUrl result = await tablesDb.CreateUrlColumn( +ColumnUrl result = await tablesDB.CreateUrlColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index a1fc21fb..105d838d 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDb.Create( +Database result = await tablesDB.Create( databaseId: "", name: "", enabled: false // optional diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 77ebbf77..66d98b65 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.DecrementRowColumn( +Row result = await tablesDB.DecrementRowColumn( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index e95f483f..4cc43f20 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.DeleteColumn( +await tablesDB.DeleteColumn( databaseId: "", tableId: "", key: "" diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index da86a942..46c899b7 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.DeleteIndex( +await tablesDB.DeleteIndex( databaseId: "", tableId: "", key: "" diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 77a79bb9..86d7fbf3 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.DeleteRow( +await tablesDB.DeleteRow( databaseId: "", tableId: "", rowId: "" diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index f703ebb3..13d5758f 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.DeleteRows( +await tablesDB.DeleteRows( databaseId: "", tableId: "", queries: new List() // optional diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 9be80ed0..4f772f3f 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.DeleteTable( +await tablesDB.DeleteTable( databaseId: "", tableId: "" ); \ No newline at end of file diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 50c36501..55395b02 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -7,8 +7,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -await tablesDb.Delete( +await tablesDB.Delete( databaseId: "" ); \ No newline at end of file diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 55b17c29..70089aa0 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); - result = await tablesDb.GetColumn( + result = await tablesDB.GetColumn( databaseId: "", tableId: "", key: "" diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 724e38d1..b48ac846 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnIndex result = await tablesDb.GetIndex( +ColumnIndex result = await tablesDB.GetIndex( databaseId: "", tableId: "", key: "" diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 4cc4ca82..99d79ac3 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.GetRow( +Row result = await tablesDB.GetRow( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 59554e3b..82311e8f 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDb.GetTable( +Table result = await tablesDB.GetTable( databaseId: "", tableId: "" ); \ No newline at end of file diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 2d9c8080..ace26de4 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -7,8 +7,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDb.Get( +Database result = await tablesDB.Get( databaseId: "" ); \ No newline at end of file diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 6d9ce27e..48eabc34 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.IncrementRowColumn( +Row result = await tablesDB.IncrementRowColumn( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 9505574e..345ac00b 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnList result = await tablesDb.ListColumns( +ColumnList result = await tablesDB.ListColumns( databaseId: "", tableId: "", queries: new List() // optional diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 4284d120..6074787f 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnIndexList result = await tablesDb.ListIndexes( +ColumnIndexList result = await tablesDB.ListIndexes( databaseId: "", tableId: "", queries: new List() // optional diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 596c167a..d3f860e8 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDb.ListRows( +RowList result = await tablesDB.ListRows( databaseId: "", tableId: "", queries: new List() // optional diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 2c74b3b6..9e94dc84 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -TableList result = await tablesDb.ListTables( +TableList result = await tablesDB.ListTables( databaseId: "", queries: new List(), // optional search: "" // optional diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 916d004e..8b320eeb 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -DatabaseList result = await tablesDb.List( +DatabaseList result = await tablesDB.List( queries: new List(), // optional search: "" // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 3c0de4cb..b6c6d584 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnBoolean result = await tablesDb.UpdateBooleanColumn( +ColumnBoolean result = await tablesDB.UpdateBooleanColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index ebbf61a7..8236b6af 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnDatetime result = await tablesDb.UpdateDatetimeColumn( +ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 1cf3efff..88567783 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnEmail result = await tablesDb.UpdateEmailColumn( +ColumnEmail result = await tablesDB.UpdateEmailColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 82d1dd81..58c3c65d 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnEnum result = await tablesDb.UpdateEnumColumn( +ColumnEnum result = await tablesDB.UpdateEnumColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 598c117b..057a0767 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnFloat result = await tablesDb.UpdateFloatColumn( +ColumnFloat result = await tablesDB.UpdateFloatColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 4c6da922..2cc3b361 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnInteger result = await tablesDb.UpdateIntegerColumn( +ColumnInteger result = await tablesDB.UpdateIntegerColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 1ab4930f..7e6d64f0 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnIp result = await tablesDb.UpdateIpColumn( +ColumnIp result = await tablesDB.UpdateIpColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index cac13422..9a0a36b6 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -8,9 +8,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnRelationship result = await tablesDb.UpdateRelationshipColumn( +ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 13465195..5eb5acdb 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.UpdateRow( +Row result = await tablesDB.UpdateRow( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 67f7a62e..401464d6 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDb.UpdateRows( +RowList result = await tablesDB.UpdateRows( databaseId: "", tableId: "", data: [object], // optional diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index aa6c0665..df5308dd 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnString result = await tablesDb.UpdateStringColumn( +ColumnString result = await tablesDB.UpdateStringColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index cedf3992..b2d52b75 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Table result = await tablesDb.UpdateTable( +Table result = await tablesDB.UpdateTable( databaseId: "", tableId: "", name: "", diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 55dc4731..d342fc94 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -ColumnUrl result = await tablesDb.UpdateUrlColumn( +ColumnUrl result = await tablesDB.UpdateUrlColumn( databaseId: "", tableId: "", key: "", diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index eb041d4c..920866ba 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Database result = await tablesDb.Update( +Database result = await tablesDB.Update( databaseId: "", name: "", enabled: false // optional diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 4de18264..e1f68a7d 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -Row result = await tablesDb.UpsertRow( +Row result = await tablesDB.UpsertRow( databaseId: "", tableId: "", rowId: "", diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index cf9076c7..199dc2ba 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -7,9 +7,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -TablesDb tablesDb = new TablesDb(client); +TablesDB tablesDB = new TablesDB(client); -RowList result = await tablesDb.UpsertRows( +RowList result = await tablesDB.UpsertRows( databaseId: "", tableId: "", rows: new List() diff --git a/docs/examples/users/create-m-f-a-recovery-codes.md b/docs/examples/users/create-m-f-a-recovery-codes.md new file mode 100644 index 00000000..d0c0d95a --- /dev/null +++ b/docs/examples/users/create-m-f-a-recovery-codes.md @@ -0,0 +1,14 @@ +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); + +MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( + userId: "" +); \ No newline at end of file diff --git a/docs/examples/users/delete-m-f-a-authenticator.md b/docs/examples/users/delete-m-f-a-authenticator.md new file mode 100644 index 00000000..b4cec73a --- /dev/null +++ b/docs/examples/users/delete-m-f-a-authenticator.md @@ -0,0 +1,16 @@ +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 + +Users users = new Users(client); + +await users.DeleteMFAAuthenticator( + userId: "", + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/users/get-m-f-a-recovery-codes.md b/docs/examples/users/get-m-f-a-recovery-codes.md new file mode 100644 index 00000000..ce945311 --- /dev/null +++ b/docs/examples/users/get-m-f-a-recovery-codes.md @@ -0,0 +1,14 @@ +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); + +MfaRecoveryCodes result = await users.GetMFARecoveryCodes( + userId: "" +); \ No newline at end of file diff --git a/docs/examples/users/list-m-f-a-factors.md b/docs/examples/users/list-m-f-a-factors.md new file mode 100644 index 00000000..956949d0 --- /dev/null +++ b/docs/examples/users/list-m-f-a-factors.md @@ -0,0 +1,14 @@ +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); + +MfaFactors result = await users.ListMFAFactors( + userId: "" +); \ No newline at end of file diff --git a/docs/examples/users/update-m-f-a-recovery-codes.md b/docs/examples/users/update-m-f-a-recovery-codes.md new file mode 100644 index 00000000..ac14ccf9 --- /dev/null +++ b/docs/examples/users/update-m-f-a-recovery-codes.md @@ -0,0 +1,14 @@ +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); + +MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( + userId: "" +); \ No newline at end of file diff --git a/docs/examples/users/update-m-f-a.md b/docs/examples/users/update-m-f-a.md new file mode 100644 index 00000000..11149823 --- /dev/null +++ b/docs/examples/users/update-m-f-a.md @@ -0,0 +1,15 @@ +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.UpdateMFA( + userId: "", + mfa: false +); \ No newline at end of file From a63c52224297a578291037380e192bdeb96c6de1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 23 Aug 2025 20:12:34 +1200 Subject: [PATCH 5/7] Add 1.8.x support --- Appwrite/Models/Execution.cs | 11 +++++++++-- Appwrite/Services/Account.cs | 8 ++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index e712b947..93824355 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -24,6 +24,9 @@ public class Execution [JsonPropertyName("functionId")] public string FunctionId { get; private set; } + [JsonPropertyName("deploymentId")] + public string DeploymentId { get; private set; } + [JsonPropertyName("trigger")] public string Trigger { get; private set; } @@ -66,6 +69,7 @@ public Execution( string updatedAt, List permissions, string functionId, + string deploymentId, string trigger, string status, string requestMethod, @@ -84,6 +88,7 @@ public Execution( UpdatedAt = updatedAt; Permissions = permissions; FunctionId = functionId; + DeploymentId = deploymentId; Trigger = trigger; Status = status; RequestMethod = requestMethod; @@ -104,14 +109,15 @@ public Execution( updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"] is JsonElement jsonArrayProp4 ? jsonArrayProp4.Deserialize>()! : (List)map["$permissions"], functionId: map["functionId"].ToString(), + deploymentId: map["deploymentId"].ToString(), trigger: map["trigger"].ToString(), status: map["status"].ToString(), requestMethod: map["requestMethod"].ToString(), requestPath: map["requestPath"].ToString(), - requestHeaders: map["requestHeaders"] is JsonElement jsonArray10 ? jsonArray10.Deserialize>>()!.Select(it => Headers.From(map: it)).ToList() : ((IEnumerable>)map["requestHeaders"]).Select(it => Headers.From(map: it)).ToList(), + requestHeaders: map["requestHeaders"] is JsonElement jsonArray11 ? jsonArray11.Deserialize>>()!.Select(it => Headers.From(map: it)).ToList() : ((IEnumerable>)map["requestHeaders"]).Select(it => Headers.From(map: it)).ToList(), responseStatusCode: Convert.ToInt64(map["responseStatusCode"]), responseBody: map["responseBody"].ToString(), - responseHeaders: map["responseHeaders"] is JsonElement jsonArray13 ? jsonArray13.Deserialize>>()!.Select(it => Headers.From(map: it)).ToList() : ((IEnumerable>)map["responseHeaders"]).Select(it => Headers.From(map: it)).ToList(), + responseHeaders: map["responseHeaders"] is JsonElement jsonArray14 ? jsonArray14.Deserialize>>()!.Select(it => Headers.From(map: it)).ToList() : ((IEnumerable>)map["responseHeaders"]).Select(it => Headers.From(map: it)).ToList(), logs: map["logs"].ToString(), errors: map["errors"].ToString(), duration: Convert.ToDouble(map["duration"]), @@ -125,6 +131,7 @@ public Execution( { "$updatedAt", UpdatedAt }, { "$permissions", Permissions }, { "functionId", FunctionId }, + { "deploymentId", DeploymentId }, { "trigger", Trigger }, { "status", Status }, { "requestMethod", RequestMethod }, diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 63454e3a..8f22c2d7 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -1480,8 +1480,11 @@ static Models.User Convert(Dictionary it) => /// /// Sends the user an email with a secret key for creating a session. If the - /// provided user ID has not be registered, a new user will be created. Use the - /// returned user ID and secret and submit a request to the [POST + /// email address has never been used, a **new account is created** using the + /// provided `userId`. Otherwise, if the email address is already attached to + /// an account, the **user ID is ignored**. Then, the user will receive an + /// email with the one-time password. Use the returned user ID and secret and + /// submit a request to the [POST /// /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) /// endpoint to complete the login process. The secret sent to the user's email /// is valid for 15 minutes. @@ -1489,6 +1492,7 @@ static Models.User Convert(Dictionary it) => /// A user is limited to 10 active sessions at a time by default. [Learn more /// about session /// limits](https://appwrite.io/docs/authentication-security#limits). + /// /// /// public Task CreateEmailToken(string userId, string email, bool? phrase = null) From 7c2d536a9308edf2fbce1bec2dedae5c8f9e4eff Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 23 Aug 2025 22:18:01 +1200 Subject: [PATCH 6/7] Add 1.8.x support --- Appwrite/Services/Account.cs | 18 +++++++++--------- Appwrite/Services/Messaging.cs | 16 ++++++++-------- Appwrite/Services/Users.cs | 12 ++++++------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 8f22c2d7..0f9efdad 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -283,7 +283,7 @@ static Models.User Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFAAuthenticator` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead.")] public Task CreateMfaAuthenticator(Appwrite.Enums.AuthenticatorType type) { var apiPath = "/account/mfa/authenticators/{type}" @@ -351,7 +351,7 @@ static Models.MfaType Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFAAuthenticator` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.")] public Task UpdateMfaAuthenticator(Appwrite.Enums.AuthenticatorType type, string otp) { var apiPath = "/account/mfa/authenticators/{type}" @@ -418,7 +418,7 @@ static Models.User Convert(Dictionary it) => /// Delete an authenticator for a user by ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead.")] public Task DeleteMfaAuthenticator(Appwrite.Enums.AuthenticatorType type) { var apiPath = "/account/mfa/authenticators/{type}" @@ -477,7 +477,7 @@ public Task DeleteMFAAuthenticator(Appwrite.Enums.AuthenticatorType type /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFAChallenge` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.")] public Task CreateMfaChallenge(Appwrite.Enums.AuthenticationFactor factor) { var apiPath = "/account/mfa/challenge"; @@ -546,7 +546,7 @@ static Models.MfaChallenge Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFAChallenge` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead.")] public Task UpdateMfaChallenge(string challengeId, string otp) { var apiPath = "/account/mfa/challenge"; @@ -615,7 +615,7 @@ static Models.Session Convert(Dictionary it) => /// List the factors available on the account to be used as a MFA challange. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.")] public Task ListMfaFactors() { var apiPath = "/account/mfa/factors"; @@ -677,7 +677,7 @@ static Models.MfaFactors Convert(Dictionary it) => /// method. An OTP challenge is required to read recovery codes. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.")] public Task GetMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; @@ -743,7 +743,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.")] public Task CreateMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; @@ -811,7 +811,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. An OTP challenge is required to regenreate recovery codes. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.")] public Task UpdateMfaRecoveryCodes() { var apiPath = "/account/mfa/recovery-codes"; diff --git a/Appwrite/Services/Messaging.cs b/Appwrite/Services/Messaging.cs index 5e8f8fa7..04392ecf 100644 --- a/Appwrite/Services/Messaging.cs +++ b/Appwrite/Services/Messaging.cs @@ -237,7 +237,7 @@ static Models.Message Convert(Dictionary it) => /// Create a new SMS message. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateSMS` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.createSMS` instead.")] public Task CreateSms(string messageId, string content, List? topics = null, List? users = null, List? targets = null, bool? draft = null, string? scheduledAt = null) { var apiPath = "/messaging/messages/sms"; @@ -315,7 +315,7 @@ static Models.Message Convert(Dictionary it) => /// /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateSMS` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead.")] public Task UpdateSms(string messageId, List? topics = null, List? users = null, List? targets = null, string? content = null, bool? draft = null, string? scheduledAt = null) { var apiPath = "/messaging/messages/sms/{messageId}" @@ -546,7 +546,7 @@ static Models.ProviderList Convert(Dictionary it) => /// Create a new Apple Push Notification service provider. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateAPNSProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.createAPNSProvider` instead.")] public Task CreateApnsProvider(string providerId, string name, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null, bool? enabled = null) { var apiPath = "/messaging/providers/apns"; @@ -623,7 +623,7 @@ static Models.Provider Convert(Dictionary it) => /// Update a Apple Push Notification service provider by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateAPNSProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead.")] public Task UpdateApnsProvider(string providerId, string? name = null, bool? enabled = null, string? authKey = null, string? authKeyId = null, string? teamId = null, string? bundleId = null, bool? sandbox = null) { var apiPath = "/messaging/providers/apns/{providerId}" @@ -700,7 +700,7 @@ static Models.Provider Convert(Dictionary it) => /// Create a new Firebase Cloud Messaging provider. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateFCMProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.createFCMProvider` instead.")] public Task CreateFcmProvider(string providerId, string name, object? serviceAccountJSON = null, bool? enabled = null) { var apiPath = "/messaging/providers/fcm"; @@ -769,7 +769,7 @@ static Models.Provider Convert(Dictionary it) => /// Update a Firebase Cloud Messaging provider by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateFCMProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead.")] public Task UpdateFcmProvider(string providerId, string? name = null, bool? enabled = null, object? serviceAccountJSON = null) { var apiPath = "/messaging/providers/fcm/{providerId}" @@ -1066,7 +1066,7 @@ static Models.Provider Convert(Dictionary it) => /// Create a new SMTP provider. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateSMTPProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead.")] public Task CreateSmtpProvider(string providerId, string name, string host, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { var apiPath = "/messaging/providers/smtp"; @@ -1155,7 +1155,7 @@ static Models.Provider Convert(Dictionary it) => /// Update a SMTP provider by its unique ID. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateSMTPProvider` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead.")] public Task UpdateSmtpProvider(string providerId, string? name = null, string? host = null, long? port = null, string? username = null, string? password = null, Appwrite.Enums.SmtpEncryption? encryption = null, bool? autoTLS = null, string? mailer = null, string? fromName = null, string? fromEmail = null, string? replyToName = null, string? replyToEmail = null, bool? enabled = null) { var apiPath = "/messaging/providers/smtp/{providerId}" diff --git a/Appwrite/Services/Users.cs b/Appwrite/Services/Users.cs index b9b05fd7..e1af4f6f 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -643,7 +643,7 @@ static Models.MembershipList Convert(Dictionary it) => /// Enable or disable MFA on a user account. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFA` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.")] public Task UpdateMfa(string userId, bool mfa) { var apiPath = "/users/{userId}/mfa" @@ -708,7 +708,7 @@ static Models.User Convert(Dictionary it) => /// Delete an authenticator app. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `DeleteMFAAuthenticator` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.")] public Task DeleteMfaAuthenticator(string userId, Appwrite.Enums.AuthenticatorType type) { var apiPath = "/users/{userId}/mfa/authenticators/{type}" @@ -767,7 +767,7 @@ public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.Authent /// List the factors available on the account to be used as a MFA challange. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `ListMFAFactors` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.")] public Task ListMfaFactors(string userId) { var apiPath = "/users/{userId}/mfa/factors" @@ -831,7 +831,7 @@ static Models.MfaFactors Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `GetMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.")] public Task GetMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" @@ -898,7 +898,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `UpdateMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.")] public Task UpdateMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" @@ -967,7 +967,7 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) => /// method by client SDK. /// /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `CreateMFARecoveryCodes` instead.")] + [Obsolete("This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.")] public Task CreateMfaRecoveryCodes(string userId) { var apiPath = "/users/{userId}/mfa/recovery-codes" From bff5e97159c02a3a521582e151cd0e165e7c5d4f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 26 Aug 2025 04:25:22 +1200 Subject: [PATCH 7/7] Fix docs --- .../{create-j-w-t.md => create-jwt.md} | 0 .../account/create-m-f-a-authenticator.md | 15 ---------- .../account/create-m-f-a-challenge.md | 14 ---------- .../account/create-m-f-a-recovery-codes.md | 12 -------- ...r-l-token.md => create-magic-url-token.md} | 0 .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- ...auth2token.md => create-o-auth-2-token.md} | 0 .../account/delete-m-f-a-authenticator.md | 15 ---------- .../account/delete-mfa-authenticator.md | 2 +- .../account/get-m-f-a-recovery-codes.md | 12 -------- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/list-m-f-a-factors.md | 12 -------- docs/examples/account/list-mfa-factors.md | 2 +- .../account/update-m-f-a-authenticator.md | 16 ----------- .../account/update-m-f-a-challenge.md | 15 ---------- .../account/update-m-f-a-recovery-codes.md | 12 -------- ...session.md => update-magic-url-session.md} | 0 .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- .../{update-m-f-a.md => update-mfa.md} | 0 .../avatars/{get-q-r.md => get-qr.md} | 0 .../examples/health/{get-d-b.md => get-db.md} | 0 ...-countries-e-u.md => list-countries-eu.md} | 0 .../messaging/create-a-p-n-s-provider.md | 21 -------------- .../messaging/create-apns-provider.md | 2 +- .../messaging/create-f-c-m-provider.md | 17 ----------- .../examples/messaging/create-fcm-provider.md | 2 +- ...1provider.md => create-msg-91-provider.md} | 0 docs/examples/messaging/create-s-m-s.md | 20 ------------- .../messaging/create-s-m-t-p-provider.md | 28 ------------------- docs/examples/messaging/create-sms.md | 2 +- .../messaging/create-smtp-provider.md | 2 +- .../messaging/update-a-p-n-s-provider.md | 21 -------------- .../messaging/update-apns-provider.md | 2 +- .../messaging/update-f-c-m-provider.md | 17 ----------- .../examples/messaging/update-fcm-provider.md | 2 +- ...1provider.md => update-msg-91-provider.md} | 0 docs/examples/messaging/update-s-m-s.md | 20 ------------- .../messaging/update-s-m-t-p-provider.md | 28 ------------------- docs/examples/messaging/update-sms.md | 2 +- .../messaging/update-smtp-provider.md | 2 +- ...e-argon2user.md => create-argon-2-user.md} | 0 .../users/{create-j-w-t.md => create-jwt.md} | 0 .../users/create-m-f-a-recovery-codes.md | 14 ---------- ...create-m-d5user.md => create-md-5-user.md} | 0 .../users/create-mfa-recovery-codes.md | 2 +- ...-h-pass-user.md => create-ph-pass-user.md} | 0 ...reate-s-h-a-user.md => create-sha-user.md} | 0 .../users/delete-m-f-a-authenticator.md | 16 ----------- .../users/delete-mfa-authenticator.md | 2 +- .../users/get-m-f-a-recovery-codes.md | 14 ---------- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/list-m-f-a-factors.md | 14 ---------- docs/examples/users/list-mfa-factors.md | 2 +- .../users/update-m-f-a-recovery-codes.md | 14 ---------- docs/examples/users/update-m-f-a.md | 15 ---------- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- 61 files changed, 23 insertions(+), 405 deletions(-) rename docs/examples/account/{create-j-w-t.md => create-jwt.md} (100%) delete mode 100644 docs/examples/account/create-m-f-a-authenticator.md delete mode 100644 docs/examples/account/create-m-f-a-challenge.md delete mode 100644 docs/examples/account/create-m-f-a-recovery-codes.md rename docs/examples/account/{create-magic-u-r-l-token.md => create-magic-url-token.md} (100%) rename docs/examples/account/{create-o-auth2token.md => create-o-auth-2-token.md} (100%) delete mode 100644 docs/examples/account/delete-m-f-a-authenticator.md delete mode 100644 docs/examples/account/get-m-f-a-recovery-codes.md delete mode 100644 docs/examples/account/list-m-f-a-factors.md delete mode 100644 docs/examples/account/update-m-f-a-authenticator.md delete mode 100644 docs/examples/account/update-m-f-a-challenge.md delete mode 100644 docs/examples/account/update-m-f-a-recovery-codes.md rename docs/examples/account/{update-magic-u-r-l-session.md => update-magic-url-session.md} (100%) rename docs/examples/account/{update-m-f-a.md => update-mfa.md} (100%) rename docs/examples/avatars/{get-q-r.md => get-qr.md} (100%) rename docs/examples/health/{get-d-b.md => get-db.md} (100%) rename docs/examples/locale/{list-countries-e-u.md => list-countries-eu.md} (100%) delete mode 100644 docs/examples/messaging/create-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/create-f-c-m-provider.md rename docs/examples/messaging/{create-msg91provider.md => create-msg-91-provider.md} (100%) delete mode 100644 docs/examples/messaging/create-s-m-s.md delete mode 100644 docs/examples/messaging/create-s-m-t-p-provider.md delete mode 100644 docs/examples/messaging/update-a-p-n-s-provider.md delete mode 100644 docs/examples/messaging/update-f-c-m-provider.md rename docs/examples/messaging/{update-msg91provider.md => update-msg-91-provider.md} (100%) delete mode 100644 docs/examples/messaging/update-s-m-s.md delete mode 100644 docs/examples/messaging/update-s-m-t-p-provider.md rename docs/examples/users/{create-argon2user.md => create-argon-2-user.md} (100%) rename docs/examples/users/{create-j-w-t.md => create-jwt.md} (100%) delete mode 100644 docs/examples/users/create-m-f-a-recovery-codes.md rename docs/examples/users/{create-m-d5user.md => create-md-5-user.md} (100%) rename docs/examples/users/{create-p-h-pass-user.md => create-ph-pass-user.md} (100%) rename docs/examples/users/{create-s-h-a-user.md => create-sha-user.md} (100%) delete mode 100644 docs/examples/users/delete-m-f-a-authenticator.md delete mode 100644 docs/examples/users/get-m-f-a-recovery-codes.md delete mode 100644 docs/examples/users/list-m-f-a-factors.md delete mode 100644 docs/examples/users/update-m-f-a-recovery-codes.md delete mode 100644 docs/examples/users/update-m-f-a.md diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-jwt.md similarity index 100% rename from docs/examples/account/create-j-w-t.md rename to docs/examples/account/create-jwt.md diff --git a/docs/examples/account/create-m-f-a-authenticator.md b/docs/examples/account/create-m-f-a-authenticator.md deleted file mode 100644 index 9076fcd0..00000000 --- a/docs/examples/account/create-m-f-a-authenticator.md +++ /dev/null @@ -1,15 +0,0 @@ -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 - .SetSession(""); // The user session to authenticate with - -Account account = new Account(client); - -MfaType result = await account.CreateMFAAuthenticator( - type: AuthenticatorType.Totp -); \ No newline at end of file diff --git a/docs/examples/account/create-m-f-a-challenge.md b/docs/examples/account/create-m-f-a-challenge.md deleted file mode 100644 index 32497b4e..00000000 --- a/docs/examples/account/create-m-f-a-challenge.md +++ /dev/null @@ -1,14 +0,0 @@ -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 - -Account account = new Account(client); - -MfaChallenge result = await account.CreateMFAChallenge( - factor: AuthenticationFactor.Email -); \ No newline at end of file diff --git a/docs/examples/account/create-m-f-a-recovery-codes.md b/docs/examples/account/create-m-f-a-recovery-codes.md deleted file mode 100644 index 406fd449..00000000 --- a/docs/examples/account/create-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -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 - -Account account = new Account(client); - -MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-url-token.md similarity index 100% rename from docs/examples/account/create-magic-u-r-l-token.md rename to docs/examples/account/create-magic-url-token.md diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index bc549704..9076fcd0 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -10,6 +10,6 @@ Client client = new Client() Account account = new Account(client); -MfaType result = await account.CreateMfaAuthenticator( +MfaType result = await account.CreateMFAAuthenticator( type: AuthenticatorType.Totp ); \ No newline at end of file diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 734133f2..32497b4e 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -9,6 +9,6 @@ Client client = new Client() Account account = new Account(client); -MfaChallenge result = await account.CreateMfaChallenge( +MfaChallenge result = await account.CreateMFAChallenge( factor: AuthenticationFactor.Email ); \ No newline at end of file diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 1922a45c..406fd449 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -9,4 +9,4 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.CreateMfaRecoveryCodes(); +MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth-2-token.md similarity index 100% rename from docs/examples/account/create-o-auth2token.md rename to docs/examples/account/create-o-auth-2-token.md diff --git a/docs/examples/account/delete-m-f-a-authenticator.md b/docs/examples/account/delete-m-f-a-authenticator.md deleted file mode 100644 index c695de29..00000000 --- a/docs/examples/account/delete-m-f-a-authenticator.md +++ /dev/null @@ -1,15 +0,0 @@ -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 - .SetSession(""); // The user session to authenticate with - -Account account = new Account(client); - -await account.DeleteMFAAuthenticator( - type: AuthenticatorType.Totp -); \ No newline at end of file diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 2b27cb6a..c695de29 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -10,6 +10,6 @@ Client client = new Client() Account account = new Account(client); -await account.DeleteMfaAuthenticator( +await account.DeleteMFAAuthenticator( type: AuthenticatorType.Totp ); \ No newline at end of file diff --git a/docs/examples/account/get-m-f-a-recovery-codes.md b/docs/examples/account/get-m-f-a-recovery-codes.md deleted file mode 100644 index 2e5468ad..00000000 --- a/docs/examples/account/get-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -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 - -Account account = new Account(client); - -MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index cc39db19..2e5468ad 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -9,4 +9,4 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.GetMfaRecoveryCodes(); +MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); diff --git a/docs/examples/account/list-m-f-a-factors.md b/docs/examples/account/list-m-f-a-factors.md deleted file mode 100644 index f284f6f2..00000000 --- a/docs/examples/account/list-m-f-a-factors.md +++ /dev/null @@ -1,12 +0,0 @@ -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 - -Account account = new Account(client); - -MfaFactors result = await account.ListMFAFactors(); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 29153492..f284f6f2 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -9,4 +9,4 @@ Client client = new Client() Account account = new Account(client); -MfaFactors result = await account.ListMfaFactors(); +MfaFactors result = await account.ListMFAFactors(); diff --git a/docs/examples/account/update-m-f-a-authenticator.md b/docs/examples/account/update-m-f-a-authenticator.md deleted file mode 100644 index f5dd5c50..00000000 --- a/docs/examples/account/update-m-f-a-authenticator.md +++ /dev/null @@ -1,16 +0,0 @@ -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 - .SetSession(""); // The user session to authenticate with - -Account account = new Account(client); - -User result = await account.UpdateMFAAuthenticator( - type: AuthenticatorType.Totp, - otp: "" -); \ No newline at end of file diff --git a/docs/examples/account/update-m-f-a-challenge.md b/docs/examples/account/update-m-f-a-challenge.md deleted file mode 100644 index f9a9db46..00000000 --- a/docs/examples/account/update-m-f-a-challenge.md +++ /dev/null @@ -1,15 +0,0 @@ -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 - -Account account = new Account(client); - -Session result = await account.UpdateMFAChallenge( - challengeId: "", - otp: "" -); \ No newline at end of file diff --git a/docs/examples/account/update-m-f-a-recovery-codes.md b/docs/examples/account/update-m-f-a-recovery-codes.md deleted file mode 100644 index bfc6c876..00000000 --- a/docs/examples/account/update-m-f-a-recovery-codes.md +++ /dev/null @@ -1,12 +0,0 @@ -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 - -Account account = new Account(client); - -MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-url-session.md similarity index 100% rename from docs/examples/account/update-magic-u-r-l-session.md rename to docs/examples/account/update-magic-url-session.md diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 051653d1..f5dd5c50 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -10,7 +10,7 @@ Client client = new Client() Account account = new Account(client); -User result = await account.UpdateMfaAuthenticator( +User result = await account.UpdateMFAAuthenticator( type: AuthenticatorType.Totp, otp: "" ); \ No newline at end of file diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index d2735058..f9a9db46 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -9,7 +9,7 @@ Client client = new Client() Account account = new Account(client); -Session result = await account.UpdateMfaChallenge( +Session result = await account.UpdateMFAChallenge( challengeId: "", otp: "" ); \ No newline at end of file diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 7daaf932..bfc6c876 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -9,4 +9,4 @@ Client client = new Client() Account account = new Account(client); -MfaRecoveryCodes result = await account.UpdateMfaRecoveryCodes(); +MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-mfa.md similarity index 100% rename from docs/examples/account/update-m-f-a.md rename to docs/examples/account/update-mfa.md diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-qr.md similarity index 100% rename from docs/examples/avatars/get-q-r.md rename to docs/examples/avatars/get-qr.md diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-db.md similarity index 100% rename from docs/examples/health/get-d-b.md rename to docs/examples/health/get-db.md diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-eu.md similarity index 100% rename from docs/examples/locale/list-countries-e-u.md rename to docs/examples/locale/list-countries-eu.md diff --git a/docs/examples/messaging/create-a-p-n-s-provider.md b/docs/examples/messaging/create-a-p-n-s-provider.md deleted file mode 100644 index 74bfe5ec..00000000 --- a/docs/examples/messaging/create-a-p-n-s-provider.md +++ /dev/null @@ -1,21 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.CreateAPNSProvider( - providerId: "", - name: "", - authKey: "", // optional - authKeyId: "", // optional - teamId: "", // optional - bundleId: "", // optional - sandbox: false, // optional - enabled: false // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 9cc37a17..74bfe5ec 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateApnsProvider( +Provider result = await messaging.CreateAPNSProvider( providerId: "", name: "", authKey: "", // optional diff --git a/docs/examples/messaging/create-f-c-m-provider.md b/docs/examples/messaging/create-f-c-m-provider.md deleted file mode 100644 index 0b72bb3f..00000000 --- a/docs/examples/messaging/create-f-c-m-provider.md +++ /dev/null @@ -1,17 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.CreateFCMProvider( - providerId: "", - name: "", - serviceAccountJSON: [object], // optional - enabled: false // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 15fdace2..0b72bb3f 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateFcmProvider( +Provider result = await messaging.CreateFCMProvider( providerId: "", name: "", serviceAccountJSON: [object], // optional diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg-91-provider.md similarity index 100% rename from docs/examples/messaging/create-msg91provider.md rename to docs/examples/messaging/create-msg-91-provider.md diff --git a/docs/examples/messaging/create-s-m-s.md b/docs/examples/messaging/create-s-m-s.md deleted file mode 100644 index f67a4316..00000000 --- a/docs/examples/messaging/create-s-m-s.md +++ /dev/null @@ -1,20 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Message result = await messaging.CreateSMS( - messageId: "", - content: "", - topics: new List(), // optional - users: new List(), // optional - targets: new List(), // optional - draft: false, // optional - scheduledAt: "" // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/create-s-m-t-p-provider.md b/docs/examples/messaging/create-s-m-t-p-provider.md deleted file mode 100644 index d29826dd..00000000 --- a/docs/examples/messaging/create-s-m-t-p-provider.md +++ /dev/null @@ -1,28 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.CreateSMTPProvider( - providerId: "", - name: "", - host: "", - port: 1, // optional - username: "", // optional - password: "", // optional - encryption: SmtpEncryption.None, // optional - autoTLS: false, // optional - mailer: "", // optional - fromName: "", // optional - fromEmail: "email@example.com", // optional - replyToName: "", // optional - replyToEmail: "email@example.com", // optional - enabled: false // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 06e9e69e..f67a4316 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.CreateSms( +Message result = await messaging.CreateSMS( messageId: "", content: "", topics: new List(), // optional diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 16b091f9..d29826dd 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.CreateSmtpProvider( +Provider result = await messaging.CreateSMTPProvider( providerId: "", name: "", host: "", diff --git a/docs/examples/messaging/update-a-p-n-s-provider.md b/docs/examples/messaging/update-a-p-n-s-provider.md deleted file mode 100644 index 24cd49da..00000000 --- a/docs/examples/messaging/update-a-p-n-s-provider.md +++ /dev/null @@ -1,21 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.UpdateAPNSProvider( - providerId: "", - name: "", // optional - enabled: false, // optional - authKey: "", // optional - authKeyId: "", // optional - teamId: "", // optional - bundleId: "", // optional - sandbox: false // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index f06e134d..24cd49da 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateApnsProvider( +Provider result = await messaging.UpdateAPNSProvider( providerId: "", name: "", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-f-c-m-provider.md b/docs/examples/messaging/update-f-c-m-provider.md deleted file mode 100644 index df1ce204..00000000 --- a/docs/examples/messaging/update-f-c-m-provider.md +++ /dev/null @@ -1,17 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.UpdateFCMProvider( - providerId: "", - name: "", // optional - enabled: false, // optional - serviceAccountJSON: [object] // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 0006fedf..df1ce204 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateFcmProvider( +Provider result = await messaging.UpdateFCMProvider( providerId: "", name: "", // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg-91-provider.md similarity index 100% rename from docs/examples/messaging/update-msg91provider.md rename to docs/examples/messaging/update-msg-91-provider.md diff --git a/docs/examples/messaging/update-s-m-s.md b/docs/examples/messaging/update-s-m-s.md deleted file mode 100644 index 3216fcff..00000000 --- a/docs/examples/messaging/update-s-m-s.md +++ /dev/null @@ -1,20 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Message result = await messaging.UpdateSMS( - messageId: "", - topics: new List(), // optional - users: new List(), // optional - targets: new List(), // optional - content: "", // optional - draft: false, // optional - scheduledAt: "" // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/update-s-m-t-p-provider.md b/docs/examples/messaging/update-s-m-t-p-provider.md deleted file mode 100644 index 29553887..00000000 --- a/docs/examples/messaging/update-s-m-t-p-provider.md +++ /dev/null @@ -1,28 +0,0 @@ -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 - -Messaging messaging = new Messaging(client); - -Provider result = await messaging.UpdateSMTPProvider( - providerId: "", - name: "", // optional - host: "", // optional - port: 1, // optional - username: "", // optional - password: "", // optional - encryption: SmtpEncryption.None, // optional - autoTLS: false, // optional - mailer: "", // optional - fromName: "", // optional - fromEmail: "email@example.com", // optional - replyToName: "", // optional - replyToEmail: "", // optional - enabled: false // optional -); \ No newline at end of file diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 475d2992..3216fcff 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -9,7 +9,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Message result = await messaging.UpdateSms( +Message result = await messaging.UpdateSMS( messageId: "", topics: new List(), // optional users: new List(), // optional diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 4e7ab6df..29553887 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -10,7 +10,7 @@ Client client = new Client() Messaging messaging = new Messaging(client); -Provider result = await messaging.UpdateSmtpProvider( +Provider result = await messaging.UpdateSMTPProvider( providerId: "", name: "", // optional host: "", // optional diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon-2-user.md similarity index 100% rename from docs/examples/users/create-argon2user.md rename to docs/examples/users/create-argon-2-user.md diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-jwt.md similarity index 100% rename from docs/examples/users/create-j-w-t.md rename to docs/examples/users/create-jwt.md diff --git a/docs/examples/users/create-m-f-a-recovery-codes.md b/docs/examples/users/create-m-f-a-recovery-codes.md deleted file mode 100644 index d0c0d95a..00000000 --- a/docs/examples/users/create-m-f-a-recovery-codes.md +++ /dev/null @@ -1,14 +0,0 @@ -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); - -MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( - userId: "" -); \ No newline at end of file diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-md-5-user.md similarity index 100% rename from docs/examples/users/create-m-d5user.md rename to docs/examples/users/create-md-5-user.md diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 9b43dc02..d0c0d95a 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -9,6 +9,6 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.CreateMfaRecoveryCodes( +MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( userId: "" ); \ No newline at end of file diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-ph-pass-user.md similarity index 100% rename from docs/examples/users/create-p-h-pass-user.md rename to docs/examples/users/create-ph-pass-user.md diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-sha-user.md similarity index 100% rename from docs/examples/users/create-s-h-a-user.md rename to docs/examples/users/create-sha-user.md diff --git a/docs/examples/users/delete-m-f-a-authenticator.md b/docs/examples/users/delete-m-f-a-authenticator.md deleted file mode 100644 index b4cec73a..00000000 --- a/docs/examples/users/delete-m-f-a-authenticator.md +++ /dev/null @@ -1,16 +0,0 @@ -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 - -Users users = new Users(client); - -await users.DeleteMFAAuthenticator( - userId: "", - type: AuthenticatorType.Totp -); \ No newline at end of file diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index bb33dbf9..b4cec73a 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -10,7 +10,7 @@ Client client = new Client() Users users = new Users(client); -await users.DeleteMfaAuthenticator( +await users.DeleteMFAAuthenticator( userId: "", type: AuthenticatorType.Totp ); \ No newline at end of file diff --git a/docs/examples/users/get-m-f-a-recovery-codes.md b/docs/examples/users/get-m-f-a-recovery-codes.md deleted file mode 100644 index ce945311..00000000 --- a/docs/examples/users/get-m-f-a-recovery-codes.md +++ /dev/null @@ -1,14 +0,0 @@ -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); - -MfaRecoveryCodes result = await users.GetMFARecoveryCodes( - userId: "" -); \ No newline at end of file diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 213c3473..ce945311 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -9,6 +9,6 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.GetMfaRecoveryCodes( +MfaRecoveryCodes result = await users.GetMFARecoveryCodes( userId: "" ); \ No newline at end of file diff --git a/docs/examples/users/list-m-f-a-factors.md b/docs/examples/users/list-m-f-a-factors.md deleted file mode 100644 index 956949d0..00000000 --- a/docs/examples/users/list-m-f-a-factors.md +++ /dev/null @@ -1,14 +0,0 @@ -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); - -MfaFactors result = await users.ListMFAFactors( - userId: "" -); \ No newline at end of file diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 54f68ae5..956949d0 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -9,6 +9,6 @@ Client client = new Client() Users users = new Users(client); -MfaFactors result = await users.ListMfaFactors( +MfaFactors result = await users.ListMFAFactors( userId: "" ); \ No newline at end of file diff --git a/docs/examples/users/update-m-f-a-recovery-codes.md b/docs/examples/users/update-m-f-a-recovery-codes.md deleted file mode 100644 index ac14ccf9..00000000 --- a/docs/examples/users/update-m-f-a-recovery-codes.md +++ /dev/null @@ -1,14 +0,0 @@ -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); - -MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( - userId: "" -); \ No newline at end of file diff --git a/docs/examples/users/update-m-f-a.md b/docs/examples/users/update-m-f-a.md deleted file mode 100644 index 11149823..00000000 --- a/docs/examples/users/update-m-f-a.md +++ /dev/null @@ -1,15 +0,0 @@ -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.UpdateMFA( - userId: "", - mfa: false -); \ No newline at end of file diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 35be7077..ac14ccf9 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -9,6 +9,6 @@ Client client = new Client() Users users = new Users(client); -MfaRecoveryCodes result = await users.UpdateMfaRecoveryCodes( +MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( userId: "" ); \ No newline at end of file diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index d009df17..11149823 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -9,7 +9,7 @@ Client client = new Client() Users users = new Users(client); -User result = await users.UpdateMfa( +User result = await users.UpdateMFA( userId: "", mfa: false ); \ No newline at end of file