From f81c287903bf908cb9727848bf0a309a4c54ee67 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Sep 2025 01:31:44 +1200 Subject: [PATCH 1/5] Add time between queries --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 +- Appwrite/Enums/CreditCard.cs | 2 +- Appwrite/Enums/ExecutionMethod.cs | 1 + Appwrite/Enums/IndexType.cs | 1 + Appwrite/Models/AttributeLine.cs | 86 +++++++ Appwrite/Models/AttributePoint.cs | 86 +++++++ Appwrite/Models/AttributePolygon.cs | 86 +++++++ Appwrite/Models/ColumnLine.cs | 86 +++++++ Appwrite/Models/ColumnPoint.cs | 86 +++++++ Appwrite/Models/ColumnPolygon.cs | 86 +++++++ Appwrite/Query.cs | 8 + Appwrite/Services/Account.cs | 4 +- Appwrite/Services/Databases.cs | 224 +++++++++++++++++- Appwrite/Services/TablesDb.cs | 216 +++++++++++++++++ README.md | 6 +- .../databases/create-line-attribute.md | 18 ++ .../databases/create-point-attribute.md | 18 ++ .../databases/create-polygon-attribute.md | 18 ++ .../databases/update-line-attribute.md | 19 ++ .../databases/update-point-attribute.md | 19 ++ .../databases/update-polygon-attribute.md | 19 ++ docs/examples/tablesdb/create-line-column.md | 18 ++ docs/examples/tablesdb/create-point-column.md | 18 ++ .../tablesdb/create-polygon-column.md | 18 ++ docs/examples/tablesdb/update-line-column.md | 19 ++ docs/examples/tablesdb/update-point-column.md | 19 ++ .../tablesdb/update-polygon-column.md | 19 ++ 28 files changed, 1196 insertions(+), 10 deletions(-) create mode 100644 Appwrite/Models/AttributeLine.cs create mode 100644 Appwrite/Models/AttributePoint.cs create mode 100644 Appwrite/Models/AttributePolygon.cs create mode 100644 Appwrite/Models/ColumnLine.cs create mode 100644 Appwrite/Models/ColumnPoint.cs create mode 100644 Appwrite/Models/ColumnPolygon.cs create mode 100644 docs/examples/databases/create-line-attribute.md create mode 100644 docs/examples/databases/create-point-attribute.md create mode 100644 docs/examples/databases/create-polygon-attribute.md create mode 100644 docs/examples/databases/update-line-attribute.md create mode 100644 docs/examples/databases/update-point-attribute.md create mode 100644 docs/examples/databases/update-polygon-attribute.md create mode 100644 docs/examples/tablesdb/create-line-column.md create mode 100644 docs/examples/tablesdb/create-point-column.md create mode 100644 docs/examples/tablesdb/create-polygon-column.md create mode 100644 docs/examples/tablesdb/update-line-column.md create mode 100644 docs/examples/tablesdb/update-point-column.md create mode 100644 docs/examples/tablesdb/update-polygon-column.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 2d5e714f..b0ba8a82 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.16.0 + 0.17.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 82cef553..cfed64e7 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.16.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.17.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.16.0"}, + { "x-sdk-version", "0.17.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/Appwrite/Enums/CreditCard.cs b/Appwrite/Enums/CreditCard.cs index 3c8b3eee..be6c71a2 100644 --- a/Appwrite/Enums/CreditCard.cs +++ b/Appwrite/Enums/CreditCard.cs @@ -23,7 +23,7 @@ public CreditCard(string value) public static CreditCard Mastercard => new CreditCard("mastercard"); public static CreditCard Naranja => new CreditCard("naranja"); public static CreditCard TarjetaShopping => new CreditCard("targeta-shopping"); - public static CreditCard UnionChinaPay => new CreditCard("union-china-pay"); + public static CreditCard UnionPay => new CreditCard("unionpay"); public static CreditCard Visa => new CreditCard("visa"); public static CreditCard MIR => new CreditCard("mir"); public static CreditCard Maestro => new CreditCard("maestro"); diff --git a/Appwrite/Enums/ExecutionMethod.cs b/Appwrite/Enums/ExecutionMethod.cs index 6b2787b9..b097cc3b 100644 --- a/Appwrite/Enums/ExecutionMethod.cs +++ b/Appwrite/Enums/ExecutionMethod.cs @@ -17,5 +17,6 @@ public ExecutionMethod(string value) public static ExecutionMethod PATCH => new ExecutionMethod("PATCH"); public static ExecutionMethod DELETE => new ExecutionMethod("DELETE"); public static ExecutionMethod OPTIONS => new ExecutionMethod("OPTIONS"); + public static ExecutionMethod HEAD => new ExecutionMethod("HEAD"); } } diff --git a/Appwrite/Enums/IndexType.cs b/Appwrite/Enums/IndexType.cs index 095fa163..eee4618f 100644 --- a/Appwrite/Enums/IndexType.cs +++ b/Appwrite/Enums/IndexType.cs @@ -14,5 +14,6 @@ public IndexType(string value) public static IndexType Key => new IndexType("key"); public static IndexType Fulltext => new IndexType("fulltext"); public static IndexType Unique => new IndexType("unique"); + public static IndexType Spatial => new IndexType("spatial"); } } diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs new file mode 100644 index 00000000..c27fbc73 --- /dev/null +++ b/Appwrite/Models/AttributeLine.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 AttributeLine + { + [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 object? Default { get; private set; } + + public AttributeLine( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static AttributeLine From(Dictionary map) => new AttributeLine( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs new file mode 100644 index 00000000..a5cb1808 --- /dev/null +++ b/Appwrite/Models/AttributePoint.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 AttributePoint + { + [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 object? Default { get; private set; } + + public AttributePoint( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static AttributePoint From(Dictionary map) => new AttributePoint( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs new file mode 100644 index 00000000..b30ef623 --- /dev/null +++ b/Appwrite/Models/AttributePolygon.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 AttributePolygon + { + [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 object? Default { get; private set; } + + public AttributePolygon( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static AttributePolygon From(Dictionary map) => new AttributePolygon( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs new file mode 100644 index 00000000..cab2aa18 --- /dev/null +++ b/Appwrite/Models/ColumnLine.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 ColumnLine + { + [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 object? Default { get; private set; } + + public ColumnLine( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static ColumnLine From(Dictionary map) => new ColumnLine( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs new file mode 100644 index 00000000..4dc055f9 --- /dev/null +++ b/Appwrite/Models/ColumnPoint.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 ColumnPoint + { + [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 object? Default { get; private set; } + + public ColumnPoint( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static ColumnPoint From(Dictionary map) => new ColumnPoint( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs new file mode 100644 index 00000000..4e90e2c0 --- /dev/null +++ b/Appwrite/Models/ColumnPolygon.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 ColumnPolygon + { + [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 object? Default { get; private set; } + + public ColumnPolygon( + string key, + string type, + string status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + object? xdefault + ) { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Default = xdefault; + } + + public static ColumnPolygon From(Dictionary map) => new ColumnPolygon( + 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: 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 }, + { "default", Default } + }; + } +} diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index bc8bef98..a8dabfa3 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -186,6 +186,10 @@ public static string CreatedAfter(string value) { return new Query("createdAfter", null, value).ToString(); } + public static string CreatedBetween(string start, string end) { + return new Query("createdBetween", null, new List { start, end }).ToString(); + } + public static string UpdatedBefore(string value) { return new Query("updatedBefore", null, value).ToString(); } @@ -194,6 +198,10 @@ public static string UpdatedAfter(string value) { return new Query("updatedAfter", null, value).ToString(); } + public static string UpdatedBetween(string start, string end) { + return new Query("updatedBetween", null, new List { start, end }).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 0f9efdad..a2474096 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -1252,7 +1252,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.")] + [Obsolete("This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.")] public Task UpdateMagicURLSession(string userId, string secret) { var apiPath = "/account/sessions/magic-url"; @@ -1287,7 +1287,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.")] + [Obsolete("This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.")] 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 7fdee327..3630924f 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -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.create` instead.")] public Task Create(string databaseId, string name, bool? enabled = null) { var apiPath = "/databases"; @@ -935,6 +935,228 @@ static Models.AttributeIp Convert(Dictionary it) => } + /// + /// Create a geometric line attribute. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.")] + public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributeLine Convert(Dictionary it) => + Models.AttributeLine.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 line attribute. Changing the `default` value will not update + /// already existing documents. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.")] + public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributeLine Convert(Dictionary it) => + Models.AttributeLine.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 geometric 2d point attribute. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.")] + public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributePoint Convert(Dictionary it) => + Models.AttributePoint.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 point attribute. Changing the `default` value will not update + /// already existing documents. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.")] + public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributePoint Convert(Dictionary it) => + Models.AttributePoint.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 geometric polygon attribute. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.")] + public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributePolygon Convert(Dictionary it) => + Models.AttributePolygon.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 polygon attribute. Changing the `default` value will not update + /// already existing documents. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.")] + public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + { "required", required }, + { "default", xdefault }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributePolygon Convert(Dictionary it) => + Models.AttributePolygon.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 attribute. [Learn more about relationship /// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index bda4b8fe..d4d5c801 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -909,6 +909,222 @@ static Models.ColumnIp Convert(Dictionary it) => } + /// + /// Create a geometric line attribute. + /// + /// + public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnLine Convert(Dictionary it) => + Models.ColumnLine.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 line column. Changing the `default` value will not update already + /// existing documents. + /// + /// + public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{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.ColumnLine Convert(Dictionary it) => + Models.ColumnLine.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 geometric point attribute. + /// + /// + public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnPoint Convert(Dictionary it) => + Models.ColumnPoint.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 point column. Changing the `default` value will not update already + /// existing documents. + /// + /// + public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{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.ColumnPoint Convert(Dictionary it) => + Models.ColumnPoint.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 geometric polygon attribute. + /// + /// + public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon" + .Replace("{databaseId}", databaseId) + .Replace("{tableId}", tableId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "required", required }, + { "default", xdefault } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.ColumnPolygon Convert(Dictionary it) => + Models.ColumnPolygon.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 polygon column. Changing the `default` value will not update + /// already existing documents. + /// + /// + public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + { + var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{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.ColumnPolygon Convert(Dictionary it) => + Models.ColumnPolygon.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). diff --git a/README.md b/README.md index 4c5bb227..4d2fdf97 100644 --- a/README.md +++ b/README.md @@ -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.16.0 +Install-Package Appwrite -Version 0.17.0 # or .NET CLI -dotnet add package Appwrite --version 0.16.0 +dotnet add package Appwrite --version 0.17.0 ``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md new file mode 100644 index 00000000..fc834cd6 --- /dev/null +++ b/docs/examples/databases/create-line-attribute.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 + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLine result = await databases.CreateLineAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md new file mode 100644 index 00000000..3f8c7d56 --- /dev/null +++ b/docs/examples/databases/create-point-attribute.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 + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +AttributePoint result = await databases.CreatePointAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md new file mode 100644 index 00000000..61ce8a14 --- /dev/null +++ b/docs/examples/databases/create-polygon-attribute.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 + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.CreatePolygonAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md new file mode 100644 index 00000000..51e85a4d --- /dev/null +++ b/docs/examples/databases/update-line-attribute.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 + +Databases databases = new Databases(client); + +AttributeLine result = await databases.UpdateLineAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md new file mode 100644 index 00000000..20822287 --- /dev/null +++ b/docs/examples/databases/update-point-attribute.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 + +Databases databases = new Databases(client); + +AttributePoint result = await databases.UpdatePointAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md new file mode 100644 index 00000000..5d5cd108 --- /dev/null +++ b/docs/examples/databases/update-polygon-attribute.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 + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.UpdatePolygonAttribute( + databaseId: "", + collectionId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md new file mode 100644 index 00000000..13a2cde7 --- /dev/null +++ b/docs/examples/tablesdb/create-line-column.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 + .SetKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLine result = await tablesDB.CreateLineColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md new file mode 100644 index 00000000..9c394614 --- /dev/null +++ b/docs/examples/tablesdb/create-point-column.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 + .SetKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPoint result = await tablesDB.CreatePointColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md new file mode 100644 index 00000000..2787f9b4 --- /dev/null +++ b/docs/examples/tablesdb/create-polygon-column.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 + .SetKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPolygon result = await tablesDB.CreatePolygonColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md new file mode 100644 index 00000000..ce04ab26 --- /dev/null +++ b/docs/examples/tablesdb/update-line-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); + +ColumnLine result = await tablesDB.UpdateLineColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md new file mode 100644 index 00000000..e17ebb31 --- /dev/null +++ b/docs/examples/tablesdb/update-point-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); + +ColumnPoint result = await tablesDB.UpdatePointColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md new file mode 100644 index 00000000..4137a211 --- /dev/null +++ b/docs/examples/tablesdb/update-polygon-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); + +ColumnPolygon result = await tablesDB.UpdatePolygonColumn( + databaseId: "", + tableId: "", + key: "", + required: false, + default: "", // optional + newKey: "" // optional +); \ No newline at end of file From 7f20313ae1490f4f4586c94acba8b1d4139a6a11 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Sep 2025 21:42:15 +1200 Subject: [PATCH 2/5] Add spatial queries --- Appwrite/Query.cs | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index a8dabfa3..6dd3fff3 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -209,5 +209,65 @@ public static string Or(List queries) { public static string And(List queries) { return new Query("and", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } + + public static string DistanceEqual(string attribute, object values, double distance, bool meters = true) + { + return new Query("distanceEqual", attribute, new List { values, distance, meters }).ToString(); + } + + public static string DistanceNotEqual(string attribute, object values, double distance, bool meters = true) + { + return new Query("distanceNotEqual", attribute, new List { values, distance, meters }).ToString(); + } + + public static string DistanceGreaterThan(string attribute, object values, double distance, bool meters = true) + { + return new Query("distanceGreaterThan", attribute, new List { values, distance, meters }).ToString(); + } + + public static string DistanceLessThan(string attribute, object values, double distance, bool meters = true) + { + return new Query("distanceLessThan", attribute, new List { values, distance, meters }).ToString(); + } + + public static string Intersects(string attribute, object values) + { + return new Query("intersects", attribute, values).ToString(); + } + + public static string NotIntersects(string attribute, object values) + { + return new Query("notIntersects", attribute, values).ToString(); + } + + public static string Crosses(string attribute, object values) + { + return new Query("crosses", attribute, values).ToString(); + } + + public static string NotCrosses(string attribute, object values) + { + return new Query("notCrosses", attribute, values).ToString(); + } + + public static string Overlaps(string attribute, object values) + { + return new Query("overlaps", attribute, values).ToString(); + } + + public static string NotOverlaps(string attribute, object values) + { + return new Query("notOverlaps", attribute, values).ToString(); + } + + public static string Touches(string attribute, object values) + { + return new Query("touches", attribute, values).ToString(); + } + + public static string NotTouches(string attribute, object values) + { + return new Query("notTouches", attribute, values).ToString(); + } } } \ No newline at end of file From 951316059c58121be6a069ac10addf3f879be642 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Sep 2025 22:02:20 +1200 Subject: [PATCH 3/5] Fix refs --- Appwrite/Services/Databases.cs | 2 +- Appwrite/Services/TablesDb.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 3630924f..fe1bd265 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -1010,7 +1010,7 @@ static Models.AttributeLine Convert(Dictionary it) => } /// - /// Create a geometric 2d point attribute. + /// Create a geometric point attribute. /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.")] diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index d4d5c801..fb93c635 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -910,7 +910,7 @@ static Models.ColumnIp Convert(Dictionary it) => } /// - /// Create a geometric line attribute. + /// Create a geometric line column. /// /// public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) @@ -946,7 +946,7 @@ static Models.ColumnLine Convert(Dictionary it) => /// /// Update a line column. Changing the `default` value will not update already - /// existing documents. + /// existing rows. /// /// public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) @@ -982,7 +982,7 @@ static Models.ColumnLine Convert(Dictionary it) => } /// - /// Create a geometric point attribute. + /// Create a geometric point column. /// /// public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) @@ -1018,7 +1018,7 @@ static Models.ColumnPoint Convert(Dictionary it) => /// /// Update a point column. Changing the `default` value will not update already - /// existing documents. + /// existing rows. /// /// public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) @@ -1054,7 +1054,7 @@ static Models.ColumnPoint Convert(Dictionary it) => } /// - /// Create a geometric polygon attribute. + /// Create a geometric polygon column. /// /// public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) @@ -1090,7 +1090,7 @@ static Models.ColumnPolygon Convert(Dictionary it) => /// /// Update a polygon column. Changing the `default` value will not update - /// already existing documents. + /// already existing rows. /// /// public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) From 5cfcc6c03a3461d2029f0ff4247dff801f2a6779 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 6 Sep 2025 04:58:38 +1200 Subject: [PATCH 4/5] Fix spatial default --- Appwrite/Models/AttributeLine.cs | 6 +++--- Appwrite/Models/AttributePoint.cs | 6 +++--- Appwrite/Models/AttributePolygon.cs | 6 +++--- Appwrite/Models/ColumnLine.cs | 6 +++--- Appwrite/Models/ColumnPoint.cs | 6 +++--- Appwrite/Models/ColumnPolygon.cs | 6 +++--- Appwrite/Services/Databases.cs | 12 ++++++------ Appwrite/Services/TablesDb.cs | 12 ++++++------ docs/examples/account/update-prefs.md | 6 +++++- docs/examples/databases/create-document.md | 8 +++++++- docs/examples/databases/create-line-attribute.md | 2 +- docs/examples/databases/create-point-attribute.md | 2 +- docs/examples/databases/create-polygon-attribute.md | 2 +- docs/examples/databases/update-line-attribute.md | 2 +- docs/examples/databases/update-point-attribute.md | 2 +- docs/examples/databases/update-polygon-attribute.md | 2 +- docs/examples/tablesdb/create-line-column.md | 2 +- docs/examples/tablesdb/create-point-column.md | 2 +- docs/examples/tablesdb/create-polygon-column.md | 2 +- docs/examples/tablesdb/create-row.md | 8 +++++++- docs/examples/tablesdb/update-line-column.md | 2 +- docs/examples/tablesdb/update-point-column.md | 2 +- docs/examples/tablesdb/update-polygon-column.md | 2 +- 23 files changed, 61 insertions(+), 45 deletions(-) diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs index c27fbc73..32a9c2ca 100644 --- a/Appwrite/Models/AttributeLine.cs +++ b/Appwrite/Models/AttributeLine.cs @@ -34,7 +34,7 @@ public class AttributeLine public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public AttributeLine( string key, @@ -45,7 +45,7 @@ public AttributeLine( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public AttributeLine( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs index a5cb1808..799d2e75 100644 --- a/Appwrite/Models/AttributePoint.cs +++ b/Appwrite/Models/AttributePoint.cs @@ -34,7 +34,7 @@ public class AttributePoint public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public AttributePoint( string key, @@ -45,7 +45,7 @@ public AttributePoint( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public AttributePoint( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs index b30ef623..85589337 100644 --- a/Appwrite/Models/AttributePolygon.cs +++ b/Appwrite/Models/AttributePolygon.cs @@ -34,7 +34,7 @@ public class AttributePolygon public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public AttributePolygon( string key, @@ -45,7 +45,7 @@ public AttributePolygon( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public AttributePolygon( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs index cab2aa18..c00c8c64 100644 --- a/Appwrite/Models/ColumnLine.cs +++ b/Appwrite/Models/ColumnLine.cs @@ -34,7 +34,7 @@ public class ColumnLine public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public ColumnLine( string key, @@ -45,7 +45,7 @@ public ColumnLine( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public ColumnLine( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs index 4dc055f9..38b70c4d 100644 --- a/Appwrite/Models/ColumnPoint.cs +++ b/Appwrite/Models/ColumnPoint.cs @@ -34,7 +34,7 @@ public class ColumnPoint public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public ColumnPoint( string key, @@ -45,7 +45,7 @@ public ColumnPoint( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public ColumnPoint( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs index 4e90e2c0..7262f65c 100644 --- a/Appwrite/Models/ColumnPolygon.cs +++ b/Appwrite/Models/ColumnPolygon.cs @@ -34,7 +34,7 @@ public class ColumnPolygon public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public object? Default { get; private set; } + public List? Default { get; private set; } public ColumnPolygon( string key, @@ -45,7 +45,7 @@ public ColumnPolygon( bool? array, string createdAt, string updatedAt, - object? xdefault + List? xdefault ) { Key = key; Type = type; @@ -67,7 +67,7 @@ public ColumnPolygon( array: (bool?)map["array"], createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), - xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null + xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["default"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index fe1bd265..5df70ce8 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -940,7 +940,7 @@ static Models.AttributeIp Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.")] - public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line" .Replace("{databaseId}", databaseId) @@ -977,7 +977,7 @@ static Models.AttributeLine Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.")] - public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}" .Replace("{databaseId}", databaseId) @@ -1014,7 +1014,7 @@ static Models.AttributeLine Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.")] - public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point" .Replace("{databaseId}", databaseId) @@ -1051,7 +1051,7 @@ static Models.AttributePoint Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.")] - public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}" .Replace("{databaseId}", databaseId) @@ -1088,7 +1088,7 @@ static Models.AttributePoint Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.")] - public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null) + public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon" .Replace("{databaseId}", databaseId) @@ -1125,7 +1125,7 @@ static Models.AttributePolygon Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.")] - public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}" .Replace("{databaseId}", databaseId) diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index fb93c635..89cd69a7 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -913,7 +913,7 @@ static Models.ColumnIp Convert(Dictionary it) => /// Create a geometric line column. /// /// - public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line" .Replace("{databaseId}", databaseId) @@ -949,7 +949,7 @@ static Models.ColumnLine Convert(Dictionary it) => /// existing rows. /// /// - public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}" .Replace("{databaseId}", databaseId) @@ -985,7 +985,7 @@ static Models.ColumnLine Convert(Dictionary it) => /// Create a geometric point column. /// /// - public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point" .Replace("{databaseId}", databaseId) @@ -1021,7 +1021,7 @@ static Models.ColumnPoint Convert(Dictionary it) => /// existing rows. /// /// - public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}" .Replace("{databaseId}", databaseId) @@ -1057,7 +1057,7 @@ static Models.ColumnPoint Convert(Dictionary it) => /// Create a geometric polygon column. /// /// - public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null) + public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon" .Replace("{databaseId}", databaseId) @@ -1093,7 +1093,7 @@ static Models.ColumnPolygon Convert(Dictionary it) => /// already existing rows. /// /// - public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, string? xdefault = null, string? newKey = null) + public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, List? xdefault = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}" .Replace("{databaseId}", databaseId) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 0b348a9c..80f42aaa 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -10,5 +10,9 @@ Client client = new Client() Account account = new Account(client); User result = await account.UpdatePrefs( - prefs: [object] + prefs: new { + language = "en", + timezone = "UTC", + darkTheme = true + } ); \ No newline at end of file diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 52254e0c..4a7444db 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -13,6 +13,12 @@ Document result = await databases.CreateDocument( databaseId: "", collectionId: "", documentId: "", - data: [object], + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, permissions: ["read("any")"] // optional ); \ No newline at end of file diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index fc834cd6..11b06546 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -14,5 +14,5 @@ AttributeLine result = await databases.CreateLineAttribute( collectionId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 3f8c7d56..6698e6d8 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -14,5 +14,5 @@ AttributePoint result = await databases.CreatePointAttribute( collectionId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 61ce8a14..b4de8bda 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -14,5 +14,5 @@ AttributePolygon result = await databases.CreatePolygonAttribute( collectionId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 51e85a4d..90bd6433 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -14,6 +14,6 @@ AttributeLine result = await databases.UpdateLineAttribute( collectionId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 20822287..eb504b3b 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -14,6 +14,6 @@ AttributePoint result = await databases.UpdatePointAttribute( collectionId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 5d5cd108..90cbac97 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -14,6 +14,6 @@ AttributePolygon result = await databases.UpdatePolygonAttribute( collectionId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 13a2cde7..ee9640b1 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -14,5 +14,5 @@ ColumnLine result = await tablesDB.CreateLineColumn( tableId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 9c394614..ea1c5240 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -14,5 +14,5 @@ ColumnPoint result = await tablesDB.CreatePointColumn( tableId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 2787f9b4..a514dd40 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -14,5 +14,5 @@ ColumnPolygon result = await tablesDB.CreatePolygonColumn( tableId: "", key: "", required: false, - default: "" // optional + default: [[1,2], [3, 4]] // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index ec6255a1..01a21b0d 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -13,6 +13,12 @@ Row result = await tablesDB.CreateRow( databaseId: "", tableId: "", rowId: "", - data: [object], + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, permissions: ["read("any")"] // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index ce04ab26..b33213bb 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -14,6 +14,6 @@ ColumnLine result = await tablesDB.UpdateLineColumn( tableId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index e17ebb31..db027169 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -14,6 +14,6 @@ ColumnPoint result = await tablesDB.UpdatePointColumn( tableId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 4137a211..374033e2 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -14,6 +14,6 @@ ColumnPolygon result = await tablesDB.UpdatePolygonColumn( tableId: "", key: "", required: false, - default: "", // optional + default: [[1,2], [3, 4]], // optional newKey: "" // optional ); \ No newline at end of file From 2ccad0ac4b69d7ebdbaa6a121b951cb20109dea0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 8 Sep 2025 21:43:07 +1200 Subject: [PATCH 5/5] Update spatial queries --- Appwrite/Query.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index 6dd3fff3..f7c9c5a7 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -212,62 +212,62 @@ public static string And(List queries) { public static string DistanceEqual(string attribute, object values, double distance, bool meters = true) { - return new Query("distanceEqual", attribute, new List { values, distance, meters }).ToString(); + return new Query("distanceEqual", attribute, new List { new List { values, distance, meters } }).ToString(); } public static string DistanceNotEqual(string attribute, object values, double distance, bool meters = true) { - return new Query("distanceNotEqual", attribute, new List { values, distance, meters }).ToString(); + return new Query("distanceNotEqual", attribute, new List { new List { values, distance, meters } }).ToString(); } public static string DistanceGreaterThan(string attribute, object values, double distance, bool meters = true) { - return new Query("distanceGreaterThan", attribute, new List { values, distance, meters }).ToString(); + return new Query("distanceGreaterThan", attribute, new List { new List { values, distance, meters } }).ToString(); } public static string DistanceLessThan(string attribute, object values, double distance, bool meters = true) { - return new Query("distanceLessThan", attribute, new List { values, distance, meters }).ToString(); + return new Query("distanceLessThan", attribute, new List { new List { values, distance, meters } }).ToString(); } public static string Intersects(string attribute, object values) { - return new Query("intersects", attribute, values).ToString(); + return new Query("intersects", attribute, new List { values }).ToString(); } public static string NotIntersects(string attribute, object values) { - return new Query("notIntersects", attribute, values).ToString(); + return new Query("notIntersects", attribute, new List { values }).ToString(); } public static string Crosses(string attribute, object values) { - return new Query("crosses", attribute, values).ToString(); + return new Query("crosses", attribute, new List { values }).ToString(); } public static string NotCrosses(string attribute, object values) { - return new Query("notCrosses", attribute, values).ToString(); + return new Query("notCrosses", attribute, new List { values }).ToString(); } public static string Overlaps(string attribute, object values) { - return new Query("overlaps", attribute, values).ToString(); + return new Query("overlaps", attribute, new List { values }).ToString(); } public static string NotOverlaps(string attribute, object values) { - return new Query("notOverlaps", attribute, values).ToString(); + return new Query("notOverlaps", attribute, new List { values }).ToString(); } public static string Touches(string attribute, object values) { - return new Query("touches", attribute, values).ToString(); + return new Query("touches", attribute, new List { values }).ToString(); } public static string NotTouches(string attribute, object values) { - return new Query("notTouches", attribute, values).ToString(); + return new Query("notTouches", attribute, new List { values }).ToString(); } } } \ No newline at end of file