diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 92ed7e5..b388d2e 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.18.0 + 0.19.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 983108d..020ebf6 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.18.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.19.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.18.0"}, + { "x-sdk-version", "0.19.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; @@ -325,7 +325,7 @@ public async Task Call( { foreach (var warning in warnings) { - Console.WriteLine("Warning: " + warning); + Console.Error.WriteLine("Warning: " + warning); } } diff --git a/Appwrite/Enums/AttributeStatus.cs b/Appwrite/Enums/AttributeStatus.cs new file mode 100644 index 0000000..3ba7e0f --- /dev/null +++ b/Appwrite/Enums/AttributeStatus.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class AttributeStatus : IEnum + { + public string Value { get; private set; } + + public AttributeStatus(string value) + { + Value = value; + } + + public static AttributeStatus Available => new AttributeStatus("available"); + public static AttributeStatus Processing => new AttributeStatus("processing"); + public static AttributeStatus Deleting => new AttributeStatus("deleting"); + public static AttributeStatus Stuck => new AttributeStatus("stuck"); + public static AttributeStatus Failed => new AttributeStatus("failed"); + } +} diff --git a/Appwrite/Enums/ColumnStatus.cs b/Appwrite/Enums/ColumnStatus.cs new file mode 100644 index 0000000..e02b4b8 --- /dev/null +++ b/Appwrite/Enums/ColumnStatus.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class ColumnStatus : IEnum + { + public string Value { get; private set; } + + public ColumnStatus(string value) + { + Value = value; + } + + public static ColumnStatus Available => new ColumnStatus("available"); + public static ColumnStatus Processing => new ColumnStatus("processing"); + public static ColumnStatus Deleting => new ColumnStatus("deleting"); + public static ColumnStatus Stuck => new ColumnStatus("stuck"); + public static ColumnStatus Failed => new ColumnStatus("failed"); + } +} diff --git a/Appwrite/Enums/DatabaseType.cs b/Appwrite/Enums/DatabaseType.cs new file mode 100644 index 0000000..bcbe1d9 --- /dev/null +++ b/Appwrite/Enums/DatabaseType.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class DatabaseType : IEnum + { + public string Value { get; private set; } + + public DatabaseType(string value) + { + Value = value; + } + + public static DatabaseType Legacy => new DatabaseType("legacy"); + public static DatabaseType Tablesdb => new DatabaseType("tablesdb"); + } +} diff --git a/Appwrite/Enums/DeploymentStatus.cs b/Appwrite/Enums/DeploymentStatus.cs new file mode 100644 index 0000000..70584f7 --- /dev/null +++ b/Appwrite/Enums/DeploymentStatus.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class DeploymentStatus : IEnum + { + public string Value { get; private set; } + + public DeploymentStatus(string value) + { + Value = value; + } + + public static DeploymentStatus Waiting => new DeploymentStatus("waiting"); + public static DeploymentStatus Processing => new DeploymentStatus("processing"); + public static DeploymentStatus Building => new DeploymentStatus("building"); + public static DeploymentStatus Ready => new DeploymentStatus("ready"); + public static DeploymentStatus Failed => new DeploymentStatus("failed"); + } +} diff --git a/Appwrite/Enums/ExecutionStatus.cs b/Appwrite/Enums/ExecutionStatus.cs new file mode 100644 index 0000000..c8e0b2a --- /dev/null +++ b/Appwrite/Enums/ExecutionStatus.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class ExecutionStatus : IEnum + { + public string Value { get; private set; } + + public ExecutionStatus(string value) + { + Value = value; + } + + public static ExecutionStatus Waiting => new ExecutionStatus("waiting"); + public static ExecutionStatus Processing => new ExecutionStatus("processing"); + public static ExecutionStatus Completed => new ExecutionStatus("completed"); + public static ExecutionStatus Failed => new ExecutionStatus("failed"); + } +} diff --git a/Appwrite/Enums/ExecutionTrigger.cs b/Appwrite/Enums/ExecutionTrigger.cs new file mode 100644 index 0000000..6d10269 --- /dev/null +++ b/Appwrite/Enums/ExecutionTrigger.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class ExecutionTrigger : IEnum + { + public string Value { get; private set; } + + public ExecutionTrigger(string value) + { + Value = value; + } + + public static ExecutionTrigger Http => new ExecutionTrigger("http"); + public static ExecutionTrigger Schedule => new ExecutionTrigger("schedule"); + public static ExecutionTrigger Event => new ExecutionTrigger("event"); + } +} diff --git a/Appwrite/Enums/HealthAntivirusStatus.cs b/Appwrite/Enums/HealthAntivirusStatus.cs new file mode 100644 index 0000000..19b947f --- /dev/null +++ b/Appwrite/Enums/HealthAntivirusStatus.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class HealthAntivirusStatus : IEnum + { + public string Value { get; private set; } + + public HealthAntivirusStatus(string value) + { + Value = value; + } + + public static HealthAntivirusStatus Disabled => new HealthAntivirusStatus("disabled"); + public static HealthAntivirusStatus Offline => new HealthAntivirusStatus("offline"); + public static HealthAntivirusStatus Online => new HealthAntivirusStatus("online"); + } +} diff --git a/Appwrite/Enums/HealthCheckStatus.cs b/Appwrite/Enums/HealthCheckStatus.cs new file mode 100644 index 0000000..881245e --- /dev/null +++ b/Appwrite/Enums/HealthCheckStatus.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class HealthCheckStatus : IEnum + { + public string Value { get; private set; } + + public HealthCheckStatus(string value) + { + Value = value; + } + + public static HealthCheckStatus Pass => new HealthCheckStatus("pass"); + public static HealthCheckStatus Fail => new HealthCheckStatus("fail"); + } +} diff --git a/Appwrite/Enums/IndexStatus.cs b/Appwrite/Enums/IndexStatus.cs new file mode 100644 index 0000000..71b2ddc --- /dev/null +++ b/Appwrite/Enums/IndexStatus.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class IndexStatus : IEnum + { + public string Value { get; private set; } + + public IndexStatus(string value) + { + Value = value; + } + + public static IndexStatus Available => new IndexStatus("available"); + public static IndexStatus Processing => new IndexStatus("processing"); + public static IndexStatus Deleting => new IndexStatus("deleting"); + public static IndexStatus Stuck => new IndexStatus("stuck"); + public static IndexStatus Failed => new IndexStatus("failed"); + } +} diff --git a/Appwrite/Enums/MessageStatus.cs b/Appwrite/Enums/MessageStatus.cs new file mode 100644 index 0000000..1c6c087 --- /dev/null +++ b/Appwrite/Enums/MessageStatus.cs @@ -0,0 +1,20 @@ +using System; + +namespace Appwrite.Enums +{ + public class MessageStatus : IEnum + { + public string Value { get; private set; } + + public MessageStatus(string value) + { + Value = value; + } + + public static MessageStatus Draft => new MessageStatus("draft"); + public static MessageStatus Processing => new MessageStatus("processing"); + public static MessageStatus Scheduled => new MessageStatus("scheduled"); + public static MessageStatus Sent => new MessageStatus("sent"); + public static MessageStatus Failed => new MessageStatus("failed"); + } +} diff --git a/Appwrite/Models/AlgoArgon2.cs b/Appwrite/Models/AlgoArgon2.cs index 11d7279..2573b10 100644 --- a/Appwrite/Models/AlgoArgon2.cs +++ b/Appwrite/Models/AlgoArgon2.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoBcrypt.cs b/Appwrite/Models/AlgoBcrypt.cs index e70f8a7..3cab59e 100644 --- a/Appwrite/Models/AlgoBcrypt.cs +++ b/Appwrite/Models/AlgoBcrypt.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoMd5.cs b/Appwrite/Models/AlgoMd5.cs index a4787d0..814de65 100644 --- a/Appwrite/Models/AlgoMd5.cs +++ b/Appwrite/Models/AlgoMd5.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoPhpass.cs b/Appwrite/Models/AlgoPhpass.cs index 6fe4fc2..693d31e 100644 --- a/Appwrite/Models/AlgoPhpass.cs +++ b/Appwrite/Models/AlgoPhpass.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoScrypt.cs b/Appwrite/Models/AlgoScrypt.cs index 1cfb0da..cb8a10b 100644 --- a/Appwrite/Models/AlgoScrypt.cs +++ b/Appwrite/Models/AlgoScrypt.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoScryptModified.cs b/Appwrite/Models/AlgoScryptModified.cs index dd69a6b..cf33b0c 100644 --- a/Appwrite/Models/AlgoScryptModified.cs +++ b/Appwrite/Models/AlgoScryptModified.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AlgoSha.cs b/Appwrite/Models/AlgoSha.cs index 76f7a37..92a8866 100644 --- a/Appwrite/Models/AlgoSha.cs +++ b/Appwrite/Models/AlgoSha.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AttributeBoolean.cs b/Appwrite/Models/AttributeBoolean.cs index 66b4b20..d165e5c 100644 --- a/Appwrite/Models/AttributeBoolean.cs +++ b/Appwrite/Models/AttributeBoolean.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeBoolean public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class AttributeBoolean public AttributeBoolean( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public AttributeBoolean( public static AttributeBoolean From(Dictionary map) => new AttributeBoolean( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public AttributeBoolean( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeDatetime.cs b/Appwrite/Models/AttributeDatetime.cs index e68b33f..0867e7e 100644 --- a/Appwrite/Models/AttributeDatetime.cs +++ b/Appwrite/Models/AttributeDatetime.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeDatetime public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class AttributeDatetime public AttributeDatetime( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public AttributeDatetime( public static AttributeDatetime From(Dictionary map) => new AttributeDatetime( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public AttributeDatetime( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeEmail.cs b/Appwrite/Models/AttributeEmail.cs index af8190e..b15a4dc 100644 --- a/Appwrite/Models/AttributeEmail.cs +++ b/Appwrite/Models/AttributeEmail.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeEmail public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class AttributeEmail public AttributeEmail( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public AttributeEmail( public static AttributeEmail From(Dictionary map) => new AttributeEmail( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public AttributeEmail( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeEnum.cs b/Appwrite/Models/AttributeEnum.cs index e07fa43..a295c0d 100644 --- a/Appwrite/Models/AttributeEnum.cs +++ b/Appwrite/Models/AttributeEnum.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeEnum public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class AttributeEnum public AttributeEnum( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public AttributeEnum( public static AttributeEnum From(Dictionary map) => new AttributeEnum( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public AttributeEnum( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeFloat.cs b/Appwrite/Models/AttributeFloat.cs index ff183a3..60dcf5d 100644 --- a/Appwrite/Models/AttributeFloat.cs +++ b/Appwrite/Models/AttributeFloat.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeFloat public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class AttributeFloat public AttributeFloat( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public AttributeFloat( public static AttributeFloat From(Dictionary map) => new AttributeFloat( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public AttributeFloat( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeInteger.cs b/Appwrite/Models/AttributeInteger.cs index 4803990..581e244 100644 --- a/Appwrite/Models/AttributeInteger.cs +++ b/Appwrite/Models/AttributeInteger.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeInteger public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class AttributeInteger public AttributeInteger( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public AttributeInteger( public static AttributeInteger From(Dictionary map) => new AttributeInteger( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public AttributeInteger( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeIp.cs b/Appwrite/Models/AttributeIp.cs index cfe4727..704864e 100644 --- a/Appwrite/Models/AttributeIp.cs +++ b/Appwrite/Models/AttributeIp.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeIp public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class AttributeIp public AttributeIp( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public AttributeIp( public static AttributeIp From(Dictionary map) => new AttributeIp( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public AttributeIp( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs index 32a9c2c..80773ac 100644 --- a/Appwrite/Models/AttributeLine.cs +++ b/Appwrite/Models/AttributeLine.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeLine public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class AttributeLine public AttributeLine( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public AttributeLine( public static AttributeLine From(Dictionary map) => new AttributeLine( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public AttributeLine( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeList.cs b/Appwrite/Models/AttributeList.cs index 1fa17b7..1c1404b 100644 --- a/Appwrite/Models/AttributeList.cs +++ b/Appwrite/Models/AttributeList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs index 799d2e7..2f15890 100644 --- a/Appwrite/Models/AttributePoint.cs +++ b/Appwrite/Models/AttributePoint.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributePoint public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class AttributePoint public AttributePoint( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public AttributePoint( public static AttributePoint From(Dictionary map) => new AttributePoint( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public AttributePoint( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs index 8558933..32d3786 100644 --- a/Appwrite/Models/AttributePolygon.cs +++ b/Appwrite/Models/AttributePolygon.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributePolygon public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class AttributePolygon public AttributePolygon( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public AttributePolygon( public static AttributePolygon From(Dictionary map) => new AttributePolygon( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public AttributePolygon( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeRelationship.cs b/Appwrite/Models/AttributeRelationship.cs index f0a1ba1..17447c0 100644 --- a/Appwrite/Models/AttributeRelationship.cs +++ b/Appwrite/Models/AttributeRelationship.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeRelationship public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -54,7 +55,7 @@ public class AttributeRelationship public AttributeRelationship( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -86,7 +87,7 @@ string side public static AttributeRelationship From(Dictionary map) => new AttributeRelationship( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -104,7 +105,7 @@ string side { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeString.cs b/Appwrite/Models/AttributeString.cs index 7aeb237..95f328b 100644 --- a/Appwrite/Models/AttributeString.cs +++ b/Appwrite/Models/AttributeString.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeString public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class AttributeString public AttributeString( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public AttributeString( public static AttributeString From(Dictionary map) => new AttributeString( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public AttributeString( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/AttributeUrl.cs b/Appwrite/Models/AttributeUrl.cs index f2a7af9..196dc21 100644 --- a/Appwrite/Models/AttributeUrl.cs +++ b/Appwrite/Models/AttributeUrl.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class AttributeUrl public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class AttributeUrl public AttributeUrl( string key, string type, - string status, + AttributeStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public AttributeUrl( public static AttributeUrl From(Dictionary map) => new AttributeUrl( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public AttributeUrl( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/Bucket.cs b/Appwrite/Models/Bucket.cs index 6308fdf..c7e22f7 100644 --- a/Appwrite/Models/Bucket.cs +++ b/Appwrite/Models/Bucket.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/BucketList.cs b/Appwrite/Models/BucketList.cs index 3435f29..c6b08fb 100644 --- a/Appwrite/Models/BucketList.cs +++ b/Appwrite/Models/BucketList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Collection.cs b/Appwrite/Models/Collection.cs index 2629bae..6b3420e 100644 --- a/Appwrite/Models/Collection.cs +++ b/Appwrite/Models/Collection.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/CollectionList.cs b/Appwrite/Models/CollectionList.cs index cab53db..861cc2c 100644 --- a/Appwrite/Models/CollectionList.cs +++ b/Appwrite/Models/CollectionList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ColumnBoolean.cs b/Appwrite/Models/ColumnBoolean.cs index 485e4a2..15afe58 100644 --- a/Appwrite/Models/ColumnBoolean.cs +++ b/Appwrite/Models/ColumnBoolean.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnBoolean public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class ColumnBoolean public ColumnBoolean( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public ColumnBoolean( public static ColumnBoolean From(Dictionary map) => new ColumnBoolean( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public ColumnBoolean( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnDatetime.cs b/Appwrite/Models/ColumnDatetime.cs index 5116f1f..e1b2ba8 100644 --- a/Appwrite/Models/ColumnDatetime.cs +++ b/Appwrite/Models/ColumnDatetime.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnDatetime public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class ColumnDatetime public ColumnDatetime( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public ColumnDatetime( public static ColumnDatetime From(Dictionary map) => new ColumnDatetime( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public ColumnDatetime( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnEmail.cs b/Appwrite/Models/ColumnEmail.cs index 1bb4145..6d3e657 100644 --- a/Appwrite/Models/ColumnEmail.cs +++ b/Appwrite/Models/ColumnEmail.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnEmail public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class ColumnEmail public ColumnEmail( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public ColumnEmail( public static ColumnEmail From(Dictionary map) => new ColumnEmail( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public ColumnEmail( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnEnum.cs b/Appwrite/Models/ColumnEnum.cs index beb6ac8..c804691 100644 --- a/Appwrite/Models/ColumnEnum.cs +++ b/Appwrite/Models/ColumnEnum.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnEnum public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class ColumnEnum public ColumnEnum( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public ColumnEnum( public static ColumnEnum From(Dictionary map) => new ColumnEnum( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public ColumnEnum( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnFloat.cs b/Appwrite/Models/ColumnFloat.cs index 595134c..f9cef29 100644 --- a/Appwrite/Models/ColumnFloat.cs +++ b/Appwrite/Models/ColumnFloat.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnFloat public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class ColumnFloat public ColumnFloat( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public ColumnFloat( public static ColumnFloat From(Dictionary map) => new ColumnFloat( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public ColumnFloat( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnIndex.cs b/Appwrite/Models/ColumnIndex.cs index ac2e683..9ce756a 100644 --- a/Appwrite/Models/ColumnIndex.cs +++ b/Appwrite/Models/ColumnIndex.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ColumnIndexList.cs b/Appwrite/Models/ColumnIndexList.cs index d1de758..b43c7c3 100644 --- a/Appwrite/Models/ColumnIndexList.cs +++ b/Appwrite/Models/ColumnIndexList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ColumnInteger.cs b/Appwrite/Models/ColumnInteger.cs index 1637e11..427935e 100644 --- a/Appwrite/Models/ColumnInteger.cs +++ b/Appwrite/Models/ColumnInteger.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnInteger public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class ColumnInteger public ColumnInteger( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public ColumnInteger( public static ColumnInteger From(Dictionary map) => new ColumnInteger( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public ColumnInteger( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnIp.cs b/Appwrite/Models/ColumnIp.cs index 31ae334..e2aba30 100644 --- a/Appwrite/Models/ColumnIp.cs +++ b/Appwrite/Models/ColumnIp.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnIp public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class ColumnIp public ColumnIp( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public ColumnIp( public static ColumnIp From(Dictionary map) => new ColumnIp( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public ColumnIp( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs index c00c8c6..1f2761b 100644 --- a/Appwrite/Models/ColumnLine.cs +++ b/Appwrite/Models/ColumnLine.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnLine public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class ColumnLine public ColumnLine( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public ColumnLine( public static ColumnLine From(Dictionary map) => new ColumnLine( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public ColumnLine( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnList.cs b/Appwrite/Models/ColumnList.cs index f98fcd0..d033168 100644 --- a/Appwrite/Models/ColumnList.cs +++ b/Appwrite/Models/ColumnList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs index 38b70c4..ca51442 100644 --- a/Appwrite/Models/ColumnPoint.cs +++ b/Appwrite/Models/ColumnPoint.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnPoint public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class ColumnPoint public ColumnPoint( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public ColumnPoint( public static ColumnPoint From(Dictionary map) => new ColumnPoint( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public ColumnPoint( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs index 7262f65..81f9969 100644 --- a/Appwrite/Models/ColumnPolygon.cs +++ b/Appwrite/Models/ColumnPolygon.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnPolygon public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -39,7 +40,7 @@ public class ColumnPolygon public ColumnPolygon( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -61,7 +62,7 @@ public ColumnPolygon( public static ColumnPolygon From(Dictionary map) => new ColumnPolygon( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -74,7 +75,7 @@ public ColumnPolygon( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnRelationship.cs b/Appwrite/Models/ColumnRelationship.cs index 7748dea..2d0f609 100644 --- a/Appwrite/Models/ColumnRelationship.cs +++ b/Appwrite/Models/ColumnRelationship.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnRelationship public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -54,7 +55,7 @@ public class ColumnRelationship public ColumnRelationship( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -86,7 +87,7 @@ string side public static ColumnRelationship From(Dictionary map) => new ColumnRelationship( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -104,7 +105,7 @@ string side { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnString.cs b/Appwrite/Models/ColumnString.cs index cc6dfbe..64853cc 100644 --- a/Appwrite/Models/ColumnString.cs +++ b/Appwrite/Models/ColumnString.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnString public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public class ColumnString public ColumnString( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -71,7 +72,7 @@ public ColumnString( public static ColumnString From(Dictionary map) => new ColumnString( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -86,7 +87,7 @@ public ColumnString( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/ColumnUrl.cs b/Appwrite/Models/ColumnUrl.cs index 14d1aab..a95b170 100644 --- a/Appwrite/Models/ColumnUrl.cs +++ b/Appwrite/Models/ColumnUrl.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,7 +17,7 @@ public class ColumnUrl public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -42,7 +43,7 @@ public class ColumnUrl public ColumnUrl( string key, string type, - string status, + ColumnStatus status, string error, bool required, bool? array, @@ -66,7 +67,7 @@ public ColumnUrl( public static ColumnUrl From(Dictionary map) => new ColumnUrl( key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: (bool?)map["array"], @@ -80,7 +81,7 @@ public ColumnUrl( { { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "required", Required }, { "array", Array }, diff --git a/Appwrite/Models/Continent.cs b/Appwrite/Models/Continent.cs index 7b4361d..dab9656 100644 --- a/Appwrite/Models/Continent.cs +++ b/Appwrite/Models/Continent.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ContinentList.cs b/Appwrite/Models/ContinentList.cs index 84f16d4..31e9d10 100644 --- a/Appwrite/Models/ContinentList.cs +++ b/Appwrite/Models/ContinentList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Country.cs b/Appwrite/Models/Country.cs index 3d1a325..ad4d0b7 100644 --- a/Appwrite/Models/Country.cs +++ b/Appwrite/Models/Country.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/CountryList.cs b/Appwrite/Models/CountryList.cs index d4c8c6c..3e8147b 100644 --- a/Appwrite/Models/CountryList.cs +++ b/Appwrite/Models/CountryList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Currency.cs b/Appwrite/Models/Currency.cs index df4a312..492ff32 100644 --- a/Appwrite/Models/Currency.cs +++ b/Appwrite/Models/Currency.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/CurrencyList.cs b/Appwrite/Models/CurrencyList.cs index ee8ed8d..2e92ffa 100644 --- a/Appwrite/Models/CurrencyList.cs +++ b/Appwrite/Models/CurrencyList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index d2f23f2..ebd1ec4 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -25,7 +26,7 @@ public class Database public bool Enabled { get; private set; } [JsonPropertyName("type")] - public string Type { get; private set; } + public DatabaseType Type { get; private set; } public Database( string id, @@ -33,7 +34,7 @@ public Database( string createdAt, string updatedAt, bool enabled, - string type + DatabaseType type ) { Id = id; Name = name; @@ -49,7 +50,7 @@ string type createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), enabled: (bool)map["enabled"], - type: map["type"].ToString() + type: new DatabaseType(map["type"].ToString()!) ); public Dictionary ToMap() => new Dictionary() @@ -59,7 +60,7 @@ string type { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "enabled", Enabled }, - { "type", Type } + { "type", Type.Value } }; } } diff --git a/Appwrite/Models/DatabaseList.cs b/Appwrite/Models/DatabaseList.cs index 652c68b..e3d0941 100644 --- a/Appwrite/Models/DatabaseList.cs +++ b/Appwrite/Models/DatabaseList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Deployment.cs b/Appwrite/Models/Deployment.cs index 05e8981..7663cf1 100644 --- a/Appwrite/Models/Deployment.cs +++ b/Appwrite/Models/Deployment.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -52,7 +53,7 @@ public class Deployment public string ScreenshotDark { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public DeploymentStatus Status { get; private set; } [JsonPropertyName("buildLogs")] public string BuildLogs { get; private set; } @@ -105,7 +106,7 @@ public Deployment( bool activate, string screenshotLight, string screenshotDark, - string status, + DeploymentStatus status, string buildLogs, long buildDuration, string providerRepositoryName, @@ -163,7 +164,7 @@ string providerBranchUrl activate: (bool)map["activate"], screenshotLight: map["screenshotLight"].ToString(), screenshotDark: map["screenshotDark"].ToString(), - status: map["status"].ToString(), + status: new DeploymentStatus(map["status"].ToString()!), buildLogs: map["buildLogs"].ToString(), buildDuration: Convert.ToInt64(map["buildDuration"]), providerRepositoryName: map["providerRepositoryName"].ToString(), @@ -194,7 +195,7 @@ string providerBranchUrl { "activate", Activate }, { "screenshotLight", ScreenshotLight }, { "screenshotDark", ScreenshotDark }, - { "status", Status }, + { "status", Status.Value }, { "buildLogs", BuildLogs }, { "buildDuration", BuildDuration }, { "providerRepositoryName", ProviderRepositoryName }, diff --git a/Appwrite/Models/DeploymentList.cs b/Appwrite/Models/DeploymentList.cs index bec66fe..c48b9f0 100644 --- a/Appwrite/Models/DeploymentList.cs +++ b/Appwrite/Models/DeploymentList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Document.cs b/Appwrite/Models/Document.cs index cfd1b52..af58951 100644 --- a/Appwrite/Models/Document.cs +++ b/Appwrite/Models/Document.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -60,7 +61,7 @@ Dictionary data createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"] is JsonElement jsonArrayProp7 ? jsonArrayProp7.Deserialize>()! : (List)map["$permissions"], - data: map + data: map.TryGetValue("data", out var dataValue) ? (Dictionary)dataValue : map ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DocumentList.cs b/Appwrite/Models/DocumentList.cs index dd4041d..c481a64 100644 --- a/Appwrite/Models/DocumentList.cs +++ b/Appwrite/Models/DocumentList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index 9382435..17898c9 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -28,10 +29,10 @@ public class Execution public string DeploymentId { get; private set; } [JsonPropertyName("trigger")] - public string Trigger { get; private set; } + public ExecutionTrigger Trigger { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public ExecutionStatus Status { get; private set; } [JsonPropertyName("requestMethod")] public string RequestMethod { get; private set; } @@ -70,8 +71,8 @@ public Execution( List permissions, string functionId, string deploymentId, - string trigger, - string status, + ExecutionTrigger trigger, + ExecutionStatus status, string requestMethod, string requestPath, List requestHeaders, @@ -110,8 +111,8 @@ public Execution( 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(), + trigger: new ExecutionTrigger(map["trigger"].ToString()!), + status: new ExecutionStatus(map["status"].ToString()!), requestMethod: map["requestMethod"].ToString(), requestPath: map["requestPath"].ToString(), 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(), @@ -132,8 +133,8 @@ public Execution( { "$permissions", Permissions }, { "functionId", FunctionId }, { "deploymentId", DeploymentId }, - { "trigger", Trigger }, - { "status", Status }, + { "trigger", Trigger.Value }, + { "status", Status.Value }, { "requestMethod", RequestMethod }, { "requestPath", RequestPath }, { "requestHeaders", RequestHeaders.Select(it => it.ToMap()) }, diff --git a/Appwrite/Models/ExecutionList.cs b/Appwrite/Models/ExecutionList.cs index f255d9e..da5c64d 100644 --- a/Appwrite/Models/ExecutionList.cs +++ b/Appwrite/Models/ExecutionList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/File.cs b/Appwrite/Models/File.cs index e8ad048..8d0d2e1 100644 --- a/Appwrite/Models/File.cs +++ b/Appwrite/Models/File.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/FileList.cs b/Appwrite/Models/FileList.cs index d262afa..c1d39a2 100644 --- a/Appwrite/Models/FileList.cs +++ b/Appwrite/Models/FileList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Framework.cs b/Appwrite/Models/Framework.cs index 2ddd78e..551df2e 100644 --- a/Appwrite/Models/Framework.cs +++ b/Appwrite/Models/Framework.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/FrameworkAdapter.cs b/Appwrite/Models/FrameworkAdapter.cs index 72ead86..5e88b2b 100644 --- a/Appwrite/Models/FrameworkAdapter.cs +++ b/Appwrite/Models/FrameworkAdapter.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/FrameworkList.cs b/Appwrite/Models/FrameworkList.cs index 664d7f8..8d9cb26 100644 --- a/Appwrite/Models/FrameworkList.cs +++ b/Appwrite/Models/FrameworkList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Function.cs b/Appwrite/Models/Function.cs index ae19780..f5b64ff 100644 --- a/Appwrite/Models/Function.cs +++ b/Appwrite/Models/Function.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/FunctionList.cs b/Appwrite/Models/FunctionList.cs index dbfbd19..eecdd23 100644 --- a/Appwrite/Models/FunctionList.cs +++ b/Appwrite/Models/FunctionList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Headers.cs b/Appwrite/Models/Headers.cs index 7e7e23d..951c0d2 100644 --- a/Appwrite/Models/Headers.cs +++ b/Appwrite/Models/Headers.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/HealthAntivirus.cs b/Appwrite/Models/HealthAntivirus.cs index a599691..2bb3b1d 100644 --- a/Appwrite/Models/HealthAntivirus.cs +++ b/Appwrite/Models/HealthAntivirus.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -13,11 +14,11 @@ public class HealthAntivirus public string Version { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public HealthAntivirusStatus Status { get; private set; } public HealthAntivirus( string version, - string status + HealthAntivirusStatus status ) { Version = version; Status = status; @@ -25,13 +26,13 @@ string status public static HealthAntivirus From(Dictionary map) => new HealthAntivirus( version: map["version"].ToString(), - status: map["status"].ToString() + status: new HealthAntivirusStatus(map["status"].ToString()!) ); public Dictionary ToMap() => new Dictionary() { { "version", Version }, - { "status", Status } + { "status", Status.Value } }; } } diff --git a/Appwrite/Models/HealthCertificate.cs b/Appwrite/Models/HealthCertificate.cs index 10ae837..4d65f5a 100644 --- a/Appwrite/Models/HealthCertificate.cs +++ b/Appwrite/Models/HealthCertificate.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/HealthQueue.cs b/Appwrite/Models/HealthQueue.cs index 756f029..7d34577 100644 --- a/Appwrite/Models/HealthQueue.cs +++ b/Appwrite/Models/HealthQueue.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/HealthStatus.cs b/Appwrite/Models/HealthStatus.cs index 0f0c021..fc80de2 100644 --- a/Appwrite/Models/HealthStatus.cs +++ b/Appwrite/Models/HealthStatus.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -16,12 +17,12 @@ public class HealthStatus public long Ping { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public HealthCheckStatus Status { get; private set; } public HealthStatus( string name, long ping, - string status + HealthCheckStatus status ) { Name = name; Ping = ping; @@ -31,14 +32,14 @@ string status public static HealthStatus From(Dictionary map) => new HealthStatus( name: map["name"].ToString(), ping: Convert.ToInt64(map["ping"]), - status: map["status"].ToString() + status: new HealthCheckStatus(map["status"].ToString()!) ); public Dictionary ToMap() => new Dictionary() { { "name", Name }, { "ping", Ping }, - { "status", Status } + { "status", Status.Value } }; } } diff --git a/Appwrite/Models/HealthTime.cs b/Appwrite/Models/HealthTime.cs index e7501af..e55b7ba 100644 --- a/Appwrite/Models/HealthTime.cs +++ b/Appwrite/Models/HealthTime.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Identity.cs b/Appwrite/Models/Identity.cs index c9d2280..240b85f 100644 --- a/Appwrite/Models/Identity.cs +++ b/Appwrite/Models/Identity.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/IdentityList.cs b/Appwrite/Models/IdentityList.cs index be5ebce..d7c0864 100644 --- a/Appwrite/Models/IdentityList.cs +++ b/Appwrite/Models/IdentityList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Index.cs b/Appwrite/Models/Index.cs index e481210..8f4ff78 100644 --- a/Appwrite/Models/Index.cs +++ b/Appwrite/Models/Index.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -25,7 +26,7 @@ public class Index public string Type { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public IndexStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -45,7 +46,7 @@ public Index( string updatedAt, string key, string type, - string status, + IndexStatus status, string error, List attributes, List lengths, @@ -69,7 +70,7 @@ public Index( updatedAt: map["$updatedAt"].ToString(), key: map["key"].ToString(), type: map["type"].ToString(), - status: map["status"].ToString(), + status: new IndexStatus(map["status"].ToString()!), error: map["error"].ToString(), attributes: map["attributes"] is JsonElement jsonArrayProp8 ? jsonArrayProp8.Deserialize>()! : (List)map["attributes"], lengths: map["lengths"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize>()! : (List)map["lengths"], @@ -83,7 +84,7 @@ public Index( { "$updatedAt", UpdatedAt }, { "key", Key }, { "type", Type }, - { "status", Status }, + { "status", Status.Value }, { "error", Error }, { "attributes", Attributes }, { "lengths", Lengths }, diff --git a/Appwrite/Models/IndexList.cs b/Appwrite/Models/IndexList.cs index 8456007..5b1989e 100644 --- a/Appwrite/Models/IndexList.cs +++ b/Appwrite/Models/IndexList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/JWT.cs b/Appwrite/Models/JWT.cs index 35d8f59..a25b7de 100644 --- a/Appwrite/Models/JWT.cs +++ b/Appwrite/Models/JWT.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Language.cs b/Appwrite/Models/Language.cs index 2e63ea4..124f01c 100644 --- a/Appwrite/Models/Language.cs +++ b/Appwrite/Models/Language.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/LanguageList.cs b/Appwrite/Models/LanguageList.cs index 3bdc2be..edc4525 100644 --- a/Appwrite/Models/LanguageList.cs +++ b/Appwrite/Models/LanguageList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Locale.cs b/Appwrite/Models/Locale.cs index 91f76a2..58cad59 100644 --- a/Appwrite/Models/Locale.cs +++ b/Appwrite/Models/Locale.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/LocaleCode.cs b/Appwrite/Models/LocaleCode.cs index 3b1945a..a16017b 100644 --- a/Appwrite/Models/LocaleCode.cs +++ b/Appwrite/Models/LocaleCode.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/LocaleCodeList.cs b/Appwrite/Models/LocaleCodeList.cs index 940d4f3..4063057 100644 --- a/Appwrite/Models/LocaleCodeList.cs +++ b/Appwrite/Models/LocaleCodeList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Log.cs b/Appwrite/Models/Log.cs index 7878c50..bbf6878 100644 --- a/Appwrite/Models/Log.cs +++ b/Appwrite/Models/Log.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/LogList.cs b/Appwrite/Models/LogList.cs index 9347764..a72414a 100644 --- a/Appwrite/Models/LogList.cs +++ b/Appwrite/Models/LogList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Membership.cs b/Appwrite/Models/Membership.cs index fe26181..8bb40c1 100644 --- a/Appwrite/Models/Membership.cs +++ b/Appwrite/Models/Membership.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/MembershipList.cs b/Appwrite/Models/MembershipList.cs index 0ebe32f..dd7bcc0 100644 --- a/Appwrite/Models/MembershipList.cs +++ b/Appwrite/Models/MembershipList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Message.cs b/Appwrite/Models/Message.cs index e205401..793ee9c 100644 --- a/Appwrite/Models/Message.cs +++ b/Appwrite/Models/Message.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -46,7 +47,7 @@ public class Message public object Data { get; private set; } [JsonPropertyName("status")] - public string Status { get; private set; } + public MessageStatus Status { get; private set; } public Message( string id, @@ -61,7 +62,7 @@ public Message( List? deliveryErrors, long deliveredTotal, object data, - string status + MessageStatus status ) { Id = id; CreatedAt = createdAt; @@ -91,7 +92,7 @@ string status deliveryErrors: map["deliveryErrors"] is JsonElement jsonArrayProp10 ? jsonArrayProp10.Deserialize>()! : (List)map["deliveryErrors"], deliveredTotal: Convert.ToInt64(map["deliveredTotal"]), data: map["data"].ToString(), - status: map["status"].ToString() + status: new MessageStatus(map["status"].ToString()!) ); public Dictionary ToMap() => new Dictionary() @@ -108,7 +109,7 @@ string status { "deliveryErrors", DeliveryErrors }, { "deliveredTotal", DeliveredTotal }, { "data", Data }, - { "status", Status } + { "status", Status.Value } }; } } diff --git a/Appwrite/Models/MessageList.cs b/Appwrite/Models/MessageList.cs index 39c66e2..b41a2df 100644 --- a/Appwrite/Models/MessageList.cs +++ b/Appwrite/Models/MessageList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/MfaChallenge.cs b/Appwrite/Models/MfaChallenge.cs index 00de1c0..d5fcc27 100644 --- a/Appwrite/Models/MfaChallenge.cs +++ b/Appwrite/Models/MfaChallenge.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/MfaFactors.cs b/Appwrite/Models/MfaFactors.cs index 6e2fa03..f0cc908 100644 --- a/Appwrite/Models/MfaFactors.cs +++ b/Appwrite/Models/MfaFactors.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/MfaRecoveryCodes.cs b/Appwrite/Models/MfaRecoveryCodes.cs index afab757..6855f35 100644 --- a/Appwrite/Models/MfaRecoveryCodes.cs +++ b/Appwrite/Models/MfaRecoveryCodes.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/MfaType.cs b/Appwrite/Models/MfaType.cs index 9f6c46a..8e008f8 100644 --- a/Appwrite/Models/MfaType.cs +++ b/Appwrite/Models/MfaType.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Phone.cs b/Appwrite/Models/Phone.cs index 257cbe5..a820f07 100644 --- a/Appwrite/Models/Phone.cs +++ b/Appwrite/Models/Phone.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/PhoneList.cs b/Appwrite/Models/PhoneList.cs index fbaa6d6..26c7f6d 100644 --- a/Appwrite/Models/PhoneList.cs +++ b/Appwrite/Models/PhoneList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Preferences.cs b/Appwrite/Models/Preferences.cs index 54a66fe..0f97086 100644 --- a/Appwrite/Models/Preferences.cs +++ b/Appwrite/Models/Preferences.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -18,7 +19,7 @@ Dictionary data } public static Preferences From(Dictionary map) => new Preferences( - data: map + data: map.TryGetValue("data", out var dataValue) ? (Dictionary)dataValue : map ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Provider.cs b/Appwrite/Models/Provider.cs index 5d4d881..430277c 100644 --- a/Appwrite/Models/Provider.cs +++ b/Appwrite/Models/Provider.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ProviderList.cs b/Appwrite/Models/ProviderList.cs index fa21109..783d903 100644 --- a/Appwrite/Models/ProviderList.cs +++ b/Appwrite/Models/ProviderList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ResourceToken.cs b/Appwrite/Models/ResourceToken.cs index baa7eaa..b2e5635 100644 --- a/Appwrite/Models/ResourceToken.cs +++ b/Appwrite/Models/ResourceToken.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/ResourceTokenList.cs b/Appwrite/Models/ResourceTokenList.cs index 4e7fbd4..8f0928f 100644 --- a/Appwrite/Models/ResourceTokenList.cs +++ b/Appwrite/Models/ResourceTokenList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Row.cs b/Appwrite/Models/Row.cs index 4477c6b..d72ab9c 100644 --- a/Appwrite/Models/Row.cs +++ b/Appwrite/Models/Row.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { @@ -60,7 +61,7 @@ Dictionary data createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"] is JsonElement jsonArrayProp7 ? jsonArrayProp7.Deserialize>()! : (List)map["$permissions"], - data: map + data: map.TryGetValue("data", out var dataValue) ? (Dictionary)dataValue : map ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/RowList.cs b/Appwrite/Models/RowList.cs index 0362db5..210a5f1 100644 --- a/Appwrite/Models/RowList.cs +++ b/Appwrite/Models/RowList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Runtime.cs b/Appwrite/Models/Runtime.cs index 61ed39d..5dcb3e2 100644 --- a/Appwrite/Models/Runtime.cs +++ b/Appwrite/Models/Runtime.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/RuntimeList.cs b/Appwrite/Models/RuntimeList.cs index 3cedc1d..c4c6b0e 100644 --- a/Appwrite/Models/RuntimeList.cs +++ b/Appwrite/Models/RuntimeList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Session.cs b/Appwrite/Models/Session.cs index 13cb939..a22bb62 100644 --- a/Appwrite/Models/Session.cs +++ b/Appwrite/Models/Session.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/SessionList.cs b/Appwrite/Models/SessionList.cs index 0e36154..685cead 100644 --- a/Appwrite/Models/SessionList.cs +++ b/Appwrite/Models/SessionList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Site.cs b/Appwrite/Models/Site.cs index 0fbf1e9..70fb1ec 100644 --- a/Appwrite/Models/Site.cs +++ b/Appwrite/Models/Site.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/SiteList.cs b/Appwrite/Models/SiteList.cs index 18ee845..2b8a361 100644 --- a/Appwrite/Models/SiteList.cs +++ b/Appwrite/Models/SiteList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Specification.cs b/Appwrite/Models/Specification.cs index dea76cb..1334b3d 100644 --- a/Appwrite/Models/Specification.cs +++ b/Appwrite/Models/Specification.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/SpecificationList.cs b/Appwrite/Models/SpecificationList.cs index 1f5d43a..82694bc 100644 --- a/Appwrite/Models/SpecificationList.cs +++ b/Appwrite/Models/SpecificationList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Subscriber.cs b/Appwrite/Models/Subscriber.cs index 0672460..0837bfc 100644 --- a/Appwrite/Models/Subscriber.cs +++ b/Appwrite/Models/Subscriber.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/SubscriberList.cs b/Appwrite/Models/SubscriberList.cs index 7002b1f..7de9083 100644 --- a/Appwrite/Models/SubscriberList.cs +++ b/Appwrite/Models/SubscriberList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Table.cs b/Appwrite/Models/Table.cs index b290163..c621543 100644 --- a/Appwrite/Models/Table.cs +++ b/Appwrite/Models/Table.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/TableList.cs b/Appwrite/Models/TableList.cs index 68d7cf3..e4251f1 100644 --- a/Appwrite/Models/TableList.cs +++ b/Appwrite/Models/TableList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Target.cs b/Appwrite/Models/Target.cs index 4a7482d..b19d882 100644 --- a/Appwrite/Models/Target.cs +++ b/Appwrite/Models/Target.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/TargetList.cs b/Appwrite/Models/TargetList.cs index c2eeef8..ceef206 100644 --- a/Appwrite/Models/TargetList.cs +++ b/Appwrite/Models/TargetList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Team.cs b/Appwrite/Models/Team.cs index 281e062..5e68469 100644 --- a/Appwrite/Models/Team.cs +++ b/Appwrite/Models/Team.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/TeamList.cs b/Appwrite/Models/TeamList.cs index e09f327..a079b7f 100644 --- a/Appwrite/Models/TeamList.cs +++ b/Appwrite/Models/TeamList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Token.cs b/Appwrite/Models/Token.cs index fc846b7..8b6ec46 100644 --- a/Appwrite/Models/Token.cs +++ b/Appwrite/Models/Token.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Topic.cs b/Appwrite/Models/Topic.cs index b3188f0..bc2f973 100644 --- a/Appwrite/Models/Topic.cs +++ b/Appwrite/Models/Topic.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/TopicList.cs b/Appwrite/Models/TopicList.cs index b2ae6b2..51bfeab 100644 --- a/Appwrite/Models/TopicList.cs +++ b/Appwrite/Models/TopicList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/User.cs b/Appwrite/Models/User.cs index ef1b762..a1ac4c6 100644 --- a/Appwrite/Models/User.cs +++ b/Appwrite/Models/User.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/UserList.cs b/Appwrite/Models/UserList.cs index 2e71261..d1574dc 100644 --- a/Appwrite/Models/UserList.cs +++ b/Appwrite/Models/UserList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/Variable.cs b/Appwrite/Models/Variable.cs index ccac47c..8234773 100644 --- a/Appwrite/Models/Variable.cs +++ b/Appwrite/Models/Variable.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/Appwrite/Models/VariableList.cs b/Appwrite/Models/VariableList.cs index db0cc6b..b17d415 100644 --- a/Appwrite/Models/VariableList.cs +++ b/Appwrite/Models/VariableList.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Appwrite.Enums; namespace Appwrite.Models { diff --git a/README.md b/README.md index 14a441d..cf1cb30 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.18.0 +Install-Package Appwrite -Version 0.19.0 # or .NET CLI -dotnet add package Appwrite --version 0.18.0 +dotnet add package Appwrite --version 0.19.0 ```