Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new push message parameters #56

Merged
merged 1 commit into from
Jan 21, 2025
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;net461</TargetFrameworks>
<PackageId>Appwrite</PackageId>
<Version>0.10.1</Version>
<Version>0.11.0</Version>
<Authors>Appwrite Team</Authors>
<Company>Appwrite Team</Company>
<Description>
Expand Down
8 changes: 3 additions & 5 deletions Appwrite/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "content-type", "application/json" },
{ "user-agent" , "AppwriteDotNetSDK/0.10.1 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
{ "user-agent" , "AppwriteDotNetSDK/0.11.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "0.10.1"},
{ "X-Appwrite-Response-Format", "1.6.0" }
{ "x-sdk-version", "0.11.0"}, { "X-Appwrite-Response-Format", "1.6.0" }
};

_config = new Dictionary<string, string>();
Expand Down Expand Up @@ -417,10 +416,9 @@ public async Task<T> ChunkedUpload<T>(
new Dictionary<string, string> { { "content-type", "application/json" } },
parameters: new Dictionary<string, object?>()
);

var chunksUploaded = (long)current["chunksUploaded"];
offset = chunksUploaded * ChunkSize;
}
}
catch (Exception ex)
{
// ignored as it mostly means file not found
Expand Down
1 change: 1 addition & 0 deletions Appwrite/Enums/ImageFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public ImageFormat(string value)
public static ImageFormat Gif => new ImageFormat("gif");
public static ImageFormat Png => new ImageFormat("png");
public static ImageFormat Webp => new ImageFormat("webp");
public static ImageFormat Avif => new ImageFormat("avif");
}
}
17 changes: 17 additions & 0 deletions Appwrite/Enums/MessagePriority.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Appwrite.Enums
{
public class MessagePriority : IEnum
{
public string Value { get; private set; }

public MessagePriority(string value)
{
Value = value;
}

public static MessagePriority Normal => new MessagePriority("normal");
public static MessagePriority High => new MessagePriority("high");
}
}
15 changes: 14 additions & 1 deletion Appwrite/Enums/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public Runtime(string value)
public static Runtime Node190 => new Runtime("node-19.0");
public static Runtime Node200 => new Runtime("node-20.0");
public static Runtime Node210 => new Runtime("node-21.0");
public static Runtime Node22 => new Runtime("node-22");
public static Runtime Php80 => new Runtime("php-8.0");
public static Runtime Php81 => new Runtime("php-8.1");
public static Runtime Php82 => new Runtime("php-8.2");
Expand All @@ -31,31 +32,43 @@ public Runtime(string value)
public static Runtime Python311 => new Runtime("python-3.11");
public static Runtime Python312 => new Runtime("python-3.12");
public static Runtime PythonMl311 => new Runtime("python-ml-3.11");
public static Runtime Deno121 => new Runtime("deno-1.21");
public static Runtime Deno124 => new Runtime("deno-1.24");
public static Runtime Deno135 => new Runtime("deno-1.35");
public static Runtime Deno140 => new Runtime("deno-1.40");
public static Runtime Deno146 => new Runtime("deno-1.46");
public static Runtime Deno20 => new Runtime("deno-2.0");
public static Runtime Dart215 => new Runtime("dart-2.15");
public static Runtime Dart216 => new Runtime("dart-2.16");
public static Runtime Dart217 => new Runtime("dart-2.17");
public static Runtime Dart218 => new Runtime("dart-2.18");
public static Runtime Dart30 => new Runtime("dart-3.0");
public static Runtime Dart31 => new Runtime("dart-3.1");
public static Runtime Dart33 => new Runtime("dart-3.3");
public static Runtime Dotnet31 => new Runtime("dotnet-3.1");
public static Runtime Dart35 => new Runtime("dart-3.5");
public static Runtime Dotnet60 => new Runtime("dotnet-6.0");
public static Runtime Dotnet70 => new Runtime("dotnet-7.0");
public static Runtime Dotnet80 => new Runtime("dotnet-8.0");
public static Runtime Java80 => new Runtime("java-8.0");
public static Runtime Java110 => new Runtime("java-11.0");
public static Runtime Java170 => new Runtime("java-17.0");
public static Runtime Java180 => new Runtime("java-18.0");
public static Runtime Java210 => new Runtime("java-21.0");
public static Runtime Java22 => new Runtime("java-22");
public static Runtime Swift55 => new Runtime("swift-5.5");
public static Runtime Swift58 => new Runtime("swift-5.8");
public static Runtime Swift59 => new Runtime("swift-5.9");
public static Runtime Swift510 => new Runtime("swift-5.10");
public static Runtime Kotlin16 => new Runtime("kotlin-1.6");
public static Runtime Kotlin18 => new Runtime("kotlin-1.8");
public static Runtime Kotlin19 => new Runtime("kotlin-1.9");
public static Runtime Kotlin20 => new Runtime("kotlin-2.0");
public static Runtime Cpp17 => new Runtime("cpp-17");
public static Runtime Cpp20 => new Runtime("cpp-20");
public static Runtime Bun10 => new Runtime("bun-1.0");
public static Runtime Bun11 => new Runtime("bun-1.1");
public static Runtime Go123 => new Runtime("go-1.23");
public static Runtime Static1 => new Runtime("static-1");
public static Runtime Flutter324 => new Runtime("flutter-3.24");
}
}
14 changes: 14 additions & 0 deletions Appwrite/Models/AttributeBoolean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class AttributeBoolean
[JsonProperty("array")]
public bool? Array { get; private set; }

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

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

[JsonProperty("default")]
public bool? Default { get; private set; }

Expand All @@ -38,6 +44,8 @@ public AttributeBoolean(
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
bool? xdefault
) {
Key = key;
Expand All @@ -46,6 +54,8 @@ public AttributeBoolean(
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Default = xdefault;
}

Expand All @@ -56,6 +66,8 @@ public AttributeBoolean(
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
xdefault: (bool?)map["default"]
);

Expand All @@ -67,6 +79,8 @@ public AttributeBoolean(
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "default", Default }
};
}
Expand Down
14 changes: 14 additions & 0 deletions Appwrite/Models/AttributeDatetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class AttributeDatetime
[JsonProperty("array")]
public bool? Array { get; private set; }

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

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

[JsonProperty("format")]
public string Format { get; private set; }

Expand All @@ -41,6 +47,8 @@ public AttributeDatetime(
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
string format,
string? xdefault
) {
Expand All @@ -50,6 +58,8 @@ public AttributeDatetime(
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Format = format;
Default = xdefault;
}
Expand All @@ -61,6 +71,8 @@ public AttributeDatetime(
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
format: map["format"].ToString(),
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
);
Expand All @@ -73,6 +85,8 @@ public AttributeDatetime(
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "format", Format },
{ "default", Default }
};
Expand Down
14 changes: 14 additions & 0 deletions Appwrite/Models/AttributeEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class AttributeEmail
[JsonProperty("array")]
public bool? Array { get; private set; }

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

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

[JsonProperty("format")]
public string Format { get; private set; }

Expand All @@ -41,6 +47,8 @@ public AttributeEmail(
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
string format,
string? xdefault
) {
Expand All @@ -50,6 +58,8 @@ public AttributeEmail(
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Format = format;
Default = xdefault;
}
Expand All @@ -61,6 +71,8 @@ public AttributeEmail(
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
format: map["format"].ToString(),
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
);
Expand All @@ -73,6 +85,8 @@ public AttributeEmail(
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "format", Format },
{ "default", Default }
};
Expand Down
20 changes: 17 additions & 3 deletions Appwrite/Models/AttributeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ public class AttributeEnum
[JsonProperty("array")]
public bool? Array { get; private set; }

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

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

[JsonProperty("elements")]
public List<object> Elements { get; private set; }
public List<string> Elements { get; private set; }

[JsonProperty("format")]
public string Format { get; private set; }
Expand All @@ -44,7 +50,9 @@ public AttributeEnum(
string error,
bool required,
bool? array,
List<object> elements,
string createdAt,
string updatedAt,
List<string> elements,
string format,
string? xdefault
) {
Expand All @@ -54,6 +62,8 @@ public AttributeEnum(
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Elements = elements;
Format = format;
Default = xdefault;
Expand All @@ -66,7 +76,9 @@ public AttributeEnum(
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
elements: ((JArray)map["elements"]).ToObject<List<object>>(),
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
elements: ((JArray)map["elements"]).ToObject<List<string>>(),
format: map["format"].ToString(),
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
);
Expand All @@ -79,6 +91,8 @@ public AttributeEnum(
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "elements", Elements },
{ "format", Format },
{ "default", Default }
Expand Down
14 changes: 14 additions & 0 deletions Appwrite/Models/AttributeFloat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class AttributeFloat
[JsonProperty("array")]
public bool? Array { get; private set; }

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

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

[JsonProperty("min")]
public double? Min { get; private set; }

Expand All @@ -44,6 +50,8 @@ public AttributeFloat(
string error,
bool required,
bool? array,
string createdAt,
string updatedAt,
double? min,
double? max,
double? xdefault
Expand All @@ -54,6 +62,8 @@ public AttributeFloat(
Error = error;
Required = required;
Array = array;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Min = min;
Max = max;
Default = xdefault;
Expand All @@ -66,6 +76,8 @@ public AttributeFloat(
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
createdAt: map["$createdAt"].ToString(),
updatedAt: map["$updatedAt"].ToString(),
min: map["min"] == null ? null : Convert.ToDouble(map["min"]),
max: map["max"] == null ? null : Convert.ToDouble(map["max"]),
xdefault: map["default"] == null ? null : Convert.ToDouble(map["default"])
Expand All @@ -79,6 +91,8 @@ public AttributeFloat(
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "$createdAt", CreatedAt },
{ "$updatedAt", UpdatedAt },
{ "min", Min },
{ "max", Max },
{ "default", Default }
Expand Down
Loading
Loading