From bc33600984de452c34e8b9e2d06b6cc30dcda3a1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Mar 2026 08:44:08 +0000 Subject: [PATCH 1/3] updated sdk --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 +- Appwrite/Enums/BackupServices.cs | 18 - Appwrite/Enums/BuildRuntime.cs | 3 + Appwrite/Enums/Runtime.cs | 3 + Appwrite/Enums/Scopes.cs | 9 - Appwrite/Models/ActivityEvent.cs | 249 ------------- Appwrite/Models/ActivityEventList.cs | 39 -- Appwrite/Models/BackupArchive.cs | 109 ------ Appwrite/Models/BackupArchiveList.cs | 39 -- Appwrite/Models/BackupPolicy.cs | 102 ----- Appwrite/Models/BackupPolicyList.cs | 39 -- Appwrite/Models/BackupRestoration.cs | 102 ----- Appwrite/Models/BackupRestorationList.cs | 39 -- Appwrite/Models/Database.cs | 20 +- Appwrite/Services/Activities.cs | 79 ---- Appwrite/Services/Backups.cs | 392 -------------------- Appwrite/Services/Databases.cs | 81 ++-- Appwrite/Services/Health.cs | 150 -------- Appwrite/Services/Sites.cs | 2 +- Appwrite/Services/TablesDB.cs | 5 +- CHANGELOG.md | 10 +- README.md | 8 +- docs/examples/activities/get-event.md | 15 - docs/examples/activities/list-events.md | 15 - docs/examples/backups/create-archive.md | 17 - docs/examples/backups/create-policy.md | 22 -- docs/examples/backups/create-restoration.md | 19 - docs/examples/backups/delete-archive.md | 15 - docs/examples/backups/delete-policy.md | 15 - docs/examples/backups/get-archive.md | 15 - docs/examples/backups/get-policy.md | 15 - docs/examples/backups/get-restoration.md | 15 - docs/examples/backups/list-archives.md | 15 - docs/examples/backups/list-policies.md | 15 - docs/examples/backups/list-restorations.md | 15 - docs/examples/backups/update-policy.md | 19 - docs/examples/databases/list-documents.md | 3 +- docs/examples/sites/create-deployment.md | 4 +- docs/examples/tablesdb/list-rows.md | 3 +- 40 files changed, 68 insertions(+), 1673 deletions(-) delete mode 100644 Appwrite/Enums/BackupServices.cs delete mode 100644 Appwrite/Models/ActivityEvent.cs delete mode 100644 Appwrite/Models/ActivityEventList.cs delete mode 100644 Appwrite/Models/BackupArchive.cs delete mode 100644 Appwrite/Models/BackupArchiveList.cs delete mode 100644 Appwrite/Models/BackupPolicy.cs delete mode 100644 Appwrite/Models/BackupPolicyList.cs delete mode 100644 Appwrite/Models/BackupRestoration.cs delete mode 100644 Appwrite/Models/BackupRestorationList.cs delete mode 100644 Appwrite/Services/Activities.cs delete mode 100644 Appwrite/Services/Backups.cs delete mode 100644 docs/examples/activities/get-event.md delete mode 100644 docs/examples/activities/list-events.md delete mode 100644 docs/examples/backups/create-archive.md delete mode 100644 docs/examples/backups/create-policy.md delete mode 100644 docs/examples/backups/create-restoration.md delete mode 100644 docs/examples/backups/delete-archive.md delete mode 100644 docs/examples/backups/delete-policy.md delete mode 100644 docs/examples/backups/get-archive.md delete mode 100644 docs/examples/backups/get-policy.md delete mode 100644 docs/examples/backups/get-restoration.md delete mode 100644 docs/examples/backups/list-archives.md delete mode 100644 docs/examples/backups/list-policies.md delete mode 100644 docs/examples/backups/list-restorations.md delete mode 100644 docs/examples/backups/update-policy.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index a5d8d3d0..942fe653 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.27.0 + 0.26.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index ee93af48..2c535750 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.27.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.26.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", "0.26.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/Appwrite/Enums/BackupServices.cs b/Appwrite/Enums/BackupServices.cs deleted file mode 100644 index ef9d1a17..00000000 --- a/Appwrite/Enums/BackupServices.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class BackupServices : IEnum - { - public string Value { get; private set; } - - public BackupServices(string value) - { - Value = value; - } - - public static BackupServices Databases => new BackupServices("databases"); - public static BackupServices Functions => new BackupServices("functions"); - public static BackupServices Storage => new BackupServices("storage"); - } -} diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index 1617eceb..ab8a3da1 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -42,6 +42,9 @@ public BuildRuntime(string value) public static BuildRuntime PythonMl311 => new BuildRuntime("python-ml-3.11"); public static BuildRuntime PythonMl312 => new BuildRuntime("python-ml-3.12"); public static BuildRuntime PythonMl313 => new BuildRuntime("python-ml-3.13"); + public static BuildRuntime Deno121 => new BuildRuntime("deno-1.21"); + public static BuildRuntime Deno124 => new BuildRuntime("deno-1.24"); + public static BuildRuntime Deno135 => new BuildRuntime("deno-1.35"); public static BuildRuntime Deno140 => new BuildRuntime("deno-1.40"); public static BuildRuntime Deno146 => new BuildRuntime("deno-1.46"); public static BuildRuntime Deno20 => new BuildRuntime("deno-2.0"); diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index 6c5f4f4d..49a1b82f 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -42,6 +42,9 @@ public Runtime(string value) public static Runtime PythonMl311 => new Runtime("python-ml-3.11"); public static Runtime PythonMl312 => new Runtime("python-ml-3.12"); public static Runtime PythonMl313 => new Runtime("python-ml-3.13"); + 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"); diff --git a/Appwrite/Enums/Scopes.cs b/Appwrite/Enums/Scopes.cs index 813361dd..a070c694 100644 --- a/Appwrite/Enums/Scopes.cs +++ b/Appwrite/Enums/Scopes.cs @@ -68,14 +68,5 @@ public Scopes(string value) public static Scopes AssistantRead => new Scopes("assistant.read"); public static Scopes TokensRead => new Scopes("tokens.read"); public static Scopes TokensWrite => new Scopes("tokens.write"); - public static Scopes PoliciesWrite => new Scopes("policies.write"); - public static Scopes PoliciesRead => new Scopes("policies.read"); - public static Scopes ArchivesRead => new Scopes("archives.read"); - public static Scopes ArchivesWrite => new Scopes("archives.write"); - public static Scopes RestorationsRead => new Scopes("restorations.read"); - public static Scopes RestorationsWrite => new Scopes("restorations.write"); - public static Scopes DomainsRead => new Scopes("domains.read"); - public static Scopes DomainsWrite => new Scopes("domains.write"); - public static Scopes EventsRead => new Scopes("events.read"); } } diff --git a/Appwrite/Models/ActivityEvent.cs b/Appwrite/Models/ActivityEvent.cs deleted file mode 100644 index c0aaa139..00000000 --- a/Appwrite/Models/ActivityEvent.cs +++ /dev/null @@ -1,249 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class ActivityEvent - { - [JsonPropertyName("$id")] - public string Id { get; private set; } - - [JsonPropertyName("userType")] - public string UserType { get; private set; } - - [JsonPropertyName("userId")] - public string UserId { get; private set; } - - [JsonPropertyName("userEmail")] - public string UserEmail { get; private set; } - - [JsonPropertyName("userName")] - public string UserName { get; private set; } - - [JsonPropertyName("resourceParent")] - public string ResourceParent { get; private set; } - - [JsonPropertyName("resourceType")] - public string ResourceType { get; private set; } - - [JsonPropertyName("resourceId")] - public string ResourceId { get; private set; } - - [JsonPropertyName("resource")] - public string Resource { get; private set; } - - [JsonPropertyName("event")] - public string Event { get; private set; } - - [JsonPropertyName("userAgent")] - public string UserAgent { get; private set; } - - [JsonPropertyName("ip")] - public string Ip { get; private set; } - - [JsonPropertyName("mode")] - public string Mode { get; private set; } - - [JsonPropertyName("country")] - public string Country { get; private set; } - - [JsonPropertyName("time")] - public string Time { get; private set; } - - [JsonPropertyName("projectId")] - public string ProjectId { get; private set; } - - [JsonPropertyName("teamId")] - public string TeamId { get; private set; } - - [JsonPropertyName("hostname")] - public string Hostname { get; private set; } - - [JsonPropertyName("osCode")] - public string OsCode { get; private set; } - - [JsonPropertyName("osName")] - public string OsName { get; private set; } - - [JsonPropertyName("osVersion")] - public string OsVersion { get; private set; } - - [JsonPropertyName("clientType")] - public string ClientType { get; private set; } - - [JsonPropertyName("clientCode")] - public string ClientCode { get; private set; } - - [JsonPropertyName("clientName")] - public string ClientName { get; private set; } - - [JsonPropertyName("clientVersion")] - public string ClientVersion { get; private set; } - - [JsonPropertyName("clientEngine")] - public string ClientEngine { get; private set; } - - [JsonPropertyName("clientEngineVersion")] - public string ClientEngineVersion { get; private set; } - - [JsonPropertyName("deviceName")] - public string DeviceName { get; private set; } - - [JsonPropertyName("deviceBrand")] - public string DeviceBrand { get; private set; } - - [JsonPropertyName("deviceModel")] - public string DeviceModel { get; private set; } - - [JsonPropertyName("countryCode")] - public string CountryCode { get; private set; } - - [JsonPropertyName("countryName")] - public string CountryName { get; private set; } - - public ActivityEvent( - string id, - string userType, - string userId, - string userEmail, - string userName, - string resourceParent, - string resourceType, - string resourceId, - string resource, - string xevent, - string userAgent, - string ip, - string mode, - string country, - string time, - string projectId, - string teamId, - string hostname, - string osCode, - string osName, - string osVersion, - string clientType, - string clientCode, - string clientName, - string clientVersion, - string clientEngine, - string clientEngineVersion, - string deviceName, - string deviceBrand, - string deviceModel, - string countryCode, - string countryName - ) { - Id = id; - UserType = userType; - UserId = userId; - UserEmail = userEmail; - UserName = userName; - ResourceParent = resourceParent; - ResourceType = resourceType; - ResourceId = resourceId; - Resource = resource; - Event = xevent; - UserAgent = userAgent; - Ip = ip; - Mode = mode; - Country = country; - Time = time; - ProjectId = projectId; - TeamId = teamId; - Hostname = hostname; - OsCode = osCode; - OsName = osName; - OsVersion = osVersion; - ClientType = clientType; - ClientCode = clientCode; - ClientName = clientName; - ClientVersion = clientVersion; - ClientEngine = clientEngine; - ClientEngineVersion = clientEngineVersion; - DeviceName = deviceName; - DeviceBrand = deviceBrand; - DeviceModel = deviceModel; - CountryCode = countryCode; - CountryName = countryName; - } - - public static ActivityEvent From(Dictionary map) => new ActivityEvent( - id: map["$id"].ToString(), - userType: map["userType"].ToString(), - userId: map["userId"].ToString(), - userEmail: map["userEmail"].ToString(), - userName: map["userName"].ToString(), - resourceParent: map["resourceParent"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString(), - resource: map["resource"].ToString(), - xevent: map["event"].ToString(), - userAgent: map["userAgent"].ToString(), - ip: map["ip"].ToString(), - mode: map["mode"].ToString(), - country: map["country"].ToString(), - time: map["time"].ToString(), - projectId: map["projectId"].ToString(), - teamId: map["teamId"].ToString(), - hostname: map["hostname"].ToString(), - osCode: map["osCode"].ToString(), - osName: map["osName"].ToString(), - osVersion: map["osVersion"].ToString(), - clientType: map["clientType"].ToString(), - clientCode: map["clientCode"].ToString(), - clientName: map["clientName"].ToString(), - clientVersion: map["clientVersion"].ToString(), - clientEngine: map["clientEngine"].ToString(), - clientEngineVersion: map["clientEngineVersion"].ToString(), - deviceName: map["deviceName"].ToString(), - deviceBrand: map["deviceBrand"].ToString(), - deviceModel: map["deviceModel"].ToString(), - countryCode: map["countryCode"].ToString(), - countryName: map["countryName"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "$id", Id }, - { "userType", UserType }, - { "userId", UserId }, - { "userEmail", UserEmail }, - { "userName", UserName }, - { "resourceParent", ResourceParent }, - { "resourceType", ResourceType }, - { "resourceId", ResourceId }, - { "resource", Resource }, - { "event", Event }, - { "userAgent", UserAgent }, - { "ip", Ip }, - { "mode", Mode }, - { "country", Country }, - { "time", Time }, - { "projectId", ProjectId }, - { "teamId", TeamId }, - { "hostname", Hostname }, - { "osCode", OsCode }, - { "osName", OsName }, - { "osVersion", OsVersion }, - { "clientType", ClientType }, - { "clientCode", ClientCode }, - { "clientName", ClientName }, - { "clientVersion", ClientVersion }, - { "clientEngine", ClientEngine }, - { "clientEngineVersion", ClientEngineVersion }, - { "deviceName", DeviceName }, - { "deviceBrand", DeviceBrand }, - { "deviceModel", DeviceModel }, - { "countryCode", CountryCode }, - { "countryName", CountryName } - }; - } -} diff --git a/Appwrite/Models/ActivityEventList.cs b/Appwrite/Models/ActivityEventList.cs deleted file mode 100644 index e8eed6ee..00000000 --- a/Appwrite/Models/ActivityEventList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class ActivityEventList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("events")] - public List Events { get; private set; } - - public ActivityEventList( - long total, - List events - ) { - Total = total; - Events = events; - } - - public static ActivityEventList From(Dictionary map) => new ActivityEventList( - total: Convert.ToInt64(map["total"]), - events: map["events"].ConvertToList>().Select(it => ActivityEvent.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "events", Events.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Models/BackupArchive.cs b/Appwrite/Models/BackupArchive.cs deleted file mode 100644 index 37d4e87e..00000000 --- a/Appwrite/Models/BackupArchive.cs +++ /dev/null @@ -1,109 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupArchive - { - [JsonPropertyName("$id")] - public string Id { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - [JsonPropertyName("policyId")] - public string PolicyId { get; private set; } - - [JsonPropertyName("size")] - public long Size { get; private set; } - - [JsonPropertyName("status")] - public string Status { get; private set; } - - [JsonPropertyName("startedAt")] - public string StartedAt { get; private set; } - - [JsonPropertyName("migrationId")] - public string MigrationId { get; private set; } - - [JsonPropertyName("services")] - public List Services { get; private set; } - - [JsonPropertyName("resources")] - public List Resources { get; private set; } - - [JsonPropertyName("resourceId")] - public string? ResourceId { get; private set; } - - [JsonPropertyName("resourceType")] - public string? ResourceType { get; private set; } - - public BackupArchive( - string id, - string createdAt, - string updatedAt, - string policyId, - long size, - string status, - string startedAt, - string migrationId, - List services, - List resources, - string? resourceId, - string? resourceType - ) { - Id = id; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - PolicyId = policyId; - Size = size; - Status = status; - StartedAt = startedAt; - MigrationId = migrationId; - Services = services; - Resources = resources; - ResourceId = resourceId; - ResourceType = resourceType; - } - - public static BackupArchive From(Dictionary map) => new BackupArchive( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - policyId: map["policyId"].ToString(), - size: Convert.ToInt64(map["size"]), - status: map["status"].ToString(), - startedAt: map["startedAt"].ToString(), - migrationId: map["migrationId"].ToString(), - services: map["services"].ConvertToList(), - resources: map["resources"].ConvertToList(), - resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, - resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null - ); - - public Dictionary ToMap() => new Dictionary() - { - { "$id", Id }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt }, - { "policyId", PolicyId }, - { "size", Size }, - { "status", Status }, - { "startedAt", StartedAt }, - { "migrationId", MigrationId }, - { "services", Services }, - { "resources", Resources }, - { "resourceId", ResourceId }, - { "resourceType", ResourceType } - }; - } -} diff --git a/Appwrite/Models/BackupArchiveList.cs b/Appwrite/Models/BackupArchiveList.cs deleted file mode 100644 index 6c1e0df0..00000000 --- a/Appwrite/Models/BackupArchiveList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupArchiveList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("archives")] - public List Archives { get; private set; } - - public BackupArchiveList( - long total, - List archives - ) { - Total = total; - Archives = archives; - } - - public static BackupArchiveList From(Dictionary map) => new BackupArchiveList( - total: Convert.ToInt64(map["total"]), - archives: map["archives"].ConvertToList>().Select(it => BackupArchive.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "archives", Archives.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Models/BackupPolicy.cs b/Appwrite/Models/BackupPolicy.cs deleted file mode 100644 index 7f1a5b2a..00000000 --- a/Appwrite/Models/BackupPolicy.cs +++ /dev/null @@ -1,102 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupPolicy - { - [JsonPropertyName("$id")] - public string Id { get; private set; } - - [JsonPropertyName("name")] - public string Name { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - [JsonPropertyName("services")] - public List Services { get; private set; } - - [JsonPropertyName("resources")] - public List Resources { get; private set; } - - [JsonPropertyName("resourceId")] - public string? ResourceId { get; private set; } - - [JsonPropertyName("resourceType")] - public string? ResourceType { get; private set; } - - [JsonPropertyName("retention")] - public long Retention { get; private set; } - - [JsonPropertyName("schedule")] - public string Schedule { get; private set; } - - [JsonPropertyName("enabled")] - public bool Enabled { get; private set; } - - public BackupPolicy( - string id, - string name, - string createdAt, - string updatedAt, - List services, - List resources, - string? resourceId, - string? resourceType, - long retention, - string schedule, - bool enabled - ) { - Id = id; - Name = name; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - Services = services; - Resources = resources; - ResourceId = resourceId; - ResourceType = resourceType; - Retention = retention; - Schedule = schedule; - Enabled = enabled; - } - - public static BackupPolicy From(Dictionary map) => new BackupPolicy( - id: map["$id"].ToString(), - name: map["name"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - services: map["services"].ConvertToList(), - resources: map["resources"].ConvertToList(), - resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, - resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null, - retention: Convert.ToInt64(map["retention"]), - schedule: map["schedule"].ToString(), - enabled: (bool)map["enabled"] - ); - - public Dictionary ToMap() => new Dictionary() - { - { "$id", Id }, - { "name", Name }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt }, - { "services", Services }, - { "resources", Resources }, - { "resourceId", ResourceId }, - { "resourceType", ResourceType }, - { "retention", Retention }, - { "schedule", Schedule }, - { "enabled", Enabled } - }; - } -} diff --git a/Appwrite/Models/BackupPolicyList.cs b/Appwrite/Models/BackupPolicyList.cs deleted file mode 100644 index 414319b2..00000000 --- a/Appwrite/Models/BackupPolicyList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupPolicyList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("policies")] - public List Policies { get; private set; } - - public BackupPolicyList( - long total, - List policies - ) { - Total = total; - Policies = policies; - } - - public static BackupPolicyList From(Dictionary map) => new BackupPolicyList( - total: Convert.ToInt64(map["total"]), - policies: map["policies"].ConvertToList>().Select(it => BackupPolicy.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "policies", Policies.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Models/BackupRestoration.cs b/Appwrite/Models/BackupRestoration.cs deleted file mode 100644 index ecf5d7a2..00000000 --- a/Appwrite/Models/BackupRestoration.cs +++ /dev/null @@ -1,102 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupRestoration - { - [JsonPropertyName("$id")] - public string Id { get; private set; } - - [JsonPropertyName("$createdAt")] - public string CreatedAt { get; private set; } - - [JsonPropertyName("$updatedAt")] - public string UpdatedAt { get; private set; } - - [JsonPropertyName("archiveId")] - public string ArchiveId { get; private set; } - - [JsonPropertyName("policyId")] - public string PolicyId { get; private set; } - - [JsonPropertyName("status")] - public string Status { get; private set; } - - [JsonPropertyName("startedAt")] - public string StartedAt { get; private set; } - - [JsonPropertyName("migrationId")] - public string MigrationId { get; private set; } - - [JsonPropertyName("services")] - public List Services { get; private set; } - - [JsonPropertyName("resources")] - public List Resources { get; private set; } - - [JsonPropertyName("options")] - public string Options { get; private set; } - - public BackupRestoration( - string id, - string createdAt, - string updatedAt, - string archiveId, - string policyId, - string status, - string startedAt, - string migrationId, - List services, - List resources, - string options - ) { - Id = id; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - ArchiveId = archiveId; - PolicyId = policyId; - Status = status; - StartedAt = startedAt; - MigrationId = migrationId; - Services = services; - Resources = resources; - Options = options; - } - - public static BackupRestoration From(Dictionary map) => new BackupRestoration( - id: map["$id"].ToString(), - createdAt: map["$createdAt"].ToString(), - updatedAt: map["$updatedAt"].ToString(), - archiveId: map["archiveId"].ToString(), - policyId: map["policyId"].ToString(), - status: map["status"].ToString(), - startedAt: map["startedAt"].ToString(), - migrationId: map["migrationId"].ToString(), - services: map["services"].ConvertToList(), - resources: map["resources"].ConvertToList(), - options: map["options"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "$id", Id }, - { "$createdAt", CreatedAt }, - { "$updatedAt", UpdatedAt }, - { "archiveId", ArchiveId }, - { "policyId", PolicyId }, - { "status", Status }, - { "startedAt", StartedAt }, - { "migrationId", MigrationId }, - { "services", Services }, - { "resources", Resources }, - { "options", Options } - }; - } -} diff --git a/Appwrite/Models/BackupRestorationList.cs b/Appwrite/Models/BackupRestorationList.cs deleted file mode 100644 index 51a304c0..00000000 --- a/Appwrite/Models/BackupRestorationList.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; -using Appwrite.Enums; -using Appwrite.Extensions; - -namespace Appwrite.Models -{ - public class BackupRestorationList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("restorations")] - public List Restorations { get; private set; } - - public BackupRestorationList( - long total, - List restorations - ) { - Total = total; - Restorations = restorations; - } - - public static BackupRestorationList From(Dictionary map) => new BackupRestorationList( - total: Convert.ToInt64(map["total"]), - restorations: map["restorations"].ConvertToList>().Select(it => BackupRestoration.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "restorations", Restorations.Select(it => it.ToMap()) } - }; - } -} diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 7143316b..5a980bf0 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -29,21 +29,13 @@ public class Database [JsonPropertyName("type")] public DatabaseType Type { get; private set; } - [JsonPropertyName("policies")] - public List Policies { get; private set; } - - [JsonPropertyName("archives")] - public List Archives { get; private set; } - public Database( string id, string name, string createdAt, string updatedAt, bool enabled, - DatabaseType type, - List policies, - List archives + DatabaseType type ) { Id = id; Name = name; @@ -51,8 +43,6 @@ List archives UpdatedAt = updatedAt; Enabled = enabled; Type = type; - Policies = policies; - Archives = archives; } public static Database From(Dictionary map) => new Database( @@ -61,9 +51,7 @@ List archives createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), enabled: (bool)map["enabled"], - type: new DatabaseType(map["type"].ToString()!), - policies: map["policies"].ConvertToList>().Select(it => Index.From(map: it)).ToList(), - archives: map["archives"].ConvertToList>().Select(it => Collection.From(map: it)).ToList() + type: new DatabaseType(map["type"].ToString()!) ); public Dictionary ToMap() => new Dictionary() @@ -73,9 +61,7 @@ List archives { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "enabled", Enabled }, - { "type", Type.Value }, - { "policies", Policies.Select(it => it.ToMap()) }, - { "archives", Archives.Select(it => it.ToMap()) } + { "type", Type.Value } }; } } diff --git a/Appwrite/Services/Activities.cs b/Appwrite/Services/Activities.cs deleted file mode 100644 index ef2a9812..00000000 --- a/Appwrite/Services/Activities.cs +++ /dev/null @@ -1,79 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Appwrite.Models; -using Appwrite.Enums; - -namespace Appwrite.Services -{ - public class Activities : Service - { - public Activities(Client client) : base(client) - { - } - - /// - /// List all events for selected filters. - /// - /// - public Task ListEvents(string? queries = null) - { - var apiPath = "/activities/events"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.ActivityEventList Convert(Dictionary it) => - Models.ActivityEventList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get event by ID. - /// - /// - /// - public Task GetEvent(string eventId) - { - var apiPath = "/activities/events/{eventId}" - .Replace("{eventId}", eventId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.ActivityEvent Convert(Dictionary it) => - Models.ActivityEvent.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - } -} diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs deleted file mode 100644 index 51eae1ba..00000000 --- a/Appwrite/Services/Backups.cs +++ /dev/null @@ -1,392 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Appwrite.Models; -using Appwrite.Enums; - -namespace Appwrite.Services -{ - public class Backups : Service - { - public Backups(Client client) : base(client) - { - } - - /// - /// List all archives for a project. - /// - /// - public Task ListArchives(List? queries = null) - { - var apiPath = "/backups/archives"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupArchiveList Convert(Dictionary it) => - Models.BackupArchiveList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Create a new archive asynchronously for a project. - /// - /// - public Task CreateArchive(List services, string? resourceId = null) - { - var apiPath = "/backups/archives"; - - var apiParameters = new Dictionary() - { - { "services", services?.Select(e => e.Value).ToList() }, - { "resourceId", resourceId } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.BackupArchive Convert(Dictionary it) => - Models.BackupArchive.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get a backup archive using it's ID. - /// - /// - public Task GetArchive(string archiveId) - { - var apiPath = "/backups/archives/{archiveId}" - .Replace("{archiveId}", archiveId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupArchive Convert(Dictionary it) => - Models.BackupArchive.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete an existing archive for a project. - /// - /// - public Task DeleteArchive(string archiveId) - { - var apiPath = "/backups/archives/{archiveId}" - .Replace("{archiveId}", archiveId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - /// List all policies for a project. - /// - /// - public Task ListPolicies(List? queries = null) - { - var apiPath = "/backups/policies"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupPolicyList Convert(Dictionary it) => - Models.BackupPolicyList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Create a new backup policy. - /// - /// - public Task CreatePolicy(string policyId, List services, long retention, string schedule, string? name = null, string? resourceId = null, bool? enabled = null) - { - var apiPath = "/backups/policies"; - - var apiParameters = new Dictionary() - { - { "policyId", policyId }, - { "name", name }, - { "services", services?.Select(e => e.Value).ToList() }, - { "resourceId", resourceId }, - { "enabled", enabled }, - { "retention", retention }, - { "schedule", schedule } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.BackupPolicy Convert(Dictionary it) => - Models.BackupPolicy.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get a backup policy using it's ID. - /// - /// - public Task GetPolicy(string policyId) - { - var apiPath = "/backups/policies/{policyId}" - .Replace("{policyId}", policyId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupPolicy Convert(Dictionary it) => - Models.BackupPolicy.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Update an existing policy using it's ID. - /// - /// - public Task UpdatePolicy(string policyId, string? name = null, long? retention = null, string? schedule = null, bool? enabled = null) - { - var apiPath = "/backups/policies/{policyId}" - .Replace("{policyId}", policyId); - - var apiParameters = new Dictionary() - { - { "name", name }, - { "retention", retention }, - { "schedule", schedule }, - { "enabled", enabled } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.BackupPolicy Convert(Dictionary it) => - Models.BackupPolicy.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Delete a policy using it's ID. - /// - /// - public Task DeletePolicy(string policyId) - { - var apiPath = "/backups/policies/{policyId}" - .Replace("{policyId}", policyId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - - return _client.Call( - method: "DELETE", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); - - } - - /// - /// Create and trigger a new restoration for a backup on a project. - /// - /// - public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null) - { - var apiPath = "/backups/restoration"; - - var apiParameters = new Dictionary() - { - { "archiveId", archiveId }, - { "services", services?.Select(e => e.Value).ToList() }, - { "newResourceId", newResourceId }, - { "newResourceName", newResourceName } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.BackupRestoration Convert(Dictionary it) => - Models.BackupRestoration.From(map: it); - - return _client.Call( - method: "POST", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// List all backup restorations for a project. - /// - /// - public Task ListRestorations(List? queries = null) - { - var apiPath = "/backups/restorations"; - - var apiParameters = new Dictionary() - { - { "queries", queries } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupRestorationList Convert(Dictionary it) => - Models.BackupRestorationList.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get the current status of a backup restoration. - /// - /// - public Task GetRestoration(string restorationId) - { - var apiPath = "/backups/restorations/{restorationId}" - .Replace("{restorationId}", restorationId); - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.BackupRestoration Convert(Dictionary it) => - Models.BackupRestoration.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - } -} diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 4b27a287..24faf620 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -1539,6 +1539,44 @@ static Models.AttributeRelationship Convert(Dictionary it) => } + /// + /// Update relationship attribute. [Learn more about relationship + /// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + /// + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")] + public Task 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() + { + { "onDelete", onDelete?.Value }, + { "newKey", newKey } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.AttributeRelationship Convert(Dictionary it) => + Models.AttributeRelationship.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Create a string attribute. /// @@ -1914,51 +1952,13 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri } - /// - /// Update relationship attribute. [Learn more about relationship - /// attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - /// - /// - /// - [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.")] - public Task 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() - { - { "onDelete", onDelete?.Value }, - { "newKey", newKey } - }; - - var apiHeaders = new Dictionary() - { - { "content-type", "application/json" } - }; - - - static Models.AttributeRelationship Convert(Dictionary it) => - Models.AttributeRelationship.From(map: it); - - return _client.Call( - method: "PATCH", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get a list of all the user's documents in a given collection. You can use /// the query params to filter your results. /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.")] - public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null) + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .Replace("{databaseId}", databaseId) @@ -1968,7 +1968,8 @@ static Models.AttributeRelationship Convert(Dictionary it) => { { "queries", queries }, { "transactionId", transactionId }, - { "total", total } + { "total", total }, + { "ttl", ttl } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/Health.cs b/Appwrite/Services/Health.cs index ef8eca7b..5b0840c4 100644 --- a/Appwrite/Services/Health.cs +++ b/Appwrite/Services/Health.cs @@ -221,66 +221,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get billing project aggregation queue. - /// - /// - public Task GetQueueBillingProjectAggregation(long? threshold = null) - { - var apiPath = "/health/queue/billing-project-aggregation"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - - /// - /// Get billing team aggregation queue. - /// - /// - public Task GetQueueBillingTeamAggregation(long? threshold = null) - { - var apiPath = "/health/queue/billing-team-aggregation"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of builds that are waiting to be processed in the Appwrite /// internal queue server. @@ -312,36 +252,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get the priority builds queue size. - /// - /// - public Task GetQueuePriorityBuilds(long? threshold = null) - { - var apiPath = "/health/queue/builds-priority"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of certificates that are waiting to be issued against /// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -624,36 +534,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get region manager queue. - /// - /// - public Task GetQueueRegionManager(long? threshold = null) - { - var apiPath = "/health/queue/region-manager"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of metrics that are waiting to be processed in the Appwrite /// stats resources queue. @@ -716,36 +596,6 @@ static Models.HealthQueue Convert(Dictionary it) => } - /// - /// Get threats queue. - /// - /// - public Task GetQueueThreats(long? threshold = null) - { - var apiPath = "/health/queue/threats"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - }; - - - static Models.HealthQueue Convert(Dictionary it) => - Models.HealthQueue.From(map: it); - - return _client.Call( - method: "GET", - path: apiPath, - headers: apiHeaders, - parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, - convert: Convert); - - } - /// /// Get the number of webhooks that are waiting to be processed in the Appwrite /// internal queue server. diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index 26019877..5f12bd3f 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -333,7 +333,7 @@ static Models.DeploymentList Convert(Dictionary it) => /// need to update the site's deployment to use your new deployment ID. /// /// - public Task CreateDeployment(string siteId, InputFile code, bool activate, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, Action? onProgress = null) + public Task CreateDeployment(string siteId, InputFile code, string? installCommand = null, string? buildCommand = null, string? outputDirectory = null, bool? activate = null, Action? onProgress = null) { var apiPath = "/sites/{siteId}/deployments" .Replace("{siteId}", siteId); diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index b0ae6e50..2e49c22b 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -2053,7 +2053,7 @@ public Task DeleteIndex(string databaseId, string tableId, string key) /// params to filter your results. /// /// - public Task ListRows(string databaseId, string tableId, List? queries = null, string? transactionId = null, bool? total = null) + public Task ListRows(string databaseId, string tableId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" .Replace("{databaseId}", databaseId) @@ -2063,7 +2063,8 @@ public Task DeleteIndex(string databaseId, string tableId, string key) { { "queries", queries }, { "transactionId", transactionId }, - { "total", total } + { "total", total }, + { "ttl", ttl } }; var apiHeaders = new Dictionary() diff --git a/CHANGELOG.md b/CHANGELOG.md index a63cd25c..12fe1c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,10 @@ # Change Log -## 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). -* Introduced new API access scopes: schedules.read, schedules.write, and events.read for finer-grained permissions. -* Encryption support added to text attributes: AttributeLongtext and AttributeMediumtext now include an optional Encrypt boolean property, with mapping to and from API payloads. -* Minor model/serialization updates to accommodate the new encrypt field across longtext and mediumtext attributes. - ## 0.26.0 * Add `dart-3.10` and `flutter-3.38` to `BuildRuntime` and `Runtime` enums * Add `bytesMax` and `bytesUsed` properties to `Collection` and `Table` models * Fix `Roles` enum removed from Teams service; `roles` parameter now accepts `IReadOnlyList` -* Add support for the new `Backups` service ## 0.25.0 @@ -118,4 +110,4 @@ You can find the new syntax for breaking changes in the [Appwrite API references * Renamed `templateBranch` to `templateVersion` in `createFunction()`. * Renamed `downloadDeployment()` to `getDeploymentDownload()` -> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** +> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** \ No newline at end of file diff --git a/README.md b/README.md index e8a63c12..69fdb20e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases).** +**This SDK is compatible with Appwrite server version latest. 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 abstracts and simplifies 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) @@ -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 - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 0.27.0 +Install-Package Appwrite -Version 0.26.0 # or .NET CLI -dotnet add package Appwrite --version 0.27.0 +dotnet add package Appwrite --version 0.26.0 ``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md deleted file mode 100644 index 0855c8b4..00000000 --- a/docs/examples/activities/get-event.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Activities activities = new Activities(client); - -ActivityEvent result = await activities.GetEvent( - eventId: "" -);``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md deleted file mode 100644 index 817589b9..00000000 --- a/docs/examples/activities/list-events.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Activities activities = new Activities(client); - -ActivityEventList result = await activities.ListEvents( - queries: "" // optional -);``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md deleted file mode 100644 index 4eee7308..00000000 --- a/docs/examples/backups/create-archive.md +++ /dev/null @@ -1,17 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupArchive result = await backups.CreateArchive( - services: new List<BackupServices> { BackupServices.Databases }, - resourceId: "" // optional -);``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md deleted file mode 100644 index a357c855..00000000 --- a/docs/examples/backups/create-policy.md +++ /dev/null @@ -1,22 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupPolicy result = await backups.CreatePolicy( - policyId: "", - services: new List<BackupServices> { BackupServices.Databases }, - retention: 1, - schedule: "", - name: "", // optional - resourceId: "", // optional - enabled: false // optional -);``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md deleted file mode 100644 index 80ec86a1..00000000 --- a/docs/examples/backups/create-restoration.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Enums; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupRestoration result = await backups.CreateRestoration( - archiveId: "", - services: new List<BackupServices> { BackupServices.Databases }, - newResourceId: "", // optional - newResourceName: "" // optional -);``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md deleted file mode 100644 index 2fe98e06..00000000 --- a/docs/examples/backups/delete-archive.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -await backups.DeleteArchive( - archiveId: "" -);``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md deleted file mode 100644 index cc154823..00000000 --- a/docs/examples/backups/delete-policy.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -await backups.DeletePolicy( - policyId: "" -);``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md deleted file mode 100644 index d06e0bc5..00000000 --- a/docs/examples/backups/get-archive.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupArchive result = await backups.GetArchive( - archiveId: "" -);``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md deleted file mode 100644 index 427fcfa0..00000000 --- a/docs/examples/backups/get-policy.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupPolicy result = await backups.GetPolicy( - policyId: "" -);``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md deleted file mode 100644 index bed028bb..00000000 --- a/docs/examples/backups/get-restoration.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupRestoration result = await backups.GetRestoration( - restorationId: "" -);``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md deleted file mode 100644 index ddc46339..00000000 --- a/docs/examples/backups/list-archives.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupArchiveList result = await backups.ListArchives( - queries: new List() // optional -);``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md deleted file mode 100644 index 8ebdffdf..00000000 --- a/docs/examples/backups/list-policies.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupPolicyList result = await backups.ListPolicies( - queries: new List() // optional -);``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md deleted file mode 100644 index 7d9712d6..00000000 --- a/docs/examples/backups/list-restorations.md +++ /dev/null @@ -1,15 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupRestorationList result = await backups.ListRestorations( - queries: new List() // optional -);``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md deleted file mode 100644 index acba52a3..00000000 --- a/docs/examples/backups/update-policy.md +++ /dev/null @@ -1,19 +0,0 @@ -```csharp -using Appwrite; -using Appwrite.Models; -using Appwrite.Services; - -Client client = new Client() - .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("") // Your project ID - .SetKey(""); // Your secret API key - -Backups backups = new Backups(client); - -BackupPolicy result = await backups.UpdatePolicy( - policyId: "", - name: "", // optional - retention: 1, // optional - schedule: "", // optional - enabled: false // optional -);``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index c5f69e3e..cb2d2dbe 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -15,5 +15,6 @@ DocumentList result = await databases.ListDocuments( collectionId: "", queries: new List(), // optional transactionId: "", // optional - total: false // optional + total: false, // optional + ttl: 0 // optional );``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index d9be1a1e..692d7743 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -13,8 +13,8 @@ Sites sites = new Sites(client); Deployment result = await sites.CreateDeployment( siteId: "", code: InputFile.FromPath("./path-to-files/image.jpg"), - activate: false, installCommand: "", // optional buildCommand: "", // optional - outputDirectory: "" // optional + outputDirectory: "", // optional + activate: false // optional );``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index a0f582fc..e9186378 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -15,5 +15,6 @@ RowList result = await tablesDB.ListRows( tableId: "", queries: new List(), // optional transactionId: "", // optional - total: false // optional + total: false, // optional + ttl: 0 // optional );``` From 18e5b62c23cd819f17ce0ef80d58aee0b691688e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Mar 2026 10:18:08 +0000 Subject: [PATCH 2/3] regen --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 +- Appwrite/Enums/BackupServices.cs | 18 + Appwrite/Enums/BuildRuntime.cs | 3 - Appwrite/Enums/Runtime.cs | 3 - Appwrite/Enums/Scopes.cs | 9 + Appwrite/Models/ActivityEvent.cs | 249 +++++++++++++ Appwrite/Models/ActivityEventList.cs | 39 ++ Appwrite/Models/BackupArchive.cs | 109 ++++++ Appwrite/Models/BackupArchiveList.cs | 39 ++ Appwrite/Models/BackupPolicy.cs | 102 +++++ Appwrite/Models/BackupPolicyList.cs | 39 ++ Appwrite/Models/BackupRestoration.cs | 102 +++++ Appwrite/Models/BackupRestorationList.cs | 39 ++ Appwrite/Models/Database.cs | 20 +- Appwrite/Services/Activities.cs | 79 ++++ Appwrite/Services/Backups.cs | 392 ++++++++++++++++++++ Appwrite/Services/Health.cs | 183 +++++++++ CHANGELOG.md | 10 +- README.md | 8 +- docs/examples/activities/get-event.md | 15 + docs/examples/activities/list-events.md | 15 + docs/examples/backups/create-archive.md | 17 + docs/examples/backups/create-policy.md | 22 ++ docs/examples/backups/create-restoration.md | 19 + docs/examples/backups/delete-archive.md | 15 + docs/examples/backups/delete-policy.md | 15 + docs/examples/backups/get-archive.md | 15 + docs/examples/backups/get-policy.md | 15 + docs/examples/backups/get-restoration.md | 15 + docs/examples/backups/list-archives.md | 15 + docs/examples/backups/list-policies.md | 15 + docs/examples/backups/list-restorations.md | 15 + docs/examples/backups/update-policy.md | 19 + docs/examples/health/get-console-pausing.md | 16 + 35 files changed, 1675 insertions(+), 17 deletions(-) create mode 100644 Appwrite/Enums/BackupServices.cs create mode 100644 Appwrite/Models/ActivityEvent.cs create mode 100644 Appwrite/Models/ActivityEventList.cs create mode 100644 Appwrite/Models/BackupArchive.cs create mode 100644 Appwrite/Models/BackupArchiveList.cs create mode 100644 Appwrite/Models/BackupPolicy.cs create mode 100644 Appwrite/Models/BackupPolicyList.cs create mode 100644 Appwrite/Models/BackupRestoration.cs create mode 100644 Appwrite/Models/BackupRestorationList.cs create mode 100644 Appwrite/Services/Activities.cs create mode 100644 Appwrite/Services/Backups.cs create mode 100644 docs/examples/activities/get-event.md create mode 100644 docs/examples/activities/list-events.md create mode 100644 docs/examples/backups/create-archive.md create mode 100644 docs/examples/backups/create-policy.md create mode 100644 docs/examples/backups/create-restoration.md create mode 100644 docs/examples/backups/delete-archive.md create mode 100644 docs/examples/backups/delete-policy.md create mode 100644 docs/examples/backups/get-archive.md create mode 100644 docs/examples/backups/get-policy.md create mode 100644 docs/examples/backups/get-restoration.md create mode 100644 docs/examples/backups/list-archives.md create mode 100644 docs/examples/backups/list-policies.md create mode 100644 docs/examples/backups/list-restorations.md create mode 100644 docs/examples/backups/update-policy.md create mode 100644 docs/examples/health/get-console-pausing.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 942fe653..0f4eba21 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.26.0 + 1.0.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 2c535750..5fa902be 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.26.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.26.0"}, + { "x-sdk-version", "1.0.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/Appwrite/Enums/BackupServices.cs b/Appwrite/Enums/BackupServices.cs new file mode 100644 index 00000000..ef9d1a17 --- /dev/null +++ b/Appwrite/Enums/BackupServices.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class BackupServices : IEnum + { + public string Value { get; private set; } + + public BackupServices(string value) + { + Value = value; + } + + public static BackupServices Databases => new BackupServices("databases"); + public static BackupServices Functions => new BackupServices("functions"); + public static BackupServices Storage => new BackupServices("storage"); + } +} diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index ab8a3da1..1617eceb 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -42,9 +42,6 @@ public BuildRuntime(string value) public static BuildRuntime PythonMl311 => new BuildRuntime("python-ml-3.11"); public static BuildRuntime PythonMl312 => new BuildRuntime("python-ml-3.12"); public static BuildRuntime PythonMl313 => new BuildRuntime("python-ml-3.13"); - public static BuildRuntime Deno121 => new BuildRuntime("deno-1.21"); - public static BuildRuntime Deno124 => new BuildRuntime("deno-1.24"); - public static BuildRuntime Deno135 => new BuildRuntime("deno-1.35"); public static BuildRuntime Deno140 => new BuildRuntime("deno-1.40"); public static BuildRuntime Deno146 => new BuildRuntime("deno-1.46"); public static BuildRuntime Deno20 => new BuildRuntime("deno-2.0"); diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index 49a1b82f..6c5f4f4d 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -42,9 +42,6 @@ public Runtime(string value) public static Runtime PythonMl311 => new Runtime("python-ml-3.11"); public static Runtime PythonMl312 => new Runtime("python-ml-3.12"); public static Runtime PythonMl313 => new Runtime("python-ml-3.13"); - 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"); diff --git a/Appwrite/Enums/Scopes.cs b/Appwrite/Enums/Scopes.cs index a070c694..813361dd 100644 --- a/Appwrite/Enums/Scopes.cs +++ b/Appwrite/Enums/Scopes.cs @@ -68,5 +68,14 @@ public Scopes(string value) public static Scopes AssistantRead => new Scopes("assistant.read"); public static Scopes TokensRead => new Scopes("tokens.read"); public static Scopes TokensWrite => new Scopes("tokens.write"); + public static Scopes PoliciesWrite => new Scopes("policies.write"); + public static Scopes PoliciesRead => new Scopes("policies.read"); + public static Scopes ArchivesRead => new Scopes("archives.read"); + public static Scopes ArchivesWrite => new Scopes("archives.write"); + public static Scopes RestorationsRead => new Scopes("restorations.read"); + public static Scopes RestorationsWrite => new Scopes("restorations.write"); + public static Scopes DomainsRead => new Scopes("domains.read"); + public static Scopes DomainsWrite => new Scopes("domains.write"); + public static Scopes EventsRead => new Scopes("events.read"); } } diff --git a/Appwrite/Models/ActivityEvent.cs b/Appwrite/Models/ActivityEvent.cs new file mode 100644 index 00000000..c0aaa139 --- /dev/null +++ b/Appwrite/Models/ActivityEvent.cs @@ -0,0 +1,249 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class ActivityEvent + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("userType")] + public string UserType { get; private set; } + + [JsonPropertyName("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("userEmail")] + public string UserEmail { get; private set; } + + [JsonPropertyName("userName")] + public string UserName { get; private set; } + + [JsonPropertyName("resourceParent")] + public string ResourceParent { get; private set; } + + [JsonPropertyName("resourceType")] + public string ResourceType { get; private set; } + + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("resource")] + public string Resource { get; private set; } + + [JsonPropertyName("event")] + public string Event { get; private set; } + + [JsonPropertyName("userAgent")] + public string UserAgent { get; private set; } + + [JsonPropertyName("ip")] + public string Ip { get; private set; } + + [JsonPropertyName("mode")] + public string Mode { get; private set; } + + [JsonPropertyName("country")] + public string Country { get; private set; } + + [JsonPropertyName("time")] + public string Time { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("hostname")] + public string Hostname { get; private set; } + + [JsonPropertyName("osCode")] + public string OsCode { get; private set; } + + [JsonPropertyName("osName")] + public string OsName { get; private set; } + + [JsonPropertyName("osVersion")] + public string OsVersion { get; private set; } + + [JsonPropertyName("clientType")] + public string ClientType { get; private set; } + + [JsonPropertyName("clientCode")] + public string ClientCode { get; private set; } + + [JsonPropertyName("clientName")] + public string ClientName { get; private set; } + + [JsonPropertyName("clientVersion")] + public string ClientVersion { get; private set; } + + [JsonPropertyName("clientEngine")] + public string ClientEngine { get; private set; } + + [JsonPropertyName("clientEngineVersion")] + public string ClientEngineVersion { get; private set; } + + [JsonPropertyName("deviceName")] + public string DeviceName { get; private set; } + + [JsonPropertyName("deviceBrand")] + public string DeviceBrand { get; private set; } + + [JsonPropertyName("deviceModel")] + public string DeviceModel { get; private set; } + + [JsonPropertyName("countryCode")] + public string CountryCode { get; private set; } + + [JsonPropertyName("countryName")] + public string CountryName { get; private set; } + + public ActivityEvent( + string id, + string userType, + string userId, + string userEmail, + string userName, + string resourceParent, + string resourceType, + string resourceId, + string resource, + string xevent, + string userAgent, + string ip, + string mode, + string country, + string time, + string projectId, + string teamId, + string hostname, + string osCode, + string osName, + string osVersion, + string clientType, + string clientCode, + string clientName, + string clientVersion, + string clientEngine, + string clientEngineVersion, + string deviceName, + string deviceBrand, + string deviceModel, + string countryCode, + string countryName + ) { + Id = id; + UserType = userType; + UserId = userId; + UserEmail = userEmail; + UserName = userName; + ResourceParent = resourceParent; + ResourceType = resourceType; + ResourceId = resourceId; + Resource = resource; + Event = xevent; + UserAgent = userAgent; + Ip = ip; + Mode = mode; + Country = country; + Time = time; + ProjectId = projectId; + TeamId = teamId; + Hostname = hostname; + OsCode = osCode; + OsName = osName; + OsVersion = osVersion; + ClientType = clientType; + ClientCode = clientCode; + ClientName = clientName; + ClientVersion = clientVersion; + ClientEngine = clientEngine; + ClientEngineVersion = clientEngineVersion; + DeviceName = deviceName; + DeviceBrand = deviceBrand; + DeviceModel = deviceModel; + CountryCode = countryCode; + CountryName = countryName; + } + + public static ActivityEvent From(Dictionary map) => new ActivityEvent( + id: map["$id"].ToString(), + userType: map["userType"].ToString(), + userId: map["userId"].ToString(), + userEmail: map["userEmail"].ToString(), + userName: map["userName"].ToString(), + resourceParent: map["resourceParent"].ToString(), + resourceType: map["resourceType"].ToString(), + resourceId: map["resourceId"].ToString(), + resource: map["resource"].ToString(), + xevent: map["event"].ToString(), + userAgent: map["userAgent"].ToString(), + ip: map["ip"].ToString(), + mode: map["mode"].ToString(), + country: map["country"].ToString(), + time: map["time"].ToString(), + projectId: map["projectId"].ToString(), + teamId: map["teamId"].ToString(), + hostname: map["hostname"].ToString(), + osCode: map["osCode"].ToString(), + osName: map["osName"].ToString(), + osVersion: map["osVersion"].ToString(), + clientType: map["clientType"].ToString(), + clientCode: map["clientCode"].ToString(), + clientName: map["clientName"].ToString(), + clientVersion: map["clientVersion"].ToString(), + clientEngine: map["clientEngine"].ToString(), + clientEngineVersion: map["clientEngineVersion"].ToString(), + deviceName: map["deviceName"].ToString(), + deviceBrand: map["deviceBrand"].ToString(), + deviceModel: map["deviceModel"].ToString(), + countryCode: map["countryCode"].ToString(), + countryName: map["countryName"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "userType", UserType }, + { "userId", UserId }, + { "userEmail", UserEmail }, + { "userName", UserName }, + { "resourceParent", ResourceParent }, + { "resourceType", ResourceType }, + { "resourceId", ResourceId }, + { "resource", Resource }, + { "event", Event }, + { "userAgent", UserAgent }, + { "ip", Ip }, + { "mode", Mode }, + { "country", Country }, + { "time", Time }, + { "projectId", ProjectId }, + { "teamId", TeamId }, + { "hostname", Hostname }, + { "osCode", OsCode }, + { "osName", OsName }, + { "osVersion", OsVersion }, + { "clientType", ClientType }, + { "clientCode", ClientCode }, + { "clientName", ClientName }, + { "clientVersion", ClientVersion }, + { "clientEngine", ClientEngine }, + { "clientEngineVersion", ClientEngineVersion }, + { "deviceName", DeviceName }, + { "deviceBrand", DeviceBrand }, + { "deviceModel", DeviceModel }, + { "countryCode", CountryCode }, + { "countryName", CountryName } + }; + } +} diff --git a/Appwrite/Models/ActivityEventList.cs b/Appwrite/Models/ActivityEventList.cs new file mode 100644 index 00000000..e8eed6ee --- /dev/null +++ b/Appwrite/Models/ActivityEventList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class ActivityEventList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("events")] + public List Events { get; private set; } + + public ActivityEventList( + long total, + List events + ) { + Total = total; + Events = events; + } + + public static ActivityEventList From(Dictionary map) => new ActivityEventList( + total: Convert.ToInt64(map["total"]), + events: map["events"].ConvertToList>().Select(it => ActivityEvent.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "events", Events.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/BackupArchive.cs b/Appwrite/Models/BackupArchive.cs new file mode 100644 index 00000000..37d4e87e --- /dev/null +++ b/Appwrite/Models/BackupArchive.cs @@ -0,0 +1,109 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupArchive + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("policyId")] + public string PolicyId { get; private set; } + + [JsonPropertyName("size")] + public long Size { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("startedAt")] + public string StartedAt { get; private set; } + + [JsonPropertyName("migrationId")] + public string MigrationId { get; private set; } + + [JsonPropertyName("services")] + public List Services { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("resourceId")] + public string? ResourceId { get; private set; } + + [JsonPropertyName("resourceType")] + public string? ResourceType { get; private set; } + + public BackupArchive( + string id, + string createdAt, + string updatedAt, + string policyId, + long size, + string status, + string startedAt, + string migrationId, + List services, + List resources, + string? resourceId, + string? resourceType + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + PolicyId = policyId; + Size = size; + Status = status; + StartedAt = startedAt; + MigrationId = migrationId; + Services = services; + Resources = resources; + ResourceId = resourceId; + ResourceType = resourceType; + } + + public static BackupArchive From(Dictionary map) => new BackupArchive( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + policyId: map["policyId"].ToString(), + size: Convert.ToInt64(map["size"]), + status: map["status"].ToString(), + startedAt: map["startedAt"].ToString(), + migrationId: map["migrationId"].ToString(), + services: map["services"].ConvertToList(), + resources: map["resources"].ConvertToList(), + resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, + resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "policyId", PolicyId }, + { "size", Size }, + { "status", Status }, + { "startedAt", StartedAt }, + { "migrationId", MigrationId }, + { "services", Services }, + { "resources", Resources }, + { "resourceId", ResourceId }, + { "resourceType", ResourceType } + }; + } +} diff --git a/Appwrite/Models/BackupArchiveList.cs b/Appwrite/Models/BackupArchiveList.cs new file mode 100644 index 00000000..6c1e0df0 --- /dev/null +++ b/Appwrite/Models/BackupArchiveList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupArchiveList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("archives")] + public List Archives { get; private set; } + + public BackupArchiveList( + long total, + List archives + ) { + Total = total; + Archives = archives; + } + + public static BackupArchiveList From(Dictionary map) => new BackupArchiveList( + total: Convert.ToInt64(map["total"]), + archives: map["archives"].ConvertToList>().Select(it => BackupArchive.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "archives", Archives.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/BackupPolicy.cs b/Appwrite/Models/BackupPolicy.cs new file mode 100644 index 00000000..7f1a5b2a --- /dev/null +++ b/Appwrite/Models/BackupPolicy.cs @@ -0,0 +1,102 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupPolicy + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("services")] + public List Services { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("resourceId")] + public string? ResourceId { get; private set; } + + [JsonPropertyName("resourceType")] + public string? ResourceType { get; private set; } + + [JsonPropertyName("retention")] + public long Retention { get; private set; } + + [JsonPropertyName("schedule")] + public string Schedule { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + public BackupPolicy( + string id, + string name, + string createdAt, + string updatedAt, + List services, + List resources, + string? resourceId, + string? resourceType, + long retention, + string schedule, + bool enabled + ) { + Id = id; + Name = name; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Services = services; + Resources = resources; + ResourceId = resourceId; + ResourceType = resourceType; + Retention = retention; + Schedule = schedule; + Enabled = enabled; + } + + public static BackupPolicy From(Dictionary map) => new BackupPolicy( + id: map["$id"].ToString(), + name: map["name"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + services: map["services"].ConvertToList(), + resources: map["resources"].ConvertToList(), + resourceId: map.TryGetValue("resourceId", out var resourceId) ? resourceId?.ToString() : null, + resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null, + retention: Convert.ToInt64(map["retention"]), + schedule: map["schedule"].ToString(), + enabled: (bool)map["enabled"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "name", Name }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "services", Services }, + { "resources", Resources }, + { "resourceId", ResourceId }, + { "resourceType", ResourceType }, + { "retention", Retention }, + { "schedule", Schedule }, + { "enabled", Enabled } + }; + } +} diff --git a/Appwrite/Models/BackupPolicyList.cs b/Appwrite/Models/BackupPolicyList.cs new file mode 100644 index 00000000..414319b2 --- /dev/null +++ b/Appwrite/Models/BackupPolicyList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupPolicyList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("policies")] + public List Policies { get; private set; } + + public BackupPolicyList( + long total, + List policies + ) { + Total = total; + Policies = policies; + } + + public static BackupPolicyList From(Dictionary map) => new BackupPolicyList( + total: Convert.ToInt64(map["total"]), + policies: map["policies"].ConvertToList>().Select(it => BackupPolicy.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "policies", Policies.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/BackupRestoration.cs b/Appwrite/Models/BackupRestoration.cs new file mode 100644 index 00000000..ecf5d7a2 --- /dev/null +++ b/Appwrite/Models/BackupRestoration.cs @@ -0,0 +1,102 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupRestoration + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("archiveId")] + public string ArchiveId { get; private set; } + + [JsonPropertyName("policyId")] + public string PolicyId { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("startedAt")] + public string StartedAt { get; private set; } + + [JsonPropertyName("migrationId")] + public string MigrationId { get; private set; } + + [JsonPropertyName("services")] + public List Services { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("options")] + public string Options { get; private set; } + + public BackupRestoration( + string id, + string createdAt, + string updatedAt, + string archiveId, + string policyId, + string status, + string startedAt, + string migrationId, + List services, + List resources, + string options + ) { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + ArchiveId = archiveId; + PolicyId = policyId; + Status = status; + StartedAt = startedAt; + MigrationId = migrationId; + Services = services; + Resources = resources; + Options = options; + } + + public static BackupRestoration From(Dictionary map) => new BackupRestoration( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + archiveId: map["archiveId"].ToString(), + policyId: map["policyId"].ToString(), + status: map["status"].ToString(), + startedAt: map["startedAt"].ToString(), + migrationId: map["migrationId"].ToString(), + services: map["services"].ConvertToList(), + resources: map["resources"].ConvertToList(), + options: map["options"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "archiveId", ArchiveId }, + { "policyId", PolicyId }, + { "status", Status }, + { "startedAt", StartedAt }, + { "migrationId", MigrationId }, + { "services", Services }, + { "resources", Resources }, + { "options", Options } + }; + } +} diff --git a/Appwrite/Models/BackupRestorationList.cs b/Appwrite/Models/BackupRestorationList.cs new file mode 100644 index 00000000..51a304c0 --- /dev/null +++ b/Appwrite/Models/BackupRestorationList.cs @@ -0,0 +1,39 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Appwrite.Enums; +using Appwrite.Extensions; + +namespace Appwrite.Models +{ + public class BackupRestorationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("restorations")] + public List Restorations { get; private set; } + + public BackupRestorationList( + long total, + List restorations + ) { + Total = total; + Restorations = restorations; + } + + public static BackupRestorationList From(Dictionary map) => new BackupRestorationList( + total: Convert.ToInt64(map["total"]), + restorations: map["restorations"].ConvertToList>().Select(it => BackupRestoration.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "restorations", Restorations.Select(it => it.ToMap()) } + }; + } +} diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 5a980bf0..7143316b 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -29,13 +29,21 @@ public class Database [JsonPropertyName("type")] public DatabaseType Type { get; private set; } + [JsonPropertyName("policies")] + public List Policies { get; private set; } + + [JsonPropertyName("archives")] + public List Archives { get; private set; } + public Database( string id, string name, string createdAt, string updatedAt, bool enabled, - DatabaseType type + DatabaseType type, + List policies, + List archives ) { Id = id; Name = name; @@ -43,6 +51,8 @@ DatabaseType type UpdatedAt = updatedAt; Enabled = enabled; Type = type; + Policies = policies; + Archives = archives; } public static Database From(Dictionary map) => new Database( @@ -51,7 +61,9 @@ DatabaseType type createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), enabled: (bool)map["enabled"], - type: new DatabaseType(map["type"].ToString()!) + type: new DatabaseType(map["type"].ToString()!), + policies: map["policies"].ConvertToList>().Select(it => Index.From(map: it)).ToList(), + archives: map["archives"].ConvertToList>().Select(it => Collection.From(map: it)).ToList() ); public Dictionary ToMap() => new Dictionary() @@ -61,7 +73,9 @@ DatabaseType type { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "enabled", Enabled }, - { "type", Type.Value } + { "type", Type.Value }, + { "policies", Policies.Select(it => it.ToMap()) }, + { "archives", Archives.Select(it => it.ToMap()) } }; } } diff --git a/Appwrite/Services/Activities.cs b/Appwrite/Services/Activities.cs new file mode 100644 index 00000000..ef2a9812 --- /dev/null +++ b/Appwrite/Services/Activities.cs @@ -0,0 +1,79 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Activities : Service + { + public Activities(Client client) : base(client) + { + } + + /// + /// List all events for selected filters. + /// + /// + public Task ListEvents(string? queries = null) + { + var apiPath = "/activities/events"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.ActivityEventList Convert(Dictionary it) => + Models.ActivityEventList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get event by ID. + /// + /// + /// + public Task GetEvent(string eventId) + { + var apiPath = "/activities/events/{eventId}" + .Replace("{eventId}", eventId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.ActivityEvent Convert(Dictionary it) => + Models.ActivityEvent.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + } +} diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs new file mode 100644 index 00000000..51eae1ba --- /dev/null +++ b/Appwrite/Services/Backups.cs @@ -0,0 +1,392 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Backups : Service + { + public Backups(Client client) : base(client) + { + } + + /// + /// List all archives for a project. + /// + /// + public Task ListArchives(List? queries = null) + { + var apiPath = "/backups/archives"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupArchiveList Convert(Dictionary it) => + Models.BackupArchiveList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new archive asynchronously for a project. + /// + /// + public Task CreateArchive(List services, string? resourceId = null) + { + var apiPath = "/backups/archives"; + + var apiParameters = new Dictionary() + { + { "services", services?.Select(e => e.Value).ToList() }, + { "resourceId", resourceId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.BackupArchive Convert(Dictionary it) => + Models.BackupArchive.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a backup archive using it's ID. + /// + /// + public Task GetArchive(string archiveId) + { + var apiPath = "/backups/archives/{archiveId}" + .Replace("{archiveId}", archiveId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupArchive Convert(Dictionary it) => + Models.BackupArchive.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete an existing archive for a project. + /// + /// + public Task DeleteArchive(string archiveId) + { + var apiPath = "/backups/archives/{archiveId}" + .Replace("{archiveId}", archiveId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// List all policies for a project. + /// + /// + public Task ListPolicies(List? queries = null) + { + var apiPath = "/backups/policies"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupPolicyList Convert(Dictionary it) => + Models.BackupPolicyList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Create a new backup policy. + /// + /// + public Task CreatePolicy(string policyId, List services, long retention, string schedule, string? name = null, string? resourceId = null, bool? enabled = null) + { + var apiPath = "/backups/policies"; + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "services", services?.Select(e => e.Value).ToList() }, + { "resourceId", resourceId }, + { "enabled", enabled }, + { "retention", retention }, + { "schedule", schedule } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) => + Models.BackupPolicy.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a backup policy using it's ID. + /// + /// + public Task GetPolicy(string policyId) + { + var apiPath = "/backups/policies/{policyId}" + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupPolicy Convert(Dictionary it) => + Models.BackupPolicy.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update an existing policy using it's ID. + /// + /// + public Task UpdatePolicy(string policyId, string? name = null, long? retention = null, string? schedule = null, bool? enabled = null) + { + var apiPath = "/backups/policies/{policyId}" + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "retention", retention }, + { "schedule", schedule }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) => + Models.BackupPolicy.From(map: it); + + return _client.Call( + method: "PATCH", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a policy using it's ID. + /// + /// + public Task DeletePolicy(string policyId) + { + var apiPath = "/backups/policies/{policyId}" + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Create and trigger a new restoration for a backup on a project. + /// + /// + public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null) + { + var apiPath = "/backups/restoration"; + + var apiParameters = new Dictionary() + { + { "archiveId", archiveId }, + { "services", services?.Select(e => e.Value).ToList() }, + { "newResourceId", newResourceId }, + { "newResourceName", newResourceName } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.BackupRestoration Convert(Dictionary it) => + Models.BackupRestoration.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List all backup restorations for a project. + /// + /// + public Task ListRestorations(List? queries = null) + { + var apiPath = "/backups/restorations"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupRestorationList Convert(Dictionary it) => + Models.BackupRestorationList.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get the current status of a backup restoration. + /// + /// + public Task GetRestoration(string restorationId) + { + var apiPath = "/backups/restorations/{restorationId}" + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.BackupRestoration Convert(Dictionary it) => + Models.BackupRestoration.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + } +} diff --git a/Appwrite/Services/Health.cs b/Appwrite/Services/Health.cs index 5b0840c4..20b5901a 100644 --- a/Appwrite/Services/Health.cs +++ b/Appwrite/Services/Health.cs @@ -132,6 +132,39 @@ static Models.HealthCertificate Convert(Dictionary it) => } + /// + /// Get console pausing health status. Monitors projects approaching the pause + /// threshold to detect potential issues with console access tracking. + /// + /// + /// + public Task GetConsolePausing(long? threshold = null, long? inactivityDays = null) + { + var apiPath = "/health/console-pausing"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold }, + { "inactivityDays", inactivityDays } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthStatus Convert(Dictionary it) => + Models.HealthStatus.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Check the Appwrite database servers are up and connection is successful. /// @@ -221,6 +254,66 @@ static Models.HealthQueue Convert(Dictionary it) => } + /// + /// Get billing project aggregation queue. + /// + /// + public Task GetQueueBillingProjectAggregation(long? threshold = null) + { + var apiPath = "/health/queue/billing-project-aggregation"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get billing team aggregation queue. + /// + /// + public Task GetQueueBillingTeamAggregation(long? threshold = null) + { + var apiPath = "/health/queue/billing-team-aggregation"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Get the number of builds that are waiting to be processed in the Appwrite /// internal queue server. @@ -252,6 +345,36 @@ static Models.HealthQueue Convert(Dictionary it) => } + /// + /// Get the priority builds queue size. + /// + /// + public Task GetQueuePriorityBuilds(long? threshold = null) + { + var apiPath = "/health/queue/builds-priority"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Get the number of certificates that are waiting to be issued against /// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -534,6 +657,36 @@ static Models.HealthQueue Convert(Dictionary it) => } + /// + /// Get region manager queue. + /// + /// + public Task GetQueueRegionManager(long? threshold = null) + { + var apiPath = "/health/queue/region-manager"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Get the number of metrics that are waiting to be processed in the Appwrite /// stats resources queue. @@ -596,6 +749,36 @@ static Models.HealthQueue Convert(Dictionary it) => } + /// + /// Get threats queue. + /// + /// + public Task GetQueueThreats(long? threshold = null) + { + var apiPath = "/health/queue/threats"; + + var apiParameters = new Dictionary() + { + { "threshold", threshold } + }; + + var apiHeaders = new Dictionary() + { + }; + + + static Models.HealthQueue Convert(Dictionary it) => + Models.HealthQueue.From(map: it); + + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + /// /// Get the number of webhooks that are waiting to be processed in the Appwrite /// internal queue server. diff --git a/CHANGELOG.md b/CHANGELOG.md index 12fe1c3f..a63cd25c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ # Change Log +## 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). +* Introduced new API access scopes: schedules.read, schedules.write, and events.read for finer-grained permissions. +* Encryption support added to text attributes: AttributeLongtext and AttributeMediumtext now include an optional Encrypt boolean property, with mapping to and from API payloads. +* Minor model/serialization updates to accommodate the new encrypt field across longtext and mediumtext attributes. + ## 0.26.0 * Add `dart-3.10` and `flutter-3.38` to `BuildRuntime` and `Runtime` enums * Add `bytesMax` and `bytesUsed` properties to `Collection` and `Table` models * Fix `Roles` enum removed from Teams service; `roles` parameter now accepts `IReadOnlyList` +* Add support for the new `Backups` service ## 0.25.0 @@ -110,4 +118,4 @@ You can find the new syntax for breaking changes in the [Appwrite API references * Renamed `templateBranch` to `templateVersion` in `createFunction()`. * Renamed `downloadDeployment()` to `getDeploymentDownload()` -> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** \ No newline at end of file +> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** diff --git a/README.md b/README.md index 69fdb20e..30f17fca 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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 latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dotnet/releases).** +**This SDK is compatible with Appwrite server version 1.8.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 abstracts and simplifies 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) @@ -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 - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 0.26.0 +Install-Package Appwrite -Version 1.0.0 # or .NET CLI -dotnet add package Appwrite --version 0.26.0 +dotnet add package Appwrite --version 1.0.0 ``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md new file mode 100644 index 00000000..0855c8b4 --- /dev/null +++ b/docs/examples/activities/get-event.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Activities activities = new Activities(client); + +ActivityEvent result = await activities.GetEvent( + eventId: "" +);``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md new file mode 100644 index 00000000..817589b9 --- /dev/null +++ b/docs/examples/activities/list-events.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Activities activities = new Activities(client); + +ActivityEventList result = await activities.ListEvents( + queries: "" // optional +);``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md new file mode 100644 index 00000000..4eee7308 --- /dev/null +++ b/docs/examples/backups/create-archive.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupArchive result = await backups.CreateArchive( + services: new List<BackupServices> { BackupServices.Databases }, + resourceId: "" // optional +);``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md new file mode 100644 index 00000000..a357c855 --- /dev/null +++ b/docs/examples/backups/create-policy.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupPolicy result = await backups.CreatePolicy( + policyId: "", + services: new List<BackupServices> { BackupServices.Databases }, + retention: 1, + schedule: "", + name: "", // optional + resourceId: "", // optional + enabled: false // optional +);``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md new file mode 100644 index 00000000..80ec86a1 --- /dev/null +++ b/docs/examples/backups/create-restoration.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupRestoration result = await backups.CreateRestoration( + archiveId: "", + services: new List<BackupServices> { BackupServices.Databases }, + newResourceId: "", // optional + newResourceName: "" // optional +);``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md new file mode 100644 index 00000000..2fe98e06 --- /dev/null +++ b/docs/examples/backups/delete-archive.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +await backups.DeleteArchive( + archiveId: "" +);``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md new file mode 100644 index 00000000..cc154823 --- /dev/null +++ b/docs/examples/backups/delete-policy.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +await backups.DeletePolicy( + policyId: "" +);``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md new file mode 100644 index 00000000..d06e0bc5 --- /dev/null +++ b/docs/examples/backups/get-archive.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupArchive result = await backups.GetArchive( + archiveId: "" +);``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md new file mode 100644 index 00000000..427fcfa0 --- /dev/null +++ b/docs/examples/backups/get-policy.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupPolicy result = await backups.GetPolicy( + policyId: "" +);``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md new file mode 100644 index 00000000..bed028bb --- /dev/null +++ b/docs/examples/backups/get-restoration.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupRestoration result = await backups.GetRestoration( + restorationId: "" +);``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md new file mode 100644 index 00000000..ddc46339 --- /dev/null +++ b/docs/examples/backups/list-archives.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupArchiveList result = await backups.ListArchives( + queries: new List() // optional +);``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md new file mode 100644 index 00000000..8ebdffdf --- /dev/null +++ b/docs/examples/backups/list-policies.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupPolicyList result = await backups.ListPolicies( + queries: new List() // optional +);``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md new file mode 100644 index 00000000..7d9712d6 --- /dev/null +++ b/docs/examples/backups/list-restorations.md @@ -0,0 +1,15 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupRestorationList result = await backups.ListRestorations( + queries: new List() // optional +);``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md new file mode 100644 index 00000000..acba52a3 --- /dev/null +++ b/docs/examples/backups/update-policy.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Backups backups = new Backups(client); + +BackupPolicy result = await backups.UpdatePolicy( + policyId: "", + name: "", // optional + retention: 1, // optional + schedule: "", // optional + enabled: false // optional +);``` diff --git a/docs/examples/health/get-console-pausing.md b/docs/examples/health/get-console-pausing.md new file mode 100644 index 00000000..b57ee49e --- /dev/null +++ b/docs/examples/health/get-console-pausing.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetConsolePausing( + threshold: 0, // optional + inactivityDays: 0 // optional +);``` From e39129014b7bb2f1c3e989c99466743b3deb6e9b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Mar 2026 10:33:49 +0000 Subject: [PATCH 3/3] regen --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a63cd25c..6637c1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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).