Skip to content

Commit e91c07a

Browse files
authored
Merge pull request #69 from appwrite/dev
Add 1.8.x support
2 parents 5609ce8 + bff5e97 commit e91c07a

File tree

119 files changed

+5034
-83
lines changed

Some content is hidden

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

119 files changed

+5034
-83
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;net462</TargetFrameworks>
44
<PackageId>Appwrite</PackageId>
5-
<Version>0.15.0</Version>
5+
<Version>0.16.0</Version>
66
<Authors>Appwrite Team</Authors>
77
<Company>Appwrite Team</Company>
88
<Description>

Appwrite/Client.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public Client(
6969
_headers = new Dictionary<string, string>()
7070
{
7171
{ "content-type", "application/json" },
72-
{ "user-agent" , $"AppwriteDotNetSDK/0.15.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
72+
{ "user-agent" , $"AppwriteDotNetSDK/0.16.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.15.0"},
77-
{ "X-Appwrite-Response-Format", "1.7.0" }
76+
{ "x-sdk-version", "0.16.0"},
77+
{ "X-Appwrite-Response-Format", "1.8.0" }
7878
};
7979

8080
_config = new Dictionary<string, string>();

Appwrite/Models/ColumnBoolean.cs

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
using System;
3+
using System.Linq;
4+
using System.Collections.Generic;
5+
using System.Text.Json;
6+
using System.Text.Json.Serialization;
7+
8+
namespace Appwrite.Models
9+
{
10+
public class ColumnBoolean
11+
{
12+
[JsonPropertyName("key")]
13+
public string Key { get; private set; }
14+
15+
[JsonPropertyName("type")]
16+
public string Type { get; private set; }
17+
18+
[JsonPropertyName("status")]
19+
public string Status { get; private set; }
20+
21+
[JsonPropertyName("error")]
22+
public string Error { get; private set; }
23+
24+
[JsonPropertyName("required")]
25+
public bool Required { get; private set; }
26+
27+
[JsonPropertyName("array")]
28+
public bool? Array { get; private set; }
29+
30+
[JsonPropertyName("$createdAt")]
31+
public string CreatedAt { get; private set; }
32+
33+
[JsonPropertyName("$updatedAt")]
34+
public string UpdatedAt { get; private set; }
35+
36+
[JsonPropertyName("default")]
37+
public bool? Default { get; private set; }
38+
39+
public ColumnBoolean(
40+
string key,
41+
string type,
42+
string status,
43+
string error,
44+
bool required,
45+
bool? array,
46+
string createdAt,
47+
string updatedAt,
48+
bool? xdefault
49+
) {
50+
Key = key;
51+
Type = type;
52+
Status = status;
53+
Error = error;
54+
Required = required;
55+
Array = array;
56+
CreatedAt = createdAt;
57+
UpdatedAt = updatedAt;
58+
Default = xdefault;
59+
}
60+
61+
public static ColumnBoolean From(Dictionary<string, object> map) => new ColumnBoolean(
62+
key: map["key"].ToString(),
63+
type: map["type"].ToString(),
64+
status: map["status"].ToString(),
65+
error: map["error"].ToString(),
66+
required: (bool)map["required"],
67+
array: (bool?)map["array"],
68+
createdAt: map["$createdAt"].ToString(),
69+
updatedAt: map["$updatedAt"].ToString(),
70+
xdefault: (bool?)map["default"]
71+
);
72+
73+
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
74+
{
75+
{ "key", Key },
76+
{ "type", Type },
77+
{ "status", Status },
78+
{ "error", Error },
79+
{ "required", Required },
80+
{ "array", Array },
81+
{ "$createdAt", CreatedAt },
82+
{ "$updatedAt", UpdatedAt },
83+
{ "default", Default }
84+
};
85+
}
86+
}

Appwrite/Models/ColumnDatetime.cs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
using System;
3+
using System.Linq;
4+
using System.Collections.Generic;
5+
using System.Text.Json;
6+
using System.Text.Json.Serialization;
7+
8+
namespace Appwrite.Models
9+
{
10+
public class ColumnDatetime
11+
{
12+
[JsonPropertyName("key")]
13+
public string Key { get; private set; }
14+
15+
[JsonPropertyName("type")]
16+
public string Type { get; private set; }
17+
18+
[JsonPropertyName("status")]
19+
public string Status { get; private set; }
20+
21+
[JsonPropertyName("error")]
22+
public string Error { get; private set; }
23+
24+
[JsonPropertyName("required")]
25+
public bool Required { get; private set; }
26+
27+
[JsonPropertyName("array")]
28+
public bool? Array { get; private set; }
29+
30+
[JsonPropertyName("$createdAt")]
31+
public string CreatedAt { get; private set; }
32+
33+
[JsonPropertyName("$updatedAt")]
34+
public string UpdatedAt { get; private set; }
35+
36+
[JsonPropertyName("format")]
37+
public string Format { get; private set; }
38+
39+
[JsonPropertyName("default")]
40+
public string? Default { get; private set; }
41+
42+
public ColumnDatetime(
43+
string key,
44+
string type,
45+
string status,
46+
string error,
47+
bool required,
48+
bool? array,
49+
string createdAt,
50+
string updatedAt,
51+
string format,
52+
string? xdefault
53+
) {
54+
Key = key;
55+
Type = type;
56+
Status = status;
57+
Error = error;
58+
Required = required;
59+
Array = array;
60+
CreatedAt = createdAt;
61+
UpdatedAt = updatedAt;
62+
Format = format;
63+
Default = xdefault;
64+
}
65+
66+
public static ColumnDatetime From(Dictionary<string, object> map) => new ColumnDatetime(
67+
key: map["key"].ToString(),
68+
type: map["type"].ToString(),
69+
status: map["status"].ToString(),
70+
error: map["error"].ToString(),
71+
required: (bool)map["required"],
72+
array: (bool?)map["array"],
73+
createdAt: map["$createdAt"].ToString(),
74+
updatedAt: map["$updatedAt"].ToString(),
75+
format: map["format"].ToString(),
76+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
77+
);
78+
79+
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
80+
{
81+
{ "key", Key },
82+
{ "type", Type },
83+
{ "status", Status },
84+
{ "error", Error },
85+
{ "required", Required },
86+
{ "array", Array },
87+
{ "$createdAt", CreatedAt },
88+
{ "$updatedAt", UpdatedAt },
89+
{ "format", Format },
90+
{ "default", Default }
91+
};
92+
}
93+
}

Appwrite/Models/ColumnEmail.cs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
using System;
3+
using System.Linq;
4+
using System.Collections.Generic;
5+
using System.Text.Json;
6+
using System.Text.Json.Serialization;
7+
8+
namespace Appwrite.Models
9+
{
10+
public class ColumnEmail
11+
{
12+
[JsonPropertyName("key")]
13+
public string Key { get; private set; }
14+
15+
[JsonPropertyName("type")]
16+
public string Type { get; private set; }
17+
18+
[JsonPropertyName("status")]
19+
public string Status { get; private set; }
20+
21+
[JsonPropertyName("error")]
22+
public string Error { get; private set; }
23+
24+
[JsonPropertyName("required")]
25+
public bool Required { get; private set; }
26+
27+
[JsonPropertyName("array")]
28+
public bool? Array { get; private set; }
29+
30+
[JsonPropertyName("$createdAt")]
31+
public string CreatedAt { get; private set; }
32+
33+
[JsonPropertyName("$updatedAt")]
34+
public string UpdatedAt { get; private set; }
35+
36+
[JsonPropertyName("format")]
37+
public string Format { get; private set; }
38+
39+
[JsonPropertyName("default")]
40+
public string? Default { get; private set; }
41+
42+
public ColumnEmail(
43+
string key,
44+
string type,
45+
string status,
46+
string error,
47+
bool required,
48+
bool? array,
49+
string createdAt,
50+
string updatedAt,
51+
string format,
52+
string? xdefault
53+
) {
54+
Key = key;
55+
Type = type;
56+
Status = status;
57+
Error = error;
58+
Required = required;
59+
Array = array;
60+
CreatedAt = createdAt;
61+
UpdatedAt = updatedAt;
62+
Format = format;
63+
Default = xdefault;
64+
}
65+
66+
public static ColumnEmail From(Dictionary<string, object> map) => new ColumnEmail(
67+
key: map["key"].ToString(),
68+
type: map["type"].ToString(),
69+
status: map["status"].ToString(),
70+
error: map["error"].ToString(),
71+
required: (bool)map["required"],
72+
array: (bool?)map["array"],
73+
createdAt: map["$createdAt"].ToString(),
74+
updatedAt: map["$updatedAt"].ToString(),
75+
format: map["format"].ToString(),
76+
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault?.ToString() : null
77+
);
78+
79+
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
80+
{
81+
{ "key", Key },
82+
{ "type", Type },
83+
{ "status", Status },
84+
{ "error", Error },
85+
{ "required", Required },
86+
{ "array", Array },
87+
{ "$createdAt", CreatedAt },
88+
{ "$updatedAt", UpdatedAt },
89+
{ "format", Format },
90+
{ "default", Default }
91+
};
92+
}
93+
}

0 commit comments

Comments
 (0)