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.27.0</Version>
<Version>1.0.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.27.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "user-agent" , $"AppwriteDotNetSDK/1.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "0.27.0"},
{ "x-sdk-version", "1.0.0"},
{ "X-Appwrite-Response-Format", "1.8.0" }
};

Expand Down
81 changes: 41 additions & 40 deletions Appwrite/Services/Databases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,44 @@ static Models.AttributeRelationship Convert(Dictionary<string, object> it) =>

}

/// <para>
/// Update relationship attribute. [Learn more about relationship
/// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
///
/// </para>
/// </summary>
[Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")]
public Task<Models.AttributeRelationship> UpdateRelationshipAttribute(string databaseId, string collectionId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null)
{
var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}"
.Replace("{databaseId}", databaseId)
.Replace("{collectionId}", collectionId)
.Replace("{key}", key);

var apiParameters = new Dictionary<string, object?>()
{
{ "onDelete", onDelete?.Value },
{ "newKey", newKey }
};

var apiHeaders = new Dictionary<string, string>()
{
{ "content-type", "application/json" }
};


static Models.AttributeRelationship Convert(Dictionary<string, object> it) =>
Models.AttributeRelationship.From(map: it);

return _client.Call<Models.AttributeRelationship>(
method: "PATCH",
path: apiPath,
headers: apiHeaders,
parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!,
convert: Convert);

}

/// <para>
/// Create a string attribute.
///
Expand Down Expand Up @@ -1914,51 +1952,13 @@ public Task<object> DeleteAttribute(string databaseId, string collectionId, stri

}

/// <para>
/// Update relationship attribute. [Learn more about relationship
/// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
///
/// </para>
/// </summary>
[Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")]
public Task<Models.AttributeRelationship> UpdateRelationshipAttribute(string databaseId, string collectionId, string key, Appwrite.Enums.RelationMutate? onDelete = null, string? newKey = null)
{
var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship"
.Replace("{databaseId}", databaseId)
.Replace("{collectionId}", collectionId)
.Replace("{key}", key);

var apiParameters = new Dictionary<string, object?>()
{
{ "onDelete", onDelete?.Value },
{ "newKey", newKey }
};

var apiHeaders = new Dictionary<string, string>()
{
{ "content-type", "application/json" }
};


static Models.AttributeRelationship Convert(Dictionary<string, object> it) =>
Models.AttributeRelationship.From(map: it);

return _client.Call<Models.AttributeRelationship>(
method: "PATCH",
path: apiPath,
headers: apiHeaders,
parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!,
convert: Convert);

}

/// <para>
/// Get a list of all the user's documents in a given collection. You can use
/// the query params to filter your results.
/// </para>
/// </summary>
[Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.")]
public Task<Models.DocumentList> ListDocuments(string databaseId, string collectionId, List<string>? queries = null, string? transactionId = null, bool? total = null)
public Task<Models.DocumentList> ListDocuments(string databaseId, string collectionId, List<string>? queries = null, string? transactionId = null, bool? total = null, long? ttl = null)
{
var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents"
.Replace("{databaseId}", databaseId)
Expand All @@ -1968,7 +1968,8 @@ static Models.AttributeRelationship Convert(Dictionary<string, object> it) =>
{
{ "queries", queries },
{ "transactionId", transactionId },
{ "total", total }
{ "total", total },
{ "ttl", ttl }
};

var apiHeaders = new Dictionary<string, string>()
Expand Down
33 changes: 33 additions & 0 deletions Appwrite/Services/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,39 @@ static Models.HealthCertificate Convert(Dictionary<string, object> it) =>

}

/// <para>
/// Get console pausing health status. Monitors projects approaching the pause
/// threshold to detect potential issues with console access tracking.
///
/// </para>
/// </summary>
public Task<Models.HealthStatus> GetConsolePausing(long? threshold = null, long? inactivityDays = null)
{
var apiPath = "/health/console-pausing";

var apiParameters = new Dictionary<string, object?>()
{
{ "threshold", threshold },
{ "inactivityDays", inactivityDays }
};

var apiHeaders = new Dictionary<string, string>()
{
};


static Models.HealthStatus Convert(Dictionary<string, object> it) =>
Models.HealthStatus.From(map: it);

return _client.Call<Models.HealthStatus>(
method: "GET",
path: apiPath,
headers: apiHeaders,
parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!,
convert: Convert);

}

/// <para>
/// Check the Appwrite database servers are up and connection is successful.
/// </para>
Expand Down
2 changes: 1 addition & 1 deletion Appwrite/Services/Sites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static Models.DeploymentList Convert(Dictionary<string, object> it) =>
/// need to update the site's deployment to use your new deployment ID.
/// </para>
/// </summary>
public Task<Models.Deployment> CreateDeployment(string siteId, InputFile code, bool activate, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, Action<UploadProgress>? onProgress = null)
public Task<Models.Deployment> CreateDeployment(string siteId, InputFile code, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, bool? activate = null, Action<UploadProgress>? onProgress = null)
{
var apiPath = "/sites/{siteId}/deployments"
.Replace("{siteId}", siteId);
Expand Down
5 changes: 3 additions & 2 deletions Appwrite/Services/TablesDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ public Task<object> DeleteIndex(string databaseId, string tableId, string key)
/// params to filter your results.
/// </para>
/// </summary>
public Task<Models.RowList> ListRows(string databaseId, string tableId, List<string>? queries = null, string? transactionId = null, bool? total = null)
public Task<Models.RowList> ListRows(string databaseId, string tableId, List<string>? queries = null, string? transactionId = null, bool? total = null, long? ttl = null)
{
var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows"
.Replace("{databaseId}", databaseId)
Expand All @@ -2063,7 +2063,8 @@ public Task<object> DeleteIndex(string databaseId, string tableId, string key)
{
{ "queries", queries },
{ "transactionId", transactionId },
{ "total", total }
{ "total", total },
{ "ttl", ttl }
};

var apiHeaders = new Dictionary<string, string>()
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 1.0.0

* Breaking: Sites.CreateDeployment signature changed; 'activate' moved after outputDirectory.
* Breaking: Relationship API path updated; old path deprecated.
* Added GetConsolePausing health check method.
* Added ttl parameter to ListDocuments and ListRows.
* Updated deployment example to show activate parameter placement.

## 0.27.0

* Added broad new runtime options across multiple languages (Node 23, 24, 25; PHP 8.4; Ruby 3.4 and 4.0; Python 3.13 and 3.14; Python ML 3.13 and 3.14; Deno 2.5 and 2.6; Go 1.23–1.26; Bun 1.2 and 1.3; Java 25; Kotlin 2.3; Swift 6.2; and Dotnet 10).
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstracts and simpli
Add this reference to your project's `.csproj` file:

```xml
<PackageReference Include="Appwrite" Version="0.27.0" />
<PackageReference Include="Appwrite" Version="1.0.0" />
```

You can install packages from the command line:

```powershell
# Package Manager
Install-Package Appwrite -Version 0.27.0
Install-Package Appwrite -Version 1.0.0

# or .NET CLI
dotnet add package Appwrite --version 0.27.0
dotnet add package Appwrite --version 1.0.0
```


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ DocumentList result = await databases.ListDocuments(
collectionId: "<COLLECTION_ID>",
queries: new List<string>(), // optional
transactionId: "<TRANSACTION_ID>", // optional
total: false // optional
total: false, // optional
ttl: 0 // optional
);```
16 changes: 16 additions & 0 deletions docs/examples/health/get-console-pausing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```csharp
using Appwrite;
using Appwrite.Models;
using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetKey("<YOUR_API_KEY>"); // Your secret API key

Health health = new Health(client);

HealthStatus result = await health.GetConsolePausing(
threshold: 0, // optional
inactivityDays: 0 // optional
);```
4 changes: 2 additions & 2 deletions docs/examples/sites/create-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Sites sites = new Sites(client);
Deployment result = await sites.CreateDeployment(
siteId: "<SITE_ID>",
code: InputFile.FromPath("./path-to-files/image.jpg"),
activate: false,
installCommand: "<INSTALL_COMMAND>", // optional
buildCommand: "<BUILD_COMMAND>", // optional
outputDirectory: "<OUTPUT_DIRECTORY>" // optional
outputDirectory: "<OUTPUT_DIRECTORY>", // optional
activate: false // optional
);```
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/list-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ RowList result = await tablesDB.ListRows(
tableId: "<TABLE_ID>",
queries: new List<string>(), // optional
transactionId: "<TRANSACTION_ID>", // optional
total: false // optional
total: false, // optional
ttl: 0 // optional
);```