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>0.16.0</Version>
<Version>0.17.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 @@ -69,11 +69,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "content-type", "application/json" },
{ "user-agent" , $"AppwriteDotNetSDK/0.16.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "user-agent" , $"AppwriteDotNetSDK/0.17.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "0.16.0"},
{ "x-sdk-version", "0.17.0"},
{ "X-Appwrite-Response-Format", "1.8.0" }
};

Expand Down
2 changes: 1 addition & 1 deletion Appwrite/Enums/CreditCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public CreditCard(string value)
public static CreditCard Mastercard => new CreditCard("mastercard");
public static CreditCard Naranja => new CreditCard("naranja");
public static CreditCard TarjetaShopping => new CreditCard("targeta-shopping");
public static CreditCard UnionChinaPay => new CreditCard("union-china-pay");
public static CreditCard UnionPay => new CreditCard("unionpay");
public static CreditCard Visa => new CreditCard("visa");
public static CreditCard MIR => new CreditCard("mir");
public static CreditCard Maestro => new CreditCard("maestro");
Expand Down
1 change: 1 addition & 0 deletions Appwrite/Enums/ExecutionMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ public ExecutionMethod(string value)
public static ExecutionMethod PATCH => new ExecutionMethod("PATCH");
public static ExecutionMethod DELETE => new ExecutionMethod("DELETE");
public static ExecutionMethod OPTIONS => new ExecutionMethod("OPTIONS");
public static ExecutionMethod HEAD => new ExecutionMethod("HEAD");
}
}
1 change: 1 addition & 0 deletions Appwrite/Enums/IndexType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public IndexType(string value)
public static IndexType Key => new IndexType("key");
public static IndexType Fulltext => new IndexType("fulltext");
public static IndexType Unique => new IndexType("unique");
public static IndexType Spatial => new IndexType("spatial");
}
}
86 changes: 86 additions & 0 deletions Appwrite/Models/AttributeLine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Appwrite.Models
{
public class AttributeLine
{
[JsonPropertyName("key")]
public string Key { get; private set; }

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

[JsonPropertyName("status")]
public string Status { get; private set; }

[JsonPropertyName("error")]
public string Error { get; private set; }

[JsonPropertyName("required")]
public bool Required { get; private set; }

[JsonPropertyName("array")]
public bool? Array { get; private set; }

[JsonPropertyName("$createdAt")]
public string CreatedAt { get; private set; }

[JsonPropertyName("$updatedAt")]
public string UpdatedAt { get; private set; }

[JsonPropertyName("default")]
public List<object>? Default { get; private set; }

public AttributeLine(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
List<object>? xdefault
) {
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Default = xdefault;
}

public static AttributeLine From(Dictionary<string, object> map) => new AttributeLine(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize<List<object>>()! : (List<object>)map["default"]
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "default", Default }
};
}
}
86 changes: 86 additions & 0 deletions Appwrite/Models/AttributePoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Appwrite.Models
{
public class AttributePoint
{
[JsonPropertyName("key")]
public string Key { get; private set; }

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

[JsonPropertyName("status")]
public string Status { get; private set; }

[JsonPropertyName("error")]
public string Error { get; private set; }

[JsonPropertyName("required")]
public bool Required { get; private set; }

[JsonPropertyName("array")]
public bool? Array { get; private set; }

[JsonPropertyName("$createdAt")]
public string CreatedAt { get; private set; }

[JsonPropertyName("$updatedAt")]
public string UpdatedAt { get; private set; }

[JsonPropertyName("default")]
public List<object>? Default { get; private set; }

public AttributePoint(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
List<object>? xdefault
) {
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Default = xdefault;
}

public static AttributePoint From(Dictionary<string, object> map) => new AttributePoint(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize<List<object>>()! : (List<object>)map["default"]
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "default", Default }
};
}
}
86 changes: 86 additions & 0 deletions Appwrite/Models/AttributePolygon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Appwrite.Models
{
public class AttributePolygon
{
[JsonPropertyName("key")]
public string Key { get; private set; }

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

[JsonPropertyName("status")]
public string Status { get; private set; }

[JsonPropertyName("error")]
public string Error { get; private set; }

[JsonPropertyName("required")]
public bool Required { get; private set; }

[JsonPropertyName("array")]
public bool? Array { get; private set; }

[JsonPropertyName("$createdAt")]
public string CreatedAt { get; private set; }

[JsonPropertyName("$updatedAt")]
public string UpdatedAt { get; private set; }

[JsonPropertyName("default")]
public List<object>? Default { get; private set; }

public AttributePolygon(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
List<object>? xdefault
) {
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Default = xdefault;
}

public static AttributePolygon From(Dictionary<string, object> map) => new AttributePolygon(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize<List<object>>()! : (List<object>)map["default"]
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "default", Default }
};
}
}
86 changes: 86 additions & 0 deletions Appwrite/Models/ColumnLine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Appwrite.Models
{
public class ColumnLine
{
[JsonPropertyName("key")]
public string Key { get; private set; }

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

[JsonPropertyName("status")]
public string Status { get; private set; }

[JsonPropertyName("error")]
public string Error { get; private set; }

[JsonPropertyName("required")]
public bool Required { get; private set; }

[JsonPropertyName("array")]
public bool? Array { get; private set; }

[JsonPropertyName("$createdAt")]
public string CreatedAt { get; private set; }

[JsonPropertyName("$updatedAt")]
public string UpdatedAt { get; private set; }

[JsonPropertyName("default")]
public List<object>? Default { get; private set; }

public ColumnLine(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
List<object>? xdefault
) {
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Default = xdefault;
}

public static ColumnLine From(Dictionary<string, object> map) => new ColumnLine(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
xdefault: map["default"] is JsonElement jsonArrayProp9 ? jsonArrayProp9.Deserialize<List<object>>()! : (List<object>)map["default"]
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "default", Default }
};
}
}
Loading