Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Appwrite/Appwrite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<PackageId>Appwrite</PackageId>
<Version>9.0.0</Version>
<Version>10.0.0</Version>
<Authors>Appwrite Team</Authors>
<Company>Appwrite Team</Company>
<Description>
Expand Down
4 changes: 2 additions & 2 deletions Appwrite/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "content-type", "application/json" },
{ "user-agent", $"AppwriteDotNetSDK/9.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "user-agent", $"AppwriteDotNetSDK/10.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "9.0.0"},
{ "x-sdk-version", "10.0.0"},
{ "X-Appwrite-Response-Format", "2.5.0" }
};

Expand Down
21 changes: 14 additions & 7 deletions Appwrite/Models/AttributeBigint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeBigint
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand Down Expand Up @@ -46,6 +49,7 @@ public class AttributeBigint

public AttributeBigint(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -59,6 +63,7 @@ public AttributeBigint(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -73,29 +78,31 @@ public AttributeBigint(

public static AttributeBigint From(Dictionary<string, object> map) => new AttributeBigint(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null
? Convert.ToInt64(numberRaw9)
: null,
max: map.TryGetValue("max", out var numberRaw10) && numberRaw10 != null
min: map.TryGetValue("min", out var numberRaw10) && numberRaw10 != null
? Convert.ToInt64(numberRaw10)
: null,
@default: map.TryGetValue("default", out var numberRaw11) && numberRaw11 != null
max: map.TryGetValue("max", out var numberRaw11) && numberRaw11 != null
? Convert.ToInt64(numberRaw11)
: null,
@default: map.TryGetValue("default", out var numberRaw12) && numberRaw12 != null
? Convert.ToInt64(numberRaw12)
: null
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
15 changes: 11 additions & 4 deletions Appwrite/Models/AttributeBoolean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeBoolean
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand All @@ -40,6 +43,7 @@ public class AttributeBoolean

public AttributeBoolean(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -51,6 +55,7 @@ public AttributeBoolean(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -63,23 +68,25 @@ public AttributeBoolean(

public static AttributeBoolean From(Dictionary<string, object> map) => new AttributeBoolean(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
@default: map.TryGetValue("default", out var boolRaw9) && boolRaw9 != null
? (bool?)boolRaw9
@default: map.TryGetValue("default", out var boolRaw10) && boolRaw10 != null
? (bool?)boolRaw10
: null
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
11 changes: 9 additions & 2 deletions Appwrite/Models/AttributeDatetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeDatetime
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand Down Expand Up @@ -43,6 +46,7 @@ public class AttributeDatetime

public AttributeDatetime(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -55,6 +59,7 @@ public AttributeDatetime(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -68,12 +73,13 @@ public AttributeDatetime(

public static AttributeDatetime From(Dictionary<string, object> map) => new AttributeDatetime(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
Expand All @@ -84,6 +90,7 @@ public AttributeDatetime(
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
11 changes: 9 additions & 2 deletions Appwrite/Models/AttributeEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeEmail
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand Down Expand Up @@ -43,6 +46,7 @@ public class AttributeEmail

public AttributeEmail(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -55,6 +59,7 @@ public AttributeEmail(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -68,12 +73,13 @@ public AttributeEmail(

public static AttributeEmail From(Dictionary<string, object> map) => new AttributeEmail(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
Expand All @@ -84,6 +90,7 @@ public AttributeEmail(
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
11 changes: 9 additions & 2 deletions Appwrite/Models/AttributeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeEnum
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand Down Expand Up @@ -46,6 +49,7 @@ public class AttributeEnum

public AttributeEnum(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -59,6 +63,7 @@ public AttributeEnum(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -73,12 +78,13 @@ public AttributeEnum(

public static AttributeEnum From(Dictionary<string, object> map) => new AttributeEnum(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
Expand All @@ -90,6 +96,7 @@ public AttributeEnum(
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
21 changes: 14 additions & 7 deletions Appwrite/Models/AttributeFloat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class AttributeFloat
[JsonPropertyName("key")]
public string Key { get; private set; }

[JsonPropertyName("description")]
public string Description { get; private set; }

[JsonPropertyName("type")]
public string Type { get; private set; }

Expand Down Expand Up @@ -46,6 +49,7 @@ public class AttributeFloat

public AttributeFloat(
string key,
string description,
string type,
Appwrite.Enums.AttributeStatus status,
string error,
Expand All @@ -59,6 +63,7 @@ public AttributeFloat(
)
{
Key = key;
Description = description;
Type = type;
Status = status;
Error = error;
Expand All @@ -73,29 +78,31 @@ public AttributeFloat(

public static AttributeFloat From(Dictionary<string, object> map) => new AttributeFloat(
key: (map.ContainsKey("key") ? map["key"] : "").ToString(),
description: (map.ContainsKey("description") ? map["description"] : "").ToString(),
type: (map.ContainsKey("type") ? map["type"] : "").ToString(),
status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!),
error: (map.ContainsKey("error") ? map["error"] : "").ToString(),
required: (bool)(map.ContainsKey("required") ? map["required"] : false),
array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null
? (bool?)boolRaw6
array: map.TryGetValue("array", out var boolRaw7) && boolRaw7 != null
? (bool?)boolRaw7
: null,
createdAt: (map.ContainsKey("$createdAt") ? map["$createdAt"] : "").ToString(),
updatedAt: (map.ContainsKey("$updatedAt") ? map["$updatedAt"] : "").ToString(),
min: map.TryGetValue("min", out var numberRaw9) && numberRaw9 != null
? Convert.ToDouble(numberRaw9)
: null,
max: map.TryGetValue("max", out var numberRaw10) && numberRaw10 != null
min: map.TryGetValue("min", out var numberRaw10) && numberRaw10 != null
? Convert.ToDouble(numberRaw10)
: null,
@default: map.TryGetValue("default", out var numberRaw11) && numberRaw11 != null
max: map.TryGetValue("max", out var numberRaw11) && numberRaw11 != null
? Convert.ToDouble(numberRaw11)
: null,
@default: map.TryGetValue("default", out var numberRaw12) && numberRaw12 != null
? Convert.ToDouble(numberRaw12)
: null
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "description", Description },
{ "type", Type },
{ "status", Status.Value },
{ "error", Error },
Expand Down
Loading