Skip to content

Commit e0ca491

Browse files
Merge pull request #47 from appwrite/1.6.x
1.6.x
2 parents fbafc06 + 61f71a0 commit e0ca491

File tree

289 files changed

+909
-494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+909
-494
lines changed

Appwrite/Appwrite.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
44
<PackageId>Appwrite</PackageId>
5-
<Version>0.8.3</Version>
5+
<Version>0.9.0</Version>
66
<Authors>Appwrite Team</Authors>
77
<Company>Appwrite Team</Company>
88
<Description>

Appwrite/Client.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ public Client(
6969
_headers = new Dictionary<string, string>()
7070
{
7171
{ "content-type", "application/json" },
72-
{ "user-agent" , "AppwriteDotNetSDK/0.8.3 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
72+
{ "user-agent" , "AppwriteDotNetSDK/0.9.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
7373
{ "x-sdk-name", ".NET" },
7474
{ "x-sdk-platform", "server" },
7575
{ "x-sdk-language", "dotnet" },
76-
{ "x-sdk-version", "0.8.3"}, { "X-Appwrite-Response-Format", "1.5.0" }
76+
{ "x-sdk-version", "0.9.0"}, { "X-Appwrite-Response-Format", "1.6.0" }
7777
};
7878

7979
_config = new Dictionary<string, string>();
@@ -300,6 +300,14 @@ public async Task<T> Call<T>(
300300
var response = await _http.SendAsync(request);
301301
var code = (int)response.StatusCode;
302302

303+
if (response.Headers.TryGetValues("x-appwrite-warning", out var warnings))
304+
{
305+
foreach (var warning in warnings)
306+
{
307+
Console.WriteLine("Warning: " + warning);
308+
}
309+
}
310+
303311
string contentType = string.Empty;
304312
if (response.Content.Headers.TryGetValues("Content-Type", out var contentTypes))
305313
{

Appwrite/Enums/Name.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public Name(string value)
1818
public static Name V1Functions => new Name("v1-functions");
1919
public static Name V1Usage => new Name("v1-usage");
2020
public static Name V1UsageDump => new Name("v1-usage-dump");
21-
public static Name Webhooksv1 => new Name("webhooksv1");
21+
public static Name V1Webhooks => new Name("v1-webhooks");
2222
public static Name V1Certificates => new Name("v1-certificates");
2323
public static Name V1Builds => new Name("v1-builds");
2424
public static Name V1Messaging => new Name("v1-messaging");

Appwrite/Enums/Runtime.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public Runtime(string value)
3131
public static Runtime Python311 => new Runtime("python-3.11");
3232
public static Runtime Python312 => new Runtime("python-3.12");
3333
public static Runtime PythonMl311 => new Runtime("python-ml-3.11");
34-
public static Runtime Deno121 => new Runtime("deno-1.21");
35-
public static Runtime Deno124 => new Runtime("deno-1.24");
36-
public static Runtime Deno135 => new Runtime("deno-1.35");
3734
public static Runtime Deno140 => new Runtime("deno-1.40");
3835
public static Runtime Dart215 => new Runtime("dart-2.15");
3936
public static Runtime Dart216 => new Runtime("dart-2.16");
@@ -59,5 +56,6 @@ public Runtime(string value)
5956
public static Runtime Cpp17 => new Runtime("cpp-17");
6057
public static Runtime Cpp20 => new Runtime("cpp-20");
6158
public static Runtime Bun10 => new Runtime("bun-1.0");
59+
public static Runtime Go123 => new Runtime("go-1.23");
6260
}
6361
}

Appwrite/Models/AttributeDatetime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AttributeDatetime(
6262
required: (bool)map["required"],
6363
array: (bool?)map["array"],
6464
format: map["format"].ToString(),
65-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
65+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
6666
);
6767

6868
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/AttributeEmail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AttributeEmail(
6262
required: (bool)map["required"],
6363
array: (bool?)map["array"],
6464
format: map["format"].ToString(),
65-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
65+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
6666
);
6767

6868
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/AttributeEnum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public AttributeEnum(
6868
array: (bool?)map["array"],
6969
elements: ((JArray)map["elements"]).ToObject<List<object>>(),
7070
format: map["format"].ToString(),
71-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
71+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
7272
);
7373

7474
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/AttributeIp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AttributeIp(
6262
required: (bool)map["required"],
6363
array: (bool?)map["array"],
6464
format: map["format"].ToString(),
65-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
65+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
6666
);
6767

6868
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/AttributeString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AttributeString(
6262
required: (bool)map["required"],
6363
array: (bool?)map["array"],
6464
size: Convert.ToInt64(map["size"]),
65-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
65+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
6666
);
6767

6868
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/AttributeUrl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AttributeUrl(
6262
required: (bool)map["required"],
6363
array: (bool?)map["array"],
6464
format: map["format"].ToString(),
65-
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
65+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
6666
);
6767

6868
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()

Appwrite/Models/Build.cs

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
using System;
3+
using System.Linq;
4+
using System.Collections.Generic;
5+
6+
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Linq;
8+
9+
namespace Appwrite.Models
10+
{
11+
public class Build
12+
{
13+
[JsonProperty("$id")]
14+
public string Id { get; private set; }
15+
16+
[JsonProperty("deploymentId")]
17+
public string DeploymentId { get; private set; }
18+
19+
[JsonProperty("status")]
20+
public string Status { get; private set; }
21+
22+
[JsonProperty("stdout")]
23+
public string Stdout { get; private set; }
24+
25+
[JsonProperty("stderr")]
26+
public string Stderr { get; private set; }
27+
28+
[JsonProperty("startTime")]
29+
public string StartTime { get; private set; }
30+
31+
[JsonProperty("endTime")]
32+
public string EndTime { get; private set; }
33+
34+
[JsonProperty("duration")]
35+
public long Duration { get; private set; }
36+
37+
[JsonProperty("size")]
38+
public long Size { get; private set; }
39+
40+
public Build(
41+
string id,
42+
string deploymentId,
43+
string status,
44+
string stdout,
45+
string stderr,
46+
string startTime,
47+
string endTime,
48+
long duration,
49+
long size
50+
) {
51+
Id = id;
52+
DeploymentId = deploymentId;
53+
Status = status;
54+
Stdout = stdout;
55+
Stderr = stderr;
56+
StartTime = startTime;
57+
EndTime = endTime;
58+
Duration = duration;
59+
Size = size;
60+
}
61+
62+
public static Build From(Dictionary<string, object> map) => new Build(
63+
id: map["$id"].ToString(),
64+
deploymentId: map["deploymentId"].ToString(),
65+
status: map["status"].ToString(),
66+
stdout: map["stdout"].ToString(),
67+
stderr: map["stderr"].ToString(),
68+
startTime: map["startTime"].ToString(),
69+
endTime: map["endTime"].ToString(),
70+
duration: Convert.ToInt64(map["duration"]),
71+
size: Convert.ToInt64(map["size"])
72+
);
73+
74+
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
75+
{
76+
{ "$id", Id },
77+
{ "deploymentId", DeploymentId },
78+
{ "status", Status },
79+
{ "stdout", Stdout },
80+
{ "stderr", Stderr },
81+
{ "startTime", StartTime },
82+
{ "endTime", EndTime },
83+
{ "duration", Duration },
84+
{ "size", Size }
85+
};
86+
}
87+
}

Appwrite/Models/Deployment.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public class Deployment
3434
[JsonProperty("size")]
3535
public long Size { get; private set; }
3636

37+
[JsonProperty("buildSize")]
38+
public long BuildSize { get; private set; }
39+
3740
[JsonProperty("buildId")]
3841
public string BuildId { get; private set; }
3942

@@ -88,6 +91,7 @@ public Deployment(
8891
string resourceType,
8992
string entrypoint,
9093
long size,
94+
long buildSize,
9195
string buildId,
9296
bool activate,
9397
string status,
@@ -112,6 +116,7 @@ string providerBranchUrl
112116
ResourceType = resourceType;
113117
Entrypoint = entrypoint;
114118
Size = size;
119+
BuildSize = buildSize;
115120
BuildId = buildId;
116121
Activate = activate;
117122
Status = status;
@@ -138,6 +143,7 @@ string providerBranchUrl
138143
resourceType: map["resourceType"].ToString(),
139144
entrypoint: map["entrypoint"].ToString(),
140145
size: Convert.ToInt64(map["size"]),
146+
buildSize: Convert.ToInt64(map["buildSize"]),
141147
buildId: map["buildId"].ToString(),
142148
activate: (bool)map["activate"],
143149
status: map["status"].ToString(),
@@ -165,6 +171,7 @@ string providerBranchUrl
165171
{ "resourceType", ResourceType },
166172
{ "entrypoint", Entrypoint },
167173
{ "size", Size },
174+
{ "buildSize", BuildSize },
168175
{ "buildId", BuildId },
169176
{ "activate", Activate },
170177
{ "status", Status },

Appwrite/Models/Execution.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public class Execution
5858
[JsonProperty("duration")]
5959
public double Duration { get; private set; }
6060

61+
[JsonProperty("scheduledAt")]
62+
public string? ScheduledAt { get; private set; }
63+
6164
public Execution(
6265
string id,
6366
string createdAt,
@@ -74,7 +77,8 @@ public Execution(
7477
List<Headers> responseHeaders,
7578
string logs,
7679
string errors,
77-
double duration
80+
double duration,
81+
string? scheduledAt
7882
) {
7983
Id = id;
8084
CreatedAt = createdAt;
@@ -92,6 +96,7 @@ double duration
9296
Logs = logs;
9397
Errors = errors;
9498
Duration = duration;
99+
ScheduledAt = scheduledAt;
95100
}
96101

97102
public static Execution From(Dictionary<string, object> map) => new Execution(
@@ -110,7 +115,8 @@ double duration
110115
responseHeaders: ((JArray)map["responseHeaders"]).ToObject<List<Dictionary<string, object>>>().Select(it => Headers.From(map: it)).ToList(),
111116
logs: map["logs"].ToString(),
112117
errors: map["errors"].ToString(),
113-
duration: Convert.ToDouble(map["duration"])
118+
duration: Convert.ToDouble(map["duration"]),
119+
scheduledAt: map.TryGetValue("scheduledAt", out var scheduledAt) ? scheduledAt?.ToString() : null
114120
);
115121

116122
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
@@ -130,7 +136,8 @@ double duration
130136
{ "responseHeaders", ResponseHeaders.Select(it => it.ToMap()) },
131137
{ "logs", Logs },
132138
{ "errors", Errors },
133-
{ "duration", Duration }
139+
{ "duration", Duration },
140+
{ "scheduledAt", ScheduledAt }
134141
};
135142
}
136143
}

Appwrite/Models/Function.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public class Function
4040
[JsonProperty("deployment")]
4141
public string Deployment { get; private set; }
4242

43+
[JsonProperty("scopes")]
44+
public List<object> Scopes { get; private set; }
45+
4346
[JsonProperty("vars")]
4447
public List<Variable> Vars { get; private set; }
4548

@@ -76,6 +79,9 @@ public class Function
7679
[JsonProperty("providerSilentMode")]
7780
public bool ProviderSilentMode { get; private set; }
7881

82+
[JsonProperty("specification")]
83+
public string Specification { get; private set; }
84+
7985
public Function(
8086
string id,
8187
string createdAt,
@@ -87,6 +93,7 @@ public Function(
8793
bool logging,
8894
string runtime,
8995
string deployment,
96+
List<object> scopes,
9097
List<Variable> vars,
9198
List<object> events,
9299
string schedule,
@@ -98,7 +105,8 @@ public Function(
98105
string providerRepositoryId,
99106
string providerBranch,
100107
string providerRootDirectory,
101-
bool providerSilentMode
108+
bool providerSilentMode,
109+
string specification
102110
) {
103111
Id = id;
104112
CreatedAt = createdAt;
@@ -110,6 +118,7 @@ bool providerSilentMode
110118
Logging = logging;
111119
Runtime = runtime;
112120
Deployment = deployment;
121+
Scopes = scopes;
113122
Vars = vars;
114123
Events = events;
115124
Schedule = schedule;
@@ -122,6 +131,7 @@ bool providerSilentMode
122131
ProviderBranch = providerBranch;
123132
ProviderRootDirectory = providerRootDirectory;
124133
ProviderSilentMode = providerSilentMode;
134+
Specification = specification;
125135
}
126136

127137
public static Function From(Dictionary<string, object> map) => new Function(
@@ -135,6 +145,7 @@ bool providerSilentMode
135145
logging: (bool)map["logging"],
136146
runtime: map["runtime"].ToString(),
137147
deployment: map["deployment"].ToString(),
148+
scopes: ((JArray)map["scopes"]).ToObject<List<object>>(),
138149
vars: ((JArray)map["vars"]).ToObject<List<Dictionary<string, object>>>().Select(it => Variable.From(map: it)).ToList(),
139150
events: ((JArray)map["events"]).ToObject<List<object>>(),
140151
schedule: map["schedule"].ToString(),
@@ -146,7 +157,8 @@ bool providerSilentMode
146157
providerRepositoryId: map["providerRepositoryId"].ToString(),
147158
providerBranch: map["providerBranch"].ToString(),
148159
providerRootDirectory: map["providerRootDirectory"].ToString(),
149-
providerSilentMode: (bool)map["providerSilentMode"]
160+
providerSilentMode: (bool)map["providerSilentMode"],
161+
specification: map["specification"].ToString()
150162
);
151163

152164
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
@@ -161,6 +173,7 @@ bool providerSilentMode
161173
{ "logging", Logging },
162174
{ "runtime", Runtime },
163175
{ "deployment", Deployment },
176+
{ "scopes", Scopes },
164177
{ "vars", Vars.Select(it => it.ToMap()) },
165178
{ "events", Events },
166179
{ "schedule", Schedule },
@@ -172,7 +185,8 @@ bool providerSilentMode
172185
{ "providerRepositoryId", ProviderRepositoryId },
173186
{ "providerBranch", ProviderBranch },
174187
{ "providerRootDirectory", ProviderRootDirectory },
175-
{ "providerSilentMode", ProviderSilentMode }
188+
{ "providerSilentMode", ProviderSilentMode },
189+
{ "specification", Specification }
176190
};
177191
}
178192
}

Appwrite/Models/Message.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ string status
8787
topics: ((JArray)map["topics"]).ToObject<List<object>>(),
8888
users: ((JArray)map["users"]).ToObject<List<object>>(),
8989
targets: ((JArray)map["targets"]).ToObject<List<object>>(),
90-
scheduledAt: map.TryGetValue("scheduledAt", out var scheduledAt) ? scheduledAt.ToString() : null,
91-
deliveredAt: map.TryGetValue("deliveredAt", out var deliveredAt) ? deliveredAt.ToString() : null,
90+
scheduledAt: map.TryGetValue("scheduledAt", out var scheduledAt) ? scheduledAt?.ToString() : null,
91+
deliveredAt: map.TryGetValue("deliveredAt", out var deliveredAt) ? deliveredAt?.ToString() : null,
9292
deliveryErrors: ((JArray)map["deliveryErrors"]).ToObject<List<object>>(),
9393
deliveredTotal: Convert.ToInt64(map["deliveredTotal"]),
9494
data: map["data"].ToString(),

0 commit comments

Comments
 (0)