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

feat: release 1.4.x #26

Merged
merged 3 commits into from
Sep 1, 2023
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite .NET SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-dotnet.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.3.7-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.4.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases).**
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the .NET SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand All @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif
Add this reference to your project's `.csproj` file:

```xml
<PackageReference Include="Appwrite" Version="0.4.2" />
<PackageReference Include="Appwrite" Version="0.5.0" />
```

You can install packages from the command line:

```powershell
# Package Manager
Install-Package Appwrite -Version 0.4.2
Install-Package Appwrite -Version 0.5.0

# or .NET CLI
dotnet add package Appwrite --version 0.4.2
dotnet add package Appwrite --version 0.5.0
```


Expand Down
13 changes: 13 additions & 0 deletions docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token

var account = new Account(client);

await account.DeleteIdentity(
identityId: "[IDENTITY_ID]");
12 changes: 12 additions & 0 deletions docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token

var account = new Account(client);

IdentityList result = await account.ListIdentities();
1 change: 0 additions & 1 deletion docs/examples/functions/create-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ var functions = new Functions(client);

Deployment result = await functions.CreateDeployment(
functionId: "[FUNCTION_ID]",
entrypoint: "[ENTRYPOINT]",
code: InputFile.FromPath("./path-to-files/image.jpg"),
activate: false);
14 changes: 14 additions & 0 deletions docs/examples/functions/download-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var functions = new Functions(client);

byte[] result = await functions.DownloadDeployment(
functionId: "[FUNCTION_ID]",
deploymentId: "[DEPLOYMENT_ID]");
3 changes: 2 additions & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ var functions = new Functions(client);

Function result = await functions.Update(
functionId: "[FUNCTION_ID]",
name: "[NAME]");
name: "[NAME]",
runtime: "node-14.5");
12 changes: 12 additions & 0 deletions docs/examples/health/get-pub-sub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var health = new Health(client);

HealthStatus result = await health.GetPubSub();
12 changes: 12 additions & 0 deletions docs/examples/health/get-queue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var health = new Health(client);

HealthStatus result = await health.GetQueue();
12 changes: 12 additions & 0 deletions docs/examples/locale/list-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var locale = new Locale(client);

LocaleCodeList result = await locale.ListCodes();
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var client = new Client()

var teams = new Teams(client);

Membership result = await teams.UpdateMembershipRoles(
Membership result = await teams.UpdateMembership(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]",
roles: new List<string> {});
13 changes: 13 additions & 0 deletions docs/examples/users/delete-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var users = new Users(client);

await users.DeleteIdentity(
identityId: "[IDENTITY_ID]");
12 changes: 12 additions & 0 deletions docs/examples/users/list-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var users = new Users(client);

IdentityList result = await users.ListIdentities();
14 changes: 14 additions & 0 deletions docs/examples/users/update-labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Appwrite;
using Appwrite.Services;
using Appwrite.Models;

var client = new Client()
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("5df5acd0d48c2") // Your project ID
.SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

var users = new Users(client);

User result = await users.UpdateLabels(
userId: "[USER_ID]",
labels: new List<string> {});
2 changes: 1 addition & 1 deletion src/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.4.2</Version>
<Version>0.5.0</Version>
<Authors>Appwrite Team</Authors>
<Company>Appwrite Team</Company>
<Description>
Expand Down
6 changes: 3 additions & 3 deletions src/Appwrite/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "content-type", "application/json" },
{ "user-agent" , "AppwriteDotNetSDK/0.4.2 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
{ "user-agent" , "AppwriteDotNetSDK/0.5.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "0.4.2"}, { "X-Appwrite-Response-Format", "1.0.0" }
{ "x-sdk-version", "0.5.0"}, { "X-Appwrite-Response-Format", "1.4.0" }
};

_config = new Dictionary<string, string>();
Expand Down Expand Up @@ -369,7 +369,7 @@ public async Task<T> ChunkedUpload<T>(
parameters[paramName] = content;

headers["Content-Range"] =
$"bytes {offset}-{Math.Min(offset + ChunkSize - 1, size)}/{size}";
$"bytes {offset}-{Math.Min(offset + ChunkSize - 1, size - 1)}/{size}";

result = await Call<Dictionary<string, object?>>(
method: "POST",
Expand Down
7 changes: 7 additions & 0 deletions src/Appwrite/Models/AttributeBoolean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class AttributeBoolean
[JsonProperty("status")]
public string Status { get; private set; }

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

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

Expand All @@ -32,13 +35,15 @@ public AttributeBoolean(
string key,
string type,
string status,
string error,
bool required,
bool? array,
bool? xdefault
) {
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
Default = xdefault;
Expand All @@ -48,6 +53,7 @@ public AttributeBoolean(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
xdefault: (bool?)map["default"]
Expand All @@ -58,6 +64,7 @@ public AttributeBoolean(
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "default", Default }
Expand Down
7 changes: 7 additions & 0 deletions src/Appwrite/Models/AttributeDatetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class AttributeDatetime
[JsonProperty("status")]
public string Status { get; private set; }

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

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

Expand All @@ -35,6 +38,7 @@ public AttributeDatetime(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string format,
Expand All @@ -43,6 +47,7 @@ public AttributeDatetime(
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
Format = format;
Expand All @@ -53,6 +58,7 @@ public AttributeDatetime(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
format: map["format"].ToString(),
Expand All @@ -64,6 +70,7 @@ public AttributeDatetime(
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "format", Format },
Expand Down
7 changes: 7 additions & 0 deletions src/Appwrite/Models/AttributeEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class AttributeEmail
[JsonProperty("status")]
public string Status { get; private set; }

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

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

Expand All @@ -35,6 +38,7 @@ public AttributeEmail(
string key,
string type,
string status,
string error,
bool required,
bool? array,
string format,
Expand All @@ -43,6 +47,7 @@ public AttributeEmail(
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
Format = format;
Expand All @@ -53,6 +58,7 @@ public AttributeEmail(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
format: map["format"].ToString(),
Expand All @@ -64,6 +70,7 @@ public AttributeEmail(
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "format", Format },
Expand Down
7 changes: 7 additions & 0 deletions src/Appwrite/Models/AttributeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class AttributeEnum
[JsonProperty("status")]
public string Status { get; private set; }

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

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

Expand All @@ -38,6 +41,7 @@ public AttributeEnum(
string key,
string type,
string status,
string error,
bool required,
bool? array,
List<object> elements,
Expand All @@ -47,6 +51,7 @@ public AttributeEnum(
Key = key;
Type = type;
Status = status;
Error = error;
Required = required;
Array = array;
Elements = elements;
Expand All @@ -58,6 +63,7 @@ public AttributeEnum(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
elements: ((JArray)map["elements"]).ToObject<List<object>>(),
Expand All @@ -70,6 +76,7 @@ public AttributeEnum(
{ "key", Key },
{ "type", Type },
{ "status", Status },
{ "error", Error },
{ "required", Required },
{ "array", Array },
{ "elements", Elements },
Expand Down
Loading