From f2deb046ae1444188615995a19ee4277e7f4043e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 10:48:13 +0530 Subject: [PATCH 01/10] chore: update .NET SDK to 6.0.0 --- Appwrite/Appwrite.csproj | 4 +- Appwrite/Client.cs | 18 +- Appwrite/Enums/BillingPlanGroup.cs | 18 + Appwrite/Enums/DatabaseStatus.cs | 18 + Appwrite/Enums/HealthAntivirusStatus.cs | 18 - Appwrite/Enums/HealthCheckStatus.cs | 17 - Appwrite/Enums/HealthQueueName.cs | 28 - Appwrite/Enums/OAuth2OidcPrompt.cs | 19 + Appwrite/Enums/OAuthProvider.cs | 1 + Appwrite/Enums/OrganizationKeyScopes.cs | 4 + Appwrite/Enums/ProjectKeyScopes.cs | 9 +- Appwrite/Enums/ProjectOAuth2OidcPrompt.cs | 19 + Appwrite/Enums/ProjectOAuthProviderId.cs | 1 + Appwrite/Enums/ProjectPolicyId.cs | 1 + Appwrite/Enums/ProjectServiceId.cs | 1 + Appwrite/Models/ActivityEvent.cs | 104 +-- Appwrite/Models/AdditionalResource.cs | 68 ++ Appwrite/Models/AttributeLine.cs | 6 +- Appwrite/Models/AttributePoint.cs | 6 +- Appwrite/Models/AttributePolygon.cs | 6 +- Appwrite/Models/BackupPolicy.cs | 7 + Appwrite/Models/BillingPlan.cs | 510 +++++++++++ Appwrite/Models/BillingPlanAddon.cs | 40 + Appwrite/Models/BillingPlanAddonDetails.cs | 82 ++ .../BillingPlanDedicatedDatabaseLimits.cs | 197 ++++ Appwrite/Models/BillingPlanLimits.cs | 44 + Appwrite/Models/BillingPlanSupportedAddons.cs | 47 + Appwrite/Models/Block.cs | 7 + Appwrite/Models/ColumnLine.cs | 6 +- Appwrite/Models/ColumnPoint.cs | 6 +- Appwrite/Models/ColumnPolygon.cs | 6 +- Appwrite/Models/Database.cs | 11 + Appwrite/Models/HealthAntivirus.cs | 40 - Appwrite/Models/HealthCertificate.cs | 68 -- Appwrite/Models/HealthQueue.cs | 33 - Appwrite/Models/HealthStatus.cs | 47 - Appwrite/Models/HealthStatusList.cs | 40 - Appwrite/Models/HealthTime.cs | 47 - Appwrite/Models/Locale.cs | 87 +- Appwrite/Models/Membership.cs | 7 + Appwrite/Models/OAuth2Appwrite.cs | 54 ++ Appwrite/Models/OAuth2Oidc.cs | 22 +- Appwrite/Models/Organization.cs | 273 ++++++ Appwrite/Models/PolicyDenyCorporateEmail.cs | 40 + Appwrite/Models/PolicyMembershipPrivacy.cs | 13 +- Appwrite/Models/Program.cs | 89 ++ Appwrite/Models/Project.cs | 129 ++- Appwrite/Models/UsageBillingPlan.cs | 103 +++ Appwrite/Models/UsageEvent.cs | 96 -- Appwrite/Models/UsageEventList.cs | 40 - Appwrite/Models/UsageGauge.cs | 61 -- Appwrite/Models/UsageGaugeList.cs | 40 - Appwrite/Models/User.cs | 49 +- Appwrite/Query.cs | 15 + Appwrite/Services/Account.cs | 147 ++- Appwrite/Services/Activities.cs | 6 +- Appwrite/Services/Advisor.cs | 12 +- Appwrite/Services/Avatars.cs | 24 +- Appwrite/Services/Backups.cs | 51 +- Appwrite/Services/Databases.cs | 221 +++-- Appwrite/Services/Functions.cs | 74 +- Appwrite/Services/Graphql.cs | 6 +- Appwrite/Services/Health.cs | 864 ------------------ Appwrite/Services/Locale.cs | 24 +- Appwrite/Services/Messaging.cs | 290 ++---- Appwrite/Services/Organization.cs | 297 +++++- Appwrite/Services/Presences.cs | 12 +- Appwrite/Services/Project.cs | 375 ++++++-- Appwrite/Services/Proxy.cs | 21 +- Appwrite/Services/Sites.cs | 69 +- Appwrite/Services/Storage.cs | 33 +- Appwrite/Services/TablesDB.cs | 212 +++-- Appwrite/Services/Teams.cs | 33 +- Appwrite/Services/Tokens.cs | 12 +- Appwrite/Services/Usage.cs | 106 --- Appwrite/Services/Users.cs | 126 ++- Appwrite/Services/Webhooks.cs | 15 +- CHANGELOG.md | 19 + README.md | 6 +- docs/examples/account/create.md | 2 +- docs/examples/account/update-password.md | 4 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/backups/create-restoration.md | 3 +- .../functions/get-deployment-download.md | 3 +- .../examples/functions/list-specifications.md | 5 +- docs/examples/health/get-antivirus.md | 14 - docs/examples/health/get-audits-db.md | 14 - docs/examples/health/get-cache.md | 14 - docs/examples/health/get-pub-sub.md | 14 - docs/examples/health/get-queue-databases.md | 16 - docs/examples/health/get-queue-deletes.md | 15 - docs/examples/health/get-queue-functions.md | 15 - docs/examples/health/get-queue-logs.md | 15 - docs/examples/health/get-queue-mails.md | 15 - docs/examples/health/get-queue-messaging.md | 15 - docs/examples/health/get-queue-migrations.md | 15 - .../health/get-queue-stats-resources.md | 15 - docs/examples/health/get-queue-usage.md | 15 - docs/examples/health/get-queue-webhooks.md | 15 - docs/examples/health/get-storage-local.md | 14 - docs/examples/health/get-storage.md | 14 - docs/examples/health/get-time.md | 14 - .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/list-provider-logs.md | 17 - .../messaging/list-subscriber-logs.md | 17 - docs/examples/messaging/list-topic-logs.md | 17 - .../messaging/update-smtp-provider.md | 2 +- .../organization/create-membership.md | 20 + .../delete-membership.md} | 6 +- .../{health/get.md => organization/delete.md} | 4 +- .../get-membership.md} | 6 +- .../{health/get-db.md => organization/get.md} | 4 +- .../list-memberships.md} | 6 +- .../update-membership.md} | 8 +- .../update.md} | 6 +- .../update-deny-corporate-email-policy.md} | 6 +- .../update-membership-privacy-policy.md | 3 +- .../update-o-auth-2-appwrite.md} | 10 +- docs/examples/project/update-o-auth-2-oidc.md | 3 + .../project/update-o-auth-2-server.md | 8 +- docs/examples/project/update-smtp.md | 2 +- docs/examples/sites/list-specifications.md | 5 +- docs/examples/tablesdb/create.md | 3 +- docs/examples/usage/list-events.md | 16 - docs/examples/usage/list-gauges.md | 16 - docs/examples/users/create.md | 2 +- docs/examples/users/update-password.md | 2 +- docs/examples/webhooks/create.md | 2 +- docs/examples/webhooks/update.md | 2 +- 129 files changed, 3485 insertions(+), 2755 deletions(-) create mode 100644 Appwrite/Enums/BillingPlanGroup.cs create mode 100644 Appwrite/Enums/DatabaseStatus.cs delete mode 100644 Appwrite/Enums/HealthAntivirusStatus.cs delete mode 100644 Appwrite/Enums/HealthCheckStatus.cs delete mode 100644 Appwrite/Enums/HealthQueueName.cs create mode 100644 Appwrite/Enums/OAuth2OidcPrompt.cs create mode 100644 Appwrite/Enums/ProjectOAuth2OidcPrompt.cs create mode 100644 Appwrite/Models/AdditionalResource.cs create mode 100644 Appwrite/Models/BillingPlan.cs create mode 100644 Appwrite/Models/BillingPlanAddon.cs create mode 100644 Appwrite/Models/BillingPlanAddonDetails.cs create mode 100644 Appwrite/Models/BillingPlanDedicatedDatabaseLimits.cs create mode 100644 Appwrite/Models/BillingPlanLimits.cs create mode 100644 Appwrite/Models/BillingPlanSupportedAddons.cs delete mode 100644 Appwrite/Models/HealthAntivirus.cs delete mode 100644 Appwrite/Models/HealthCertificate.cs delete mode 100644 Appwrite/Models/HealthQueue.cs delete mode 100644 Appwrite/Models/HealthStatus.cs delete mode 100644 Appwrite/Models/HealthStatusList.cs delete mode 100644 Appwrite/Models/HealthTime.cs create mode 100644 Appwrite/Models/OAuth2Appwrite.cs create mode 100644 Appwrite/Models/Organization.cs create mode 100644 Appwrite/Models/PolicyDenyCorporateEmail.cs create mode 100644 Appwrite/Models/Program.cs create mode 100644 Appwrite/Models/UsageBillingPlan.cs delete mode 100644 Appwrite/Models/UsageEvent.cs delete mode 100644 Appwrite/Models/UsageEventList.cs delete mode 100644 Appwrite/Models/UsageGauge.cs delete mode 100644 Appwrite/Models/UsageGaugeList.cs delete mode 100644 Appwrite/Services/Health.cs delete mode 100644 Appwrite/Services/Usage.cs delete mode 100644 docs/examples/health/get-antivirus.md delete mode 100644 docs/examples/health/get-audits-db.md delete mode 100644 docs/examples/health/get-cache.md delete mode 100644 docs/examples/health/get-pub-sub.md delete mode 100644 docs/examples/health/get-queue-databases.md delete mode 100644 docs/examples/health/get-queue-deletes.md delete mode 100644 docs/examples/health/get-queue-functions.md delete mode 100644 docs/examples/health/get-queue-logs.md delete mode 100644 docs/examples/health/get-queue-mails.md delete mode 100644 docs/examples/health/get-queue-messaging.md delete mode 100644 docs/examples/health/get-queue-migrations.md delete mode 100644 docs/examples/health/get-queue-stats-resources.md delete mode 100644 docs/examples/health/get-queue-usage.md delete mode 100644 docs/examples/health/get-queue-webhooks.md delete mode 100644 docs/examples/health/get-storage-local.md delete mode 100644 docs/examples/health/get-storage.md delete mode 100644 docs/examples/health/get-time.md delete mode 100644 docs/examples/messaging/list-provider-logs.md delete mode 100644 docs/examples/messaging/list-subscriber-logs.md delete mode 100644 docs/examples/messaging/list-topic-logs.md create mode 100644 docs/examples/organization/create-membership.md rename docs/examples/{health/get-queue-builds.md => organization/delete-membership.md} (70%) rename docs/examples/{health/get.md => organization/delete.md} (78%) rename docs/examples/{health/get-queue-certificates.md => organization/get-membership.md} (67%) rename docs/examples/{health/get-db.md => organization/get.md} (74%) rename docs/examples/{messaging/list-message-logs.md => organization/list-memberships.md} (71%) rename docs/examples/{health/get-console-pausing.md => organization/update-membership.md} (62%) rename docs/examples/{health/get-certificate.md => organization/update.md} (71%) rename docs/examples/{health/get-queue-audits.md => project/update-deny-corporate-email-policy.md} (71%) rename docs/examples/{health/get-failed-jobs.md => project/update-o-auth-2-appwrite.md} (57%) delete mode 100644 docs/examples/usage/list-events.md delete mode 100644 docs/examples/usage/list-gauges.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 08124b8f..51965b44 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 5.1.0 + 6.0.0 Appwrite Team Appwrite Team @@ -20,7 +20,7 @@ - + diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 753520b7..d65c3b68 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -76,11 +76,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/5.1.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/6.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "5.1.0"}, + { "x-sdk-version", "6.0.0"}, { "X-Appwrite-Response-Format", "1.9.5" } }; @@ -139,6 +139,14 @@ public Client SetJWT(string value) { return this; } + /// The OAuth access token to authenticate with + public Client SetBearer(string value) { + _config["bearer"] = value; + AddHeader("Authorization", value); + + return this; + } + public Client SetLocale(string value) { _config["locale"] = value; AddHeader("X-Appwrite-Locale", value); @@ -178,7 +186,7 @@ public Client SetCookie(string value) { return this; } - /// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + /// Impersonate a user by ID public Client SetImpersonateUserId(string value) { _config["impersonateUserId"] = value; AddHeader("X-Appwrite-Impersonate-User-Id", value); @@ -186,7 +194,7 @@ public Client SetImpersonateUserId(string value) { return this; } - /// Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + /// Impersonate a user by email public Client SetImpersonateUserEmail(string value) { _config["impersonateUserEmail"] = value; AddHeader("X-Appwrite-Impersonate-User-Email", value); @@ -194,7 +202,7 @@ public Client SetImpersonateUserEmail(string value) { return this; } - /// Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + /// Impersonate a user by phone public Client SetImpersonateUserPhone(string value) { _config["impersonateUserPhone"] = value; AddHeader("X-Appwrite-Impersonate-User-Phone", value); diff --git a/Appwrite/Enums/BillingPlanGroup.cs b/Appwrite/Enums/BillingPlanGroup.cs new file mode 100644 index 00000000..9340d570 --- /dev/null +++ b/Appwrite/Enums/BillingPlanGroup.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class BillingPlanGroup : IEnum + { + public string Value { get; private set; } + + public BillingPlanGroup(string value) + { + Value = value; + } + + public static BillingPlanGroup Starter => new BillingPlanGroup("starter"); + public static BillingPlanGroup Pro => new BillingPlanGroup("pro"); + public static BillingPlanGroup Scale => new BillingPlanGroup("scale"); + } +} diff --git a/Appwrite/Enums/DatabaseStatus.cs b/Appwrite/Enums/DatabaseStatus.cs new file mode 100644 index 00000000..cd8892d2 --- /dev/null +++ b/Appwrite/Enums/DatabaseStatus.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class DatabaseStatus : IEnum + { + public string Value { get; private set; } + + public DatabaseStatus(string value) + { + Value = value; + } + + public static DatabaseStatus Provisioning => new DatabaseStatus("provisioning"); + public static DatabaseStatus Ready => new DatabaseStatus("ready"); + public static DatabaseStatus Failed => new DatabaseStatus("failed"); + } +} diff --git a/Appwrite/Enums/HealthAntivirusStatus.cs b/Appwrite/Enums/HealthAntivirusStatus.cs deleted file mode 100644 index 19b947f0..00000000 --- a/Appwrite/Enums/HealthAntivirusStatus.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class HealthAntivirusStatus : IEnum - { - public string Value { get; private set; } - - public HealthAntivirusStatus(string value) - { - Value = value; - } - - public static HealthAntivirusStatus Disabled => new HealthAntivirusStatus("disabled"); - public static HealthAntivirusStatus Offline => new HealthAntivirusStatus("offline"); - public static HealthAntivirusStatus Online => new HealthAntivirusStatus("online"); - } -} diff --git a/Appwrite/Enums/HealthCheckStatus.cs b/Appwrite/Enums/HealthCheckStatus.cs deleted file mode 100644 index 881245e2..00000000 --- a/Appwrite/Enums/HealthCheckStatus.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class HealthCheckStatus : IEnum - { - public string Value { get; private set; } - - public HealthCheckStatus(string value) - { - Value = value; - } - - public static HealthCheckStatus Pass => new HealthCheckStatus("pass"); - public static HealthCheckStatus Fail => new HealthCheckStatus("fail"); - } -} diff --git a/Appwrite/Enums/HealthQueueName.cs b/Appwrite/Enums/HealthQueueName.cs deleted file mode 100644 index 92110acb..00000000 --- a/Appwrite/Enums/HealthQueueName.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class HealthQueueName : IEnum - { - public string Value { get; private set; } - - public HealthQueueName(string value) - { - Value = value; - } - - public static HealthQueueName V1Database => new HealthQueueName("v1-database"); - public static HealthQueueName V1Deletes => new HealthQueueName("v1-deletes"); - public static HealthQueueName V1Audits => new HealthQueueName("v1-audits"); - public static HealthQueueName V1Mails => new HealthQueueName("v1-mails"); - public static HealthQueueName V1Functions => new HealthQueueName("v1-functions"); - public static HealthQueueName V1StatsResources => new HealthQueueName("v1-stats-resources"); - public static HealthQueueName V1StatsUsage => new HealthQueueName("v1-stats-usage"); - public static HealthQueueName V1Webhooks => new HealthQueueName("v1-webhooks"); - public static HealthQueueName V1Certificates => new HealthQueueName("v1-certificates"); - public static HealthQueueName V1Builds => new HealthQueueName("v1-builds"); - public static HealthQueueName V1Screenshots => new HealthQueueName("v1-screenshots"); - public static HealthQueueName V1Messaging => new HealthQueueName("v1-messaging"); - public static HealthQueueName V1Migrations => new HealthQueueName("v1-migrations"); - } -} diff --git a/Appwrite/Enums/OAuth2OidcPrompt.cs b/Appwrite/Enums/OAuth2OidcPrompt.cs new file mode 100644 index 00000000..f98ba312 --- /dev/null +++ b/Appwrite/Enums/OAuth2OidcPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class OAuth2OidcPrompt : IEnum + { + public string Value { get; private set; } + + public OAuth2OidcPrompt(string value) + { + Value = value; + } + + public static OAuth2OidcPrompt None => new OAuth2OidcPrompt("none"); + public static OAuth2OidcPrompt Login => new OAuth2OidcPrompt("login"); + public static OAuth2OidcPrompt Consent => new OAuth2OidcPrompt("consent"); + public static OAuth2OidcPrompt SelectAccount => new OAuth2OidcPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/OAuthProvider.cs b/Appwrite/Enums/OAuthProvider.cs index 4e0756aa..7fb67664 100644 --- a/Appwrite/Enums/OAuthProvider.cs +++ b/Appwrite/Enums/OAuthProvider.cs @@ -13,6 +13,7 @@ public OAuthProvider(string value) public static OAuthProvider Amazon => new OAuthProvider("amazon"); public static OAuthProvider Apple => new OAuthProvider("apple"); + public static OAuthProvider Appwrite => new OAuthProvider("appwrite"); public static OAuthProvider Auth0 => new OAuthProvider("auth0"); public static OAuthProvider Authentik => new OAuthProvider("authentik"); public static OAuthProvider Autodesk => new OAuthProvider("autodesk"); diff --git a/Appwrite/Enums/OrganizationKeyScopes.cs b/Appwrite/Enums/OrganizationKeyScopes.cs index 8785aa5a..8802f0fa 100644 --- a/Appwrite/Enums/OrganizationKeyScopes.cs +++ b/Appwrite/Enums/OrganizationKeyScopes.cs @@ -17,6 +17,10 @@ public OrganizationKeyScopes(string value) public static OrganizationKeyScopes DevKeysWrite => new OrganizationKeyScopes("devKeys.write"); public static OrganizationKeyScopes OrganizationKeysRead => new OrganizationKeyScopes("organization.keys.read"); public static OrganizationKeyScopes OrganizationKeysWrite => new OrganizationKeyScopes("organization.keys.write"); + public static OrganizationKeyScopes OrganizationMembershipsRead => new OrganizationKeyScopes("organization.memberships.read"); + public static OrganizationKeyScopes OrganizationMembershipsWrite => new OrganizationKeyScopes("organization.memberships.write"); + public static OrganizationKeyScopes OrganizationRead => new OrganizationKeyScopes("organization.read"); + public static OrganizationKeyScopes OrganizationWrite => new OrganizationKeyScopes("organization.write"); public static OrganizationKeyScopes DomainsRead => new OrganizationKeyScopes("domains.read"); public static OrganizationKeyScopes DomainsWrite => new OrganizationKeyScopes("domains.write"); public static OrganizationKeyScopes KeysRead => new OrganizationKeyScopes("keys.read"); diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index 219422bc..9ccbd816 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -23,10 +23,12 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes PoliciesWrite => new ProjectKeyScopes("policies.write"); public static ProjectKeyScopes ProjectPoliciesRead => new ProjectKeyScopes("project.policies.read"); public static ProjectKeyScopes ProjectPoliciesWrite => new ProjectKeyScopes("project.policies.write"); + public static ProjectKeyScopes ProjectOauth2Read => new ProjectKeyScopes("project.oauth2.read"); + public static ProjectKeyScopes ProjectOauth2Write => new ProjectKeyScopes("project.oauth2.write"); public static ProjectKeyScopes TemplatesRead => new ProjectKeyScopes("templates.read"); public static ProjectKeyScopes TemplatesWrite => new ProjectKeyScopes("templates.write"); - public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); - public static ProjectKeyScopes Oauth2Write => new ProjectKeyScopes("oauth2.write"); + public static ProjectKeyScopes StagesRead => new ProjectKeyScopes("stages.read"); + public static ProjectKeyScopes StagesWrite => new ProjectKeyScopes("stages.write"); public static ProjectKeyScopes UsersRead => new ProjectKeyScopes("users.read"); public static ProjectKeyScopes UsersWrite => new ProjectKeyScopes("users.write"); public static ProjectKeyScopes SessionsRead => new ProjectKeyScopes("sessions.read"); @@ -101,11 +103,14 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ArchivesWrite => new ProjectKeyScopes("archives.write"); public static ProjectKeyScopes RestorationsRead => new ProjectKeyScopes("restorations.read"); public static ProjectKeyScopes RestorationsWrite => new ProjectKeyScopes("restorations.write"); + public static ProjectKeyScopes DedicatedDatabasesExecute => new ProjectKeyScopes("dedicatedDatabases.execute"); public static ProjectKeyScopes DomainsRead => new ProjectKeyScopes("domains.read"); public static ProjectKeyScopes DomainsWrite => new ProjectKeyScopes("domains.write"); public static ProjectKeyScopes EventsRead => new ProjectKeyScopes("events.read"); public static ProjectKeyScopes AppsRead => new ProjectKeyScopes("apps.read"); public static ProjectKeyScopes AppsWrite => new ProjectKeyScopes("apps.write"); + public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); + public static ProjectKeyScopes Oauth2Write => new ProjectKeyScopes("oauth2.write"); public static ProjectKeyScopes UsageRead => new ProjectKeyScopes("usage.read"); } } diff --git a/Appwrite/Enums/ProjectOAuth2OidcPrompt.cs b/Appwrite/Enums/ProjectOAuth2OidcPrompt.cs new file mode 100644 index 00000000..c24d8341 --- /dev/null +++ b/Appwrite/Enums/ProjectOAuth2OidcPrompt.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class ProjectOAuth2OidcPrompt : IEnum + { + public string Value { get; private set; } + + public ProjectOAuth2OidcPrompt(string value) + { + Value = value; + } + + public static ProjectOAuth2OidcPrompt None => new ProjectOAuth2OidcPrompt("none"); + public static ProjectOAuth2OidcPrompt Login => new ProjectOAuth2OidcPrompt("login"); + public static ProjectOAuth2OidcPrompt Consent => new ProjectOAuth2OidcPrompt("consent"); + public static ProjectOAuth2OidcPrompt SelectAccount => new ProjectOAuth2OidcPrompt("select_account"); + } +} diff --git a/Appwrite/Enums/ProjectOAuthProviderId.cs b/Appwrite/Enums/ProjectOAuthProviderId.cs index 5194d3b4..83c2af26 100644 --- a/Appwrite/Enums/ProjectOAuthProviderId.cs +++ b/Appwrite/Enums/ProjectOAuthProviderId.cs @@ -13,6 +13,7 @@ public ProjectOAuthProviderId(string value) public static ProjectOAuthProviderId Amazon => new ProjectOAuthProviderId("amazon"); public static ProjectOAuthProviderId Apple => new ProjectOAuthProviderId("apple"); + public static ProjectOAuthProviderId Appwrite => new ProjectOAuthProviderId("appwrite"); public static ProjectOAuthProviderId Auth0 => new ProjectOAuthProviderId("auth0"); public static ProjectOAuthProviderId Authentik => new ProjectOAuthProviderId("authentik"); public static ProjectOAuthProviderId Autodesk => new ProjectOAuthProviderId("autodesk"); diff --git a/Appwrite/Enums/ProjectPolicyId.cs b/Appwrite/Enums/ProjectPolicyId.cs index 39f655e9..af6c3509 100644 --- a/Appwrite/Enums/ProjectPolicyId.cs +++ b/Appwrite/Enums/ProjectPolicyId.cs @@ -24,5 +24,6 @@ public ProjectPolicyId(string value) public static ProjectPolicyId DenyAliasedEmail => new ProjectPolicyId("deny-aliased-email"); public static ProjectPolicyId DenyDisposableEmail => new ProjectPolicyId("deny-disposable-email"); public static ProjectPolicyId DenyFreeEmail => new ProjectPolicyId("deny-free-email"); + public static ProjectPolicyId DenyCorporateEmail => new ProjectPolicyId("deny-corporate-email"); } } diff --git a/Appwrite/Enums/ProjectServiceId.cs b/Appwrite/Enums/ProjectServiceId.cs index 6ab7b943..dd139a80 100644 --- a/Appwrite/Enums/ProjectServiceId.cs +++ b/Appwrite/Enums/ProjectServiceId.cs @@ -29,5 +29,6 @@ public ProjectServiceId(string value) public static ProjectServiceId Migrations => new ProjectServiceId("migrations"); public static ProjectServiceId Messaging => new ProjectServiceId("messaging"); public static ProjectServiceId Advisor => new ProjectServiceId("advisor"); + public static ProjectServiceId Oauth2 => new ProjectServiceId("oauth2"); } } diff --git a/Appwrite/Models/ActivityEvent.cs b/Appwrite/Models/ActivityEvent.cs index dcd88607..e0864a01 100644 --- a/Appwrite/Models/ActivityEvent.cs +++ b/Appwrite/Models/ActivityEvent.cs @@ -65,48 +65,6 @@ public class ActivityEvent [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 actorType, @@ -125,21 +83,7 @@ public ActivityEvent( 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 + string hostname ) { Id = id; @@ -160,20 +104,6 @@ string countryName 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( @@ -194,21 +124,7 @@ string countryName 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() + hostname: map["hostname"].ToString() ); public Dictionary ToMap() => new Dictionary() @@ -230,21 +146,7 @@ string countryName { "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 } + { "hostname", Hostname } }; } } diff --git a/Appwrite/Models/AdditionalResource.cs b/Appwrite/Models/AdditionalResource.cs new file mode 100644 index 00000000..2034f21f --- /dev/null +++ b/Appwrite/Models/AdditionalResource.cs @@ -0,0 +1,68 @@ + +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 AdditionalResource + { + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("unit")] + public string Unit { get; private set; } + + [JsonPropertyName("currency")] + public string Currency { get; private set; } + + [JsonPropertyName("price")] + public double Price { get; private set; } + + [JsonPropertyName("value")] + public long Value { get; private set; } + + [JsonPropertyName("invoiceDesc")] + public string InvoiceDesc { get; private set; } + + public AdditionalResource( + string name, + string unit, + string currency, + double price, + long @value, + string invoiceDesc + ) + { + Name = name; + Unit = unit; + Currency = currency; + Price = price; + Value = @value; + InvoiceDesc = invoiceDesc; + } + + public static AdditionalResource From(Dictionary map) => new AdditionalResource( + name: map["name"].ToString(), + unit: map["unit"].ToString(), + currency: map["currency"].ToString(), + price: Convert.ToDouble(map["price"]), + @value: Convert.ToInt64(map["value"]), + invoiceDesc: map["invoiceDesc"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "name", Name }, + { "unit", Unit }, + { "currency", Currency }, + { "price", Price }, + { "value", Value }, + { "invoiceDesc", InvoiceDesc } + }; + } +} diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs index 1c6cb2fc..8180fa75 100644 --- a/Appwrite/Models/AttributeLine.cs +++ b/Appwrite/Models/AttributeLine.cs @@ -36,7 +36,7 @@ public class AttributeLine public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List>? Default { get; private set; } public AttributeLine( string key, @@ -47,7 +47,7 @@ public AttributeLine( bool? array, string createdAt, string updatedAt, - List? @default + List>? @default ) { Key = key; @@ -73,7 +73,7 @@ public AttributeLine( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList>() : null ); diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs index b8b70a96..80256bd2 100644 --- a/Appwrite/Models/AttributePoint.cs +++ b/Appwrite/Models/AttributePoint.cs @@ -36,7 +36,7 @@ public class AttributePoint public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List? Default { get; private set; } public AttributePoint( string key, @@ -47,7 +47,7 @@ public AttributePoint( bool? array, string createdAt, string updatedAt, - List? @default + List? @default ) { Key = key; @@ -73,7 +73,7 @@ public AttributePoint( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList() : null ); diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs index 668ef205..4934c95e 100644 --- a/Appwrite/Models/AttributePolygon.cs +++ b/Appwrite/Models/AttributePolygon.cs @@ -36,7 +36,7 @@ public class AttributePolygon public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List>>? Default { get; private set; } public AttributePolygon( string key, @@ -47,7 +47,7 @@ public AttributePolygon( bool? array, string createdAt, string updatedAt, - List? @default + List>>? @default ) { Key = key; @@ -73,7 +73,7 @@ public AttributePolygon( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList>>() : null ); diff --git a/Appwrite/Models/BackupPolicy.cs b/Appwrite/Models/BackupPolicy.cs index a53bbdf1..c33b80f6 100644 --- a/Appwrite/Models/BackupPolicy.cs +++ b/Appwrite/Models/BackupPolicy.cs @@ -41,6 +41,9 @@ public class BackupPolicy [JsonPropertyName("schedule")] public string Schedule { get; private set; } + [JsonPropertyName("type")] + public string Type { get; private set; } + [JsonPropertyName("enabled")] public bool Enabled { get; private set; } @@ -55,6 +58,7 @@ public BackupPolicy( string? resourceType, long retention, string schedule, + string type, bool enabled ) { @@ -68,6 +72,7 @@ bool enabled ResourceType = resourceType; Retention = retention; Schedule = schedule; + Type = type; Enabled = enabled; } @@ -82,6 +87,7 @@ bool enabled resourceType: map.TryGetValue("resourceType", out var resourceType) ? resourceType?.ToString() : null, retention: Convert.ToInt64(map["retention"]), schedule: map["schedule"].ToString(), + type: map["type"].ToString(), enabled: (bool)map["enabled"] ); @@ -97,6 +103,7 @@ bool enabled { "resourceType", ResourceType }, { "retention", Retention }, { "schedule", Schedule }, + { "type", Type }, { "enabled", Enabled } }; } diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs new file mode 100644 index 00000000..0c05ee92 --- /dev/null +++ b/Appwrite/Models/BillingPlan.cs @@ -0,0 +1,510 @@ + +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 BillingPlan + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("desc")] + public string Desc { get; private set; } + + [JsonPropertyName("order")] + public long Order { get; private set; } + + [JsonPropertyName("price")] + public double Price { get; private set; } + + [JsonPropertyName("trial")] + public long Trial { get; private set; } + + [JsonPropertyName("bandwidth")] + public long Bandwidth { get; private set; } + + [JsonPropertyName("storage")] + public long Storage { get; private set; } + + [JsonPropertyName("imageTransformations")] + public long ImageTransformations { get; private set; } + + [JsonPropertyName("screenshotsGenerated")] + public long ScreenshotsGenerated { get; private set; } + + [JsonPropertyName("members")] + public long Members { get; private set; } + + [JsonPropertyName("webhooks")] + public long Webhooks { get; private set; } + + [JsonPropertyName("projects")] + public long Projects { get; private set; } + + [JsonPropertyName("platforms")] + public long Platforms { get; private set; } + + [JsonPropertyName("users")] + public long Users { get; private set; } + + [JsonPropertyName("teams")] + public long Teams { get; private set; } + + [JsonPropertyName("databases")] + public long Databases { get; private set; } + + [JsonPropertyName("databasesReads")] + public long DatabasesReads { get; private set; } + + [JsonPropertyName("databasesWrites")] + public long DatabasesWrites { get; private set; } + + [JsonPropertyName("databasesBatchSize")] + public long DatabasesBatchSize { get; private set; } + + [JsonPropertyName("buckets")] + public long Buckets { get; private set; } + + [JsonPropertyName("fileSize")] + public long FileSize { get; private set; } + + [JsonPropertyName("functions")] + public long Functions { get; private set; } + + [JsonPropertyName("sites")] + public long Sites { get; private set; } + + [JsonPropertyName("executions")] + public long Executions { get; private set; } + + [JsonPropertyName("executionsRetentionCount")] + public long ExecutionsRetentionCount { get; private set; } + + [JsonPropertyName("GBHours")] + public long GBHours { get; private set; } + + [JsonPropertyName("realtime")] + public long Realtime { get; private set; } + + [JsonPropertyName("realtimeMessages")] + public long RealtimeMessages { get; private set; } + + [JsonPropertyName("messages")] + public long Messages { get; private set; } + + [JsonPropertyName("topics")] + public long Topics { get; private set; } + + [JsonPropertyName("authPhone")] + public long AuthPhone { get; private set; } + + [JsonPropertyName("domains")] + public long Domains { get; private set; } + + [JsonPropertyName("activityLogs")] + public long ActivityLogs { get; private set; } + + [JsonPropertyName("usageLogs")] + public long UsageLogs { get; private set; } + + [JsonPropertyName("usageLogsIntervals")] + public List? UsageLogsIntervals { get; private set; } + + [JsonPropertyName("projectInactivityDays")] + public long ProjectInactivityDays { get; private set; } + + [JsonPropertyName("alertLimit")] + public long AlertLimit { get; private set; } + + [JsonPropertyName("usage")] + public UsageBillingPlan Usage { get; private set; } + + [JsonPropertyName("addons")] + public BillingPlanAddon Addons { get; private set; } + + [JsonPropertyName("budgetCapEnabled")] + public bool BudgetCapEnabled { get; private set; } + + [JsonPropertyName("customSmtp")] + public bool CustomSmtp { get; private set; } + + [JsonPropertyName("emailBranding")] + public bool EmailBranding { get; private set; } + + [JsonPropertyName("requiresPaymentMethod")] + public bool RequiresPaymentMethod { get; private set; } + + [JsonPropertyName("requiresBillingAddress")] + public bool RequiresBillingAddress { get; private set; } + + [JsonPropertyName("isAvailable")] + public bool IsAvailable { get; private set; } + + [JsonPropertyName("selfService")] + public bool SelfService { get; private set; } + + [JsonPropertyName("premiumSupport")] + public bool PremiumSupport { get; private set; } + + [JsonPropertyName("budgeting")] + public bool Budgeting { get; private set; } + + [JsonPropertyName("supportsMockNumbers")] + public bool SupportsMockNumbers { get; private set; } + + [JsonPropertyName("supportsOrganizationRoles")] + public bool SupportsOrganizationRoles { get; private set; } + + [JsonPropertyName("supportsCredits")] + public bool SupportsCredits { get; private set; } + + [JsonPropertyName("supportsDisposableEmailValidation")] + public bool SupportsDisposableEmailValidation { get; private set; } + + [JsonPropertyName("supportsCanonicalEmailValidation")] + public bool SupportsCanonicalEmailValidation { get; private set; } + + [JsonPropertyName("supportsFreeEmailValidation")] + public bool SupportsFreeEmailValidation { get; private set; } + + [JsonPropertyName("supportsCorporateEmailValidation")] + public bool SupportsCorporateEmailValidation { get; private set; } + + [JsonPropertyName("supportsProjectSpecificRoles")] + public bool SupportsProjectSpecificRoles { get; private set; } + + [JsonPropertyName("backupsEnabled")] + public bool BackupsEnabled { get; private set; } + + [JsonPropertyName("usagePerProject")] + public bool UsagePerProject { get; private set; } + + [JsonPropertyName("supportedAddons")] + public BillingPlanSupportedAddons SupportedAddons { get; private set; } + + [JsonPropertyName("backupPolicies")] + public long BackupPolicies { get; private set; } + + [JsonPropertyName("deploymentSize")] + public long DeploymentSize { get; private set; } + + [JsonPropertyName("buildSize")] + public long BuildSize { get; private set; } + + [JsonPropertyName("databasesAllowEncrypt")] + public bool DatabasesAllowEncrypt { get; private set; } + + [JsonPropertyName("limits")] + public BillingPlanLimits? Limits { get; private set; } + + [JsonPropertyName("group")] + public BillingPlanGroup Group { get; private set; } + + [JsonPropertyName("program")] + public Program? Program { get; private set; } + + [JsonPropertyName("dedicatedDatabases")] + public BillingPlanDedicatedDatabaseLimits? DedicatedDatabases { get; private set; } + + public BillingPlan( + string id, + string name, + string desc, + long order, + double price, + long trial, + long bandwidth, + long storage, + long imageTransformations, + long screenshotsGenerated, + long members, + long webhooks, + long projects, + long platforms, + long users, + long teams, + long databases, + long databasesReads, + long databasesWrites, + long databasesBatchSize, + long buckets, + long fileSize, + long functions, + long sites, + long executions, + long executionsRetentionCount, + long gBHours, + long realtime, + long realtimeMessages, + long messages, + long topics, + long authPhone, + long domains, + long activityLogs, + long usageLogs, + List? usageLogsIntervals, + long projectInactivityDays, + long alertLimit, + UsageBillingPlan usage, + BillingPlanAddon addons, + bool budgetCapEnabled, + bool customSmtp, + bool emailBranding, + bool requiresPaymentMethod, + bool requiresBillingAddress, + bool isAvailable, + bool selfService, + bool premiumSupport, + bool budgeting, + bool supportsMockNumbers, + bool supportsOrganizationRoles, + bool supportsCredits, + bool supportsDisposableEmailValidation, + bool supportsCanonicalEmailValidation, + bool supportsFreeEmailValidation, + bool supportsCorporateEmailValidation, + bool supportsProjectSpecificRoles, + bool backupsEnabled, + bool usagePerProject, + BillingPlanSupportedAddons supportedAddons, + long backupPolicies, + long deploymentSize, + long buildSize, + bool databasesAllowEncrypt, + BillingPlanLimits? limits, + BillingPlanGroup @group, + Program? program, + BillingPlanDedicatedDatabaseLimits? dedicatedDatabases + ) + { + Id = id; + Name = name; + Desc = desc; + Order = order; + Price = price; + Trial = trial; + Bandwidth = bandwidth; + Storage = storage; + ImageTransformations = imageTransformations; + ScreenshotsGenerated = screenshotsGenerated; + Members = members; + Webhooks = webhooks; + Projects = projects; + Platforms = platforms; + Users = users; + Teams = teams; + Databases = databases; + DatabasesReads = databasesReads; + DatabasesWrites = databasesWrites; + DatabasesBatchSize = databasesBatchSize; + Buckets = buckets; + FileSize = fileSize; + Functions = functions; + Sites = sites; + Executions = executions; + ExecutionsRetentionCount = executionsRetentionCount; + GBHours = gBHours; + Realtime = realtime; + RealtimeMessages = realtimeMessages; + Messages = messages; + Topics = topics; + AuthPhone = authPhone; + Domains = domains; + ActivityLogs = activityLogs; + UsageLogs = usageLogs; + UsageLogsIntervals = usageLogsIntervals; + ProjectInactivityDays = projectInactivityDays; + AlertLimit = alertLimit; + Usage = usage; + Addons = addons; + BudgetCapEnabled = budgetCapEnabled; + CustomSmtp = customSmtp; + EmailBranding = emailBranding; + RequiresPaymentMethod = requiresPaymentMethod; + RequiresBillingAddress = requiresBillingAddress; + IsAvailable = isAvailable; + SelfService = selfService; + PremiumSupport = premiumSupport; + Budgeting = budgeting; + SupportsMockNumbers = supportsMockNumbers; + SupportsOrganizationRoles = supportsOrganizationRoles; + SupportsCredits = supportsCredits; + SupportsDisposableEmailValidation = supportsDisposableEmailValidation; + SupportsCanonicalEmailValidation = supportsCanonicalEmailValidation; + SupportsFreeEmailValidation = supportsFreeEmailValidation; + SupportsCorporateEmailValidation = supportsCorporateEmailValidation; + SupportsProjectSpecificRoles = supportsProjectSpecificRoles; + BackupsEnabled = backupsEnabled; + UsagePerProject = usagePerProject; + SupportedAddons = supportedAddons; + BackupPolicies = backupPolicies; + DeploymentSize = deploymentSize; + BuildSize = buildSize; + DatabasesAllowEncrypt = databasesAllowEncrypt; + Limits = limits; + Group = @group; + Program = program; + DedicatedDatabases = dedicatedDatabases; + } + + public static BillingPlan From(Dictionary map) => new BillingPlan( + id: map["$id"].ToString(), + name: map["name"].ToString(), + desc: map["desc"].ToString(), + order: Convert.ToInt64(map["order"]), + price: Convert.ToDouble(map["price"]), + trial: Convert.ToInt64(map["trial"]), + bandwidth: Convert.ToInt64(map["bandwidth"]), + storage: Convert.ToInt64(map["storage"]), + imageTransformations: Convert.ToInt64(map["imageTransformations"]), + screenshotsGenerated: Convert.ToInt64(map["screenshotsGenerated"]), + members: Convert.ToInt64(map["members"]), + webhooks: Convert.ToInt64(map["webhooks"]), + projects: Convert.ToInt64(map["projects"]), + platforms: Convert.ToInt64(map["platforms"]), + users: Convert.ToInt64(map["users"]), + teams: Convert.ToInt64(map["teams"]), + databases: Convert.ToInt64(map["databases"]), + databasesReads: Convert.ToInt64(map["databasesReads"]), + databasesWrites: Convert.ToInt64(map["databasesWrites"]), + databasesBatchSize: Convert.ToInt64(map["databasesBatchSize"]), + buckets: Convert.ToInt64(map["buckets"]), + fileSize: Convert.ToInt64(map["fileSize"]), + functions: Convert.ToInt64(map["functions"]), + sites: Convert.ToInt64(map["sites"]), + executions: Convert.ToInt64(map["executions"]), + executionsRetentionCount: Convert.ToInt64(map["executionsRetentionCount"]), + gBHours: Convert.ToInt64(map["GBHours"]), + realtime: Convert.ToInt64(map["realtime"]), + realtimeMessages: Convert.ToInt64(map["realtimeMessages"]), + messages: Convert.ToInt64(map["messages"]), + topics: Convert.ToInt64(map["topics"]), + authPhone: Convert.ToInt64(map["authPhone"]), + domains: Convert.ToInt64(map["domains"]), + activityLogs: Convert.ToInt64(map["activityLogs"]), + usageLogs: Convert.ToInt64(map["usageLogs"]), + usageLogsIntervals: map.TryGetValue("usageLogsIntervals", out var arrayRaw36) && arrayRaw36 != null + ? arrayRaw36.ConvertToList() + : null, + projectInactivityDays: Convert.ToInt64(map["projectInactivityDays"]), + alertLimit: Convert.ToInt64(map["alertLimit"]), + usage: Appwrite.Models.UsageBillingPlan.From(map: map["usage"] is JsonElement jsonObj39 ? jsonObj39.Deserialize>()! : (Dictionary)map["usage"]), + addons: Appwrite.Models.BillingPlanAddon.From(map: map["addons"] is JsonElement jsonObj40 ? jsonObj40.Deserialize>()! : (Dictionary)map["addons"]), + budgetCapEnabled: (bool)map["budgetCapEnabled"], + customSmtp: (bool)map["customSmtp"], + emailBranding: (bool)map["emailBranding"], + requiresPaymentMethod: (bool)map["requiresPaymentMethod"], + requiresBillingAddress: (bool)map["requiresBillingAddress"], + isAvailable: (bool)map["isAvailable"], + selfService: (bool)map["selfService"], + premiumSupport: (bool)map["premiumSupport"], + budgeting: (bool)map["budgeting"], + supportsMockNumbers: (bool)map["supportsMockNumbers"], + supportsOrganizationRoles: (bool)map["supportsOrganizationRoles"], + supportsCredits: (bool)map["supportsCredits"], + supportsDisposableEmailValidation: (bool)map["supportsDisposableEmailValidation"], + supportsCanonicalEmailValidation: (bool)map["supportsCanonicalEmailValidation"], + supportsFreeEmailValidation: (bool)map["supportsFreeEmailValidation"], + supportsCorporateEmailValidation: (bool)map["supportsCorporateEmailValidation"], + supportsProjectSpecificRoles: (bool)map["supportsProjectSpecificRoles"], + backupsEnabled: (bool)map["backupsEnabled"], + usagePerProject: (bool)map["usagePerProject"], + supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj60 ? jsonObj60.Deserialize>()! : (Dictionary)map["supportedAddons"]), + backupPolicies: Convert.ToInt64(map["backupPolicies"]), + deploymentSize: Convert.ToInt64(map["deploymentSize"]), + buildSize: Convert.ToInt64(map["buildSize"]), + databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], + limits: map.TryGetValue("limits", out var objectRaw65) && objectRaw65 != null + ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw65 is JsonElement jsonObj65 ? jsonObj65.Deserialize>()! : (Dictionary)objectRaw65) + : null, + @group: new BillingPlanGroup(map["group"].ToString()!), + program: map.TryGetValue("program", out var objectRaw67) && objectRaw67 != null + ? Appwrite.Models.Program.From(map: objectRaw67 is JsonElement jsonObj67 ? jsonObj67.Deserialize>()! : (Dictionary)objectRaw67) + : null, + dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw68) && objectRaw68 != null + ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) + : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "name", Name }, + { "desc", Desc }, + { "order", Order }, + { "price", Price }, + { "trial", Trial }, + { "bandwidth", Bandwidth }, + { "storage", Storage }, + { "imageTransformations", ImageTransformations }, + { "screenshotsGenerated", ScreenshotsGenerated }, + { "members", Members }, + { "webhooks", Webhooks }, + { "projects", Projects }, + { "platforms", Platforms }, + { "users", Users }, + { "teams", Teams }, + { "databases", Databases }, + { "databasesReads", DatabasesReads }, + { "databasesWrites", DatabasesWrites }, + { "databasesBatchSize", DatabasesBatchSize }, + { "buckets", Buckets }, + { "fileSize", FileSize }, + { "functions", Functions }, + { "sites", Sites }, + { "executions", Executions }, + { "executionsRetentionCount", ExecutionsRetentionCount }, + { "GBHours", GBHours }, + { "realtime", Realtime }, + { "realtimeMessages", RealtimeMessages }, + { "messages", Messages }, + { "topics", Topics }, + { "authPhone", AuthPhone }, + { "domains", Domains }, + { "activityLogs", ActivityLogs }, + { "usageLogs", UsageLogs }, + { "usageLogsIntervals", UsageLogsIntervals }, + { "projectInactivityDays", ProjectInactivityDays }, + { "alertLimit", AlertLimit }, + { "usage", Usage?.ToMap() }, + { "addons", Addons?.ToMap() }, + { "budgetCapEnabled", BudgetCapEnabled }, + { "customSmtp", CustomSmtp }, + { "emailBranding", EmailBranding }, + { "requiresPaymentMethod", RequiresPaymentMethod }, + { "requiresBillingAddress", RequiresBillingAddress }, + { "isAvailable", IsAvailable }, + { "selfService", SelfService }, + { "premiumSupport", PremiumSupport }, + { "budgeting", Budgeting }, + { "supportsMockNumbers", SupportsMockNumbers }, + { "supportsOrganizationRoles", SupportsOrganizationRoles }, + { "supportsCredits", SupportsCredits }, + { "supportsDisposableEmailValidation", SupportsDisposableEmailValidation }, + { "supportsCanonicalEmailValidation", SupportsCanonicalEmailValidation }, + { "supportsFreeEmailValidation", SupportsFreeEmailValidation }, + { "supportsCorporateEmailValidation", SupportsCorporateEmailValidation }, + { "supportsProjectSpecificRoles", SupportsProjectSpecificRoles }, + { "backupsEnabled", BackupsEnabled }, + { "usagePerProject", UsagePerProject }, + { "supportedAddons", SupportedAddons?.ToMap() }, + { "backupPolicies", BackupPolicies }, + { "deploymentSize", DeploymentSize }, + { "buildSize", BuildSize }, + { "databasesAllowEncrypt", DatabasesAllowEncrypt }, + { "limits", Limits?.ToMap() }, + { "group", Group.Value }, + { "program", Program?.ToMap() }, + { "dedicatedDatabases", DedicatedDatabases?.ToMap() } + }; + } +} diff --git a/Appwrite/Models/BillingPlanAddon.cs b/Appwrite/Models/BillingPlanAddon.cs new file mode 100644 index 00000000..7871d6c3 --- /dev/null +++ b/Appwrite/Models/BillingPlanAddon.cs @@ -0,0 +1,40 @@ + +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 BillingPlanAddon + { + [JsonPropertyName("seats")] + public BillingPlanAddonDetails Seats { get; private set; } + + [JsonPropertyName("projects")] + public BillingPlanAddonDetails Projects { get; private set; } + + public BillingPlanAddon( + BillingPlanAddonDetails seats, + BillingPlanAddonDetails projects + ) + { + Seats = seats; + Projects = projects; + } + + public static BillingPlanAddon From(Dictionary map) => new BillingPlanAddon( + seats: Appwrite.Models.BillingPlanAddonDetails.From(map: map["seats"] is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)map["seats"]), + projects: Appwrite.Models.BillingPlanAddonDetails.From(map: map["projects"] is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)map["projects"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "seats", Seats?.ToMap() }, + { "projects", Projects?.ToMap() } + }; + } +} diff --git a/Appwrite/Models/BillingPlanAddonDetails.cs b/Appwrite/Models/BillingPlanAddonDetails.cs new file mode 100644 index 00000000..620c7cf2 --- /dev/null +++ b/Appwrite/Models/BillingPlanAddonDetails.cs @@ -0,0 +1,82 @@ + +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 BillingPlanAddonDetails + { + [JsonPropertyName("supported")] + public bool Supported { get; private set; } + + [JsonPropertyName("planIncluded")] + public long PlanIncluded { get; private set; } + + [JsonPropertyName("limit")] + public long Limit { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("currency")] + public string Currency { get; private set; } + + [JsonPropertyName("price")] + public double Price { get; private set; } + + [JsonPropertyName("value")] + public long Value { get; private set; } + + [JsonPropertyName("invoiceDesc")] + public string InvoiceDesc { get; private set; } + + public BillingPlanAddonDetails( + bool supported, + long planIncluded, + long limit, + string type, + string currency, + double price, + long @value, + string invoiceDesc + ) + { + Supported = supported; + PlanIncluded = planIncluded; + Limit = limit; + Type = type; + Currency = currency; + Price = price; + Value = @value; + InvoiceDesc = invoiceDesc; + } + + public static BillingPlanAddonDetails From(Dictionary map) => new BillingPlanAddonDetails( + supported: (bool)map["supported"], + planIncluded: Convert.ToInt64(map["planIncluded"]), + limit: Convert.ToInt64(map["limit"]), + type: map["type"].ToString(), + currency: map["currency"].ToString(), + price: Convert.ToDouble(map["price"]), + @value: Convert.ToInt64(map["value"]), + invoiceDesc: map["invoiceDesc"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "supported", Supported }, + { "planIncluded", PlanIncluded }, + { "limit", Limit }, + { "type", Type }, + { "currency", Currency }, + { "price", Price }, + { "value", Value }, + { "invoiceDesc", InvoiceDesc } + }; + } +} diff --git a/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.cs b/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.cs new file mode 100644 index 00000000..df177c8f --- /dev/null +++ b/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.cs @@ -0,0 +1,197 @@ + +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 BillingPlanDedicatedDatabaseLimits + { + [JsonPropertyName("minCpu")] + public long? MinCpu { get; private set; } + + [JsonPropertyName("maxCpu")] + public long? MaxCpu { get; private set; } + + [JsonPropertyName("minMemoryMb")] + public long? MinMemoryMb { get; private set; } + + [JsonPropertyName("maxMemoryMb")] + public long? MaxMemoryMb { get; private set; } + + [JsonPropertyName("minStorageGb")] + public long? MinStorageGb { get; private set; } + + [JsonPropertyName("maxStorageGb")] + public long? MaxStorageGb { get; private set; } + + [JsonPropertyName("maxReplicas")] + public long? MaxReplicas { get; private set; } + + [JsonPropertyName("maxConnections")] + public long? MaxConnections { get; private set; } + + [JsonPropertyName("maxIpAllowlistSize")] + public long? MaxIpAllowlistSize { get; private set; } + + [JsonPropertyName("maxExtensions")] + public long? MaxExtensions { get; private set; } + + [JsonPropertyName("maxBackupRetentionDays")] + public long? MaxBackupRetentionDays { get; private set; } + + [JsonPropertyName("maxPitrRetentionDays")] + public long? MaxPitrRetentionDays { get; private set; } + + [JsonPropertyName("maxSqlApiMaxRows")] + public long? MaxSqlApiMaxRows { get; private set; } + + [JsonPropertyName("maxSqlApiMaxBytes")] + public long? MaxSqlApiMaxBytes { get; private set; } + + [JsonPropertyName("maxSqlApiTimeoutSeconds")] + public long? MaxSqlApiTimeoutSeconds { get; private set; } + + [JsonPropertyName("maxSqlApiAllowedStatements")] + public long? MaxSqlApiAllowedStatements { get; private set; } + + [JsonPropertyName("allowedSqlStatements")] + public List? AllowedSqlStatements { get; private set; } + + [JsonPropertyName("allowedStorageClasses")] + public List? AllowedStorageClasses { get; private set; } + + [JsonPropertyName("allowedSyncModes")] + public List? AllowedSyncModes { get; private set; } + + public BillingPlanDedicatedDatabaseLimits( + long? minCpu, + long? maxCpu, + long? minMemoryMb, + long? maxMemoryMb, + long? minStorageGb, + long? maxStorageGb, + long? maxReplicas, + long? maxConnections, + long? maxIpAllowlistSize, + long? maxExtensions, + long? maxBackupRetentionDays, + long? maxPitrRetentionDays, + long? maxSqlApiMaxRows, + long? maxSqlApiMaxBytes, + long? maxSqlApiTimeoutSeconds, + long? maxSqlApiAllowedStatements, + List? allowedSqlStatements, + List? allowedStorageClasses, + List? allowedSyncModes + ) + { + MinCpu = minCpu; + MaxCpu = maxCpu; + MinMemoryMb = minMemoryMb; + MaxMemoryMb = maxMemoryMb; + MinStorageGb = minStorageGb; + MaxStorageGb = maxStorageGb; + MaxReplicas = maxReplicas; + MaxConnections = maxConnections; + MaxIpAllowlistSize = maxIpAllowlistSize; + MaxExtensions = maxExtensions; + MaxBackupRetentionDays = maxBackupRetentionDays; + MaxPitrRetentionDays = maxPitrRetentionDays; + MaxSqlApiMaxRows = maxSqlApiMaxRows; + MaxSqlApiMaxBytes = maxSqlApiMaxBytes; + MaxSqlApiTimeoutSeconds = maxSqlApiTimeoutSeconds; + MaxSqlApiAllowedStatements = maxSqlApiAllowedStatements; + AllowedSqlStatements = allowedSqlStatements; + AllowedStorageClasses = allowedStorageClasses; + AllowedSyncModes = allowedSyncModes; + } + + public static BillingPlanDedicatedDatabaseLimits From(Dictionary map) => new BillingPlanDedicatedDatabaseLimits( + minCpu: map.TryGetValue("minCpu", out var numberRaw1) && numberRaw1 != null + ? Convert.ToInt64(numberRaw1) + : null, + maxCpu: map.TryGetValue("maxCpu", out var numberRaw2) && numberRaw2 != null + ? Convert.ToInt64(numberRaw2) + : null, + minMemoryMb: map.TryGetValue("minMemoryMb", out var numberRaw3) && numberRaw3 != null + ? Convert.ToInt64(numberRaw3) + : null, + maxMemoryMb: map.TryGetValue("maxMemoryMb", out var numberRaw4) && numberRaw4 != null + ? Convert.ToInt64(numberRaw4) + : null, + minStorageGb: map.TryGetValue("minStorageGb", out var numberRaw5) && numberRaw5 != null + ? Convert.ToInt64(numberRaw5) + : null, + maxStorageGb: map.TryGetValue("maxStorageGb", out var numberRaw6) && numberRaw6 != null + ? Convert.ToInt64(numberRaw6) + : null, + maxReplicas: map.TryGetValue("maxReplicas", out var numberRaw7) && numberRaw7 != null + ? Convert.ToInt64(numberRaw7) + : null, + maxConnections: map.TryGetValue("maxConnections", out var numberRaw8) && numberRaw8 != null + ? Convert.ToInt64(numberRaw8) + : null, + maxIpAllowlistSize: map.TryGetValue("maxIpAllowlistSize", out var numberRaw9) && numberRaw9 != null + ? Convert.ToInt64(numberRaw9) + : null, + maxExtensions: map.TryGetValue("maxExtensions", out var numberRaw10) && numberRaw10 != null + ? Convert.ToInt64(numberRaw10) + : null, + maxBackupRetentionDays: map.TryGetValue("maxBackupRetentionDays", out var numberRaw11) && numberRaw11 != null + ? Convert.ToInt64(numberRaw11) + : null, + maxPitrRetentionDays: map.TryGetValue("maxPitrRetentionDays", out var numberRaw12) && numberRaw12 != null + ? Convert.ToInt64(numberRaw12) + : null, + maxSqlApiMaxRows: map.TryGetValue("maxSqlApiMaxRows", out var numberRaw13) && numberRaw13 != null + ? Convert.ToInt64(numberRaw13) + : null, + maxSqlApiMaxBytes: map.TryGetValue("maxSqlApiMaxBytes", out var numberRaw14) && numberRaw14 != null + ? Convert.ToInt64(numberRaw14) + : null, + maxSqlApiTimeoutSeconds: map.TryGetValue("maxSqlApiTimeoutSeconds", out var numberRaw15) && numberRaw15 != null + ? Convert.ToInt64(numberRaw15) + : null, + maxSqlApiAllowedStatements: map.TryGetValue("maxSqlApiAllowedStatements", out var numberRaw16) && numberRaw16 != null + ? Convert.ToInt64(numberRaw16) + : null, + allowedSqlStatements: map.TryGetValue("allowedSqlStatements", out var arrayRaw17) && arrayRaw17 != null + ? arrayRaw17.ConvertToList() + : null, + allowedStorageClasses: map.TryGetValue("allowedStorageClasses", out var arrayRaw18) && arrayRaw18 != null + ? arrayRaw18.ConvertToList() + : null, + allowedSyncModes: map.TryGetValue("allowedSyncModes", out var arrayRaw19) && arrayRaw19 != null + ? arrayRaw19.ConvertToList() + : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "minCpu", MinCpu }, + { "maxCpu", MaxCpu }, + { "minMemoryMb", MinMemoryMb }, + { "maxMemoryMb", MaxMemoryMb }, + { "minStorageGb", MinStorageGb }, + { "maxStorageGb", MaxStorageGb }, + { "maxReplicas", MaxReplicas }, + { "maxConnections", MaxConnections }, + { "maxIpAllowlistSize", MaxIpAllowlistSize }, + { "maxExtensions", MaxExtensions }, + { "maxBackupRetentionDays", MaxBackupRetentionDays }, + { "maxPitrRetentionDays", MaxPitrRetentionDays }, + { "maxSqlApiMaxRows", MaxSqlApiMaxRows }, + { "maxSqlApiMaxBytes", MaxSqlApiMaxBytes }, + { "maxSqlApiTimeoutSeconds", MaxSqlApiTimeoutSeconds }, + { "maxSqlApiAllowedStatements", MaxSqlApiAllowedStatements }, + { "allowedSqlStatements", AllowedSqlStatements }, + { "allowedStorageClasses", AllowedStorageClasses }, + { "allowedSyncModes", AllowedSyncModes } + }; + } +} diff --git a/Appwrite/Models/BillingPlanLimits.cs b/Appwrite/Models/BillingPlanLimits.cs new file mode 100644 index 00000000..33d42f7f --- /dev/null +++ b/Appwrite/Models/BillingPlanLimits.cs @@ -0,0 +1,44 @@ + +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 BillingPlanLimits + { + [JsonPropertyName("credits")] + public long? Credits { get; private set; } + + [JsonPropertyName("dailyCredits")] + public long? DailyCredits { get; private set; } + + public BillingPlanLimits( + long? credits, + long? dailyCredits + ) + { + Credits = credits; + DailyCredits = dailyCredits; + } + + public static BillingPlanLimits From(Dictionary map) => new BillingPlanLimits( + credits: map.TryGetValue("credits", out var numberRaw1) && numberRaw1 != null + ? Convert.ToInt64(numberRaw1) + : null, + dailyCredits: map.TryGetValue("dailyCredits", out var numberRaw2) && numberRaw2 != null + ? Convert.ToInt64(numberRaw2) + : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "credits", Credits }, + { "dailyCredits", DailyCredits } + }; + } +} diff --git a/Appwrite/Models/BillingPlanSupportedAddons.cs b/Appwrite/Models/BillingPlanSupportedAddons.cs new file mode 100644 index 00000000..a4b47abe --- /dev/null +++ b/Appwrite/Models/BillingPlanSupportedAddons.cs @@ -0,0 +1,47 @@ + +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 BillingPlanSupportedAddons + { + [JsonPropertyName("baa")] + public bool Baa { get; private set; } + + [JsonPropertyName("premiumGeoDB")] + public bool PremiumGeoDB { get; private set; } + + [JsonPropertyName("premiumGeoDBOrg")] + public bool PremiumGeoDBOrg { get; private set; } + + public BillingPlanSupportedAddons( + bool baa, + bool premiumGeoDB, + bool premiumGeoDBOrg + ) + { + Baa = baa; + PremiumGeoDB = premiumGeoDB; + PremiumGeoDBOrg = premiumGeoDBOrg; + } + + public static BillingPlanSupportedAddons From(Dictionary map) => new BillingPlanSupportedAddons( + baa: (bool)map["baa"], + premiumGeoDB: (bool)map["premiumGeoDB"], + premiumGeoDBOrg: (bool)map["premiumGeoDBOrg"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "baa", Baa }, + { "premiumGeoDB", PremiumGeoDB }, + { "premiumGeoDBOrg", PremiumGeoDBOrg } + }; + } +} diff --git a/Appwrite/Models/Block.cs b/Appwrite/Models/Block.cs index b86d5b54..27280fcb 100644 --- a/Appwrite/Models/Block.cs +++ b/Appwrite/Models/Block.cs @@ -20,6 +20,9 @@ public class Block [JsonPropertyName("resourceId")] public string ResourceId { get; private set; } + [JsonPropertyName("mode")] + public string Mode { get; private set; } + [JsonPropertyName("reason")] public string? Reason { get; private set; } @@ -45,6 +48,7 @@ public Block( string createdAt, string resourceType, string resourceId, + string mode, string? reason, string? expiredAt, string projectName, @@ -57,6 +61,7 @@ string billingPlan CreatedAt = createdAt; ResourceType = resourceType; ResourceId = resourceId; + Mode = mode; Reason = reason; ExpiredAt = expiredAt; ProjectName = projectName; @@ -70,6 +75,7 @@ string billingPlan createdAt: map["$createdAt"].ToString(), resourceType: map["resourceType"].ToString(), resourceId: map["resourceId"].ToString(), + mode: map["mode"].ToString(), reason: map.TryGetValue("reason", out var reason) ? reason?.ToString() : null, expiredAt: map.TryGetValue("expiredAt", out var expiredAt) ? expiredAt?.ToString() : null, projectName: map["projectName"].ToString(), @@ -84,6 +90,7 @@ string billingPlan { "$createdAt", CreatedAt }, { "resourceType", ResourceType }, { "resourceId", ResourceId }, + { "mode", Mode }, { "reason", Reason }, { "expiredAt", ExpiredAt }, { "projectName", ProjectName }, diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs index 865acd0a..a941803d 100644 --- a/Appwrite/Models/ColumnLine.cs +++ b/Appwrite/Models/ColumnLine.cs @@ -36,7 +36,7 @@ public class ColumnLine public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List>? Default { get; private set; } public ColumnLine( string key, @@ -47,7 +47,7 @@ public ColumnLine( bool? array, string createdAt, string updatedAt, - List? @default + List>? @default ) { Key = key; @@ -73,7 +73,7 @@ public ColumnLine( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList>() : null ); diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs index 76a1aa7d..55968a40 100644 --- a/Appwrite/Models/ColumnPoint.cs +++ b/Appwrite/Models/ColumnPoint.cs @@ -36,7 +36,7 @@ public class ColumnPoint public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List? Default { get; private set; } public ColumnPoint( string key, @@ -47,7 +47,7 @@ public ColumnPoint( bool? array, string createdAt, string updatedAt, - List? @default + List? @default ) { Key = key; @@ -73,7 +73,7 @@ public ColumnPoint( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList() : null ); diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs index 811e614b..6ed47a6c 100644 --- a/Appwrite/Models/ColumnPolygon.cs +++ b/Appwrite/Models/ColumnPolygon.cs @@ -36,7 +36,7 @@ public class ColumnPolygon public string UpdatedAt { get; private set; } [JsonPropertyName("default")] - public List? Default { get; private set; } + public List>>? Default { get; private set; } public ColumnPolygon( string key, @@ -47,7 +47,7 @@ public ColumnPolygon( bool? array, string createdAt, string updatedAt, - List? @default + List>>? @default ) { Key = key; @@ -73,7 +73,7 @@ public ColumnPolygon( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), @default: map.TryGetValue("default", out var arrayRaw9) && arrayRaw9 != null - ? arrayRaw9.ConvertToList() + ? arrayRaw9.ConvertToList>>() : null ); diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 2ff2a2ec..31822325 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -29,6 +29,9 @@ public class Database [JsonPropertyName("type")] public DatabaseType Type { get; private set; } + [JsonPropertyName("status")] + public DatabaseStatus? Status { get; private set; } + [JsonPropertyName("policies")] public List Policies { get; private set; } @@ -42,6 +45,7 @@ public Database( string updatedAt, bool enabled, DatabaseType type, + DatabaseStatus? status, List policies, List archives ) @@ -52,6 +56,7 @@ List archives UpdatedAt = updatedAt; Enabled = enabled; Type = type; + Status = status; Policies = policies; Archives = archives; } @@ -63,6 +68,11 @@ List archives updatedAt: map["$updatedAt"].ToString(), enabled: (bool)map["enabled"], type: new DatabaseType(map["type"].ToString()!), + status: map.TryGetValue("status", out var enumRaw7) + ? enumRaw7 == null + ? null + : new DatabaseStatus(enumRaw7.ToString()!) + : null, policies: map["policies"].ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList(), archives: map["archives"].ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() ); @@ -75,6 +85,7 @@ List archives { "$updatedAt", UpdatedAt }, { "enabled", Enabled }, { "type", Type.Value }, + { "status", Status?.Value }, { "policies", Policies?.Select(it => it.ToMap()).ToList() }, { "archives", Archives?.Select(it => it.ToMap()).ToList() } }; diff --git a/Appwrite/Models/HealthAntivirus.cs b/Appwrite/Models/HealthAntivirus.cs deleted file mode 100644 index 2d0b7a9a..00000000 --- a/Appwrite/Models/HealthAntivirus.cs +++ /dev/null @@ -1,40 +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 HealthAntivirus - { - [JsonPropertyName("version")] - public string Version { get; private set; } - - [JsonPropertyName("status")] - public HealthAntivirusStatus Status { get; private set; } - - public HealthAntivirus( - string version, - HealthAntivirusStatus status - ) - { - Version = version; - Status = status; - } - - public static HealthAntivirus From(Dictionary map) => new HealthAntivirus( - version: map["version"].ToString(), - status: new HealthAntivirusStatus(map["status"].ToString()!) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "version", Version }, - { "status", Status.Value } - }; - } -} diff --git a/Appwrite/Models/HealthCertificate.cs b/Appwrite/Models/HealthCertificate.cs deleted file mode 100644 index 0ece0b5b..00000000 --- a/Appwrite/Models/HealthCertificate.cs +++ /dev/null @@ -1,68 +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 HealthCertificate - { - [JsonPropertyName("name")] - public string Name { get; private set; } - - [JsonPropertyName("subjectSN")] - public string SubjectSN { get; private set; } - - [JsonPropertyName("issuerOrganisation")] - public string IssuerOrganisation { get; private set; } - - [JsonPropertyName("validFrom")] - public string ValidFrom { get; private set; } - - [JsonPropertyName("validTo")] - public string ValidTo { get; private set; } - - [JsonPropertyName("signatureTypeSN")] - public string SignatureTypeSN { get; private set; } - - public HealthCertificate( - string name, - string subjectSN, - string issuerOrganisation, - string validFrom, - string validTo, - string signatureTypeSN - ) - { - Name = name; - SubjectSN = subjectSN; - IssuerOrganisation = issuerOrganisation; - ValidFrom = validFrom; - ValidTo = validTo; - SignatureTypeSN = signatureTypeSN; - } - - public static HealthCertificate From(Dictionary map) => new HealthCertificate( - name: map["name"].ToString(), - subjectSN: map["subjectSN"].ToString(), - issuerOrganisation: map["issuerOrganisation"].ToString(), - validFrom: map["validFrom"].ToString(), - validTo: map["validTo"].ToString(), - signatureTypeSN: map["signatureTypeSN"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "name", Name }, - { "subjectSN", SubjectSN }, - { "issuerOrganisation", IssuerOrganisation }, - { "validFrom", ValidFrom }, - { "validTo", ValidTo }, - { "signatureTypeSN", SignatureTypeSN } - }; - } -} diff --git a/Appwrite/Models/HealthQueue.cs b/Appwrite/Models/HealthQueue.cs deleted file mode 100644 index e3bc96f3..00000000 --- a/Appwrite/Models/HealthQueue.cs +++ /dev/null @@ -1,33 +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 HealthQueue - { - [JsonPropertyName("size")] - public long Size { get; private set; } - - public HealthQueue( - long size - ) - { - Size = size; - } - - public static HealthQueue From(Dictionary map) => new HealthQueue( - size: Convert.ToInt64(map["size"]) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "size", Size } - }; - } -} diff --git a/Appwrite/Models/HealthStatus.cs b/Appwrite/Models/HealthStatus.cs deleted file mode 100644 index 83fe5e5a..00000000 --- a/Appwrite/Models/HealthStatus.cs +++ /dev/null @@ -1,47 +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 HealthStatus - { - [JsonPropertyName("name")] - public string Name { get; private set; } - - [JsonPropertyName("ping")] - public long Ping { get; private set; } - - [JsonPropertyName("status")] - public HealthCheckStatus Status { get; private set; } - - public HealthStatus( - string name, - long ping, - HealthCheckStatus status - ) - { - Name = name; - Ping = ping; - Status = status; - } - - public static HealthStatus From(Dictionary map) => new HealthStatus( - name: map["name"].ToString(), - ping: Convert.ToInt64(map["ping"]), - status: new HealthCheckStatus(map["status"].ToString()!) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "name", Name }, - { "ping", Ping }, - { "status", Status.Value } - }; - } -} diff --git a/Appwrite/Models/HealthStatusList.cs b/Appwrite/Models/HealthStatusList.cs deleted file mode 100644 index f7b147c3..00000000 --- a/Appwrite/Models/HealthStatusList.cs +++ /dev/null @@ -1,40 +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 HealthStatusList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("statuses")] - public List Statuses { get; private set; } - - public HealthStatusList( - long total, - List statuses - ) - { - Total = total; - Statuses = statuses; - } - - public static HealthStatusList From(Dictionary map) => new HealthStatusList( - total: Convert.ToInt64(map["total"]), - statuses: map["statuses"].ConvertToList>().Select(it => Appwrite.Models.HealthStatus.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "statuses", Statuses?.Select(it => it.ToMap()).ToList() } - }; - } -} diff --git a/Appwrite/Models/HealthTime.cs b/Appwrite/Models/HealthTime.cs deleted file mode 100644 index df83bafa..00000000 --- a/Appwrite/Models/HealthTime.cs +++ /dev/null @@ -1,47 +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 HealthTime - { - [JsonPropertyName("remoteTime")] - public long RemoteTime { get; private set; } - - [JsonPropertyName("localTime")] - public long LocalTime { get; private set; } - - [JsonPropertyName("diff")] - public long Diff { get; private set; } - - public HealthTime( - long remoteTime, - long localTime, - long diff - ) - { - RemoteTime = remoteTime; - LocalTime = localTime; - Diff = diff; - } - - public static HealthTime From(Dictionary map) => new HealthTime( - remoteTime: Convert.ToInt64(map["remoteTime"]), - localTime: Convert.ToInt64(map["localTime"]), - diff: Convert.ToInt64(map["diff"]) - ); - - public Dictionary ToMap() => new Dictionary() - { - { "remoteTime", RemoteTime }, - { "localTime", LocalTime }, - { "diff", Diff } - }; - } -} diff --git a/Appwrite/Models/Locale.cs b/Appwrite/Models/Locale.cs index fa256279..6208de4a 100644 --- a/Appwrite/Models/Locale.cs +++ b/Appwrite/Models/Locale.cs @@ -32,6 +32,39 @@ public class Locale [JsonPropertyName("currency")] public string Currency { get; private set; } + [JsonPropertyName("city")] + public string? City { get; private set; } + + [JsonPropertyName("timeZone")] + public string? TimeZone { get; private set; } + + [JsonPropertyName("postalCode")] + public string? PostalCode { get; private set; } + + [JsonPropertyName("latitude")] + public double? Latitude { get; private set; } + + [JsonPropertyName("longitude")] + public double? Longitude { get; private set; } + + [JsonPropertyName("autonomousSystemNumber")] + public string? AutonomousSystemNumber { get; private set; } + + [JsonPropertyName("autonomousSystemOrganization")] + public string? AutonomousSystemOrganization { get; private set; } + + [JsonPropertyName("isp")] + public string? Isp { get; private set; } + + [JsonPropertyName("connectionType")] + public string? ConnectionType { get; private set; } + + [JsonPropertyName("connectionUsageType")] + public string? ConnectionUsageType { get; private set; } + + [JsonPropertyName("connectionOrganization")] + public string? ConnectionOrganization { get; private set; } + public Locale( string ip, string countryCode, @@ -39,7 +72,18 @@ public Locale( string continentCode, string continent, bool eu, - string currency + string currency, + string? city, + string? timeZone, + string? postalCode, + double? latitude, + double? longitude, + string? autonomousSystemNumber, + string? autonomousSystemOrganization, + string? isp, + string? connectionType, + string? connectionUsageType, + string? connectionOrganization ) { Ip = ip; @@ -49,6 +93,17 @@ string currency Continent = continent; Eu = eu; Currency = currency; + City = city; + TimeZone = timeZone; + PostalCode = postalCode; + Latitude = latitude; + Longitude = longitude; + AutonomousSystemNumber = autonomousSystemNumber; + AutonomousSystemOrganization = autonomousSystemOrganization; + Isp = isp; + ConnectionType = connectionType; + ConnectionUsageType = connectionUsageType; + ConnectionOrganization = connectionOrganization; } public static Locale From(Dictionary map) => new Locale( @@ -58,7 +113,22 @@ string currency continentCode: map["continentCode"].ToString(), continent: map["continent"].ToString(), eu: (bool)map["eu"], - currency: map["currency"].ToString() + currency: map["currency"].ToString(), + city: map.TryGetValue("city", out var city) ? city?.ToString() : null, + timeZone: map.TryGetValue("timeZone", out var timeZone) ? timeZone?.ToString() : null, + postalCode: map.TryGetValue("postalCode", out var postalCode) ? postalCode?.ToString() : null, + latitude: map.TryGetValue("latitude", out var numberRaw11) && numberRaw11 != null + ? Convert.ToDouble(numberRaw11) + : null, + longitude: map.TryGetValue("longitude", out var numberRaw12) && numberRaw12 != null + ? Convert.ToDouble(numberRaw12) + : null, + autonomousSystemNumber: map.TryGetValue("autonomousSystemNumber", out var autonomousSystemNumber) ? autonomousSystemNumber?.ToString() : null, + autonomousSystemOrganization: map.TryGetValue("autonomousSystemOrganization", out var autonomousSystemOrganization) ? autonomousSystemOrganization?.ToString() : null, + isp: map.TryGetValue("isp", out var isp) ? isp?.ToString() : null, + connectionType: map.TryGetValue("connectionType", out var connectionType) ? connectionType?.ToString() : null, + connectionUsageType: map.TryGetValue("connectionUsageType", out var connectionUsageType) ? connectionUsageType?.ToString() : null, + connectionOrganization: map.TryGetValue("connectionOrganization", out var connectionOrganization) ? connectionOrganization?.ToString() : null ); public Dictionary ToMap() => new Dictionary() @@ -69,7 +139,18 @@ string currency { "continentCode", ContinentCode }, { "continent", Continent }, { "eu", Eu }, - { "currency", Currency } + { "currency", Currency }, + { "city", City }, + { "timeZone", TimeZone }, + { "postalCode", PostalCode }, + { "latitude", Latitude }, + { "longitude", Longitude }, + { "autonomousSystemNumber", AutonomousSystemNumber }, + { "autonomousSystemOrganization", AutonomousSystemOrganization }, + { "isp", Isp }, + { "connectionType", ConnectionType }, + { "connectionUsageType", ConnectionUsageType }, + { "connectionOrganization", ConnectionOrganization } }; } } diff --git a/Appwrite/Models/Membership.cs b/Appwrite/Models/Membership.cs index a23c0c5a..a72a6fbf 100644 --- a/Appwrite/Models/Membership.cs +++ b/Appwrite/Models/Membership.cs @@ -50,6 +50,9 @@ public class Membership [JsonPropertyName("mfa")] public bool Mfa { get; private set; } + [JsonPropertyName("userAccessedAt")] + public string UserAccessedAt { get; private set; } + [JsonPropertyName("roles")] public List Roles { get; private set; } @@ -67,6 +70,7 @@ public Membership( string joined, bool confirm, bool mfa, + string userAccessedAt, List roles ) { @@ -83,6 +87,7 @@ List roles Joined = joined; Confirm = confirm; Mfa = mfa; + UserAccessedAt = userAccessedAt; Roles = roles; } @@ -100,6 +105,7 @@ List roles joined: map["joined"].ToString(), confirm: (bool)map["confirm"], mfa: (bool)map["mfa"], + userAccessedAt: map["userAccessedAt"].ToString(), roles: map["roles"].ConvertToList() ); @@ -118,6 +124,7 @@ List roles { "joined", Joined }, { "confirm", Confirm }, { "mfa", Mfa }, + { "userAccessedAt", UserAccessedAt }, { "roles", Roles } }; } diff --git a/Appwrite/Models/OAuth2Appwrite.cs b/Appwrite/Models/OAuth2Appwrite.cs new file mode 100644 index 00000000..33fa2c01 --- /dev/null +++ b/Appwrite/Models/OAuth2Appwrite.cs @@ -0,0 +1,54 @@ + +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 OAuth2Appwrite + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("clientId")] + public string ClientId { get; private set; } + + [JsonPropertyName("clientSecret")] + public string ClientSecret { get; private set; } + + public OAuth2Appwrite( + string id, + bool enabled, + string clientId, + string clientSecret + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = clientSecret; + } + + public static OAuth2Appwrite From(Dictionary map) => new OAuth2Appwrite( + id: map["$id"].ToString(), + enabled: (bool)map["enabled"], + clientId: map["clientId"].ToString(), + clientSecret: map["clientSecret"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret } + }; + } +} diff --git a/Appwrite/Models/OAuth2Oidc.cs b/Appwrite/Models/OAuth2Oidc.cs index e061b07a..89d5341a 100644 --- a/Appwrite/Models/OAuth2Oidc.cs +++ b/Appwrite/Models/OAuth2Oidc.cs @@ -35,6 +35,12 @@ public class OAuth2Oidc [JsonPropertyName("userInfoURL")] public string UserInfoURL { get; private set; } + [JsonPropertyName("prompt")] + public List Prompt { get; private set; } + + [JsonPropertyName("maxAge")] + public long? MaxAge { get; private set; } + public OAuth2Oidc( string id, bool enabled, @@ -43,7 +49,9 @@ public OAuth2Oidc( string wellKnownURL, string authorizationURL, string tokenURL, - string userInfoURL + string userInfoURL, + List prompt, + long? maxAge ) { Id = id; @@ -54,6 +62,8 @@ string userInfoURL AuthorizationURL = authorizationURL; TokenURL = tokenURL; UserInfoURL = userInfoURL; + Prompt = prompt; + MaxAge = maxAge; } public static OAuth2Oidc From(Dictionary map) => new OAuth2Oidc( @@ -64,7 +74,11 @@ string userInfoURL wellKnownURL: map["wellKnownURL"].ToString(), authorizationURL: map["authorizationURL"].ToString(), tokenURL: map["tokenURL"].ToString(), - userInfoURL: map["userInfoURL"].ToString() + userInfoURL: map["userInfoURL"].ToString(), + prompt: map["prompt"].ConvertToList(), + maxAge: map.TryGetValue("maxAge", out var numberRaw10) && numberRaw10 != null + ? Convert.ToInt64(numberRaw10) + : null ); public Dictionary ToMap() => new Dictionary() @@ -76,7 +90,9 @@ string userInfoURL { "wellKnownURL", WellKnownURL }, { "authorizationURL", AuthorizationURL }, { "tokenURL", TokenURL }, - { "userInfoURL", UserInfoURL } + { "userInfoURL", UserInfoURL }, + { "prompt", Prompt }, + { "maxAge", MaxAge } }; } } diff --git a/Appwrite/Models/Organization.cs b/Appwrite/Models/Organization.cs new file mode 100644 index 00000000..babb60f2 --- /dev/null +++ b/Appwrite/Models/Organization.cs @@ -0,0 +1,273 @@ + +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 Organization + { + [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("name")] + public string Name { get; private set; } + + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("prefs")] + public Preferences Prefs { get; private set; } + + [JsonPropertyName("billingBudget")] + public long BillingBudget { get; private set; } + + [JsonPropertyName("budgetAlerts")] + public List BudgetAlerts { get; private set; } + + [JsonPropertyName("billingPlan")] + public string BillingPlan { get; private set; } + + [JsonPropertyName("billingPlanId")] + public string BillingPlanId { get; private set; } + + [JsonPropertyName("billingPlanDetails")] + public BillingPlan BillingPlanDetails { get; private set; } + + [JsonPropertyName("billingEmail")] + public string BillingEmail { get; private set; } + + [JsonPropertyName("billingStartDate")] + public string BillingStartDate { get; private set; } + + [JsonPropertyName("billingCurrentInvoiceDate")] + public string BillingCurrentInvoiceDate { get; private set; } + + [JsonPropertyName("billingNextInvoiceDate")] + public string BillingNextInvoiceDate { get; private set; } + + [JsonPropertyName("billingTrialStartDate")] + public string BillingTrialStartDate { get; private set; } + + [JsonPropertyName("billingTrialDays")] + public long BillingTrialDays { get; private set; } + + [JsonPropertyName("billingAggregationId")] + public string BillingAggregationId { get; private set; } + + [JsonPropertyName("billingInvoiceId")] + public string BillingInvoiceId { get; private set; } + + [JsonPropertyName("paymentMethodId")] + public string PaymentMethodId { get; private set; } + + [JsonPropertyName("billingAddressId")] + public string BillingAddressId { get; private set; } + + [JsonPropertyName("backupPaymentMethodId")] + public string BackupPaymentMethodId { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("remarks")] + public string Remarks { get; private set; } + + [JsonPropertyName("agreementBAA")] + public string AgreementBAA { get; private set; } + + [JsonPropertyName("programManagerName")] + public string ProgramManagerName { get; private set; } + + [JsonPropertyName("programManagerCalendar")] + public string ProgramManagerCalendar { get; private set; } + + [JsonPropertyName("programDiscordChannelName")] + public string ProgramDiscordChannelName { get; private set; } + + [JsonPropertyName("programDiscordChannelUrl")] + public string ProgramDiscordChannelUrl { get; private set; } + + [JsonPropertyName("billingLimits")] + public BillingLimits? BillingLimits { get; private set; } + + [JsonPropertyName("billingPlanDowngrade")] + public string BillingPlanDowngrade { get; private set; } + + [JsonPropertyName("billingTaxId")] + public string BillingTaxId { get; private set; } + + [JsonPropertyName("markedForDeletion")] + public bool MarkedForDeletion { get; private set; } + + [JsonPropertyName("platform")] + public string Platform { get; private set; } + + [JsonPropertyName("projects")] + public List Projects { get; private set; } + + public Organization( + string id, + string createdAt, + string updatedAt, + string name, + long total, + Preferences prefs, + long billingBudget, + List budgetAlerts, + string billingPlan, + string billingPlanId, + BillingPlan billingPlanDetails, + string billingEmail, + string billingStartDate, + string billingCurrentInvoiceDate, + string billingNextInvoiceDate, + string billingTrialStartDate, + long billingTrialDays, + string billingAggregationId, + string billingInvoiceId, + string paymentMethodId, + string billingAddressId, + string backupPaymentMethodId, + string status, + string remarks, + string agreementBAA, + string programManagerName, + string programManagerCalendar, + string programDiscordChannelName, + string programDiscordChannelUrl, + BillingLimits? billingLimits, + string billingPlanDowngrade, + string billingTaxId, + bool markedForDeletion, + string platform, + List projects + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Total = total; + Prefs = prefs; + BillingBudget = billingBudget; + BudgetAlerts = budgetAlerts; + BillingPlan = billingPlan; + BillingPlanId = billingPlanId; + BillingPlanDetails = billingPlanDetails; + BillingEmail = billingEmail; + BillingStartDate = billingStartDate; + BillingCurrentInvoiceDate = billingCurrentInvoiceDate; + BillingNextInvoiceDate = billingNextInvoiceDate; + BillingTrialStartDate = billingTrialStartDate; + BillingTrialDays = billingTrialDays; + BillingAggregationId = billingAggregationId; + BillingInvoiceId = billingInvoiceId; + PaymentMethodId = paymentMethodId; + BillingAddressId = billingAddressId; + BackupPaymentMethodId = backupPaymentMethodId; + Status = status; + Remarks = remarks; + AgreementBAA = agreementBAA; + ProgramManagerName = programManagerName; + ProgramManagerCalendar = programManagerCalendar; + ProgramDiscordChannelName = programDiscordChannelName; + ProgramDiscordChannelUrl = programDiscordChannelUrl; + BillingLimits = billingLimits; + BillingPlanDowngrade = billingPlanDowngrade; + BillingTaxId = billingTaxId; + MarkedForDeletion = markedForDeletion; + Platform = platform; + Projects = projects; + } + + public static Organization From(Dictionary map) => new Organization( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + name: map["name"].ToString(), + total: Convert.ToInt64(map["total"]), + prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["prefs"]), + billingBudget: Convert.ToInt64(map["billingBudget"]), + budgetAlerts: map["budgetAlerts"].ConvertToList(), + billingPlan: map["billingPlan"].ToString(), + billingPlanId: map["billingPlanId"].ToString(), + billingPlanDetails: Appwrite.Models.BillingPlan.From(map: map["billingPlanDetails"] is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)map["billingPlanDetails"]), + billingEmail: map["billingEmail"].ToString(), + billingStartDate: map["billingStartDate"].ToString(), + billingCurrentInvoiceDate: map["billingCurrentInvoiceDate"].ToString(), + billingNextInvoiceDate: map["billingNextInvoiceDate"].ToString(), + billingTrialStartDate: map["billingTrialStartDate"].ToString(), + billingTrialDays: Convert.ToInt64(map["billingTrialDays"]), + billingAggregationId: map["billingAggregationId"].ToString(), + billingInvoiceId: map["billingInvoiceId"].ToString(), + paymentMethodId: map["paymentMethodId"].ToString(), + billingAddressId: map["billingAddressId"].ToString(), + backupPaymentMethodId: map["backupPaymentMethodId"].ToString(), + status: map["status"].ToString(), + remarks: map["remarks"].ToString(), + agreementBAA: map["agreementBAA"].ToString(), + programManagerName: map["programManagerName"].ToString(), + programManagerCalendar: map["programManagerCalendar"].ToString(), + programDiscordChannelName: map["programDiscordChannelName"].ToString(), + programDiscordChannelUrl: map["programDiscordChannelUrl"].ToString(), + billingLimits: map.TryGetValue("billingLimits", out var objectRaw30) && objectRaw30 != null + ? Appwrite.Models.BillingLimits.From(map: objectRaw30 is JsonElement jsonObj30 ? jsonObj30.Deserialize>()! : (Dictionary)objectRaw30) + : null, + billingPlanDowngrade: map["billingPlanDowngrade"].ToString(), + billingTaxId: map["billingTaxId"].ToString(), + markedForDeletion: (bool)map["markedForDeletion"], + platform: map["platform"].ToString(), + projects: map["projects"].ConvertToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "total", Total }, + { "prefs", Prefs?.ToMap() }, + { "billingBudget", BillingBudget }, + { "budgetAlerts", BudgetAlerts }, + { "billingPlan", BillingPlan }, + { "billingPlanId", BillingPlanId }, + { "billingPlanDetails", BillingPlanDetails?.ToMap() }, + { "billingEmail", BillingEmail }, + { "billingStartDate", BillingStartDate }, + { "billingCurrentInvoiceDate", BillingCurrentInvoiceDate }, + { "billingNextInvoiceDate", BillingNextInvoiceDate }, + { "billingTrialStartDate", BillingTrialStartDate }, + { "billingTrialDays", BillingTrialDays }, + { "billingAggregationId", BillingAggregationId }, + { "billingInvoiceId", BillingInvoiceId }, + { "paymentMethodId", PaymentMethodId }, + { "billingAddressId", BillingAddressId }, + { "backupPaymentMethodId", BackupPaymentMethodId }, + { "status", Status }, + { "remarks", Remarks }, + { "agreementBAA", AgreementBAA }, + { "programManagerName", ProgramManagerName }, + { "programManagerCalendar", ProgramManagerCalendar }, + { "programDiscordChannelName", ProgramDiscordChannelName }, + { "programDiscordChannelUrl", ProgramDiscordChannelUrl }, + { "billingLimits", BillingLimits?.ToMap() }, + { "billingPlanDowngrade", BillingPlanDowngrade }, + { "billingTaxId", BillingTaxId }, + { "markedForDeletion", MarkedForDeletion }, + { "platform", Platform }, + { "projects", Projects } + }; + } +} diff --git a/Appwrite/Models/PolicyDenyCorporateEmail.cs b/Appwrite/Models/PolicyDenyCorporateEmail.cs new file mode 100644 index 00000000..1b0a257e --- /dev/null +++ b/Appwrite/Models/PolicyDenyCorporateEmail.cs @@ -0,0 +1,40 @@ + +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 PolicyDenyCorporateEmail + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + public PolicyDenyCorporateEmail( + string id, + bool enabled + ) + { + Id = id; + Enabled = enabled; + } + + public static PolicyDenyCorporateEmail From(Dictionary map) => new PolicyDenyCorporateEmail( + id: map["$id"].ToString(), + enabled: (bool)map["enabled"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled } + }; + } +} diff --git a/Appwrite/Models/PolicyMembershipPrivacy.cs b/Appwrite/Models/PolicyMembershipPrivacy.cs index 3a4bd1ec..11eb044a 100644 --- a/Appwrite/Models/PolicyMembershipPrivacy.cs +++ b/Appwrite/Models/PolicyMembershipPrivacy.cs @@ -29,13 +29,17 @@ public class PolicyMembershipPrivacy [JsonPropertyName("userMFA")] public bool UserMFA { get; private set; } + [JsonPropertyName("userAccessedAt")] + public bool UserAccessedAt { get; private set; } + public PolicyMembershipPrivacy( string id, bool userId, bool userEmail, bool userPhone, bool userName, - bool userMFA + bool userMFA, + bool userAccessedAt ) { Id = id; @@ -44,6 +48,7 @@ bool userMFA UserPhone = userPhone; UserName = userName; UserMFA = userMFA; + UserAccessedAt = userAccessedAt; } public static PolicyMembershipPrivacy From(Dictionary map) => new PolicyMembershipPrivacy( @@ -52,7 +57,8 @@ bool userMFA userEmail: (bool)map["userEmail"], userPhone: (bool)map["userPhone"], userName: (bool)map["userName"], - userMFA: (bool)map["userMFA"] + userMFA: (bool)map["userMFA"], + userAccessedAt: (bool)map["userAccessedAt"] ); public Dictionary ToMap() => new Dictionary() @@ -62,7 +68,8 @@ bool userMFA { "userEmail", UserEmail }, { "userPhone", UserPhone }, { "userName", UserName }, - { "userMFA", UserMFA } + { "userMFA", UserMFA }, + { "userAccessedAt", UserAccessedAt } }; } } diff --git a/Appwrite/Models/Program.cs b/Appwrite/Models/Program.cs new file mode 100644 index 00000000..acd068f1 --- /dev/null +++ b/Appwrite/Models/Program.cs @@ -0,0 +1,89 @@ + +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 Program + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("title")] + public string Title { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("tag")] + public string Tag { get; private set; } + + [JsonPropertyName("icon")] + public string Icon { get; private set; } + + [JsonPropertyName("url")] + public string Url { get; private set; } + + [JsonPropertyName("active")] + public bool Active { get; private set; } + + [JsonPropertyName("external")] + public bool External { get; private set; } + + [JsonPropertyName("billingPlanId")] + public string BillingPlanId { get; private set; } + + public Program( + string id, + string title, + string description, + string tag, + string icon, + string url, + bool active, + bool external, + string billingPlanId + ) + { + Id = id; + Title = title; + Description = description; + Tag = tag; + Icon = icon; + Url = url; + Active = active; + External = external; + BillingPlanId = billingPlanId; + } + + public static Program From(Dictionary map) => new Program( + id: map["$id"].ToString(), + title: map["title"].ToString(), + description: map["description"].ToString(), + tag: map["tag"].ToString(), + icon: map["icon"].ToString(), + url: map["url"].ToString(), + active: (bool)map["active"], + external: (bool)map["external"], + billingPlanId: map["billingPlanId"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "title", Title }, + { "description", Description }, + { "tag", Tag }, + { "icon", Icon }, + { "url", Url }, + { "active", Active }, + { "external", External }, + { "billingPlanId", BillingPlanId } + }; + } +} diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 54354db1..10b325e8 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -74,6 +74,9 @@ public class Project [JsonPropertyName("status")] public string Status { get; private set; } + [JsonPropertyName("onboarding")] + public object Onboarding { get; private set; } + [JsonPropertyName("authMethods")] public List AuthMethods { get; private set; } @@ -93,31 +96,49 @@ public class Project public BillingLimits? BillingLimits { get; private set; } [JsonPropertyName("oAuth2ServerEnabled")] - public bool OAuth2ServerEnabled { get; private set; } + public bool? OAuth2ServerEnabled { get; private set; } [JsonPropertyName("oAuth2ServerAuthorizationUrl")] - public string OAuth2ServerAuthorizationUrl { get; private set; } + public string? OAuth2ServerAuthorizationUrl { get; private set; } [JsonPropertyName("oAuth2ServerScopes")] - public List OAuth2ServerScopes { get; private set; } + public List? OAuth2ServerScopes { get; private set; } + + [JsonPropertyName("oAuth2ServerDefaultScopes")] + public List? OAuth2ServerDefaultScopes { get; private set; } + + [JsonPropertyName("oAuth2ServerAuthorizationDetailsTypes")] + public List? OAuth2ServerAuthorizationDetailsTypes { get; private set; } [JsonPropertyName("oAuth2ServerAccessTokenDuration")] - public long OAuth2ServerAccessTokenDuration { get; private set; } + public long? OAuth2ServerAccessTokenDuration { get; private set; } [JsonPropertyName("oAuth2ServerRefreshTokenDuration")] - public long OAuth2ServerRefreshTokenDuration { get; private set; } + public long? OAuth2ServerRefreshTokenDuration { get; private set; } [JsonPropertyName("oAuth2ServerPublicAccessTokenDuration")] - public long OAuth2ServerPublicAccessTokenDuration { get; private set; } + public long? OAuth2ServerPublicAccessTokenDuration { get; private set; } [JsonPropertyName("oAuth2ServerPublicRefreshTokenDuration")] - public long OAuth2ServerPublicRefreshTokenDuration { get; private set; } + public long? OAuth2ServerPublicRefreshTokenDuration { get; private set; } [JsonPropertyName("oAuth2ServerConfidentialPkce")] - public bool OAuth2ServerConfidentialPkce { get; private set; } + public bool? OAuth2ServerConfidentialPkce { get; private set; } + + [JsonPropertyName("oAuth2ServerVerificationUrl")] + public string? OAuth2ServerVerificationUrl { get; private set; } + + [JsonPropertyName("oAuth2ServerUserCodeLength")] + public long? OAuth2ServerUserCodeLength { get; private set; } + + [JsonPropertyName("oAuth2ServerUserCodeFormat")] + public string? OAuth2ServerUserCodeFormat { get; private set; } + + [JsonPropertyName("oAuth2ServerDeviceCodeDuration")] + public long? OAuth2ServerDeviceCodeDuration { get; private set; } [JsonPropertyName("oAuth2ServerDiscoveryUrl")] - public string OAuth2ServerDiscoveryUrl { get; private set; } + public string? OAuth2ServerDiscoveryUrl { get; private set; } public Project( string id, @@ -141,21 +162,28 @@ public Project( string pingedAt, List labels, string status, + object onboarding, List authMethods, List services, List protocols, List blocks, string consoleAccessedAt, BillingLimits? billingLimits, - bool oAuth2ServerEnabled, - string oAuth2ServerAuthorizationUrl, - List oAuth2ServerScopes, - long oAuth2ServerAccessTokenDuration, - long oAuth2ServerRefreshTokenDuration, - long oAuth2ServerPublicAccessTokenDuration, - long oAuth2ServerPublicRefreshTokenDuration, - bool oAuth2ServerConfidentialPkce, - string oAuth2ServerDiscoveryUrl + bool? oAuth2ServerEnabled, + string? oAuth2ServerAuthorizationUrl, + List? oAuth2ServerScopes, + List? oAuth2ServerDefaultScopes, + List? oAuth2ServerAuthorizationDetailsTypes, + long? oAuth2ServerAccessTokenDuration, + long? oAuth2ServerRefreshTokenDuration, + long? oAuth2ServerPublicAccessTokenDuration, + long? oAuth2ServerPublicRefreshTokenDuration, + bool? oAuth2ServerConfidentialPkce, + string? oAuth2ServerVerificationUrl, + long? oAuth2ServerUserCodeLength, + string? oAuth2ServerUserCodeFormat, + long? oAuth2ServerDeviceCodeDuration, + string? oAuth2ServerDiscoveryUrl ) { Id = id; @@ -179,6 +207,7 @@ string oAuth2ServerDiscoveryUrl PingedAt = pingedAt; Labels = labels; Status = status; + Onboarding = onboarding; AuthMethods = authMethods; Services = services; Protocols = protocols; @@ -188,11 +217,17 @@ string oAuth2ServerDiscoveryUrl OAuth2ServerEnabled = oAuth2ServerEnabled; OAuth2ServerAuthorizationUrl = oAuth2ServerAuthorizationUrl; OAuth2ServerScopes = oAuth2ServerScopes; + OAuth2ServerDefaultScopes = oAuth2ServerDefaultScopes; + OAuth2ServerAuthorizationDetailsTypes = oAuth2ServerAuthorizationDetailsTypes; OAuth2ServerAccessTokenDuration = oAuth2ServerAccessTokenDuration; OAuth2ServerRefreshTokenDuration = oAuth2ServerRefreshTokenDuration; OAuth2ServerPublicAccessTokenDuration = oAuth2ServerPublicAccessTokenDuration; OAuth2ServerPublicRefreshTokenDuration = oAuth2ServerPublicRefreshTokenDuration; OAuth2ServerConfidentialPkce = oAuth2ServerConfidentialPkce; + OAuth2ServerVerificationUrl = oAuth2ServerVerificationUrl; + OAuth2ServerUserCodeLength = oAuth2ServerUserCodeLength; + OAuth2ServerUserCodeFormat = oAuth2ServerUserCodeFormat; + OAuth2ServerDeviceCodeDuration = oAuth2ServerDeviceCodeDuration; OAuth2ServerDiscoveryUrl = oAuth2ServerDiscoveryUrl; } @@ -218,23 +253,52 @@ string oAuth2ServerDiscoveryUrl pingedAt: map["pingedAt"].ToString(), labels: map["labels"].ConvertToList(), status: map["status"].ToString(), + onboarding: map["onboarding"].ToString(), authMethods: map["authMethods"].ConvertToList>().Select(it => Appwrite.Models.ProjectAuthMethod.From(map: it)).ToList(), services: map["services"].ConvertToList>().Select(it => Appwrite.Models.ProjectService.From(map: it)).ToList(), protocols: map["protocols"].ConvertToList>().Select(it => Appwrite.Models.ProjectProtocol.From(map: it)).ToList(), blocks: map["blocks"].ConvertToList>().Select(it => Appwrite.Models.Block.From(map: it)).ToList(), consoleAccessedAt: map["consoleAccessedAt"].ToString(), - billingLimits: map.TryGetValue("billingLimits", out var objectRaw27) && objectRaw27 != null - ? Appwrite.Models.BillingLimits.From(map: objectRaw27 is JsonElement jsonObj27 ? jsonObj27.Deserialize>()! : (Dictionary)objectRaw27) + billingLimits: map.TryGetValue("billingLimits", out var objectRaw28) && objectRaw28 != null + ? Appwrite.Models.BillingLimits.From(map: objectRaw28 is JsonElement jsonObj28 ? jsonObj28.Deserialize>()! : (Dictionary)objectRaw28) + : null, + oAuth2ServerEnabled: map.TryGetValue("oAuth2ServerEnabled", out var boolRaw29) && boolRaw29 != null + ? (bool?)boolRaw29 + : null, + oAuth2ServerAuthorizationUrl: map.TryGetValue("oAuth2ServerAuthorizationUrl", out var oAuth2ServerAuthorizationUrl) ? oAuth2ServerAuthorizationUrl?.ToString() : null, + oAuth2ServerScopes: map.TryGetValue("oAuth2ServerScopes", out var arrayRaw31) && arrayRaw31 != null + ? arrayRaw31.ConvertToList() + : null, + oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw32) && arrayRaw32 != null + ? arrayRaw32.ConvertToList() + : null, + oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw33) && arrayRaw33 != null + ? arrayRaw33.ConvertToList() + : null, + oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw34) && numberRaw34 != null + ? Convert.ToInt64(numberRaw34) + : null, + oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw35) && numberRaw35 != null + ? Convert.ToInt64(numberRaw35) + : null, + oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw36) && numberRaw36 != null + ? Convert.ToInt64(numberRaw36) + : null, + oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw37) && numberRaw37 != null + ? Convert.ToInt64(numberRaw37) + : null, + oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw38) && boolRaw38 != null + ? (bool?)boolRaw38 + : null, + oAuth2ServerVerificationUrl: map.TryGetValue("oAuth2ServerVerificationUrl", out var oAuth2ServerVerificationUrl) ? oAuth2ServerVerificationUrl?.ToString() : null, + oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw40) && numberRaw40 != null + ? Convert.ToInt64(numberRaw40) + : null, + oAuth2ServerUserCodeFormat: map.TryGetValue("oAuth2ServerUserCodeFormat", out var oAuth2ServerUserCodeFormat) ? oAuth2ServerUserCodeFormat?.ToString() : null, + oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw42) && numberRaw42 != null + ? Convert.ToInt64(numberRaw42) : null, - oAuth2ServerEnabled: (bool)map["oAuth2ServerEnabled"], - oAuth2ServerAuthorizationUrl: map["oAuth2ServerAuthorizationUrl"].ToString(), - oAuth2ServerScopes: map["oAuth2ServerScopes"].ConvertToList(), - oAuth2ServerAccessTokenDuration: Convert.ToInt64(map["oAuth2ServerAccessTokenDuration"]), - oAuth2ServerRefreshTokenDuration: Convert.ToInt64(map["oAuth2ServerRefreshTokenDuration"]), - oAuth2ServerPublicAccessTokenDuration: Convert.ToInt64(map["oAuth2ServerPublicAccessTokenDuration"]), - oAuth2ServerPublicRefreshTokenDuration: Convert.ToInt64(map["oAuth2ServerPublicRefreshTokenDuration"]), - oAuth2ServerConfidentialPkce: (bool)map["oAuth2ServerConfidentialPkce"], - oAuth2ServerDiscoveryUrl: map["oAuth2ServerDiscoveryUrl"].ToString() + oAuth2ServerDiscoveryUrl: map.TryGetValue("oAuth2ServerDiscoveryUrl", out var oAuth2ServerDiscoveryUrl) ? oAuth2ServerDiscoveryUrl?.ToString() : null ); public Dictionary ToMap() => new Dictionary() @@ -260,6 +324,7 @@ string oAuth2ServerDiscoveryUrl { "pingedAt", PingedAt }, { "labels", Labels }, { "status", Status }, + { "onboarding", Onboarding }, { "authMethods", AuthMethods?.Select(it => it.ToMap()).ToList() }, { "services", Services?.Select(it => it.ToMap()).ToList() }, { "protocols", Protocols?.Select(it => it.ToMap()).ToList() }, @@ -269,11 +334,17 @@ string oAuth2ServerDiscoveryUrl { "oAuth2ServerEnabled", OAuth2ServerEnabled }, { "oAuth2ServerAuthorizationUrl", OAuth2ServerAuthorizationUrl }, { "oAuth2ServerScopes", OAuth2ServerScopes }, + { "oAuth2ServerDefaultScopes", OAuth2ServerDefaultScopes }, + { "oAuth2ServerAuthorizationDetailsTypes", OAuth2ServerAuthorizationDetailsTypes }, { "oAuth2ServerAccessTokenDuration", OAuth2ServerAccessTokenDuration }, { "oAuth2ServerRefreshTokenDuration", OAuth2ServerRefreshTokenDuration }, { "oAuth2ServerPublicAccessTokenDuration", OAuth2ServerPublicAccessTokenDuration }, { "oAuth2ServerPublicRefreshTokenDuration", OAuth2ServerPublicRefreshTokenDuration }, { "oAuth2ServerConfidentialPkce", OAuth2ServerConfidentialPkce }, + { "oAuth2ServerVerificationUrl", OAuth2ServerVerificationUrl }, + { "oAuth2ServerUserCodeLength", OAuth2ServerUserCodeLength }, + { "oAuth2ServerUserCodeFormat", OAuth2ServerUserCodeFormat }, + { "oAuth2ServerDeviceCodeDuration", OAuth2ServerDeviceCodeDuration }, { "oAuth2ServerDiscoveryUrl", OAuth2ServerDiscoveryUrl } }; } diff --git a/Appwrite/Models/UsageBillingPlan.cs b/Appwrite/Models/UsageBillingPlan.cs new file mode 100644 index 00000000..978141f0 --- /dev/null +++ b/Appwrite/Models/UsageBillingPlan.cs @@ -0,0 +1,103 @@ + +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 UsageBillingPlan + { + [JsonPropertyName("bandwidth")] + public AdditionalResource Bandwidth { get; private set; } + + [JsonPropertyName("executions")] + public AdditionalResource Executions { get; private set; } + + [JsonPropertyName("member")] + public AdditionalResource Member { get; private set; } + + [JsonPropertyName("realtime")] + public AdditionalResource Realtime { get; private set; } + + [JsonPropertyName("realtimeMessages")] + public AdditionalResource RealtimeMessages { get; private set; } + + [JsonPropertyName("realtimeBandwidth")] + public AdditionalResource RealtimeBandwidth { get; private set; } + + [JsonPropertyName("storage")] + public AdditionalResource Storage { get; private set; } + + [JsonPropertyName("users")] + public AdditionalResource Users { get; private set; } + + [JsonPropertyName("GBHours")] + public AdditionalResource GBHours { get; private set; } + + [JsonPropertyName("imageTransformations")] + public AdditionalResource ImageTransformations { get; private set; } + + [JsonPropertyName("credits")] + public AdditionalResource Credits { get; private set; } + + public UsageBillingPlan( + AdditionalResource bandwidth, + AdditionalResource executions, + AdditionalResource member, + AdditionalResource realtime, + AdditionalResource realtimeMessages, + AdditionalResource realtimeBandwidth, + AdditionalResource storage, + AdditionalResource users, + AdditionalResource gBHours, + AdditionalResource imageTransformations, + AdditionalResource credits + ) + { + Bandwidth = bandwidth; + Executions = executions; + Member = member; + Realtime = realtime; + RealtimeMessages = realtimeMessages; + RealtimeBandwidth = realtimeBandwidth; + Storage = storage; + Users = users; + GBHours = gBHours; + ImageTransformations = imageTransformations; + Credits = credits; + } + + public static UsageBillingPlan From(Dictionary map) => new UsageBillingPlan( + bandwidth: Appwrite.Models.AdditionalResource.From(map: map["bandwidth"] is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)map["bandwidth"]), + executions: Appwrite.Models.AdditionalResource.From(map: map["executions"] is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)map["executions"]), + member: Appwrite.Models.AdditionalResource.From(map: map["member"] is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)map["member"]), + realtime: Appwrite.Models.AdditionalResource.From(map: map["realtime"] is JsonElement jsonObj4 ? jsonObj4.Deserialize>()! : (Dictionary)map["realtime"]), + realtimeMessages: Appwrite.Models.AdditionalResource.From(map: map["realtimeMessages"] is JsonElement jsonObj5 ? jsonObj5.Deserialize>()! : (Dictionary)map["realtimeMessages"]), + realtimeBandwidth: Appwrite.Models.AdditionalResource.From(map: map["realtimeBandwidth"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["realtimeBandwidth"]), + storage: Appwrite.Models.AdditionalResource.From(map: map["storage"] is JsonElement jsonObj7 ? jsonObj7.Deserialize>()! : (Dictionary)map["storage"]), + users: Appwrite.Models.AdditionalResource.From(map: map["users"] is JsonElement jsonObj8 ? jsonObj8.Deserialize>()! : (Dictionary)map["users"]), + gBHours: Appwrite.Models.AdditionalResource.From(map: map["GBHours"] is JsonElement jsonObj9 ? jsonObj9.Deserialize>()! : (Dictionary)map["GBHours"]), + imageTransformations: Appwrite.Models.AdditionalResource.From(map: map["imageTransformations"] is JsonElement jsonObj10 ? jsonObj10.Deserialize>()! : (Dictionary)map["imageTransformations"]), + credits: Appwrite.Models.AdditionalResource.From(map: map["credits"] is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)map["credits"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "bandwidth", Bandwidth?.ToMap() }, + { "executions", Executions?.ToMap() }, + { "member", Member?.ToMap() }, + { "realtime", Realtime?.ToMap() }, + { "realtimeMessages", RealtimeMessages?.ToMap() }, + { "realtimeBandwidth", RealtimeBandwidth?.ToMap() }, + { "storage", Storage?.ToMap() }, + { "users", Users?.ToMap() }, + { "GBHours", GBHours?.ToMap() }, + { "imageTransformations", ImageTransformations?.ToMap() }, + { "credits", Credits?.ToMap() } + }; + } +} diff --git a/Appwrite/Models/UsageEvent.cs b/Appwrite/Models/UsageEvent.cs deleted file mode 100644 index 2d881278..00000000 --- a/Appwrite/Models/UsageEvent.cs +++ /dev/null @@ -1,96 +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 UsageEvent - { - [JsonPropertyName("metric")] - public string Metric { get; private set; } - - [JsonPropertyName("value")] - public long Value { get; private set; } - - [JsonPropertyName("time")] - public string Time { get; private set; } - - [JsonPropertyName("path")] - public string Path { get; private set; } - - [JsonPropertyName("method")] - public string Method { get; private set; } - - [JsonPropertyName("status")] - public string Status { get; private set; } - - [JsonPropertyName("resourceType")] - public string ResourceType { get; private set; } - - [JsonPropertyName("resourceId")] - public string ResourceId { get; private set; } - - [JsonPropertyName("countryCode")] - public string CountryCode { get; private set; } - - [JsonPropertyName("userAgent")] - public string UserAgent { get; private set; } - - public UsageEvent( - string metric, - long @value, - string time, - string @path, - string method, - string status, - string resourceType, - string resourceId, - string countryCode, - string userAgent - ) - { - Metric = metric; - Value = @value; - Time = time; - Path = @path; - Method = method; - Status = status; - ResourceType = resourceType; - ResourceId = resourceId; - CountryCode = countryCode; - UserAgent = userAgent; - } - - public static UsageEvent From(Dictionary map) => new UsageEvent( - metric: map["metric"].ToString(), - @value: Convert.ToInt64(map["value"]), - time: map["time"].ToString(), - @path: map["path"].ToString(), - method: map["method"].ToString(), - status: map["status"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString(), - countryCode: map["countryCode"].ToString(), - userAgent: map["userAgent"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "metric", Metric }, - { "value", Value }, - { "time", Time }, - { "path", Path }, - { "method", Method }, - { "status", Status }, - { "resourceType", ResourceType }, - { "resourceId", ResourceId }, - { "countryCode", CountryCode }, - { "userAgent", UserAgent } - }; - } -} diff --git a/Appwrite/Models/UsageEventList.cs b/Appwrite/Models/UsageEventList.cs deleted file mode 100644 index d2439cf0..00000000 --- a/Appwrite/Models/UsageEventList.cs +++ /dev/null @@ -1,40 +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 UsageEventList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("events")] - public List Events { get; private set; } - - public UsageEventList( - long total, - List events - ) - { - Total = total; - Events = events; - } - - public static UsageEventList From(Dictionary map) => new UsageEventList( - total: Convert.ToInt64(map["total"]), - events: map["events"].ConvertToList>().Select(it => Appwrite.Models.UsageEvent.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "events", Events?.Select(it => it.ToMap()).ToList() } - }; - } -} diff --git a/Appwrite/Models/UsageGauge.cs b/Appwrite/Models/UsageGauge.cs deleted file mode 100644 index 3bd12d75..00000000 --- a/Appwrite/Models/UsageGauge.cs +++ /dev/null @@ -1,61 +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 UsageGauge - { - [JsonPropertyName("metric")] - public string Metric { get; private set; } - - [JsonPropertyName("value")] - public long Value { get; private set; } - - [JsonPropertyName("time")] - public string Time { get; private set; } - - [JsonPropertyName("resourceType")] - public string ResourceType { get; private set; } - - [JsonPropertyName("resourceId")] - public string ResourceId { get; private set; } - - public UsageGauge( - string metric, - long @value, - string time, - string resourceType, - string resourceId - ) - { - Metric = metric; - Value = @value; - Time = time; - ResourceType = resourceType; - ResourceId = resourceId; - } - - public static UsageGauge From(Dictionary map) => new UsageGauge( - metric: map["metric"].ToString(), - @value: Convert.ToInt64(map["value"]), - time: map["time"].ToString(), - resourceType: map["resourceType"].ToString(), - resourceId: map["resourceId"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "metric", Metric }, - { "value", Value }, - { "time", Time }, - { "resourceType", ResourceType }, - { "resourceId", ResourceId } - }; - } -} diff --git a/Appwrite/Models/UsageGaugeList.cs b/Appwrite/Models/UsageGaugeList.cs deleted file mode 100644 index 206ed720..00000000 --- a/Appwrite/Models/UsageGaugeList.cs +++ /dev/null @@ -1,40 +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 UsageGaugeList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("gauges")] - public List Gauges { get; private set; } - - public UsageGaugeList( - long total, - List gauges - ) - { - Total = total; - Gauges = gauges; - } - - public static UsageGaugeList From(Dictionary map) => new UsageGaugeList( - total: Convert.ToInt64(map["total"]), - gauges: map["gauges"].ConvertToList>().Select(it => Appwrite.Models.UsageGauge.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "gauges", Gauges?.Select(it => it.ToMap()).ToList() } - }; - } -} diff --git a/Appwrite/Models/User.cs b/Appwrite/Models/User.cs index 5276bdc4..f3440fc7 100644 --- a/Appwrite/Models/User.cs +++ b/Appwrite/Models/User.cs @@ -53,6 +53,21 @@ public class User [JsonPropertyName("emailVerification")] public bool EmailVerification { get; private set; } + [JsonPropertyName("emailCanonical")] + public string? EmailCanonical { get; private set; } + + [JsonPropertyName("emailIsFree")] + public bool? EmailIsFree { get; private set; } + + [JsonPropertyName("emailIsDisposable")] + public bool? EmailIsDisposable { get; private set; } + + [JsonPropertyName("emailIsCorporate")] + public bool? EmailIsCorporate { get; private set; } + + [JsonPropertyName("emailIsCanonical")] + public bool? EmailIsCanonical { get; private set; } + [JsonPropertyName("phoneVerification")] public bool PhoneVerification { get; private set; } @@ -89,6 +104,11 @@ public User( string email, string phone, bool emailVerification, + string? emailCanonical, + bool? emailIsFree, + bool? emailIsDisposable, + bool? emailIsCorporate, + bool? emailIsCanonical, bool phoneVerification, bool mfa, Preferences prefs, @@ -112,6 +132,11 @@ public User( Email = email; Phone = phone; EmailVerification = emailVerification; + EmailCanonical = emailCanonical; + EmailIsFree = emailIsFree; + EmailIsDisposable = emailIsDisposable; + EmailIsCorporate = emailIsCorporate; + EmailIsCanonical = emailIsCanonical; PhoneVerification = phoneVerification; Mfa = mfa; Prefs = prefs; @@ -136,13 +161,26 @@ public User( email: map["email"].ToString(), phone: map["phone"].ToString(), emailVerification: (bool)map["emailVerification"], + emailCanonical: map.TryGetValue("emailCanonical", out var emailCanonical) ? emailCanonical?.ToString() : null, + emailIsFree: map.TryGetValue("emailIsFree", out var boolRaw16) && boolRaw16 != null + ? (bool?)boolRaw16 + : null, + emailIsDisposable: map.TryGetValue("emailIsDisposable", out var boolRaw17) && boolRaw17 != null + ? (bool?)boolRaw17 + : null, + emailIsCorporate: map.TryGetValue("emailIsCorporate", out var boolRaw18) && boolRaw18 != null + ? (bool?)boolRaw18 + : null, + emailIsCanonical: map.TryGetValue("emailIsCanonical", out var boolRaw19) && boolRaw19 != null + ? (bool?)boolRaw19 + : null, phoneVerification: (bool)map["phoneVerification"], mfa: (bool)map["mfa"], - prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj17 ? jsonObj17.Deserialize>()! : (Dictionary)map["prefs"]), + prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj22 ? jsonObj22.Deserialize>()! : (Dictionary)map["prefs"]), targets: map["targets"].ConvertToList>().Select(it => Appwrite.Models.Target.From(map: it)).ToList(), accessedAt: map["accessedAt"].ToString(), - impersonator: map.TryGetValue("impersonator", out var boolRaw20) && boolRaw20 != null - ? (bool?)boolRaw20 + impersonator: map.TryGetValue("impersonator", out var boolRaw25) && boolRaw25 != null + ? (bool?)boolRaw25 : null, impersonatorUserId: map.TryGetValue("impersonatorUserId", out var impersonatorUserId) ? impersonatorUserId?.ToString() : null ); @@ -163,6 +201,11 @@ public User( { "email", Email }, { "phone", Phone }, { "emailVerification", EmailVerification }, + { "emailCanonical", EmailCanonical }, + { "emailIsFree", EmailIsFree }, + { "emailIsDisposable", EmailIsDisposable }, + { "emailIsCorporate", EmailIsCorporate }, + { "emailIsCanonical", EmailIsCanonical }, { "phoneVerification", PhoneVerification }, { "mfa", Mfa }, { "prefs", Prefs?.ToMap() }, diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index 130ba057..9142a0de 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -300,6 +300,21 @@ public static string DistanceLessThan(string attribute, object values, double di return new Query("distanceLessThan", attribute, new List { new List { values, distance, meters } }).ToString(); } + public static string VectorDot(string attribute, List vector) + { + return new Query("vectorDot", attribute, new List { vector }).ToString(); + } + + public static string VectorCosine(string attribute, List vector) + { + return new Query("vectorCosine", attribute, new List { vector }).ToString(); + } + + public static string VectorEuclidean(string attribute, List vector) + { + return new Query("vectorEuclidean", attribute, new List { vector }).ToString(); + } + public static string Intersects(string attribute, object values) { return new Query("intersects", attribute, new List { values }).ToString(); diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 338429fd..9adf981b 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -27,7 +27,8 @@ public Account(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -70,7 +71,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -112,7 +114,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -146,7 +149,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -213,7 +217,8 @@ public Task DeleteIdentity(string identityId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -248,7 +253,8 @@ static Models.JWT Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -282,7 +288,8 @@ static Models.LogList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -320,7 +327,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -357,7 +365,8 @@ static Models.MfaType Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -395,7 +404,8 @@ static Models.MfaType Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -432,7 +442,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -528,7 +539,8 @@ public Task DeleteMFAAuthenticator(Appwrite.Enums.AuthenticatorType type var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -564,7 +576,8 @@ static Models.MfaChallenge Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -604,7 +617,8 @@ static Models.MfaChallenge Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -643,7 +657,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -676,7 +691,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -708,7 +724,8 @@ static Models.MfaFactors Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -744,7 +761,8 @@ static Models.MfaFactors Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -779,7 +797,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -817,7 +836,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -854,7 +874,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -891,7 +912,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -927,7 +949,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -961,7 +984,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -998,7 +1022,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1037,7 +1062,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1069,7 +1095,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1105,7 +1132,8 @@ static Models.Preferences Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1147,7 +1175,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1192,7 +1221,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1225,7 +1255,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1293,7 +1324,8 @@ public Task DeleteSessions() var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1333,7 +1365,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1371,7 +1404,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1409,7 +1443,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1446,7 +1481,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1480,7 +1516,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1516,7 +1553,8 @@ static Models.Session Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1584,7 +1622,8 @@ public Task DeleteSession(string sessionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1633,7 +1672,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1683,7 +1723,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1732,7 +1773,8 @@ public Task CreateOAuth2Token(Appwrite.Enums.OAuthProvider provider, str var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "text/html" } }; @@ -1771,7 +1813,8 @@ public Task CreateOAuth2Token(Appwrite.Enums.OAuthProvider provider, str var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1819,7 +1862,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1868,7 +1912,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1906,7 +1951,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1945,7 +1991,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1985,7 +2032,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2023,7 +2071,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Activities.cs b/Appwrite/Services/Activities.cs index 58f62df8..7fe45333 100644 --- a/Appwrite/Services/Activities.cs +++ b/Appwrite/Services/Activities.cs @@ -28,7 +28,8 @@ public Activities(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -62,7 +63,8 @@ static Models.ActivityEventList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Advisor.cs b/Appwrite/Services/Advisor.cs index 847dc0d1..af0bc406 100644 --- a/Appwrite/Services/Advisor.cs +++ b/Appwrite/Services/Advisor.cs @@ -31,7 +31,8 @@ public Advisor(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -66,7 +67,8 @@ static Models.ReportList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -134,7 +136,8 @@ public Task DeleteReport(string reportId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -169,7 +172,8 @@ static Models.InsightList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Avatars.cs b/Appwrite/Services/Avatars.cs index 60f46d16..06deb177 100644 --- a/Appwrite/Services/Avatars.cs +++ b/Appwrite/Services/Avatars.cs @@ -40,7 +40,8 @@ public Task GetBrowser(Appwrite.Enums.Browser code, long? width = null, var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; @@ -79,7 +80,8 @@ public Task GetCreditCard(Appwrite.Enums.CreditCard code, long? width = var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; @@ -110,7 +112,8 @@ public Task GetFavicon(string url) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/*" } }; @@ -150,7 +153,8 @@ public Task GetFlag(Appwrite.Enums.Flag code, long? width = null, long? var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; @@ -190,7 +194,8 @@ public Task GetImage(string url, long? width = null, long? height = null var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/*" } }; @@ -236,7 +241,8 @@ public Task GetInitials(string? name = null, long? width = null, long? h var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; @@ -269,7 +275,8 @@ public Task GetQR(string text, long? size = null, long? margin = null, b var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; @@ -325,7 +332,8 @@ public Task GetScreenshot(string url, object? headers = null, long? view var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/png" } }; diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs index 180d5c4d..fd199d91 100644 --- a/Appwrite/Services/Backups.cs +++ b/Appwrite/Services/Backups.cs @@ -28,7 +28,8 @@ public Backups(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -63,7 +64,8 @@ static Models.BackupArchiveList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -96,7 +98,8 @@ static Models.BackupArchive Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -130,7 +133,8 @@ public Task DeleteArchive(string archiveId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -158,7 +162,8 @@ public Task DeleteArchive(string archiveId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -198,7 +203,8 @@ static Models.BackupPolicyList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -231,7 +237,8 @@ static Models.BackupPolicy Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -269,7 +276,8 @@ static Models.BackupPolicy Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -303,7 +311,8 @@ public Task DeletePolicy(string policyId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -318,9 +327,19 @@ public Task DeletePolicy(string policyId) /// /// Create and trigger a new restoration for a backup on a project. + /// + /// When restoring a DocumentsDB or VectorsDB database to a new resource, pass + /// `newSpecification` to provision the restored database on a different + /// specification than the archived one (for example, restoring onto a larger + /// or smaller dedicated database). Use `serverless` to restore onto the shared + /// pool, or a dedicated specification slug to restore onto a dedicated + /// database of that size. The specification must be permitted by the + /// organization's plan. `newSpecification` is not supported for + /// legacy/TablesDB databases or for bucket restores. + /// /// /// - public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null) + public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null, string? newSpecification = null) { var apiPath = "/backups/restoration"; @@ -329,13 +348,15 @@ public Task DeletePolicy(string policyId) { "archiveId", archiveId }, { "services", services?.Select(e => e.Value).ToList() }, { "newResourceId", newResourceId }, - { "newResourceName", newResourceName } + { "newResourceName", newResourceName }, + { "newSpecification", newSpecification } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -368,7 +389,8 @@ static Models.BackupRestoration Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -401,7 +423,8 @@ static Models.BackupRestorationList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index 5af68af2..d87d2727 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -32,7 +32,8 @@ public Databases(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -70,7 +71,8 @@ static Models.DatabaseList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -92,6 +94,7 @@ static Models.Database Convert(Dictionary it) /// List transactions across all databases. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.listTransactions` instead.")] public Task ListTransactions(List? queries = null) { var apiPath = "/databases/transactions"; @@ -103,7 +106,8 @@ static Models.Database Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -125,6 +129,7 @@ static Models.TransactionList Convert(Dictionary it) /// Create a new transaction. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTransaction` instead.")] public Task CreateTransaction(long? ttl = null) { var apiPath = "/databases/transactions"; @@ -137,7 +142,8 @@ static Models.TransactionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -159,6 +165,7 @@ static Models.Transaction Convert(Dictionary it) /// Get a transaction by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.getTransaction` instead.")] public Task GetTransaction(string transactionId) { var apiPath = "/databases/transactions/{transactionId}" @@ -170,7 +177,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -192,6 +200,7 @@ static Models.Transaction Convert(Dictionary it) /// Update a transaction, to either commit or roll back its operations. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTransaction` instead.")] public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) { var apiPath = "/databases/transactions/{transactionId}" @@ -206,7 +215,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -228,6 +238,7 @@ static Models.Transaction Convert(Dictionary it) /// Delete a transaction by its unique ID. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTransaction` instead.")] public Task DeleteTransaction(string transactionId) { var apiPath = "/databases/transactions/{transactionId}" @@ -257,6 +268,7 @@ public Task DeleteTransaction(string transactionId) /// Create multiple operations in a single transaction. /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createOperations` instead.")] public Task CreateOperations(string transactionId, List? operations = null) { var apiPath = "/databases/transactions/{transactionId}/operations" @@ -270,7 +282,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -305,7 +318,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -342,7 +356,8 @@ static Models.Database Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -411,7 +426,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -456,7 +472,8 @@ static Models.CollectionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -492,7 +509,8 @@ static Models.Collection Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -533,7 +551,8 @@ static Models.Collection Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -602,7 +621,8 @@ public Task DeleteCollection(string databaseId, string collectionId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -646,7 +666,8 @@ static Models.AttributeList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -690,7 +711,8 @@ static Models.AttributeBigint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -731,7 +753,8 @@ static Models.AttributeBigint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -772,7 +795,8 @@ static Models.AttributeBoolean Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -812,7 +836,8 @@ static Models.AttributeBoolean Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -853,7 +878,8 @@ static Models.AttributeDatetime Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -894,7 +920,8 @@ static Models.AttributeDatetime Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -936,7 +963,8 @@ static Models.AttributeEmail Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -979,7 +1007,8 @@ static Models.AttributeEmail Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1022,7 +1051,8 @@ static Models.AttributeEnum Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1066,7 +1096,8 @@ static Models.AttributeEnum Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1110,7 +1141,8 @@ static Models.AttributeFloat Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1154,7 +1186,8 @@ static Models.AttributeFloat Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1198,7 +1231,8 @@ static Models.AttributeInteger Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1239,7 +1273,8 @@ static Models.AttributeInteger Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1281,7 +1316,8 @@ static Models.AttributeIp Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1304,7 +1340,7 @@ static Models.AttributeIp Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.")] - public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null) + public Task CreateLineAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line" .Replace("{databaseId}", databaseId) @@ -1320,7 +1356,8 @@ static Models.AttributeIp Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1344,7 +1381,7 @@ static Models.AttributeLine Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.")] - public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdateLineAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}" .Replace("{databaseId}", databaseId) @@ -1361,7 +1398,8 @@ static Models.AttributeLine Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1384,6 +1422,7 @@ static Models.AttributeLine Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createLongtextColumn` instead.")] public Task CreateLongtextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/longtext" @@ -1402,7 +1441,8 @@ static Models.AttributeLine Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1426,6 +1466,7 @@ static Models.AttributeLongtext Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateLongtextColumn` instead.")] public Task UpdateLongtextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}" @@ -1443,7 +1484,8 @@ static Models.AttributeLongtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1466,6 +1508,7 @@ static Models.AttributeLongtext Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createMediumtextColumn` instead.")] public Task CreateMediumtextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext" @@ -1484,7 +1527,8 @@ static Models.AttributeLongtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1508,6 +1552,7 @@ static Models.AttributeMediumtext Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateMediumtextColumn` instead.")] public Task UpdateMediumtextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}" @@ -1525,7 +1570,8 @@ static Models.AttributeMediumtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1548,7 +1594,7 @@ static Models.AttributeMediumtext Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.")] - public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null) + public Task CreatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point" .Replace("{databaseId}", databaseId) @@ -1564,7 +1610,8 @@ static Models.AttributeMediumtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1588,7 +1635,7 @@ static Models.AttributePoint Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.")] - public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdatePointAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}" .Replace("{databaseId}", databaseId) @@ -1605,7 +1652,8 @@ static Models.AttributePoint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1628,7 +1676,7 @@ static Models.AttributePoint Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.")] - public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null) + public Task CreatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon" .Replace("{databaseId}", databaseId) @@ -1644,7 +1692,8 @@ static Models.AttributePoint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1668,7 +1717,7 @@ static Models.AttributePolygon Convert(Dictionary it) /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.")] - public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdatePolygonAttribute(string databaseId, string collectionId, string key, bool required, List>? @default = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}" .Replace("{databaseId}", databaseId) @@ -1685,7 +1734,8 @@ static Models.AttributePolygon Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1729,7 +1779,8 @@ static Models.AttributePolygon Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1770,7 +1821,8 @@ static Models.AttributeRelationship Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1813,7 +1865,8 @@ static Models.AttributeRelationship Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1856,7 +1909,8 @@ static Models.AttributeString Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1879,6 +1933,7 @@ static Models.AttributeString Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTextColumn` instead.")] public Task CreateTextAttribute(string databaseId, string collectionId, string key, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/text" @@ -1897,7 +1952,8 @@ static Models.AttributeString Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1921,6 +1977,7 @@ static Models.AttributeText Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead.")] public Task UpdateTextAttribute(string databaseId, string collectionId, string key, bool required, string @default, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}" @@ -1938,7 +1995,8 @@ static Models.AttributeText Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1979,7 +2037,8 @@ static Models.AttributeText Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2021,7 +2080,8 @@ static Models.AttributeUrl Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2044,6 +2104,7 @@ static Models.AttributeUrl Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createVarcharColumn` instead.")] public Task CreateVarcharAttribute(string databaseId, string collectionId, string key, long size, bool required, string? @default = null, bool? array = null, bool? encrypt = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/varchar" @@ -2063,7 +2124,8 @@ static Models.AttributeUrl Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2087,6 +2149,7 @@ static Models.AttributeVarchar Convert(Dictionary it) /// /// /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.updateVarcharColumn` instead.")] public Task UpdateVarcharAttribute(string databaseId, string collectionId, string key, bool required, string @default, long? size = null, string? newKey = null) { var apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}" @@ -2105,7 +2168,8 @@ static Models.AttributeVarchar Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2141,7 +2205,8 @@ public Task GetAttribute(string databaseId, string collectionId, string var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2253,7 +2318,8 @@ public Task DeleteAttribute(string databaseId, string collectionId, stri var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2296,7 +2362,8 @@ static Models.DocumentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2337,7 +2404,8 @@ static Models.Document Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2379,7 +2447,8 @@ static Models.DocumentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2420,7 +2489,8 @@ static Models.DocumentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2459,7 +2529,8 @@ static Models.DocumentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2498,7 +2569,8 @@ static Models.DocumentList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2541,7 +2613,8 @@ static Models.Document Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2582,7 +2655,8 @@ static Models.Document Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2656,7 +2730,8 @@ public Task DeleteDocument(string databaseId, string collectionId, strin var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2697,7 +2772,8 @@ static Models.Document Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2734,7 +2810,8 @@ static Models.Document Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2777,7 +2854,8 @@ static Models.IndexList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2813,7 +2891,8 @@ static Models.Index Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Functions.cs b/Appwrite/Services/Functions.cs index fe1987ed..7ce93ad2 100644 --- a/Appwrite/Services/Functions.cs +++ b/Appwrite/Services/Functions.cs @@ -31,7 +31,8 @@ public Functions(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -89,7 +90,8 @@ static Models.FunctionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -121,7 +123,8 @@ static Models.Function Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -143,17 +146,19 @@ static Models.RuntimeList Convert(Dictionary it) /// List allowed function specifications for this instance. /// /// - public Task ListSpecifications() + public Task ListSpecifications(string? type = null) { var apiPath = "/functions/specifications"; var apiParameters = new Dictionary() { + { "type", type } }; var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -186,7 +191,8 @@ static Models.SpecificationList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -241,7 +247,8 @@ static Models.Function Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -306,7 +313,8 @@ public Task Delete(string functionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -343,7 +351,8 @@ static Models.Function Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -390,7 +399,8 @@ static Models.DeploymentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "multipart/form-data" } + { "content-type", "multipart/form-data" }, + { "accept", "application/json" } }; @@ -435,7 +445,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -479,7 +490,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -518,7 +530,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -552,7 +565,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -606,7 +620,7 @@ public Task DeleteDeployment(string functionId, string deploymentId) /// browser to start downloading the file to user downloads directory. /// /// - public Task GetDeploymentDownload(string functionId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null) + public Task GetDeploymentDownload(string functionId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null, string? token = null) { var apiPath = "/functions/{functionId}/deployments/{deploymentId}/download" .Replace("{functionId}", functionId) @@ -614,12 +628,14 @@ public Task GetDeploymentDownload(string functionId, string deploymentId var apiParameters = new Dictionary() { - { "type", type?.Value } + { "type", type?.Value }, + { "token", token } }; var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "*/*" } }; @@ -653,7 +669,8 @@ public Task GetDeploymentDownload(string functionId, string deploymentId var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -689,7 +706,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -732,7 +750,8 @@ static Models.ExecutionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -766,7 +785,8 @@ static Models.Execution Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -831,7 +851,8 @@ public Task DeleteExecution(string functionId, string executionId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -870,7 +891,8 @@ static Models.VariableList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -904,7 +926,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -942,7 +965,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Graphql.cs b/Appwrite/Services/Graphql.cs index 2aebacce..aec1b0ec 100644 --- a/Appwrite/Services/Graphql.cs +++ b/Appwrite/Services/Graphql.cs @@ -30,7 +30,8 @@ public Task Query(object query) { { "X-Appwrite-Project", _client.GetConfig("project") }, { "x-sdk-graphql", "true" }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -65,7 +66,8 @@ public Task Mutation(object query) { { "X-Appwrite-Project", _client.GetConfig("project") }, { "x-sdk-graphql", "true" }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Health.cs b/Appwrite/Services/Health.cs deleted file mode 100644 index 01af8330..00000000 --- a/Appwrite/Services/Health.cs +++ /dev/null @@ -1,864 +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 Health : Service - { - public Health(Client client) : base(client) - { - } - - /// - /// Check the Appwrite HTTP server is up and responsive. - /// - /// - public Task Get() - { - var apiPath = "/health"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatus Convert(Dictionary it) - { - return 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 Antivirus server is up and connection is successful. - /// - /// - public Task GetAntivirus() - { - var apiPath = "/health/anti-virus"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthAntivirus Convert(Dictionary it) - { - return Models.HealthAntivirus.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 database that backs the audit and activity store. When the - /// connection is reachable the endpoint returns a passing status with its - /// response time. - /// - /// - /// - public Task GetAuditsDB() - { - var apiPath = "/health/audits-db"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatusList Convert(Dictionary it) - { - return Models.HealthStatusList.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 in-memory cache servers are up and connection is - /// successful. - /// - /// - public Task GetCache() - { - var apiPath = "/health/cache"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatusList Convert(Dictionary it) - { - return Models.HealthStatusList.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 SSL certificate for a domain - /// - /// - public Task GetCertificate(string? domain = null) - { - var apiPath = "/health/certificate"; - - var apiParameters = new Dictionary() - { - { "domain", domain } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthCertificate Convert(Dictionary it) - { - return Models.HealthCertificate.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 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() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatus Convert(Dictionary it) - { - return 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. - /// - /// - public Task GetDB() - { - var apiPath = "/health/db"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatusList Convert(Dictionary it) - { - return Models.HealthStatusList.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 pub-sub servers are up and connection is successful. - /// - /// - public Task GetPubSub() - { - var apiPath = "/health/pubsub"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatusList Convert(Dictionary it) - { - return Models.HealthStatusList.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 audit logs that are waiting to be processed in the - /// Appwrite internal queue server. - /// - /// - /// - public Task GetQueueAudits(long? threshold = null) - { - var apiPath = "/health/queue/audits"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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. - /// - /// - public Task GetQueueBuilds(long? threshold = null) - { - var apiPath = "/health/queue/builds"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 - /// server. - /// - /// - public Task GetQueueCertificates(long? threshold = null) - { - var apiPath = "/health/queue/certificates"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 database changes that are waiting to be processed in the - /// Appwrite internal queue server. - /// - /// - public Task GetQueueDatabases(string? name = null, long? threshold = null) - { - var apiPath = "/health/queue/databases"; - - var apiParameters = new Dictionary() - { - { "name", name }, - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 background destructive changes that are waiting to be - /// processed in the Appwrite internal queue server. - /// - /// - public Task GetQueueDeletes(long? threshold = null) - { - var apiPath = "/health/queue/deletes"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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); - - } - - /// - /// Returns the amount of failed jobs in a given queue. - /// - /// - /// - public Task GetFailedJobs(Appwrite.Enums.HealthQueueName name, long? threshold = null) - { - var apiPath = "/health/queue/failed/{name}" - .Replace("{name}", name.Value); - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 function executions that are waiting to be processed in - /// the Appwrite internal queue server. - /// - /// - public Task GetQueueFunctions(long? threshold = null) - { - var apiPath = "/health/queue/functions"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 logs that are waiting to be processed in the Appwrite - /// internal queue server. - /// - /// - public Task GetQueueLogs(long? threshold = null) - { - var apiPath = "/health/queue/logs"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 mails that are waiting to be processed in the Appwrite - /// internal queue server. - /// - /// - public Task GetQueueMails(long? threshold = null) - { - var apiPath = "/health/queue/mails"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 messages that are waiting to be processed in the Appwrite - /// internal queue server. - /// - /// - public Task GetQueueMessaging(long? threshold = null) - { - var apiPath = "/health/queue/messaging"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 migrations that are waiting to be processed in the - /// Appwrite internal queue server. - /// - /// - public Task GetQueueMigrations(long? threshold = null) - { - var apiPath = "/health/queue/migrations"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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. - /// - /// - public Task GetQueueStatsResources(long? threshold = null) - { - var apiPath = "/health/queue/stats-resources"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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 - /// internal queue server. - /// - /// - public Task GetQueueUsage(long? threshold = null) - { - var apiPath = "/health/queue/stats-usage"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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. - /// - /// - public Task GetQueueWebhooks(long? threshold = null) - { - var apiPath = "/health/queue/webhooks"; - - var apiParameters = new Dictionary() - { - { "threshold", threshold } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthQueue Convert(Dictionary it) - { - return 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); - - } - - /// - /// Check the Appwrite storage device is up and connection is successful. - /// - /// - public Task GetStorage() - { - var apiPath = "/health/storage"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatus Convert(Dictionary it) - { - return 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 local storage device is up and connection is successful. - /// - /// - public Task GetStorageLocal() - { - var apiPath = "/health/storage/local"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthStatus Convert(Dictionary it) - { - return 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 server time is synced with Google remote NTP server. We - /// use this technology to smoothly handle leap seconds with no disruptive - /// events. The [Network Time - /// Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is - /// used by hundreds of millions of computers and devices to synchronize their - /// clocks over the Internet. If your computer sets its own clock, it likely - /// uses NTP. - /// - /// - public Task GetTime() - { - var apiPath = "/health/time"; - - var apiParameters = new Dictionary() - { - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.HealthTime Convert(Dictionary it) - { - return Models.HealthTime.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/Locale.cs b/Appwrite/Services/Locale.cs index 9f065f56..5b80b0dc 100644 --- a/Appwrite/Services/Locale.cs +++ b/Appwrite/Services/Locale.cs @@ -32,7 +32,8 @@ public Locale(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -65,7 +66,8 @@ static Models.Locale Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -98,7 +100,8 @@ static Models.LocaleCodeList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -131,7 +134,8 @@ static Models.ContinentList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -164,7 +168,8 @@ static Models.CountryList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -197,7 +202,8 @@ static Models.CountryList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -231,7 +237,8 @@ static Models.PhoneList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -264,7 +271,8 @@ static Models.CurrencyList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Messaging.cs b/Appwrite/Services/Messaging.cs index 000f9dff..aa8ef109 100644 --- a/Appwrite/Services/Messaging.cs +++ b/Appwrite/Services/Messaging.cs @@ -30,7 +30,8 @@ public Messaging(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -75,7 +76,8 @@ static Models.MessageList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -123,7 +125,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -175,7 +178,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -230,7 +234,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -271,7 +276,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -311,7 +317,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -355,7 +362,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -398,7 +406,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -432,7 +441,8 @@ static Models.Message Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -480,41 +490,6 @@ public Task Delete(string messageId) } - /// - /// Get the message activity logs listed by its unique ID. - /// - /// - public Task ListMessageLogs(string messageId, List? queries = null, bool? total = null) - { - var apiPath = "/messaging/messages/{messageId}/logs" - .Replace("{messageId}", messageId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.LogList Convert(Dictionary it) - { - return Models.LogList.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 a list of the targets associated with a message. /// @@ -532,7 +507,8 @@ static Models.LogList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -567,7 +543,8 @@ static Models.TargetList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -609,7 +586,8 @@ static Models.ProviderList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -650,7 +628,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -692,7 +671,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -733,7 +713,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -771,7 +752,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -808,7 +790,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -846,7 +829,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -883,7 +867,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -926,7 +911,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -969,7 +955,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1008,7 +995,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1047,7 +1035,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1088,7 +1077,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1129,7 +1119,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1170,7 +1161,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1211,7 +1203,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1254,7 +1247,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1297,7 +1291,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1345,7 +1340,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1392,7 +1388,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1440,7 +1437,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1487,7 +1485,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1526,7 +1525,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1565,7 +1565,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1604,7 +1605,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1643,7 +1645,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1682,7 +1685,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1721,7 +1725,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1760,7 +1765,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1799,7 +1805,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1833,7 +1840,8 @@ static Models.Provider Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1880,76 +1888,6 @@ public Task DeleteProvider(string providerId) } - /// - /// Get the provider activity logs listed by its unique ID. - /// - /// - public Task ListProviderLogs(string providerId, List? queries = null, bool? total = null) - { - var apiPath = "/messaging/providers/{providerId}/logs" - .Replace("{providerId}", providerId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.LogList Convert(Dictionary it) - { - return Models.LogList.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 subscriber activity logs listed by its unique ID. - /// - /// - public Task ListSubscriberLogs(string subscriberId, List? queries = null, bool? total = null) - { - var apiPath = "/messaging/subscribers/{subscriberId}/logs" - .Replace("{subscriberId}", subscriberId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.LogList Convert(Dictionary it) - { - return Models.LogList.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 a list of all topics from the current Appwrite project. /// @@ -1967,7 +1905,8 @@ static Models.LogList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2003,7 +1942,8 @@ static Models.TopicList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2037,7 +1977,8 @@ static Models.Topic Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2074,7 +2015,8 @@ static Models.Topic Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2121,41 +2063,6 @@ public Task DeleteTopic(string topicId) } - /// - /// Get the topic activity logs listed by its unique ID. - /// - /// - public Task ListTopicLogs(string topicId, List? queries = null, bool? total = null) - { - var apiPath = "/messaging/topics/{topicId}/logs" - .Replace("{topicId}", topicId); - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.LogList Convert(Dictionary it) - { - return Models.LogList.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 a list of all subscribers from the current Appwrite project. /// @@ -2174,7 +2081,8 @@ static Models.LogList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2210,7 +2118,8 @@ static Models.SubscriberList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2245,7 +2154,8 @@ static Models.Subscriber Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Organization.cs b/Appwrite/Services/Organization.cs index 74e21021..be43215d 100644 --- a/Appwrite/Services/Organization.cs +++ b/Appwrite/Services/Organization.cs @@ -13,6 +13,103 @@ public Organization(Client client) : base(client) { } + /// + /// Get the current organization. + /// + /// + public Task Get() + { + var apiPath = "/organization"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Organization Convert(Dictionary it) + { + return Models.Organization.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 the current organization's name. + /// + /// + public Task Update(string name) + { + var apiPath = "/organization"; + + var apiParameters = new Dictionary() + { + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Organization Convert(Dictionary it) + { + return Models.Organization.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete the current organization. All projects that belong to the + /// organization are deleted as well. + /// + /// + public Task Delete() + { + var apiPath = "/organization"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + /// /// Get a list of all API keys from the current organization. /// @@ -29,7 +126,8 @@ public Organization(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -66,7 +164,8 @@ static Models.KeyList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -100,7 +199,8 @@ static Models.Key Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -138,7 +238,8 @@ static Models.Key Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -178,6 +279,185 @@ public Task DeleteKey(string keyId) + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Get a list of all memberships from the current organization. + /// + /// + public Task ListMemberships(List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/organization/memberships"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.MembershipList Convert(Dictionary it) + { + return Models.MembershipList.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); + + } + + /// + /// Invite a new member to join the current organization. An email with a link + /// to join the organization will be sent to the new member's email address. If + /// member doesn't exist in the project it will be automatically created. + /// + /// + public Task CreateMembership(List roles, string? email = null, string? userId = null, string? phone = null, string? url = null, string? name = null) + { + var apiPath = "/organization/memberships"; + + var apiParameters = new Dictionary() + { + { "email", email }, + { "userId", userId }, + { "phone", phone }, + { "roles", roles }, + { "url", url }, + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Membership Convert(Dictionary it) + { + return Models.Membership.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 membership from the current organization by its unique ID. + /// + /// + public Task GetMembership(string membershipId) + { + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Membership Convert(Dictionary it) + { + return Models.Membership.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); + + } + + /// + /// Modify the roles of a member in the current organization. + /// + /// + public Task UpdateMembership(string membershipId, List roles) + { + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); + + var apiParameters = new Dictionary() + { + { "roles", roles } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Membership Convert(Dictionary it) + { + return Models.Membership.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); + + } + + /// + /// Remove a member from the current organization. The member is removed + /// whether they accepted the invitation or not; a pending invitation is + /// revoked. + /// + /// + public Task DeleteMembership(string membershipId) + { + var apiPath = "/organization/memberships/{membershipId}" + .Replace("{membershipId}", membershipId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" } + }; + + + return _client.Call( method: "DELETE", path: apiPath, @@ -204,7 +484,8 @@ public Task DeleteKey(string keyId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -240,7 +521,8 @@ static Models.ProjectList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -308,7 +590,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Presences.cs b/Appwrite/Services/Presences.cs index 67b1870b..4c653ce8 100644 --- a/Appwrite/Services/Presences.cs +++ b/Appwrite/Services/Presences.cs @@ -31,7 +31,8 @@ public Presences(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -66,7 +67,8 @@ static Models.PresenceList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -106,7 +108,8 @@ static Models.Presence Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -148,7 +151,8 @@ static Models.Presence Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index 6fd17fd0..a3c7d922 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -91,7 +91,8 @@ public Task Delete() var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -125,7 +126,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -166,7 +168,8 @@ static Models.KeyList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -205,7 +208,8 @@ static Models.Key Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -238,7 +242,8 @@ static Models.EphemeralKey Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -276,7 +281,8 @@ static Models.Key Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -341,7 +347,8 @@ public Task DeleteKey(string keyId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -376,7 +383,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -412,7 +420,8 @@ static Models.MockNumberList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -446,7 +455,8 @@ static Models.MockNumber Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -482,7 +492,8 @@ static Models.MockNumber Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -548,7 +559,8 @@ public Task DeleteMockPhone(string number) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -570,7 +582,7 @@ static Models.OAuth2ProviderList Convert(Dictionary it) /// Update the OAuth2 server (OIDC provider) configuration. /// /// - public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, bool? confidentialPkce = null) + public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, List? authorizationDetailsTypes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, bool? confidentialPkce = null, string? verificationUrl = null, long? userCodeLength = null, string? userCodeFormat = null, long? deviceCodeDuration = null, List? defaultScopes = null) { var apiPath = "/project/oauth2-server"; @@ -579,17 +591,24 @@ static Models.OAuth2ProviderList Convert(Dictionary it) { "enabled", enabled }, { "authorizationUrl", authorizationUrl }, { "scopes", scopes }, + { "authorizationDetailsTypes", authorizationDetailsTypes }, { "accessTokenDuration", accessTokenDuration }, { "refreshTokenDuration", refreshTokenDuration }, { "publicAccessTokenDuration", publicAccessTokenDuration }, { "publicRefreshTokenDuration", publicRefreshTokenDuration }, - { "confidentialPkce", confidentialPkce } + { "confidentialPkce", confidentialPkce }, + { "verificationUrl", verificationUrl }, + { "userCodeLength", userCodeLength }, + { "userCodeFormat", userCodeFormat }, + { "deviceCodeDuration", deviceCodeDuration }, + { "defaultScopes", defaultScopes } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -625,7 +644,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -663,7 +683,8 @@ static Models.OAuth2Amazon Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -681,6 +702,43 @@ static Models.OAuth2Apple Convert(Dictionary it) } + /// + /// Update the project OAuth2 Appwrite configuration. + /// + /// + public Task UpdateOAuth2Appwrite(string? clientId = null, string? clientSecret = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/appwrite"; + + var apiParameters = new Dictionary() + { + { "clientId", clientId }, + { "clientSecret", clientSecret }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.OAuth2Appwrite Convert(Dictionary it) + { + return Models.OAuth2Appwrite.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); + + } + /// /// Update the project OAuth2 Auth0 configuration. /// @@ -700,7 +758,8 @@ static Models.OAuth2Apple Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -737,7 +796,8 @@ static Models.OAuth2Auth0 Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -773,7 +833,8 @@ static Models.OAuth2Authentik Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -809,7 +870,8 @@ static Models.OAuth2Autodesk Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -845,7 +907,8 @@ static Models.OAuth2Bitbucket Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -881,7 +944,8 @@ static Models.OAuth2Bitly Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -917,7 +981,8 @@ static Models.OAuth2Box Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -953,7 +1018,8 @@ static Models.OAuth2Dailymotion Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -989,7 +1055,8 @@ static Models.OAuth2Discord Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1025,7 +1092,8 @@ static Models.OAuth2Disqus Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1061,7 +1129,8 @@ static Models.OAuth2Dropbox Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1097,7 +1166,8 @@ static Models.OAuth2Etsy Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1133,7 +1203,8 @@ static Models.OAuth2Facebook Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1170,7 +1241,8 @@ static Models.OAuth2Figma Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1206,7 +1278,8 @@ static Models.OAuth2FusionAuth Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1243,7 +1316,8 @@ static Models.OAuth2Github Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1280,7 +1354,8 @@ static Models.OAuth2Gitlab Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1318,7 +1393,8 @@ static Models.OAuth2Google Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1354,7 +1430,8 @@ static Models.OAuth2Keycloak Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1390,7 +1467,8 @@ static Models.OAuth2Kick Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1427,7 +1505,8 @@ static Models.OAuth2Linkedin Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1463,7 +1542,8 @@ static Models.OAuth2Microsoft Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1485,7 +1565,7 @@ static Models.OAuth2Notion Convert(Dictionary it) /// Update the project OAuth2 Oidc configuration. /// /// - public Task UpdateOAuth2Oidc(string? clientId = null, string? clientSecret = null, string? wellKnownURL = null, string? authorizationURL = null, string? tokenURL = null, string? userInfoURL = null, bool? enabled = null) + public Task UpdateOAuth2Oidc(string? clientId = null, string? clientSecret = null, string? wellKnownURL = null, string? authorizationURL = null, string? tokenURL = null, string? userInfoURL = null, List? prompt = null, long? maxAge = null, bool? enabled = null) { var apiPath = "/project/oauth2/oidc"; @@ -1497,13 +1577,16 @@ static Models.OAuth2Notion Convert(Dictionary it) { "authorizationURL", authorizationURL }, { "tokenURL", tokenURL }, { "userInfoURL", userInfoURL }, + { "prompt", prompt?.Select(e => e.Value).ToList() }, + { "maxAge", maxAge }, { "enabled", enabled } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1541,7 +1624,8 @@ static Models.OAuth2Oidc Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1577,7 +1661,8 @@ static Models.OAuth2Okta Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1613,7 +1698,8 @@ static Models.OAuth2Paypal Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1649,7 +1735,8 @@ static Models.OAuth2Paypal Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1685,7 +1772,8 @@ static Models.OAuth2Podio Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1721,7 +1809,8 @@ static Models.OAuth2Salesforce Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1757,7 +1846,8 @@ static Models.OAuth2Slack Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1793,7 +1883,8 @@ static Models.OAuth2Spotify Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1829,7 +1920,8 @@ static Models.OAuth2Stripe Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1865,7 +1957,8 @@ static Models.OAuth2Tradeshift Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1901,7 +1994,8 @@ static Models.OAuth2Tradeshift Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1937,7 +2031,8 @@ static Models.OAuth2Twitch Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1973,7 +2068,8 @@ static Models.OAuth2WordPress Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2009,7 +2105,8 @@ static Models.OAuth2X Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2045,7 +2142,8 @@ static Models.OAuth2Yahoo Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2081,7 +2179,8 @@ static Models.OAuth2Yandex Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2117,7 +2216,8 @@ static Models.OAuth2Zoho Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2151,7 +2251,8 @@ public Task GetOAuth2Provider(Appwrite.Enums.ProjectOAuthProviderId prov var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2346,7 +2447,8 @@ static object Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2384,7 +2486,8 @@ static Models.PlatformList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2421,7 +2524,8 @@ static Models.PlatformAndroid Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2459,7 +2563,8 @@ static Models.PlatformAndroid Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2496,7 +2601,8 @@ static Models.PlatformApple Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2534,7 +2640,8 @@ static Models.PlatformApple Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2571,7 +2678,8 @@ static Models.PlatformLinux Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2609,7 +2717,8 @@ static Models.PlatformLinux Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2646,7 +2755,8 @@ static Models.PlatformWeb Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2684,7 +2794,8 @@ static Models.PlatformWeb Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2721,7 +2832,8 @@ static Models.PlatformWindows Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2755,7 +2867,8 @@ public Task GetPlatform(string platformId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2839,7 +2952,8 @@ public Task DeletePlatform(string platformId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2874,7 +2988,44 @@ static Models.PolicyList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Project Convert(Dictionary it) + { + return Models.Project.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); + + } + + /// + /// Configures if only corporate email addresses (non-free and non-disposable + /// domains) are allowed during new user sign-ups and email updates. + /// + /// + public Task UpdateDenyCorporateEmailPolicy(bool enabled) + { + var apiPath = "/project/policies/deny-corporate-email"; + + var apiParameters = new Dictionary() + { + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2909,7 +3060,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2944,7 +3096,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2968,7 +3121,7 @@ static Models.Project Convert(Dictionary it) /// email, phone number, and MFA status of other members.. /// /// - public Task UpdateMembershipPrivacyPolicy(bool? userId = null, bool? userEmail = null, bool? userPhone = null, bool? userName = null, bool? userMFA = null) + public Task UpdateMembershipPrivacyPolicy(bool? userId = null, bool? userEmail = null, bool? userPhone = null, bool? userName = null, bool? userMFA = null, bool? userAccessedAt = null) { var apiPath = "/project/policies/membership-privacy"; @@ -2978,13 +3131,15 @@ static Models.Project Convert(Dictionary it) { "userEmail", userEmail }, { "userPhone", userPhone }, { "userName", userName }, - { "userMFA", userMFA } + { "userMFA", userMFA }, + { "userAccessedAt", userAccessedAt } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3020,7 +3175,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3062,7 +3218,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3099,7 +3256,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3137,7 +3295,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3175,7 +3334,8 @@ static Models.PolicyPasswordStrength Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3210,7 +3370,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3246,7 +3407,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3281,7 +3443,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3317,7 +3480,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3351,7 +3515,8 @@ public Task GetPolicy(Appwrite.Enums.ProjectPolicyId policyId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -3409,6 +3574,10 @@ static object Convert(Dictionary it) { return Appwrite.Models.PolicyDenyFreeEmail.From(map: it); } + if (it.TryGetValue("$id", out var idValue14) && idValue14?.ToString() == "deny-corporate-email") + { + return Appwrite.Models.PolicyDenyCorporateEmail.From(map: it); + } throw new System.Exception("Unable to match response to any expected response model"); } @@ -3439,7 +3608,8 @@ static object Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3475,7 +3645,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3520,7 +3691,8 @@ static Models.Project Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3585,7 +3757,8 @@ public Task CreateSMTPTest(List emails) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -3627,7 +3800,8 @@ static Models.EmailTemplateList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3663,7 +3837,8 @@ static Models.EmailTemplate Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -3697,7 +3872,8 @@ static Models.EmailTemplate Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -3735,7 +3911,8 @@ static Models.VariableList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -3768,7 +3945,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -3805,7 +3983,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Proxy.cs b/Appwrite/Services/Proxy.cs index 95bbbd96..9f1e2a6d 100644 --- a/Appwrite/Services/Proxy.cs +++ b/Appwrite/Services/Proxy.cs @@ -30,7 +30,8 @@ public Proxy(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -67,7 +68,8 @@ static Models.ProxyRuleList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -106,7 +108,8 @@ static Models.ProxyRule Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -148,7 +151,8 @@ static Models.ProxyRule Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -187,7 +191,8 @@ static Models.ProxyRule Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -220,7 +225,8 @@ static Models.ProxyRule Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -286,7 +292,8 @@ public Task DeleteRule(string ruleId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index 23f17e94..4cd3038c 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -31,7 +31,8 @@ public Sites(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -87,7 +88,8 @@ static Models.SiteList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -120,7 +122,8 @@ static Models.Site Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -142,17 +145,19 @@ static Models.FrameworkList Convert(Dictionary it) /// List allowed site specifications for this instance. /// /// - public Task ListSpecifications() + public Task ListSpecifications(string? type = null) { var apiPath = "/sites/specifications"; var apiParameters = new Dictionary() { + { "type", type } }; var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -185,7 +190,8 @@ static Models.SpecificationList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -241,7 +247,8 @@ static Models.Site Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -306,7 +313,8 @@ public Task Delete(string siteId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -343,7 +351,8 @@ static Models.Site Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -384,7 +393,8 @@ static Models.DeploymentList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "multipart/form-data" } + { "content-type", "multipart/form-data" }, + { "accept", "application/json" } }; @@ -428,7 +438,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -472,7 +483,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -511,7 +523,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -545,7 +558,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -612,7 +626,8 @@ public Task GetDeploymentDownload(string siteId, string deploymentId, Ap var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "*/*" } }; @@ -646,7 +661,8 @@ public Task GetDeploymentDownload(string siteId, string deploymentId, Ap var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -682,7 +698,8 @@ static Models.Deployment Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -716,7 +733,8 @@ static Models.ExecutionList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -751,7 +769,8 @@ public Task DeleteLog(string siteId, string logId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -781,7 +800,8 @@ public Task DeleteLog(string siteId, string logId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -820,7 +840,8 @@ static Models.VariableList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -854,7 +875,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -892,7 +914,8 @@ static Models.Variable Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Storage.cs b/Appwrite/Services/Storage.cs index fed8a691..22608c88 100644 --- a/Appwrite/Services/Storage.cs +++ b/Appwrite/Services/Storage.cs @@ -31,7 +31,8 @@ public Storage(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -75,7 +76,8 @@ static Models.BucketList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -109,7 +111,8 @@ static Models.Bucket Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -153,7 +156,8 @@ static Models.Bucket Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -219,7 +223,8 @@ public Task DeleteBucket(string bucketId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -273,7 +278,8 @@ static Models.FileList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "multipart/form-data" } + { "content-type", "multipart/form-data" }, + { "accept", "application/json" } }; @@ -313,7 +319,8 @@ static Models.File Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -351,7 +358,8 @@ static Models.File Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -419,7 +427,8 @@ public Task GetFileDownload(string bucketId, string fileId, string? toke var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "*/*" } }; @@ -464,7 +473,8 @@ public Task GetFilePreview(string bucketId, string fileId, long? width = var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/*" } }; @@ -496,7 +506,8 @@ public Task GetFileView(string bucketId, string fileId, string? token = var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "*/*" } }; diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index f34ee786..5b9eda7c 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -31,7 +31,8 @@ public TablesDB(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -54,7 +55,7 @@ static Models.DatabaseList Convert(Dictionary it) /// /// /// - public Task Create(string databaseId, string name, bool? enabled = null) + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null) { var apiPath = "/tablesdb"; @@ -62,13 +63,15 @@ static Models.DatabaseList Convert(Dictionary it) { { "databaseId", databaseId }, { "name", name }, - { "enabled", enabled } + { "enabled", enabled }, + { "specification", specification } }; var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -101,7 +104,8 @@ static Models.Database Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -135,7 +139,8 @@ static Models.TransactionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -168,7 +173,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -204,7 +210,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -268,7 +275,8 @@ public Task DeleteTransaction(string transactionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -302,7 +310,8 @@ static Models.Transaction Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -338,7 +347,8 @@ static Models.Database Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -405,7 +415,8 @@ public Task Delete(string databaseId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -449,7 +460,8 @@ static Models.TableList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -484,7 +496,8 @@ static Models.Table Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -524,7 +537,8 @@ static Models.Table Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -591,7 +605,8 @@ public Task DeleteTable(string databaseId, string tableId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -634,7 +649,8 @@ static Models.ColumnList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -677,7 +693,8 @@ static Models.ColumnBigint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -717,7 +734,8 @@ static Models.ColumnBigint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -757,7 +775,8 @@ static Models.ColumnBoolean Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -796,7 +815,8 @@ static Models.ColumnBoolean Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -836,7 +856,8 @@ static Models.ColumnDatetime Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -876,7 +897,8 @@ static Models.ColumnDatetime Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -917,7 +939,8 @@ static Models.ColumnEmail Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -958,7 +981,8 @@ static Models.ColumnEmail Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1000,7 +1024,8 @@ static Models.ColumnEnum Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1043,7 +1068,8 @@ static Models.ColumnEnum Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1086,7 +1112,8 @@ static Models.ColumnFloat Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1129,7 +1156,8 @@ static Models.ColumnFloat Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1172,7 +1200,8 @@ static Models.ColumnInteger Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1212,7 +1241,8 @@ static Models.ColumnInteger Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1253,7 +1283,8 @@ static Models.ColumnIp Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1275,7 +1306,7 @@ static Models.ColumnIp Convert(Dictionary it) /// Create a geometric line column. /// /// - public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, List? @default = null) + public Task CreateLineColumn(string databaseId, string tableId, string key, bool required, List>? @default = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line" .Replace("{databaseId}", databaseId) @@ -1291,7 +1322,8 @@ static Models.ColumnIp Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1314,7 +1346,7 @@ static Models.ColumnLine Convert(Dictionary it) /// existing rows. /// /// - public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdateLineColumn(string databaseId, string tableId, string key, bool required, List>? @default = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}" .Replace("{databaseId}", databaseId) @@ -1331,7 +1363,8 @@ static Models.ColumnLine Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1372,7 +1405,8 @@ static Models.ColumnLine Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1413,7 +1447,8 @@ static Models.ColumnLongtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1454,7 +1489,8 @@ static Models.ColumnLongtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1495,7 +1531,8 @@ static Models.ColumnMediumtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1517,7 +1554,7 @@ static Models.ColumnMediumtext Convert(Dictionary it) /// Create a geometric point column. /// /// - public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null) + public Task CreatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point" .Replace("{databaseId}", databaseId) @@ -1533,7 +1570,8 @@ static Models.ColumnMediumtext Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1556,7 +1594,7 @@ static Models.ColumnPoint Convert(Dictionary it) /// existing rows. /// /// - public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdatePointColumn(string databaseId, string tableId, string key, bool required, List? @default = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}" .Replace("{databaseId}", databaseId) @@ -1573,7 +1611,8 @@ static Models.ColumnPoint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1595,7 +1634,7 @@ static Models.ColumnPoint Convert(Dictionary it) /// Create a geometric polygon column. /// /// - public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, List? @default = null) + public Task CreatePolygonColumn(string databaseId, string tableId, string key, bool required, List>? @default = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon" .Replace("{databaseId}", databaseId) @@ -1611,7 +1650,8 @@ static Models.ColumnPoint Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1634,7 +1674,7 @@ static Models.ColumnPolygon Convert(Dictionary it) /// already existing rows. /// /// - public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, List? @default = null, string? newKey = null) + public Task UpdatePolygonColumn(string databaseId, string tableId, string key, bool required, List>? @default = null, string? newKey = null) { var apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}" .Replace("{databaseId}", databaseId) @@ -1651,7 +1691,8 @@ static Models.ColumnPolygon Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1694,7 +1735,8 @@ static Models.ColumnPolygon Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1737,7 +1779,8 @@ static Models.ColumnRelationship Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1780,7 +1823,8 @@ static Models.ColumnString Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1821,7 +1865,8 @@ static Models.ColumnString Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1862,7 +1907,8 @@ static Models.ColumnText Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1902,7 +1948,8 @@ static Models.ColumnText Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1943,7 +1990,8 @@ static Models.ColumnUrl Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1985,7 +2033,8 @@ static Models.ColumnUrl Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2027,7 +2076,8 @@ static Models.ColumnVarchar Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2062,7 +2112,8 @@ public Task GetColumn(string databaseId, string tableId, string key) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2173,7 +2224,8 @@ public Task DeleteColumn(string databaseId, string tableId, string key) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2209,7 +2261,8 @@ static Models.ColumnRelationship Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2251,7 +2304,8 @@ static Models.ColumnIndexList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2286,7 +2340,8 @@ static Models.ColumnIndex Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2356,7 +2411,8 @@ public Task DeleteIndex(string databaseId, string tableId, string key) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2398,7 +2454,8 @@ static Models.RowList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2438,7 +2495,8 @@ static Models.Row Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2479,7 +2537,8 @@ static Models.RowList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2518,7 +2577,8 @@ static Models.RowList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2556,7 +2616,8 @@ static Models.RowList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2594,7 +2655,8 @@ static Models.RowList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -2636,7 +2698,8 @@ static Models.Row Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2676,7 +2739,8 @@ static Models.Row Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2748,7 +2812,8 @@ public Task DeleteRow(string databaseId, string tableId, string rowId, s var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -2788,7 +2853,8 @@ static Models.Row Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Teams.cs b/Appwrite/Services/Teams.cs index a04f23ae..4710d6af 100644 --- a/Appwrite/Services/Teams.cs +++ b/Appwrite/Services/Teams.cs @@ -31,7 +31,8 @@ public Teams(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -69,7 +70,8 @@ static Models.TeamList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -102,7 +104,8 @@ static Models.Team Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -137,7 +140,8 @@ static Models.Team Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -205,7 +209,8 @@ public Task Delete(string teamId) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -265,7 +270,8 @@ static Models.MembershipList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -301,7 +307,8 @@ static Models.Membership Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -340,7 +347,8 @@ static Models.Membership Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -415,7 +423,8 @@ public Task DeleteMembership(string teamId, string membershipId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -450,7 +459,8 @@ static Models.Membership Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -487,7 +497,8 @@ static Models.Preferences Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Tokens.cs b/Appwrite/Services/Tokens.cs index cc334ab9..d9d4f631 100644 --- a/Appwrite/Services/Tokens.cs +++ b/Appwrite/Services/Tokens.cs @@ -32,7 +32,8 @@ public Tokens(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -69,7 +70,8 @@ static Models.ResourceTokenList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -102,7 +104,8 @@ static Models.ResourceToken Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -138,7 +141,8 @@ static Models.ResourceToken Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Usage.cs b/Appwrite/Services/Usage.cs deleted file mode 100644 index 6fba966f..00000000 --- a/Appwrite/Services/Usage.cs +++ /dev/null @@ -1,106 +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 Usage : Service - { - public Usage(Client client) : base(client) - { - } - - /// - /// Query usage event metrics from the usage database. Returns individual event - /// rows with full metadata. Pass Query objects as JSON strings to filter, - /// paginate, and order results. Supported query methods: equal, - /// greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. - /// Supported filter attributes: metric, path, method, status, resource, - /// resourceId, country, userAgent, time (these match the underlying column - /// names — note that the response surfaces `resource` as `resourceType` and - /// `country` as `countryCode`). When no time filter is supplied the endpoint - /// defaults to the last 7 days. Default `limit(100)` is applied if none is - /// given; user-supplied limits are capped at 500. The `total` field is capped - /// at 5000 to keep counts predictable — pass `total=false` to skip the count - /// entirely. - /// - /// - public Task ListEvents(List? queries = null, bool? total = null) - { - var apiPath = "/usage/events"; - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.UsageEventList Convert(Dictionary it) - { - return Models.UsageEventList.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); - - } - - /// - /// Query usage gauge metrics (point-in-time resource snapshots) from the usage - /// database. Returns individual gauge snapshots with metric, value, timestamp, - /// resourceType, and resourceId. Pass Query objects as JSON strings to filter, - /// paginate, and order results. Supported query methods: equal, - /// greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. - /// Supported filter attributes: metric, time. Use `orderDesc("time"), - /// limit(1)` to fetch the most recent snapshot. When no time filter is - /// supplied the endpoint defaults to the last 7 days. Default `limit(100)` is - /// applied if none is given; user-supplied limits are capped at 500. The - /// `total` field is capped at 5000 to keep counts predictable — pass - /// `total=false` to skip the count entirely. - /// - /// - public Task ListGauges(List? queries = null, bool? total = null) - { - var apiPath = "/usage/gauges"; - - var apiParameters = new Dictionary() - { - { "queries", queries }, - { "total", total } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") } - }; - - - static Models.UsageGaugeList Convert(Dictionary it) - { - return Models.UsageGaugeList.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/Users.cs b/Appwrite/Services/Users.cs index 3fd10ad1..deee23c3 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -31,7 +31,8 @@ public Users(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -69,7 +70,8 @@ static Models.UserList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -109,7 +111,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -149,7 +152,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -184,7 +188,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -253,7 +258,8 @@ public Task DeleteIdentity(string identityId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -293,7 +299,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -338,7 +345,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -382,7 +390,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -423,7 +432,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -456,7 +466,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -525,7 +536,8 @@ public Task Delete(string userId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -565,7 +577,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -603,7 +616,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -643,7 +657,8 @@ static Models.JWT Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -678,7 +693,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -714,7 +730,8 @@ static Models.LogList Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -750,7 +767,8 @@ static Models.MembershipList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -785,7 +803,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -880,7 +899,8 @@ public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.Authent var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -913,7 +933,8 @@ static Models.MfaFactors Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -950,7 +971,8 @@ static Models.MfaFactors Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -986,7 +1008,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1024,7 +1047,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1061,7 +1085,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1099,7 +1124,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1136,7 +1162,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1171,7 +1198,8 @@ static Models.MfaRecoveryCodes Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1206,7 +1234,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1241,7 +1270,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1274,7 +1304,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1311,7 +1342,8 @@ static Models.Preferences Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1345,7 +1377,8 @@ static Models.Preferences Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1384,7 +1417,8 @@ static Models.SessionList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1479,7 +1513,8 @@ public Task DeleteSession(string userId, string sessionId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1514,7 +1549,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1553,7 +1589,8 @@ static Models.TargetList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1587,7 +1624,8 @@ static Models.Target Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -1625,7 +1663,8 @@ static Models.Target Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1695,7 +1734,8 @@ public Task DeleteTarget(string userId, string targetId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1730,7 +1770,8 @@ static Models.Token Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -1765,7 +1806,8 @@ static Models.User Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/Appwrite/Services/Webhooks.cs b/Appwrite/Services/Webhooks.cs index bdfb6be1..c9e43260 100644 --- a/Appwrite/Services/Webhooks.cs +++ b/Appwrite/Services/Webhooks.cs @@ -30,7 +30,8 @@ public Webhooks(Client client) : base(client) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -73,7 +74,8 @@ static Models.WebhookList Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -107,7 +109,8 @@ static Models.Webhook Convert(Dictionary it) var apiHeaders = new Dictionary() { - { "X-Appwrite-Project", _client.GetConfig("project") } + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } }; @@ -149,7 +152,8 @@ static Models.Webhook Convert(Dictionary it) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; @@ -216,7 +220,8 @@ public Task Delete(string webhookId) var apiHeaders = new Dictionary() { { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" } + { "content-type", "application/json" }, + { "accept", "application/json" } }; diff --git a/CHANGELOG.md b/CHANGELOG.md index a87c1618..de6e8f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log +## 6.0.0 + +* Breaking: Removed `Health` service with all its models and enums +* Breaking: Removed `Usage` service and `UsageEvent`/`UsageGauge` models +* Breaking: Removed `Messaging` log methods `ListMessageLogs`, `ListProviderLogs`, `ListSubscriberLogs`, `ListTopicLogs` +* Breaking: Removed OS, client, device, and country fields from `ActivityEvent` +* Breaking: Changed spatial attribute/column `default` parameters from `List` to typed coordinate lists +* Breaking: Made `Project` OAuth2 server properties nullable +* Added: `Organization` service methods `Get`, `Update`, `Delete`, and membership CRUD +* Added: `Client.SetBearer` for OAuth access token authentication +* Added: vector query methods `Query.VectorDot`, `Query.VectorCosine`, `Query.VectorEuclidean` +* Added: `Project.UpdateOAuth2Appwrite` and `Project.UpdateDenyCorporateEmailPolicy` methods +* Added: OIDC `prompt` and `maxAge` parameters plus OAuth2 device-flow server options +* Added: optional `specification` on `TablesDB.Create`, `newSpecification` on `Backups.CreateRestoration` +* Added: optional `type` on `ListSpecifications`, `token` on `GetDeploymentDownload` +* Added: geolocation and ISP fields on `Locale`, email classification fields on `User` +* Added: `DatabaseStatus`, `BillingPlanGroup`, `OAuth2OidcPrompt` enums and new key scopes +* Added: billing plan models, `Database.Status`, `BackupPolicy.Type`, `Block.Mode`, `Membership.UserAccessedAt` + ## 5.1.0 * Added: `createSesProvider` and `updateSesProvider` to `messaging` diff --git a/README.md b/README.md index 6d03fb5f..e1163250 100644 --- a/README.md +++ b/README.md @@ -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 5.1.0 +Install-Package Appwrite -Version 6.0.0 # or .NET CLI -dotnet add package Appwrite --version 5.1.0 +dotnet add package Appwrite --version 6.0.0 ``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index bbc8ae23..3488b4a4 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -13,6 +13,6 @@ Account account = new Account(client); User result = await account.Create( userId: "", email: "email@example.com", - password: "", + password: "password", name: "" // optional );``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 5d0c5d7e..17e459e1 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -11,6 +11,6 @@ Client client = new Client() Account account = new Account(client); User result = await account.UpdatePassword( - password: "", - oldPassword: "" // optional + password: "password", + oldPassword: "password" // optional );``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index a822d3e4..ea571253 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -13,5 +13,5 @@ Account account = new Account(client); Token result = await account.UpdateRecovery( userId: "", secret: "", - password: "" + password: "password" );``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 80ec86a1..25de7452 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -15,5 +15,6 @@ BackupRestoration result = await backups.CreateRestoration( archiveId: "", services: new List<BackupServices> { BackupServices.Databases }, newResourceId: "", // optional - newResourceName: "" // optional + newResourceName: "", // optional + newSpecification: "serverless" // optional );``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index d78d52a7..64cff1ac 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -14,5 +14,6 @@ Functions functions = new Functions(client); byte[] result = await functions.GetDeploymentDownload( functionId: "", deploymentId: "", - type: DeploymentDownloadType.Source // optional + type: DeploymentDownloadType.Source, // optional + token: "" // optional );``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 2c168c03..cacd502b 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -10,5 +10,6 @@ Client client = new Client() Functions functions = new Functions(client); -SpecificationList result = await functions.ListSpecifications(); -``` +SpecificationList result = await functions.ListSpecifications( + type: "runtimes" // optional +);``` diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md deleted file mode 100644 index f7fdc0c5..00000000 --- a/docs/examples/health/get-antivirus.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthAntivirus result = await health.GetAntivirus(); -``` diff --git a/docs/examples/health/get-audits-db.md b/docs/examples/health/get-audits-db.md deleted file mode 100644 index 1bf229a5..00000000 --- a/docs/examples/health/get-audits-db.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthStatusList result = await health.GetAuditsDB(); -``` diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md deleted file mode 100644 index d10993ff..00000000 --- a/docs/examples/health/get-cache.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthStatusList result = await health.GetCache(); -``` diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md deleted file mode 100644 index 9e44103a..00000000 --- a/docs/examples/health/get-pub-sub.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthStatusList result = await health.GetPubSub(); -``` diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md deleted file mode 100644 index fc8312e7..00000000 --- a/docs/examples/health/get-queue-databases.md +++ /dev/null @@ -1,16 +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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueDatabases( - name: "", // optional - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md deleted file mode 100644 index c905fa86..00000000 --- a/docs/examples/health/get-queue-deletes.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueDeletes( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md deleted file mode 100644 index 79751bba..00000000 --- a/docs/examples/health/get-queue-functions.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueFunctions( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md deleted file mode 100644 index 50a48066..00000000 --- a/docs/examples/health/get-queue-logs.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueLogs( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md deleted file mode 100644 index d0224adc..00000000 --- a/docs/examples/health/get-queue-mails.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueMails( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md deleted file mode 100644 index 3a7b2daf..00000000 --- a/docs/examples/health/get-queue-messaging.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueMessaging( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md deleted file mode 100644 index 78bfa709..00000000 --- a/docs/examples/health/get-queue-migrations.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueMigrations( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md deleted file mode 100644 index 1ad7d854..00000000 --- a/docs/examples/health/get-queue-stats-resources.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueStatsResources( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md deleted file mode 100644 index a45b7473..00000000 --- a/docs/examples/health/get-queue-usage.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueUsage( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md deleted file mode 100644 index 9a670034..00000000 --- a/docs/examples/health/get-queue-webhooks.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 - -Health health = new Health(client); - -HealthQueue result = await health.GetQueueWebhooks( - threshold: 0 // optional -);``` diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md deleted file mode 100644 index 73aa2069..00000000 --- a/docs/examples/health/get-storage-local.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthStatus result = await health.GetStorageLocal(); -``` diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md deleted file mode 100644 index 06b00580..00000000 --- a/docs/examples/health/get-storage.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthStatus result = await health.GetStorage(); -``` diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md deleted file mode 100644 index e8a0cecf..00000000 --- a/docs/examples/health/get-time.md +++ /dev/null @@ -1,14 +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 - -Health health = new Health(client); - -HealthTime result = await health.GetTime(); -``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 1e28297e..4ec4314f 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -17,7 +17,7 @@ Provider result = await messaging.CreateSMTPProvider( host: "", port: 1, // optional username: "", // optional - password: "", // optional + password: "password", // optional encryption: SmtpEncryption.None, // optional autoTLS: false, // optional mailer: "", // optional diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md deleted file mode 100644 index 47f3bb2f..00000000 --- a/docs/examples/messaging/list-provider-logs.md +++ /dev/null @@ -1,17 +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 - -Messaging messaging = new Messaging(client); - -LogList result = await messaging.ListProviderLogs( - providerId: "", - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md deleted file mode 100644 index b5db4513..00000000 --- a/docs/examples/messaging/list-subscriber-logs.md +++ /dev/null @@ -1,17 +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 - -Messaging messaging = new Messaging(client); - -LogList result = await messaging.ListSubscriberLogs( - subscriberId: "", - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md deleted file mode 100644 index 0402adba..00000000 --- a/docs/examples/messaging/list-topic-logs.md +++ /dev/null @@ -1,17 +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 - -Messaging messaging = new Messaging(client); - -LogList result = await messaging.ListTopicLogs( - topicId: "", - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index b9f0436f..9789829c 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -17,7 +17,7 @@ Provider result = await messaging.UpdateSMTPProvider( host: "", // optional port: 1, // optional username: "", // optional - password: "", // optional + password: "password", // optional encryption: SmtpEncryption.None, // optional autoTLS: false, // optional mailer: "", // optional diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md new file mode 100644 index 00000000..07f723aa --- /dev/null +++ b/docs/examples/organization/create-membership.md @@ -0,0 +1,20 @@ +```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 + +Organization organization = new Organization(client); + +Membership result = await organization.CreateMembership( + roles: new List(), + email: "email@example.com", // optional + userId: "", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "" // optional +);``` diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/organization/delete-membership.md similarity index 70% rename from docs/examples/health/get-queue-builds.md rename to docs/examples/organization/delete-membership.md index 65cea923..0c3b257f 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/organization/delete-membership.md @@ -8,8 +8,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthQueue result = await health.GetQueueBuilds( - threshold: 0 // optional +await organization.DeleteMembership( + membershipId: "" );``` diff --git a/docs/examples/health/get.md b/docs/examples/organization/delete.md similarity index 78% rename from docs/examples/health/get.md rename to docs/examples/organization/delete.md index 4b31b04b..702750fe 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/organization/delete.md @@ -8,7 +8,7 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthStatus result = await health.Get(); +await organization.Delete(); ``` diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/organization/get-membership.md similarity index 67% rename from docs/examples/health/get-queue-certificates.md rename to docs/examples/organization/get-membership.md index 4457901e..60426303 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/organization/get-membership.md @@ -8,8 +8,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthQueue result = await health.GetQueueCertificates( - threshold: 0 // optional +Membership result = await organization.GetMembership( + membershipId: "" );``` diff --git a/docs/examples/health/get-db.md b/docs/examples/organization/get.md similarity index 74% rename from docs/examples/health/get-db.md rename to docs/examples/organization/get.md index 83827fc1..ab20af7d 100644 --- a/docs/examples/health/get-db.md +++ b/docs/examples/organization/get.md @@ -8,7 +8,7 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthStatusList result = await health.GetDB(); +Organization result = await organization.Get(); ``` diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/organization/list-memberships.md similarity index 71% rename from docs/examples/messaging/list-message-logs.md rename to docs/examples/organization/list-memberships.md index 2684e747..00a7c736 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/organization/list-memberships.md @@ -8,10 +8,10 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Messaging messaging = new Messaging(client); +Organization organization = new Organization(client); -LogList result = await messaging.ListMessageLogs( - messageId: "", +MembershipList result = await organization.ListMemberships( queries: new List(), // optional + search: "", // optional total: false // optional );``` diff --git a/docs/examples/health/get-console-pausing.md b/docs/examples/organization/update-membership.md similarity index 62% rename from docs/examples/health/get-console-pausing.md rename to docs/examples/organization/update-membership.md index b57ee49e..de696dc5 100644 --- a/docs/examples/health/get-console-pausing.md +++ b/docs/examples/organization/update-membership.md @@ -8,9 +8,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthStatus result = await health.GetConsolePausing( - threshold: 0, // optional - inactivityDays: 0 // optional +Membership result = await organization.UpdateMembership( + membershipId: "", + roles: new List() );``` diff --git a/docs/examples/health/get-certificate.md b/docs/examples/organization/update.md similarity index 71% rename from docs/examples/health/get-certificate.md rename to docs/examples/organization/update.md index 2db4b038..2db709e5 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/organization/update.md @@ -8,8 +8,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Organization organization = new Organization(client); -HealthCertificate result = await health.GetCertificate( - domain: "" // optional +Organization result = await organization.Update( + name: "" );``` diff --git a/docs/examples/health/get-queue-audits.md b/docs/examples/project/update-deny-corporate-email-policy.md similarity index 71% rename from docs/examples/health/get-queue-audits.md rename to docs/examples/project/update-deny-corporate-email-policy.md index 9e04d1fe..99a41b18 100644 --- a/docs/examples/health/get-queue-audits.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -8,8 +8,8 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Project project = new Project(client); -HealthQueue result = await health.GetQueueAudits( - threshold: 0 // optional +Project result = await project.UpdateDenyCorporateEmailPolicy( + enabled: false );``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index 37ef7fe1..bd452cf8 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -15,5 +15,6 @@ Project result = await project.UpdateMembershipPrivacyPolicy( userEmail: false, // optional userPhone: false, // optional userName: false, // optional - userMFA: false // optional + userMFA: false, // optional + userAccessedAt: false // optional );``` diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/project/update-o-auth-2-appwrite.md similarity index 57% rename from docs/examples/health/get-failed-jobs.md rename to docs/examples/project/update-o-auth-2-appwrite.md index 9e122b71..45aec1c8 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -1,6 +1,5 @@ ```csharp using Appwrite; -using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -9,9 +8,10 @@ Client client = new Client() .SetProject("") // Your project ID .SetKey(""); // Your secret API key -Health health = new Health(client); +Project project = new Project(client); -HealthQueue result = await health.GetFailedJobs( - name: HealthQueueName.V1Database, - threshold: 0 // optional +OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( + clientId: "", // optional + clientSecret: "", // optional + enabled: false // optional );``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index 9c86e7d5..fee55e75 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -1,5 +1,6 @@ ```csharp using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -17,5 +18,7 @@ OAuth2Oidc result = await project.UpdateOAuth2Oidc( authorizationURL: "https://example.com", // optional tokenURL: "https://example.com", // optional userInfoURL: "https://example.com", // optional + prompt: new List<ProjectOAuth2OidcPrompt> { ProjectOAuth2OidcPrompt.None }, // optional + maxAge: 0, // optional enabled: false // optional );``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 2734038b..a43abfd3 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -14,9 +14,15 @@ Project result = await project.UpdateOAuth2Server( enabled: false, authorizationUrl: "https://example.com", scopes: new List(), // optional + authorizationDetailsTypes: new List(), // optional accessTokenDuration: 60, // optional refreshTokenDuration: 60, // optional publicAccessTokenDuration: 60, // optional publicRefreshTokenDuration: 60, // optional - confidentialPkce: false // optional + confidentialPkce: false, // optional + verificationUrl: "https://example.com", // optional + userCodeLength: 6, // optional + userCodeFormat: "numeric", // optional + deviceCodeDuration: 60, // optional + defaultScopes: new List() // optional );``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index c4918f4e..91c2fda2 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -15,7 +15,7 @@ Project result = await project.UpdateSMTP( host: "", // optional port: 0, // optional username: "", // optional - password: "", // optional + password: "password", // optional senderEmail: "email@example.com", // optional senderName: "", // optional replyToEmail: "email@example.com", // optional diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index a1d63a1e..af963654 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -10,5 +10,6 @@ Client client = new Client() Sites sites = new Sites(client); -SpecificationList result = await sites.ListSpecifications(); -``` +SpecificationList result = await sites.ListSpecifications( + type: "runtimes" // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index d34245c8..03f9ab32 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -13,5 +13,6 @@ TablesDB tablesDB = new TablesDB(client); Database result = await tablesDB.Create( databaseId: "", name: "", - enabled: false // optional + enabled: false, // optional + specification: "serverless" // optional );``` diff --git a/docs/examples/usage/list-events.md b/docs/examples/usage/list-events.md deleted file mode 100644 index 162d1b16..00000000 --- a/docs/examples/usage/list-events.md +++ /dev/null @@ -1,16 +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 - -Usage usage = new Usage(client); - -UsageEventList result = await usage.ListEvents( - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/usage/list-gauges.md b/docs/examples/usage/list-gauges.md deleted file mode 100644 index e7ea2a85..00000000 --- a/docs/examples/usage/list-gauges.md +++ /dev/null @@ -1,16 +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 - -Usage usage = new Usage(client); - -UsageGaugeList result = await usage.ListGauges( - queries: new List(), // optional - total: false // optional -);``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e15c2071..dd8d684c 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -14,6 +14,6 @@ User result = await users.Create( userId: "", email: "email@example.com", // optional phone: "+12065550100", // optional - password: "", // optional + password: "password", // optional name: "" // optional );``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 0222d6f6..17e3a35c 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -12,5 +12,5 @@ Users users = new Users(client); User result = await users.UpdatePassword( userId: "", - password: "" + password: "password" );``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 35647c9b..c3e9f558 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -18,6 +18,6 @@ Webhook result = await webhooks.Create( enabled: false, // optional tls: false, // optional authUsername: "", // optional - authPassword: "", // optional + authPassword: "password", // optional secret: "" // optional );``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index ca1fac72..d3485855 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -18,5 +18,5 @@ Webhook result = await webhooks.Update( enabled: false, // optional tls: false, // optional authUsername: "", // optional - authPassword: "" // optional + authPassword: "password" // optional );``` From 9c87db9857ba4d0d73f6c83a12b8f96bfade4f43 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 11:04:26 +0530 Subject: [PATCH 02/10] docs: clarify ActivityEvent changelog, country field remains --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de6e8f4c..30de9067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * Breaking: Removed `Health` service with all its models and enums * Breaking: Removed `Usage` service and `UsageEvent`/`UsageGauge` models * Breaking: Removed `Messaging` log methods `ListMessageLogs`, `ListProviderLogs`, `ListSubscriberLogs`, `ListTopicLogs` -* Breaking: Removed OS, client, device, and country fields from `ActivityEvent` +* Breaking: Removed OS, client, and device fields plus `countryCode`/`countryName` from `ActivityEvent` (`country` remains) * Breaking: Changed spatial attribute/column `default` parameters from `List` to typed coordinate lists * Breaking: Made `Project` OAuth2 server properties nullable * Added: `Organization` service methods `Get`, `Update`, `Delete`, and membership CRUD From 8789da28aa6068e4a1d69bad7588eb970971e2b6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 12:11:40 +0530 Subject: [PATCH 03/10] chore: update .NET SDK to 6.0.0 --- Appwrite/Client.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index d65c3b68..9b456828 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -142,7 +142,7 @@ public Client SetJWT(string value) { /// The OAuth access token to authenticate with public Client SetBearer(string value) { _config["bearer"] = value; - AddHeader("Authorization", value); + AddHeader("Authorization", "Bearer " + value); return this; } From d31f08a2679e509b87e2dfbe0c8e2d960c5a289b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 23 Jul 2026 16:18:14 +0530 Subject: [PATCH 04/10] chore: update .NET SDK to 6.1.0 --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 +- Appwrite/Enums/DatabaseStatus.cs | 11 + Appwrite/Enums/DatabaseType.cs | 3 + Appwrite/Enums/OrganizationKeyScopes.cs | 2 + Appwrite/Enums/ProjectKeyScopes.cs | 3 + Appwrite/Models/ActivityEvent.cs | 83 +- Appwrite/Models/App.cs | 208 +++++ Appwrite/Models/AppInstallation.cs | 96 +++ Appwrite/Models/AppInstallationList.cs | 40 + Appwrite/Models/AppKey.cs | 89 ++ Appwrite/Models/AppKeyList.cs | 40 + Appwrite/Models/AppScope.cs | 61 ++ Appwrite/Models/AppScopeList.cs | 40 + Appwrite/Models/AppSecret.cs | 89 ++ Appwrite/Models/AppSecretList.cs | 40 + Appwrite/Models/AppSecretPlaintext.cs | 89 ++ Appwrite/Models/AppsList.cs | 40 + Appwrite/Models/BillingPlan.cs | 29 +- Appwrite/Models/Database.cs | 39 +- Appwrite/Models/DatabaseStatus.cs | 82 ++ Appwrite/Models/DatabaseStatusConnections.cs | 40 + Appwrite/Models/DatabaseStatusReplica.cs | 56 ++ Appwrite/Models/DatabaseStatusVolume.cs | 54 ++ Appwrite/Models/DedicatedDatabase.cs | 369 +++++++++ Appwrite/Models/DedicatedDatabaseMember.cs | 54 ++ Appwrite/Models/DedicatedDatabaseReplicas.cs | 47 ++ .../Models/DedicatedDatabaseSpecification.cs | 89 ++ .../DedicatedDatabaseSpecificationList.cs | 47 ++ .../DedicatedDatabaseSpecificationPricing.cs | 61 ++ Appwrite/Models/Oauth2Approve.cs | 33 + Appwrite/Models/Oauth2Authorize.cs | 40 + Appwrite/Models/Oauth2Consent.cs | 96 +++ Appwrite/Models/Oauth2ConsentList.cs | 40 + Appwrite/Models/Oauth2ConsentToken.cs | 103 +++ Appwrite/Models/Oauth2ConsentTokenList.cs | 40 + Appwrite/Models/Oauth2DeviceAuthorization.cs | 68 ++ Appwrite/Models/Oauth2Grant.cs | 110 +++ Appwrite/Models/Oauth2Organization.cs | 33 + Appwrite/Models/Oauth2OrganizationList.cs | 40 + Appwrite/Models/Oauth2PAR.cs | 40 + Appwrite/Models/Oauth2Project.cs | 47 ++ Appwrite/Models/Oauth2ProjectList.cs | 40 + Appwrite/Models/Oauth2Reject.cs | 33 + Appwrite/Models/Oauth2Token.cs | 75 ++ Appwrite/Models/Project.cs | 58 +- Appwrite/Services/Account.cs | 210 +++++ Appwrite/Services/Apps.cs | 784 ++++++++++++++++++ Appwrite/Services/Backups.cs | 36 +- Appwrite/Services/Oauth2.cs | 515 ++++++++++++ Appwrite/Services/Organization.cs | 180 ++++ Appwrite/Services/Project.cs | 3 +- Appwrite/Services/Sites.cs | 5 +- Appwrite/Services/TablesDB.cs | 154 +++- Appwrite/Services/Teams.cs | 185 +++++ CHANGELOG.md | 10 + README.md | 6 +- docs/examples/account/delete-consent-token.md | 16 + docs/examples/account/delete-consent.md | 15 + docs/examples/account/get-consent-token.md | 16 + docs/examples/account/get-consent.md | 15 + docs/examples/account/list-consent-tokens.md | 17 + docs/examples/account/list-consents.md | 16 + .../apps/create-installation-token.md | 16 + docs/examples/apps/create-key.md | 15 + docs/examples/apps/create-secret.md | 15 + docs/examples/apps/create.md | 33 + docs/examples/apps/delete-key.md | 16 + docs/examples/apps/delete-secret.md | 16 + docs/examples/apps/delete-tokens.md | 15 + docs/examples/apps/delete.md | 15 + docs/examples/apps/get-installation.md | 16 + docs/examples/apps/get-key.md | 16 + docs/examples/apps/get-secret.md | 16 + docs/examples/apps/get.md | 15 + .../examples/apps/list-installation-scopes.md | 14 + docs/examples/apps/list-installations.md | 17 + docs/examples/apps/list-keys.md | 17 + docs/examples/apps/list-o-auth-2-scopes.md | 14 + docs/examples/apps/list-secrets.md | 17 + docs/examples/apps/list.md | 16 + docs/examples/apps/update-labels.md | 16 + docs/examples/apps/update-team.md | 16 + docs/examples/apps/update.md | 34 + docs/examples/backups/create-restoration.md | 3 +- docs/examples/oauth2/approve.md | 17 + docs/examples/oauth2/authorize-post.md | 28 + docs/examples/oauth2/authorize.md | 28 + .../oauth2/create-device-authorization.md | 19 + docs/examples/oauth2/create-grant.md | 15 + docs/examples/oauth2/create-par.md | 27 + docs/examples/oauth2/create-token.md | 24 + docs/examples/oauth2/get-grant.md | 15 + docs/examples/oauth2/list-organizations.md | 17 + docs/examples/oauth2/list-projects.md | 17 + docs/examples/oauth2/reject.md | 15 + docs/examples/oauth2/revoke.md | 18 + .../organization/create-installation.md | 16 + .../organization/delete-installation.md | 15 + .../examples/organization/get-installation.md | 15 + .../organization/list-installations.md | 16 + .../organization/update-installation.md | 16 + .../project/update-o-auth-2-server.md | 1 + .../examples/sites/get-deployment-download.md | 3 +- docs/examples/tablesdb/create-failover.md | 16 + docs/examples/tablesdb/create.md | 3 +- docs/examples/tablesdb/get-replicas.md | 15 + docs/examples/tablesdb/get-status.md | 15 + docs/examples/tablesdb/list-specifications.md | 14 + docs/examples/tablesdb/update.md | 3 +- docs/examples/teams/create-installation.md | 17 + docs/examples/teams/delete-installation.md | 16 + docs/examples/teams/get-installation.md | 16 + docs/examples/teams/list-installations.md | 17 + docs/examples/teams/update-installation.md | 17 + 115 files changed, 5755 insertions(+), 70 deletions(-) create mode 100644 Appwrite/Models/App.cs create mode 100644 Appwrite/Models/AppInstallation.cs create mode 100644 Appwrite/Models/AppInstallationList.cs create mode 100644 Appwrite/Models/AppKey.cs create mode 100644 Appwrite/Models/AppKeyList.cs create mode 100644 Appwrite/Models/AppScope.cs create mode 100644 Appwrite/Models/AppScopeList.cs create mode 100644 Appwrite/Models/AppSecret.cs create mode 100644 Appwrite/Models/AppSecretList.cs create mode 100644 Appwrite/Models/AppSecretPlaintext.cs create mode 100644 Appwrite/Models/AppsList.cs create mode 100644 Appwrite/Models/DatabaseStatus.cs create mode 100644 Appwrite/Models/DatabaseStatusConnections.cs create mode 100644 Appwrite/Models/DatabaseStatusReplica.cs create mode 100644 Appwrite/Models/DatabaseStatusVolume.cs create mode 100644 Appwrite/Models/DedicatedDatabase.cs create mode 100644 Appwrite/Models/DedicatedDatabaseMember.cs create mode 100644 Appwrite/Models/DedicatedDatabaseReplicas.cs create mode 100644 Appwrite/Models/DedicatedDatabaseSpecification.cs create mode 100644 Appwrite/Models/DedicatedDatabaseSpecificationList.cs create mode 100644 Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs create mode 100644 Appwrite/Models/Oauth2Approve.cs create mode 100644 Appwrite/Models/Oauth2Authorize.cs create mode 100644 Appwrite/Models/Oauth2Consent.cs create mode 100644 Appwrite/Models/Oauth2ConsentList.cs create mode 100644 Appwrite/Models/Oauth2ConsentToken.cs create mode 100644 Appwrite/Models/Oauth2ConsentTokenList.cs create mode 100644 Appwrite/Models/Oauth2DeviceAuthorization.cs create mode 100644 Appwrite/Models/Oauth2Grant.cs create mode 100644 Appwrite/Models/Oauth2Organization.cs create mode 100644 Appwrite/Models/Oauth2OrganizationList.cs create mode 100644 Appwrite/Models/Oauth2PAR.cs create mode 100644 Appwrite/Models/Oauth2Project.cs create mode 100644 Appwrite/Models/Oauth2ProjectList.cs create mode 100644 Appwrite/Models/Oauth2Reject.cs create mode 100644 Appwrite/Models/Oauth2Token.cs create mode 100644 Appwrite/Services/Apps.cs create mode 100644 Appwrite/Services/Oauth2.cs create mode 100644 docs/examples/account/delete-consent-token.md create mode 100644 docs/examples/account/delete-consent.md create mode 100644 docs/examples/account/get-consent-token.md create mode 100644 docs/examples/account/get-consent.md create mode 100644 docs/examples/account/list-consent-tokens.md create mode 100644 docs/examples/account/list-consents.md create mode 100644 docs/examples/apps/create-installation-token.md create mode 100644 docs/examples/apps/create-key.md create mode 100644 docs/examples/apps/create-secret.md create mode 100644 docs/examples/apps/create.md create mode 100644 docs/examples/apps/delete-key.md create mode 100644 docs/examples/apps/delete-secret.md create mode 100644 docs/examples/apps/delete-tokens.md create mode 100644 docs/examples/apps/delete.md create mode 100644 docs/examples/apps/get-installation.md create mode 100644 docs/examples/apps/get-key.md create mode 100644 docs/examples/apps/get-secret.md create mode 100644 docs/examples/apps/get.md create mode 100644 docs/examples/apps/list-installation-scopes.md create mode 100644 docs/examples/apps/list-installations.md create mode 100644 docs/examples/apps/list-keys.md create mode 100644 docs/examples/apps/list-o-auth-2-scopes.md create mode 100644 docs/examples/apps/list-secrets.md create mode 100644 docs/examples/apps/list.md create mode 100644 docs/examples/apps/update-labels.md create mode 100644 docs/examples/apps/update-team.md create mode 100644 docs/examples/apps/update.md create mode 100644 docs/examples/oauth2/approve.md create mode 100644 docs/examples/oauth2/authorize-post.md create mode 100644 docs/examples/oauth2/authorize.md create mode 100644 docs/examples/oauth2/create-device-authorization.md create mode 100644 docs/examples/oauth2/create-grant.md create mode 100644 docs/examples/oauth2/create-par.md create mode 100644 docs/examples/oauth2/create-token.md create mode 100644 docs/examples/oauth2/get-grant.md create mode 100644 docs/examples/oauth2/list-organizations.md create mode 100644 docs/examples/oauth2/list-projects.md create mode 100644 docs/examples/oauth2/reject.md create mode 100644 docs/examples/oauth2/revoke.md create mode 100644 docs/examples/organization/create-installation.md create mode 100644 docs/examples/organization/delete-installation.md create mode 100644 docs/examples/organization/get-installation.md create mode 100644 docs/examples/organization/list-installations.md create mode 100644 docs/examples/organization/update-installation.md create mode 100644 docs/examples/tablesdb/create-failover.md create mode 100644 docs/examples/tablesdb/get-replicas.md create mode 100644 docs/examples/tablesdb/get-status.md create mode 100644 docs/examples/tablesdb/list-specifications.md create mode 100644 docs/examples/teams/create-installation.md create mode 100644 docs/examples/teams/delete-installation.md create mode 100644 docs/examples/teams/get-installation.md create mode 100644 docs/examples/teams/list-installations.md create mode 100644 docs/examples/teams/update-installation.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 51965b44..bcbc04bf 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 6.0.0 + 6.1.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 9b456828..4754333e 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -76,11 +76,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/6.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/6.1.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "6.0.0"}, + { "x-sdk-version", "6.1.0"}, { "X-Appwrite-Response-Format", "1.9.5" } }; diff --git a/Appwrite/Enums/DatabaseStatus.cs b/Appwrite/Enums/DatabaseStatus.cs index cd8892d2..dc8860a1 100644 --- a/Appwrite/Enums/DatabaseStatus.cs +++ b/Appwrite/Enums/DatabaseStatus.cs @@ -13,6 +13,17 @@ public DatabaseStatus(string value) public static DatabaseStatus Provisioning => new DatabaseStatus("provisioning"); public static DatabaseStatus Ready => new DatabaseStatus("ready"); + public static DatabaseStatus Inactive => new DatabaseStatus("inactive"); + public static DatabaseStatus Paused => new DatabaseStatus("paused"); public static DatabaseStatus Failed => new DatabaseStatus("failed"); + public static DatabaseStatus Deleting => new DatabaseStatus("deleting"); + public static DatabaseStatus Deleted => new DatabaseStatus("deleted"); + public static DatabaseStatus Restoring => new DatabaseStatus("restoring"); + public static DatabaseStatus Scaling => new DatabaseStatus("scaling"); + public static DatabaseStatus Upgrading => new DatabaseStatus("upgrading"); + public static DatabaseStatus Migrating => new DatabaseStatus("migrating"); + public static DatabaseStatus Pausing => new DatabaseStatus("pausing"); + public static DatabaseStatus Resuming => new DatabaseStatus("resuming"); + public static DatabaseStatus FailingOver => new DatabaseStatus("failing-over"); } } diff --git a/Appwrite/Enums/DatabaseType.cs b/Appwrite/Enums/DatabaseType.cs index 11b4916b..5a559464 100644 --- a/Appwrite/Enums/DatabaseType.cs +++ b/Appwrite/Enums/DatabaseType.cs @@ -15,5 +15,8 @@ public DatabaseType(string value) public static DatabaseType Tablesdb => new DatabaseType("tablesdb"); public static DatabaseType Documentsdb => new DatabaseType("documentsdb"); public static DatabaseType Vectorsdb => new DatabaseType("vectorsdb"); + public static DatabaseType Mysql => new DatabaseType("mysql"); + public static DatabaseType Postgresql => new DatabaseType("postgresql"); + public static DatabaseType Mongodb => new DatabaseType("mongodb"); } } diff --git a/Appwrite/Enums/OrganizationKeyScopes.cs b/Appwrite/Enums/OrganizationKeyScopes.cs index 8802f0fa..8e848a17 100644 --- a/Appwrite/Enums/OrganizationKeyScopes.cs +++ b/Appwrite/Enums/OrganizationKeyScopes.cs @@ -17,6 +17,8 @@ public OrganizationKeyScopes(string value) public static OrganizationKeyScopes DevKeysWrite => new OrganizationKeyScopes("devKeys.write"); public static OrganizationKeyScopes OrganizationKeysRead => new OrganizationKeyScopes("organization.keys.read"); public static OrganizationKeyScopes OrganizationKeysWrite => new OrganizationKeyScopes("organization.keys.write"); + public static OrganizationKeyScopes OrganizationInstallationsRead => new OrganizationKeyScopes("organization.installations.read"); + public static OrganizationKeyScopes OrganizationInstallationsWrite => new OrganizationKeyScopes("organization.installations.write"); public static OrganizationKeyScopes OrganizationMembershipsRead => new OrganizationKeyScopes("organization.memberships.read"); public static OrganizationKeyScopes OrganizationMembershipsWrite => new OrganizationKeyScopes("organization.memberships.write"); public static OrganizationKeyScopes OrganizationRead => new OrganizationKeyScopes("organization.read"); diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index 9ccbd816..e728151f 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -106,11 +106,14 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes DedicatedDatabasesExecute => new ProjectKeyScopes("dedicatedDatabases.execute"); public static ProjectKeyScopes DomainsRead => new ProjectKeyScopes("domains.read"); public static ProjectKeyScopes DomainsWrite => new ProjectKeyScopes("domains.write"); + public static ProjectKeyScopes WafRulesRead => new ProjectKeyScopes("wafRules.read"); + public static ProjectKeyScopes WafRulesWrite => new ProjectKeyScopes("wafRules.write"); public static ProjectKeyScopes EventsRead => new ProjectKeyScopes("events.read"); public static ProjectKeyScopes AppsRead => new ProjectKeyScopes("apps.read"); public static ProjectKeyScopes AppsWrite => new ProjectKeyScopes("apps.write"); public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); public static ProjectKeyScopes Oauth2Write => new ProjectKeyScopes("oauth2.write"); + public static ProjectKeyScopes Oauth2Introspect => new ProjectKeyScopes("oauth2.introspect"); public static ProjectKeyScopes UsageRead => new ProjectKeyScopes("usage.read"); } } diff --git a/Appwrite/Models/ActivityEvent.cs b/Appwrite/Models/ActivityEvent.cs index e0864a01..04af514f 100644 --- a/Appwrite/Models/ActivityEvent.cs +++ b/Appwrite/Models/ActivityEvent.cs @@ -53,6 +53,33 @@ public class ActivityEvent [JsonPropertyName("country")] public string Country { get; private set; } + [JsonPropertyName("continentCode")] + public string ContinentCode { get; private set; } + + [JsonPropertyName("city")] + public string City { get; private set; } + + [JsonPropertyName("subdivisions")] + public string Subdivisions { get; private set; } + + [JsonPropertyName("isp")] + public string Isp { get; private set; } + + [JsonPropertyName("autonomousSystemNumber")] + public string AutonomousSystemNumber { get; private set; } + + [JsonPropertyName("autonomousSystemOrganization")] + public string AutonomousSystemOrganization { get; private set; } + + [JsonPropertyName("connectionType")] + public string ConnectionType { get; private set; } + + [JsonPropertyName("connectionUsageType")] + public string ConnectionUsageType { get; private set; } + + [JsonPropertyName("connectionOrganization")] + public string ConnectionOrganization { get; private set; } + [JsonPropertyName("time")] public string Time { get; private set; } @@ -65,6 +92,12 @@ public class ActivityEvent [JsonPropertyName("hostname")] public string Hostname { get; private set; } + [JsonPropertyName("sdk")] + public string Sdk { get; private set; } + + [JsonPropertyName("sdkVersion")] + public string SdkVersion { get; private set; } + public ActivityEvent( string id, string actorType, @@ -80,10 +113,21 @@ public ActivityEvent( string ip, string mode, string country, + string continentCode, + string city, + string subdivisions, + string isp, + string autonomousSystemNumber, + string autonomousSystemOrganization, + string connectionType, + string connectionUsageType, + string connectionOrganization, string time, string projectId, string teamId, - string hostname + string hostname, + string sdk, + string sdkVersion ) { Id = id; @@ -100,10 +144,21 @@ string hostname Ip = ip; Mode = mode; Country = country; + ContinentCode = continentCode; + City = city; + Subdivisions = subdivisions; + Isp = isp; + AutonomousSystemNumber = autonomousSystemNumber; + AutonomousSystemOrganization = autonomousSystemOrganization; + ConnectionType = connectionType; + ConnectionUsageType = connectionUsageType; + ConnectionOrganization = connectionOrganization; Time = time; ProjectId = projectId; TeamId = teamId; Hostname = hostname; + Sdk = sdk; + SdkVersion = sdkVersion; } public static ActivityEvent From(Dictionary map) => new ActivityEvent( @@ -121,10 +176,21 @@ string hostname ip: map["ip"].ToString(), mode: map["mode"].ToString(), country: map["country"].ToString(), + continentCode: map["continentCode"].ToString(), + city: map["city"].ToString(), + subdivisions: map["subdivisions"].ToString(), + isp: map["isp"].ToString(), + autonomousSystemNumber: map["autonomousSystemNumber"].ToString(), + autonomousSystemOrganization: map["autonomousSystemOrganization"].ToString(), + connectionType: map["connectionType"].ToString(), + connectionUsageType: map["connectionUsageType"].ToString(), + connectionOrganization: map["connectionOrganization"].ToString(), time: map["time"].ToString(), projectId: map["projectId"].ToString(), teamId: map["teamId"].ToString(), - hostname: map["hostname"].ToString() + hostname: map["hostname"].ToString(), + sdk: map["sdk"].ToString(), + sdkVersion: map["sdkVersion"].ToString() ); public Dictionary ToMap() => new Dictionary() @@ -143,10 +209,21 @@ string hostname { "ip", Ip }, { "mode", Mode }, { "country", Country }, + { "continentCode", ContinentCode }, + { "city", City }, + { "subdivisions", Subdivisions }, + { "isp", Isp }, + { "autonomousSystemNumber", AutonomousSystemNumber }, + { "autonomousSystemOrganization", AutonomousSystemOrganization }, + { "connectionType", ConnectionType }, + { "connectionUsageType", ConnectionUsageType }, + { "connectionOrganization", ConnectionOrganization }, { "time", Time }, { "projectId", ProjectId }, { "teamId", TeamId }, - { "hostname", Hostname } + { "hostname", Hostname }, + { "sdk", Sdk }, + { "sdkVersion", SdkVersion } }; } } diff --git a/Appwrite/Models/App.cs b/Appwrite/Models/App.cs new file mode 100644 index 00000000..866d9629 --- /dev/null +++ b/Appwrite/Models/App.cs @@ -0,0 +1,208 @@ + +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 App + { + [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("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("clientUri")] + public string ClientUri { get; private set; } + + [JsonPropertyName("logoUri")] + public string LogoUri { get; private set; } + + [JsonPropertyName("privacyPolicyUrl")] + public string PrivacyPolicyUrl { get; private set; } + + [JsonPropertyName("termsUrl")] + public string TermsUrl { get; private set; } + + [JsonPropertyName("contacts")] + public List Contacts { get; private set; } + + [JsonPropertyName("tagline")] + public string Tagline { get; private set; } + + [JsonPropertyName("tags")] + public List Tags { get; private set; } + + [JsonPropertyName("labels")] + public List Labels { get; private set; } + + [JsonPropertyName("images")] + public List Images { get; private set; } + + [JsonPropertyName("supportUrl")] + public string SupportUrl { get; private set; } + + [JsonPropertyName("dataDeletionUrl")] + public string DataDeletionUrl { get; private set; } + + [JsonPropertyName("redirectUris")] + public List RedirectUris { get; private set; } + + [JsonPropertyName("postLogoutRedirectUris")] + public List PostLogoutRedirectUris { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("deviceFlow")] + public bool DeviceFlow { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("installationScopes")] + public List InstallationScopes { get; private set; } + + [JsonPropertyName("installationRedirectUrl")] + public string InstallationRedirectUrl { get; private set; } + + [JsonPropertyName("secrets")] + public List Secrets { get; private set; } + + public App( + string id, + string createdAt, + string updatedAt, + string name, + string description, + string clientUri, + string logoUri, + string privacyPolicyUrl, + string termsUrl, + List contacts, + string tagline, + List tags, + List labels, + List images, + string supportUrl, + string dataDeletionUrl, + List redirectUris, + List postLogoutRedirectUris, + bool enabled, + string type, + bool deviceFlow, + string teamId, + string userId, + List installationScopes, + string installationRedirectUrl, + List secrets + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Name = name; + Description = description; + ClientUri = clientUri; + LogoUri = logoUri; + PrivacyPolicyUrl = privacyPolicyUrl; + TermsUrl = termsUrl; + Contacts = contacts; + Tagline = tagline; + Tags = tags; + Labels = labels; + Images = images; + SupportUrl = supportUrl; + DataDeletionUrl = dataDeletionUrl; + RedirectUris = redirectUris; + PostLogoutRedirectUris = postLogoutRedirectUris; + Enabled = enabled; + Type = type; + DeviceFlow = deviceFlow; + TeamId = teamId; + UserId = userId; + InstallationScopes = installationScopes; + InstallationRedirectUrl = installationRedirectUrl; + Secrets = secrets; + } + + public static App From(Dictionary map) => new App( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + name: map["name"].ToString(), + description: map["description"].ToString(), + clientUri: map["clientUri"].ToString(), + logoUri: map["logoUri"].ToString(), + privacyPolicyUrl: map["privacyPolicyUrl"].ToString(), + termsUrl: map["termsUrl"].ToString(), + contacts: map["contacts"].ConvertToList(), + tagline: map["tagline"].ToString(), + tags: map["tags"].ConvertToList(), + labels: map["labels"].ConvertToList(), + images: map["images"].ConvertToList(), + supportUrl: map["supportUrl"].ToString(), + dataDeletionUrl: map["dataDeletionUrl"].ToString(), + redirectUris: map["redirectUris"].ConvertToList(), + postLogoutRedirectUris: map["postLogoutRedirectUris"].ConvertToList(), + enabled: (bool)map["enabled"], + type: map["type"].ToString(), + deviceFlow: (bool)map["deviceFlow"], + teamId: map["teamId"].ToString(), + userId: map["userId"].ToString(), + installationScopes: map["installationScopes"].ConvertToList(), + installationRedirectUrl: map["installationRedirectUrl"].ToString(), + secrets: map["secrets"].ConvertToList>().Select(it => Appwrite.Models.AppSecret.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "name", Name }, + { "description", Description }, + { "clientUri", ClientUri }, + { "logoUri", LogoUri }, + { "privacyPolicyUrl", PrivacyPolicyUrl }, + { "termsUrl", TermsUrl }, + { "contacts", Contacts }, + { "tagline", Tagline }, + { "tags", Tags }, + { "labels", Labels }, + { "images", Images }, + { "supportUrl", SupportUrl }, + { "dataDeletionUrl", DataDeletionUrl }, + { "redirectUris", RedirectUris }, + { "postLogoutRedirectUris", PostLogoutRedirectUris }, + { "enabled", Enabled }, + { "type", Type }, + { "deviceFlow", DeviceFlow }, + { "teamId", TeamId }, + { "userId", UserId }, + { "installationScopes", InstallationScopes }, + { "installationRedirectUrl", InstallationRedirectUrl }, + { "secrets", Secrets?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/AppInstallation.cs b/Appwrite/Models/AppInstallation.cs new file mode 100644 index 00000000..6acf408b --- /dev/null +++ b/Appwrite/Models/AppInstallation.cs @@ -0,0 +1,96 @@ + +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 AppInstallation + { + [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("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("teamId")] + public string TeamId { get; private set; } + + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + + [JsonPropertyName("authorizationDetails")] + public object AuthorizationDetails { get; private set; } + + [JsonPropertyName("createdById")] + public string CreatedById { get; private set; } + + [JsonPropertyName("createdByName")] + public string CreatedByName { get; private set; } + + [JsonPropertyName("lastAccessedAt")] + public string? LastAccessedAt { get; private set; } + + public AppInstallation( + string id, + string createdAt, + string updatedAt, + string appId, + string teamId, + List scopes, + object authorizationDetails, + string createdById, + string createdByName, + string? lastAccessedAt + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + AppId = appId; + TeamId = teamId; + Scopes = scopes; + AuthorizationDetails = authorizationDetails; + CreatedById = createdById; + CreatedByName = createdByName; + LastAccessedAt = lastAccessedAt; + } + + public static AppInstallation From(Dictionary map) => new AppInstallation( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + appId: map["appId"].ToString(), + teamId: map["teamId"].ToString(), + scopes: map["scopes"].ConvertToList(), + authorizationDetails: map["authorizationDetails"].ToString(), + createdById: map["createdById"].ToString(), + createdByName: map["createdByName"].ToString(), + lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "appId", AppId }, + { "teamId", TeamId }, + { "scopes", Scopes }, + { "authorizationDetails", AuthorizationDetails }, + { "createdById", CreatedById }, + { "createdByName", CreatedByName }, + { "lastAccessedAt", LastAccessedAt } + }; + } +} diff --git a/Appwrite/Models/AppInstallationList.cs b/Appwrite/Models/AppInstallationList.cs new file mode 100644 index 00000000..a5c8b4a0 --- /dev/null +++ b/Appwrite/Models/AppInstallationList.cs @@ -0,0 +1,40 @@ + +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 AppInstallationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("installations")] + public List Installations { get; private set; } + + public AppInstallationList( + long total, + List installations + ) + { + Total = total; + Installations = installations; + } + + public static AppInstallationList From(Dictionary map) => new AppInstallationList( + total: Convert.ToInt64(map["total"]), + installations: map["installations"].ConvertToList>().Select(it => Appwrite.Models.AppInstallation.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "installations", Installations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/AppKey.cs b/Appwrite/Models/AppKey.cs new file mode 100644 index 00000000..ba98c012 --- /dev/null +++ b/Appwrite/Models/AppKey.cs @@ -0,0 +1,89 @@ + +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 AppKey + { + [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("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("secret")] + public string Secret { get; private set; } + + [JsonPropertyName("hint")] + public string Hint { get; private set; } + + [JsonPropertyName("createdById")] + public string CreatedById { get; private set; } + + [JsonPropertyName("createdByName")] + public string CreatedByName { get; private set; } + + [JsonPropertyName("lastAccessedAt")] + public string? LastAccessedAt { get; private set; } + + public AppKey( + string id, + string createdAt, + string updatedAt, + string appId, + string secret, + string hint, + string createdById, + string createdByName, + string? lastAccessedAt + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + AppId = appId; + Secret = secret; + Hint = hint; + CreatedById = createdById; + CreatedByName = createdByName; + LastAccessedAt = lastAccessedAt; + } + + public static AppKey From(Dictionary map) => new AppKey( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + appId: map["appId"].ToString(), + secret: map["secret"].ToString(), + hint: map["hint"].ToString(), + createdById: map["createdById"].ToString(), + createdByName: map["createdByName"].ToString(), + lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "appId", AppId }, + { "secret", Secret }, + { "hint", Hint }, + { "createdById", CreatedById }, + { "createdByName", CreatedByName }, + { "lastAccessedAt", LastAccessedAt } + }; + } +} diff --git a/Appwrite/Models/AppKeyList.cs b/Appwrite/Models/AppKeyList.cs new file mode 100644 index 00000000..ea0a40b2 --- /dev/null +++ b/Appwrite/Models/AppKeyList.cs @@ -0,0 +1,40 @@ + +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 AppKeyList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("keys")] + public List Keys { get; private set; } + + public AppKeyList( + long total, + List keys + ) + { + Total = total; + Keys = keys; + } + + public static AppKeyList From(Dictionary map) => new AppKeyList( + total: Convert.ToInt64(map["total"]), + keys: map["keys"].ConvertToList>().Select(it => Appwrite.Models.AppKey.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "keys", Keys?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/AppScope.cs b/Appwrite/Models/AppScope.cs new file mode 100644 index 00000000..8426fc01 --- /dev/null +++ b/Appwrite/Models/AppScope.cs @@ -0,0 +1,61 @@ + +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 AppScope + { + [JsonPropertyName("value")] + public string Value { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("category")] + public string Category { get; private set; } + + [JsonPropertyName("deprecated")] + public bool Deprecated { get; private set; } + + public AppScope( + string @value, + string description, + string type, + string category, + bool deprecated + ) + { + Value = @value; + Description = description; + Type = type; + Category = category; + Deprecated = deprecated; + } + + public static AppScope From(Dictionary map) => new AppScope( + @value: map["value"].ToString(), + description: map["description"].ToString(), + type: map["type"].ToString(), + category: map["category"].ToString(), + deprecated: (bool)map["deprecated"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "value", Value }, + { "description", Description }, + { "type", Type }, + { "category", Category }, + { "deprecated", Deprecated } + }; + } +} diff --git a/Appwrite/Models/AppScopeList.cs b/Appwrite/Models/AppScopeList.cs new file mode 100644 index 00000000..f284b002 --- /dev/null +++ b/Appwrite/Models/AppScopeList.cs @@ -0,0 +1,40 @@ + +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 AppScopeList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + + public AppScopeList( + long total, + List scopes + ) + { + Total = total; + Scopes = scopes; + } + + public static AppScopeList From(Dictionary map) => new AppScopeList( + total: Convert.ToInt64(map["total"]), + scopes: map["scopes"].ConvertToList>().Select(it => Appwrite.Models.AppScope.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "scopes", Scopes?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/AppSecret.cs b/Appwrite/Models/AppSecret.cs new file mode 100644 index 00000000..3c7f9156 --- /dev/null +++ b/Appwrite/Models/AppSecret.cs @@ -0,0 +1,89 @@ + +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 AppSecret + { + [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("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("secret")] + public string Secret { get; private set; } + + [JsonPropertyName("hint")] + public string Hint { get; private set; } + + [JsonPropertyName("createdById")] + public string CreatedById { get; private set; } + + [JsonPropertyName("createdByName")] + public string CreatedByName { get; private set; } + + [JsonPropertyName("lastAccessedAt")] + public string? LastAccessedAt { get; private set; } + + public AppSecret( + string id, + string createdAt, + string updatedAt, + string appId, + string secret, + string hint, + string createdById, + string createdByName, + string? lastAccessedAt + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + AppId = appId; + Secret = secret; + Hint = hint; + CreatedById = createdById; + CreatedByName = createdByName; + LastAccessedAt = lastAccessedAt; + } + + public static AppSecret From(Dictionary map) => new AppSecret( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + appId: map["appId"].ToString(), + secret: map["secret"].ToString(), + hint: map["hint"].ToString(), + createdById: map["createdById"].ToString(), + createdByName: map["createdByName"].ToString(), + lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "appId", AppId }, + { "secret", Secret }, + { "hint", Hint }, + { "createdById", CreatedById }, + { "createdByName", CreatedByName }, + { "lastAccessedAt", LastAccessedAt } + }; + } +} diff --git a/Appwrite/Models/AppSecretList.cs b/Appwrite/Models/AppSecretList.cs new file mode 100644 index 00000000..9730bfae --- /dev/null +++ b/Appwrite/Models/AppSecretList.cs @@ -0,0 +1,40 @@ + +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 AppSecretList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("secrets")] + public List Secrets { get; private set; } + + public AppSecretList( + long total, + List secrets + ) + { + Total = total; + Secrets = secrets; + } + + public static AppSecretList From(Dictionary map) => new AppSecretList( + total: Convert.ToInt64(map["total"]), + secrets: map["secrets"].ConvertToList>().Select(it => Appwrite.Models.AppSecret.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "secrets", Secrets?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/AppSecretPlaintext.cs b/Appwrite/Models/AppSecretPlaintext.cs new file mode 100644 index 00000000..0fe131b7 --- /dev/null +++ b/Appwrite/Models/AppSecretPlaintext.cs @@ -0,0 +1,89 @@ + +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 AppSecretPlaintext + { + [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("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("secret")] + public string Secret { get; private set; } + + [JsonPropertyName("hint")] + public string Hint { get; private set; } + + [JsonPropertyName("createdById")] + public string CreatedById { get; private set; } + + [JsonPropertyName("createdByName")] + public string CreatedByName { get; private set; } + + [JsonPropertyName("lastAccessedAt")] + public string? LastAccessedAt { get; private set; } + + public AppSecretPlaintext( + string id, + string createdAt, + string updatedAt, + string appId, + string secret, + string hint, + string createdById, + string createdByName, + string? lastAccessedAt + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + AppId = appId; + Secret = secret; + Hint = hint; + CreatedById = createdById; + CreatedByName = createdByName; + LastAccessedAt = lastAccessedAt; + } + + public static AppSecretPlaintext From(Dictionary map) => new AppSecretPlaintext( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + appId: map["appId"].ToString(), + secret: map["secret"].ToString(), + hint: map["hint"].ToString(), + createdById: map["createdById"].ToString(), + createdByName: map["createdByName"].ToString(), + lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "appId", AppId }, + { "secret", Secret }, + { "hint", Hint }, + { "createdById", CreatedById }, + { "createdByName", CreatedByName }, + { "lastAccessedAt", LastAccessedAt } + }; + } +} diff --git a/Appwrite/Models/AppsList.cs b/Appwrite/Models/AppsList.cs new file mode 100644 index 00000000..f54516e1 --- /dev/null +++ b/Appwrite/Models/AppsList.cs @@ -0,0 +1,40 @@ + +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 AppsList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("apps")] + public List Apps { get; private set; } + + public AppsList( + long total, + List apps + ) + { + Total = total; + Apps = apps; + } + + public static AppsList From(Dictionary map) => new AppsList( + total: Convert.ToInt64(map["total"]), + apps: map["apps"].ConvertToList>().Select(it => Appwrite.Models.App.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "apps", Apps?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index 0c05ee92..9911795a 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -47,6 +47,9 @@ public class BillingPlan [JsonPropertyName("webhooks")] public long Webhooks { get; private set; } + [JsonPropertyName("wafRules")] + public long WafRules { get; private set; } + [JsonPropertyName("projects")] public long Projects { get; private set; } @@ -228,6 +231,7 @@ public BillingPlan( long screenshotsGenerated, long members, long webhooks, + long wafRules, long projects, long platforms, long users, @@ -298,6 +302,7 @@ public BillingPlan( ScreenshotsGenerated = screenshotsGenerated; Members = members; Webhooks = webhooks; + WafRules = wafRules; Projects = projects; Platforms = platforms; Users = users; @@ -369,6 +374,7 @@ public BillingPlan( screenshotsGenerated: Convert.ToInt64(map["screenshotsGenerated"]), members: Convert.ToInt64(map["members"]), webhooks: Convert.ToInt64(map["webhooks"]), + wafRules: Convert.ToInt64(map["wafRules"]), projects: Convert.ToInt64(map["projects"]), platforms: Convert.ToInt64(map["platforms"]), users: Convert.ToInt64(map["users"]), @@ -392,13 +398,13 @@ public BillingPlan( domains: Convert.ToInt64(map["domains"]), activityLogs: Convert.ToInt64(map["activityLogs"]), usageLogs: Convert.ToInt64(map["usageLogs"]), - usageLogsIntervals: map.TryGetValue("usageLogsIntervals", out var arrayRaw36) && arrayRaw36 != null - ? arrayRaw36.ConvertToList() + usageLogsIntervals: map.TryGetValue("usageLogsIntervals", out var arrayRaw37) && arrayRaw37 != null + ? arrayRaw37.ConvertToList() : null, projectInactivityDays: Convert.ToInt64(map["projectInactivityDays"]), alertLimit: Convert.ToInt64(map["alertLimit"]), - usage: Appwrite.Models.UsageBillingPlan.From(map: map["usage"] is JsonElement jsonObj39 ? jsonObj39.Deserialize>()! : (Dictionary)map["usage"]), - addons: Appwrite.Models.BillingPlanAddon.From(map: map["addons"] is JsonElement jsonObj40 ? jsonObj40.Deserialize>()! : (Dictionary)map["addons"]), + usage: Appwrite.Models.UsageBillingPlan.From(map: map["usage"] is JsonElement jsonObj40 ? jsonObj40.Deserialize>()! : (Dictionary)map["usage"]), + addons: Appwrite.Models.BillingPlanAddon.From(map: map["addons"] is JsonElement jsonObj41 ? jsonObj41.Deserialize>()! : (Dictionary)map["addons"]), budgetCapEnabled: (bool)map["budgetCapEnabled"], customSmtp: (bool)map["customSmtp"], emailBranding: (bool)map["emailBranding"], @@ -418,20 +424,20 @@ public BillingPlan( supportsProjectSpecificRoles: (bool)map["supportsProjectSpecificRoles"], backupsEnabled: (bool)map["backupsEnabled"], usagePerProject: (bool)map["usagePerProject"], - supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj60 ? jsonObj60.Deserialize>()! : (Dictionary)map["supportedAddons"]), + supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj61 ? jsonObj61.Deserialize>()! : (Dictionary)map["supportedAddons"]), backupPolicies: Convert.ToInt64(map["backupPolicies"]), deploymentSize: Convert.ToInt64(map["deploymentSize"]), buildSize: Convert.ToInt64(map["buildSize"]), databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], - limits: map.TryGetValue("limits", out var objectRaw65) && objectRaw65 != null - ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw65 is JsonElement jsonObj65 ? jsonObj65.Deserialize>()! : (Dictionary)objectRaw65) + limits: map.TryGetValue("limits", out var objectRaw66) && objectRaw66 != null + ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw66 is JsonElement jsonObj66 ? jsonObj66.Deserialize>()! : (Dictionary)objectRaw66) : null, @group: new BillingPlanGroup(map["group"].ToString()!), - program: map.TryGetValue("program", out var objectRaw67) && objectRaw67 != null - ? Appwrite.Models.Program.From(map: objectRaw67 is JsonElement jsonObj67 ? jsonObj67.Deserialize>()! : (Dictionary)objectRaw67) + program: map.TryGetValue("program", out var objectRaw68) && objectRaw68 != null + ? Appwrite.Models.Program.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) : null, - dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw68) && objectRaw68 != null - ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) + dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw69) && objectRaw69 != null + ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) : null ); @@ -449,6 +455,7 @@ public BillingPlan( { "screenshotsGenerated", ScreenshotsGenerated }, { "members", Members }, { "webhooks", Webhooks }, + { "wafRules", WafRules }, { "projects", Projects }, { "platforms", Platforms }, { "users", Users }, diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 31822325..8d7ee677 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -32,11 +32,20 @@ public class Database [JsonPropertyName("status")] public DatabaseStatus? Status { get; private set; } + [JsonPropertyName("engine")] + public string? Engine { get; private set; } + + [JsonPropertyName("specification")] + public string? Specification { get; private set; } + + [JsonPropertyName("replicas")] + public long? Replicas { get; private set; } + [JsonPropertyName("policies")] - public List Policies { get; private set; } + public List? Policies { get; private set; } [JsonPropertyName("archives")] - public List Archives { get; private set; } + public List? Archives { get; private set; } public Database( string id, @@ -46,8 +55,11 @@ public Database( bool enabled, DatabaseType type, DatabaseStatus? status, - List policies, - List archives + string? engine, + string? specification, + long? replicas, + List? policies, + List? archives ) { Id = id; @@ -57,6 +69,9 @@ List archives Enabled = enabled; Type = type; Status = status; + Engine = engine; + Specification = specification; + Replicas = replicas; Policies = policies; Archives = archives; } @@ -73,8 +88,17 @@ List archives ? null : new DatabaseStatus(enumRaw7.ToString()!) : null, - policies: map["policies"].ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList(), - archives: map["archives"].ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() + engine: map.TryGetValue("engine", out var engine) ? engine?.ToString() : null, + specification: map.TryGetValue("specification", out var specification) ? specification?.ToString() : null, + replicas: map.TryGetValue("replicas", out var numberRaw10) && numberRaw10 != null + ? Convert.ToInt64(numberRaw10) + : null, + policies: map.TryGetValue("policies", out var arrayRaw11) && arrayRaw11 != null + ? arrayRaw11.ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() + : null, + archives: map.TryGetValue("archives", out var arrayRaw12) && arrayRaw12 != null + ? arrayRaw12.ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() + : null ); public Dictionary ToMap() => new Dictionary() @@ -86,6 +110,9 @@ List archives { "enabled", Enabled }, { "type", Type.Value }, { "status", Status?.Value }, + { "engine", Engine }, + { "specification", Specification }, + { "replicas", Replicas }, { "policies", Policies?.Select(it => it.ToMap()).ToList() }, { "archives", Archives?.Select(it => it.ToMap()).ToList() } }; diff --git a/Appwrite/Models/DatabaseStatus.cs b/Appwrite/Models/DatabaseStatus.cs new file mode 100644 index 00000000..e5abcad2 --- /dev/null +++ b/Appwrite/Models/DatabaseStatus.cs @@ -0,0 +1,82 @@ + +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 DatabaseStatus + { + [JsonPropertyName("health")] + public string Health { get; private set; } + + [JsonPropertyName("ready")] + public bool Ready { get; private set; } + + [JsonPropertyName("engine")] + public string Engine { get; private set; } + + [JsonPropertyName("version")] + public string Version { get; private set; } + + [JsonPropertyName("uptime")] + public long Uptime { get; private set; } + + [JsonPropertyName("connections")] + public DatabaseStatusConnections Connections { get; private set; } + + [JsonPropertyName("replicas")] + public List Replicas { get; private set; } + + [JsonPropertyName("volumes")] + public List Volumes { get; private set; } + + public DatabaseStatus( + string health, + bool ready, + string engine, + string version, + long uptime, + DatabaseStatusConnections connections, + List replicas, + List volumes + ) + { + Health = health; + Ready = ready; + Engine = engine; + Version = version; + Uptime = uptime; + Connections = connections; + Replicas = replicas; + Volumes = volumes; + } + + public static DatabaseStatus From(Dictionary map) => new DatabaseStatus( + health: map["health"].ToString(), + ready: (bool)map["ready"], + engine: map["engine"].ToString(), + version: map["version"].ToString(), + uptime: Convert.ToInt64(map["uptime"]), + connections: Appwrite.Models.DatabaseStatusConnections.From(map: map["connections"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["connections"]), + replicas: map["replicas"].ConvertToList>().Select(it => Appwrite.Models.DatabaseStatusReplica.From(map: it)).ToList(), + volumes: map["volumes"].ConvertToList>().Select(it => Appwrite.Models.DatabaseStatusVolume.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "health", Health }, + { "ready", Ready }, + { "engine", Engine }, + { "version", Version }, + { "uptime", Uptime }, + { "connections", Connections?.ToMap() }, + { "replicas", Replicas?.Select(it => it.ToMap()).ToList() }, + { "volumes", Volumes?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DatabaseStatusConnections.cs b/Appwrite/Models/DatabaseStatusConnections.cs new file mode 100644 index 00000000..4a1de49a --- /dev/null +++ b/Appwrite/Models/DatabaseStatusConnections.cs @@ -0,0 +1,40 @@ + +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 DatabaseStatusConnections + { + [JsonPropertyName("current")] + public long Current { get; private set; } + + [JsonPropertyName("max")] + public long Max { get; private set; } + + public DatabaseStatusConnections( + long current, + long max + ) + { + Current = current; + Max = max; + } + + public static DatabaseStatusConnections From(Dictionary map) => new DatabaseStatusConnections( + current: Convert.ToInt64(map["current"]), + max: Convert.ToInt64(map["max"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "current", Current }, + { "max", Max } + }; + } +} diff --git a/Appwrite/Models/DatabaseStatusReplica.cs b/Appwrite/Models/DatabaseStatusReplica.cs new file mode 100644 index 00000000..b5b8442b --- /dev/null +++ b/Appwrite/Models/DatabaseStatusReplica.cs @@ -0,0 +1,56 @@ + +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 DatabaseStatusReplica + { + [JsonPropertyName("index")] + public long Index { get; private set; } + + [JsonPropertyName("role")] + public string Role { get; private set; } + + [JsonPropertyName("healthy")] + public bool Healthy { get; private set; } + + [JsonPropertyName("lagSeconds")] + public double? LagSeconds { get; private set; } + + public DatabaseStatusReplica( + long index, + string role, + bool healthy, + double? lagSeconds + ) + { + Index = index; + Role = role; + Healthy = healthy; + LagSeconds = lagSeconds; + } + + public static DatabaseStatusReplica From(Dictionary map) => new DatabaseStatusReplica( + index: Convert.ToInt64(map["index"]), + role: map["role"].ToString(), + healthy: (bool)map["healthy"], + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null + ? Convert.ToDouble(numberRaw4) + : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "index", Index }, + { "role", Role }, + { "healthy", Healthy }, + { "lagSeconds", LagSeconds } + }; + } +} diff --git a/Appwrite/Models/DatabaseStatusVolume.cs b/Appwrite/Models/DatabaseStatusVolume.cs new file mode 100644 index 00000000..8fe63d8a --- /dev/null +++ b/Appwrite/Models/DatabaseStatusVolume.cs @@ -0,0 +1,54 @@ + +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 DatabaseStatusVolume + { + [JsonPropertyName("path")] + public string Path { get; private set; } + + [JsonPropertyName("usedPercent")] + public string UsedPercent { get; private set; } + + [JsonPropertyName("available")] + public string Available { get; private set; } + + [JsonPropertyName("mounted")] + public bool Mounted { get; private set; } + + public DatabaseStatusVolume( + string @path, + string usedPercent, + string available, + bool mounted + ) + { + Path = @path; + UsedPercent = usedPercent; + Available = available; + Mounted = mounted; + } + + public static DatabaseStatusVolume From(Dictionary map) => new DatabaseStatusVolume( + @path: map["path"].ToString(), + usedPercent: map["usedPercent"].ToString(), + available: map["available"].ToString(), + mounted: (bool)map["mounted"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "path", Path }, + { "usedPercent", UsedPercent }, + { "available", Available }, + { "mounted", Mounted } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabase.cs b/Appwrite/Models/DedicatedDatabase.cs new file mode 100644 index 00000000..23c8fd07 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabase.cs @@ -0,0 +1,369 @@ + +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 DedicatedDatabase + { + [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("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("api")] + public string Api { get; private set; } + + [JsonPropertyName("engine")] + public string Engine { get; private set; } + + [JsonPropertyName("version")] + public string Version { get; private set; } + + [JsonPropertyName("specification")] + public string Specification { get; private set; } + + [JsonPropertyName("backend")] + public string Backend { get; private set; } + + [JsonPropertyName("hostname")] + public string Hostname { get; private set; } + + [JsonPropertyName("connectionPort")] + public long ConnectionPort { get; private set; } + + [JsonPropertyName("connectionUser")] + public string ConnectionUser { get; private set; } + + [JsonPropertyName("connectionPassword")] + public string ConnectionPassword { get; private set; } + + [JsonPropertyName("connectionString")] + public string ConnectionString { get; private set; } + + [JsonPropertyName("ssl")] + public bool Ssl { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("containerStatus")] + public string ContainerStatus { get; private set; } + + [JsonPropertyName("lastAccessedAt")] + public string? LastAccessedAt { get; private set; } + + [JsonPropertyName("idleUntil")] + public string? IdleUntil { get; private set; } + + [JsonPropertyName("lifecycleState")] + public string LifecycleState { get; private set; } + + [JsonPropertyName("idleTimeoutMinutes")] + public long IdleTimeoutMinutes { get; private set; } + + [JsonPropertyName("cpu")] + public long Cpu { get; private set; } + + [JsonPropertyName("memory")] + public long Memory { get; private set; } + + [JsonPropertyName("storage")] + public long Storage { get; private set; } + + [JsonPropertyName("storageClass")] + public string StorageClass { get; private set; } + + [JsonPropertyName("storageMaxGb")] + public long StorageMaxGb { get; private set; } + + [JsonPropertyName("nodePool")] + public string NodePool { get; private set; } + + [JsonPropertyName("replicas")] + public long Replicas { get; private set; } + + [JsonPropertyName("syncMode")] + public string SyncMode { get; private set; } + + [JsonPropertyName("crossRegionReplicas")] + public long CrossRegionReplicas { get; private set; } + + [JsonPropertyName("networkMaxConnections")] + public long NetworkMaxConnections { get; private set; } + + [JsonPropertyName("networkIdleTimeoutSeconds")] + public long NetworkIdleTimeoutSeconds { get; private set; } + + [JsonPropertyName("networkIPAllowlist")] + public List NetworkIPAllowlist { get; private set; } + + [JsonPropertyName("backupEnabled")] + public bool BackupEnabled { get; private set; } + + [JsonPropertyName("pitr")] + public bool Pitr { get; private set; } + + [JsonPropertyName("pitrRetentionDays")] + public long PitrRetentionDays { get; private set; } + + [JsonPropertyName("storageAutoscaling")] + public bool StorageAutoscaling { get; private set; } + + [JsonPropertyName("storageAutoscalingThresholdPercent")] + public long StorageAutoscalingThresholdPercent { get; private set; } + + [JsonPropertyName("storageAutoscalingMaxGb")] + public long StorageAutoscalingMaxGb { get; private set; } + + [JsonPropertyName("maintenanceWindowDay")] + public string MaintenanceWindowDay { get; private set; } + + [JsonPropertyName("maintenanceWindowHourUtc")] + public long MaintenanceWindowHourUtc { get; private set; } + + [JsonPropertyName("metricsEnabled")] + public bool MetricsEnabled { get; private set; } + + [JsonPropertyName("sqlApiEnabled")] + public bool SqlApiEnabled { get; private set; } + + [JsonPropertyName("sqlApiAllowedStatements")] + public List SqlApiAllowedStatements { get; private set; } + + [JsonPropertyName("sqlApiMaxRows")] + public long SqlApiMaxRows { get; private set; } + + [JsonPropertyName("sqlApiMaxBytes")] + public long SqlApiMaxBytes { get; private set; } + + [JsonPropertyName("sqlApiTimeoutSeconds")] + public long SqlApiTimeoutSeconds { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public DedicatedDatabase( + string id, + string createdAt, + string updatedAt, + string projectId, + string name, + string api, + string engine, + string version, + string specification, + string backend, + string hostname, + long connectionPort, + string connectionUser, + string connectionPassword, + string connectionString, + bool ssl, + string status, + string containerStatus, + string? lastAccessedAt, + string? idleUntil, + string lifecycleState, + long idleTimeoutMinutes, + long cpu, + long memory, + long storage, + string storageClass, + long storageMaxGb, + string nodePool, + long replicas, + string syncMode, + long crossRegionReplicas, + long networkMaxConnections, + long networkIdleTimeoutSeconds, + List networkIPAllowlist, + bool backupEnabled, + bool pitr, + long pitrRetentionDays, + bool storageAutoscaling, + long storageAutoscalingThresholdPercent, + long storageAutoscalingMaxGb, + string maintenanceWindowDay, + long maintenanceWindowHourUtc, + bool metricsEnabled, + bool sqlApiEnabled, + List sqlApiAllowedStatements, + long sqlApiMaxRows, + long sqlApiMaxBytes, + long sqlApiTimeoutSeconds, + string error + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + ProjectId = projectId; + Name = name; + Api = api; + Engine = engine; + Version = version; + Specification = specification; + Backend = backend; + Hostname = hostname; + ConnectionPort = connectionPort; + ConnectionUser = connectionUser; + ConnectionPassword = connectionPassword; + ConnectionString = connectionString; + Ssl = ssl; + Status = status; + ContainerStatus = containerStatus; + LastAccessedAt = lastAccessedAt; + IdleUntil = idleUntil; + LifecycleState = lifecycleState; + IdleTimeoutMinutes = idleTimeoutMinutes; + Cpu = cpu; + Memory = memory; + Storage = storage; + StorageClass = storageClass; + StorageMaxGb = storageMaxGb; + NodePool = nodePool; + Replicas = replicas; + SyncMode = syncMode; + CrossRegionReplicas = crossRegionReplicas; + NetworkMaxConnections = networkMaxConnections; + NetworkIdleTimeoutSeconds = networkIdleTimeoutSeconds; + NetworkIPAllowlist = networkIPAllowlist; + BackupEnabled = backupEnabled; + Pitr = pitr; + PitrRetentionDays = pitrRetentionDays; + StorageAutoscaling = storageAutoscaling; + StorageAutoscalingThresholdPercent = storageAutoscalingThresholdPercent; + StorageAutoscalingMaxGb = storageAutoscalingMaxGb; + MaintenanceWindowDay = maintenanceWindowDay; + MaintenanceWindowHourUtc = maintenanceWindowHourUtc; + MetricsEnabled = metricsEnabled; + SqlApiEnabled = sqlApiEnabled; + SqlApiAllowedStatements = sqlApiAllowedStatements; + SqlApiMaxRows = sqlApiMaxRows; + SqlApiMaxBytes = sqlApiMaxBytes; + SqlApiTimeoutSeconds = sqlApiTimeoutSeconds; + Error = error; + } + + public static DedicatedDatabase From(Dictionary map) => new DedicatedDatabase( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + projectId: map["projectId"].ToString(), + name: map["name"].ToString(), + api: map["api"].ToString(), + engine: map["engine"].ToString(), + version: map["version"].ToString(), + specification: map["specification"].ToString(), + backend: map["backend"].ToString(), + hostname: map["hostname"].ToString(), + connectionPort: Convert.ToInt64(map["connectionPort"]), + connectionUser: map["connectionUser"].ToString(), + connectionPassword: map["connectionPassword"].ToString(), + connectionString: map["connectionString"].ToString(), + ssl: (bool)map["ssl"], + status: map["status"].ToString(), + containerStatus: map["containerStatus"].ToString(), + lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null, + idleUntil: map.TryGetValue("idleUntil", out var idleUntil) ? idleUntil?.ToString() : null, + lifecycleState: map["lifecycleState"].ToString(), + idleTimeoutMinutes: Convert.ToInt64(map["idleTimeoutMinutes"]), + cpu: Convert.ToInt64(map["cpu"]), + memory: Convert.ToInt64(map["memory"]), + storage: Convert.ToInt64(map["storage"]), + storageClass: map["storageClass"].ToString(), + storageMaxGb: Convert.ToInt64(map["storageMaxGb"]), + nodePool: map["nodePool"].ToString(), + replicas: Convert.ToInt64(map["replicas"]), + syncMode: map["syncMode"].ToString(), + crossRegionReplicas: Convert.ToInt64(map["crossRegionReplicas"]), + networkMaxConnections: Convert.ToInt64(map["networkMaxConnections"]), + networkIdleTimeoutSeconds: Convert.ToInt64(map["networkIdleTimeoutSeconds"]), + networkIPAllowlist: map["networkIPAllowlist"].ConvertToList(), + backupEnabled: (bool)map["backupEnabled"], + pitr: (bool)map["pitr"], + pitrRetentionDays: Convert.ToInt64(map["pitrRetentionDays"]), + storageAutoscaling: (bool)map["storageAutoscaling"], + storageAutoscalingThresholdPercent: Convert.ToInt64(map["storageAutoscalingThresholdPercent"]), + storageAutoscalingMaxGb: Convert.ToInt64(map["storageAutoscalingMaxGb"]), + maintenanceWindowDay: map["maintenanceWindowDay"].ToString(), + maintenanceWindowHourUtc: Convert.ToInt64(map["maintenanceWindowHourUtc"]), + metricsEnabled: (bool)map["metricsEnabled"], + sqlApiEnabled: (bool)map["sqlApiEnabled"], + sqlApiAllowedStatements: map["sqlApiAllowedStatements"].ConvertToList(), + sqlApiMaxRows: Convert.ToInt64(map["sqlApiMaxRows"]), + sqlApiMaxBytes: Convert.ToInt64(map["sqlApiMaxBytes"]), + sqlApiTimeoutSeconds: Convert.ToInt64(map["sqlApiTimeoutSeconds"]), + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "projectId", ProjectId }, + { "name", Name }, + { "api", Api }, + { "engine", Engine }, + { "version", Version }, + { "specification", Specification }, + { "backend", Backend }, + { "hostname", Hostname }, + { "connectionPort", ConnectionPort }, + { "connectionUser", ConnectionUser }, + { "connectionPassword", ConnectionPassword }, + { "connectionString", ConnectionString }, + { "ssl", Ssl }, + { "status", Status }, + { "containerStatus", ContainerStatus }, + { "lastAccessedAt", LastAccessedAt }, + { "idleUntil", IdleUntil }, + { "lifecycleState", LifecycleState }, + { "idleTimeoutMinutes", IdleTimeoutMinutes }, + { "cpu", Cpu }, + { "memory", Memory }, + { "storage", Storage }, + { "storageClass", StorageClass }, + { "storageMaxGb", StorageMaxGb }, + { "nodePool", NodePool }, + { "replicas", Replicas }, + { "syncMode", SyncMode }, + { "crossRegionReplicas", CrossRegionReplicas }, + { "networkMaxConnections", NetworkMaxConnections }, + { "networkIdleTimeoutSeconds", NetworkIdleTimeoutSeconds }, + { "networkIPAllowlist", NetworkIPAllowlist }, + { "backupEnabled", BackupEnabled }, + { "pitr", Pitr }, + { "pitrRetentionDays", PitrRetentionDays }, + { "storageAutoscaling", StorageAutoscaling }, + { "storageAutoscalingThresholdPercent", StorageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", StorageAutoscalingMaxGb }, + { "maintenanceWindowDay", MaintenanceWindowDay }, + { "maintenanceWindowHourUtc", MaintenanceWindowHourUtc }, + { "metricsEnabled", MetricsEnabled }, + { "sqlApiEnabled", SqlApiEnabled }, + { "sqlApiAllowedStatements", SqlApiAllowedStatements }, + { "sqlApiMaxRows", SqlApiMaxRows }, + { "sqlApiMaxBytes", SqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", SqlApiTimeoutSeconds }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseMember.cs b/Appwrite/Models/DedicatedDatabaseMember.cs new file mode 100644 index 00000000..5a3875a8 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseMember.cs @@ -0,0 +1,54 @@ + +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 DedicatedDatabaseMember + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("role")] + public string Role { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("lagSeconds")] + public double LagSeconds { get; private set; } + + public DedicatedDatabaseMember( + string id, + string role, + string status, + double lagSeconds + ) + { + Id = id; + Role = role; + Status = status; + LagSeconds = lagSeconds; + } + + public static DedicatedDatabaseMember From(Dictionary map) => new DedicatedDatabaseMember( + id: map["$id"].ToString(), + role: map["role"].ToString(), + status: map["status"].ToString(), + lagSeconds: Convert.ToDouble(map["lagSeconds"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "role", Role }, + { "status", Status }, + { "lagSeconds", LagSeconds } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseReplicas.cs b/Appwrite/Models/DedicatedDatabaseReplicas.cs new file mode 100644 index 00000000..caaa5990 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseReplicas.cs @@ -0,0 +1,47 @@ + +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 DedicatedDatabaseReplicas + { + [JsonPropertyName("replicas")] + public long Replicas { get; private set; } + + [JsonPropertyName("syncMode")] + public string SyncMode { get; private set; } + + [JsonPropertyName("members")] + public List Members { get; private set; } + + public DedicatedDatabaseReplicas( + long replicas, + string syncMode, + List members + ) + { + Replicas = replicas; + SyncMode = syncMode; + Members = members; + } + + public static DedicatedDatabaseReplicas From(Dictionary map) => new DedicatedDatabaseReplicas( + replicas: Convert.ToInt64(map["replicas"]), + syncMode: map["syncMode"].ToString(), + members: map["members"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseMember.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "replicas", Replicas }, + { "syncMode", SyncMode }, + { "members", Members?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseSpecification.cs b/Appwrite/Models/DedicatedDatabaseSpecification.cs new file mode 100644 index 00000000..0b815194 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseSpecification.cs @@ -0,0 +1,89 @@ + +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 DedicatedDatabaseSpecification + { + [JsonPropertyName("slug")] + public string Slug { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("price")] + public double Price { get; private set; } + + [JsonPropertyName("cpu")] + public long Cpu { get; private set; } + + [JsonPropertyName("memory")] + public long Memory { get; private set; } + + [JsonPropertyName("maxConnections")] + public long MaxConnections { get; private set; } + + [JsonPropertyName("includedStorage")] + public long IncludedStorage { get; private set; } + + [JsonPropertyName("includedBandwidth")] + public long IncludedBandwidth { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + public DedicatedDatabaseSpecification( + string slug, + string name, + double price, + long cpu, + long memory, + long maxConnections, + long includedStorage, + long includedBandwidth, + bool enabled + ) + { + Slug = slug; + Name = name; + Price = price; + Cpu = cpu; + Memory = memory; + MaxConnections = maxConnections; + IncludedStorage = includedStorage; + IncludedBandwidth = includedBandwidth; + Enabled = enabled; + } + + public static DedicatedDatabaseSpecification From(Dictionary map) => new DedicatedDatabaseSpecification( + slug: map["slug"].ToString(), + name: map["name"].ToString(), + price: Convert.ToDouble(map["price"]), + cpu: Convert.ToInt64(map["cpu"]), + memory: Convert.ToInt64(map["memory"]), + maxConnections: Convert.ToInt64(map["maxConnections"]), + includedStorage: Convert.ToInt64(map["includedStorage"]), + includedBandwidth: Convert.ToInt64(map["includedBandwidth"]), + enabled: (bool)map["enabled"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "slug", Slug }, + { "name", Name }, + { "price", Price }, + { "cpu", Cpu }, + { "memory", Memory }, + { "maxConnections", MaxConnections }, + { "includedStorage", IncludedStorage }, + { "includedBandwidth", IncludedBandwidth }, + { "enabled", Enabled } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseSpecificationList.cs b/Appwrite/Models/DedicatedDatabaseSpecificationList.cs new file mode 100644 index 00000000..59c0336b --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseSpecificationList.cs @@ -0,0 +1,47 @@ + +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 DedicatedDatabaseSpecificationList + { + [JsonPropertyName("specifications")] + public List Specifications { get; private set; } + + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("pricing")] + public DedicatedDatabaseSpecificationPricing Pricing { get; private set; } + + public DedicatedDatabaseSpecificationList( + List specifications, + long total, + DedicatedDatabaseSpecificationPricing pricing + ) + { + Specifications = specifications; + Total = total; + Pricing = pricing; + } + + public static DedicatedDatabaseSpecificationList From(Dictionary map) => new DedicatedDatabaseSpecificationList( + specifications: map["specifications"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseSpecification.From(map: it)).ToList(), + total: Convert.ToInt64(map["total"]), + pricing: Appwrite.Models.DedicatedDatabaseSpecificationPricing.From(map: map["pricing"] is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)map["pricing"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "specifications", Specifications?.Select(it => it.ToMap()).ToList() }, + { "total", Total }, + { "pricing", Pricing?.ToMap() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs b/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs new file mode 100644 index 00000000..ccf587aa --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs @@ -0,0 +1,61 @@ + +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 DedicatedDatabaseSpecificationPricing + { + [JsonPropertyName("storageOverageRate")] + public double StorageOverageRate { get; private set; } + + [JsonPropertyName("bandwidthOverageRate")] + public double BandwidthOverageRate { get; private set; } + + [JsonPropertyName("replicaRate")] + public double ReplicaRate { get; private set; } + + [JsonPropertyName("crossRegionReplicaRate")] + public double CrossRegionReplicaRate { get; private set; } + + [JsonPropertyName("pitrRate")] + public double PitrRate { get; private set; } + + public DedicatedDatabaseSpecificationPricing( + double storageOverageRate, + double bandwidthOverageRate, + double replicaRate, + double crossRegionReplicaRate, + double pitrRate + ) + { + StorageOverageRate = storageOverageRate; + BandwidthOverageRate = bandwidthOverageRate; + ReplicaRate = replicaRate; + CrossRegionReplicaRate = crossRegionReplicaRate; + PitrRate = pitrRate; + } + + public static DedicatedDatabaseSpecificationPricing From(Dictionary map) => new DedicatedDatabaseSpecificationPricing( + storageOverageRate: Convert.ToDouble(map["storageOverageRate"]), + bandwidthOverageRate: Convert.ToDouble(map["bandwidthOverageRate"]), + replicaRate: Convert.ToDouble(map["replicaRate"]), + crossRegionReplicaRate: Convert.ToDouble(map["crossRegionReplicaRate"]), + pitrRate: Convert.ToDouble(map["pitrRate"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "storageOverageRate", StorageOverageRate }, + { "bandwidthOverageRate", BandwidthOverageRate }, + { "replicaRate", ReplicaRate }, + { "crossRegionReplicaRate", CrossRegionReplicaRate }, + { "pitrRate", PitrRate } + }; + } +} diff --git a/Appwrite/Models/Oauth2Approve.cs b/Appwrite/Models/Oauth2Approve.cs new file mode 100644 index 00000000..cbcd97db --- /dev/null +++ b/Appwrite/Models/Oauth2Approve.cs @@ -0,0 +1,33 @@ + +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 Oauth2Approve + { + [JsonPropertyName("redirectUrl")] + public string RedirectUrl { get; private set; } + + public Oauth2Approve( + string redirectUrl + ) + { + RedirectUrl = redirectUrl; + } + + public static Oauth2Approve From(Dictionary map) => new Oauth2Approve( + redirectUrl: map["redirectUrl"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "redirectUrl", RedirectUrl } + }; + } +} diff --git a/Appwrite/Models/Oauth2Authorize.cs b/Appwrite/Models/Oauth2Authorize.cs new file mode 100644 index 00000000..6ce3913c --- /dev/null +++ b/Appwrite/Models/Oauth2Authorize.cs @@ -0,0 +1,40 @@ + +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 Oauth2Authorize + { + [JsonPropertyName("grantId")] + public string GrantId { get; private set; } + + [JsonPropertyName("redirectUrl")] + public string RedirectUrl { get; private set; } + + public Oauth2Authorize( + string grantId, + string redirectUrl + ) + { + GrantId = grantId; + RedirectUrl = redirectUrl; + } + + public static Oauth2Authorize From(Dictionary map) => new Oauth2Authorize( + grantId: map["grantId"].ToString(), + redirectUrl: map["redirectUrl"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "grantId", GrantId }, + { "redirectUrl", RedirectUrl } + }; + } +} diff --git a/Appwrite/Models/Oauth2Consent.cs b/Appwrite/Models/Oauth2Consent.cs new file mode 100644 index 00000000..86c338b4 --- /dev/null +++ b/Appwrite/Models/Oauth2Consent.cs @@ -0,0 +1,96 @@ + +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 Oauth2Consent + { + [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("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("cimdUrl")] + public string CimdUrl { get; private set; } + + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("authorizationDetails")] + public string AuthorizationDetails { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + public Oauth2Consent( + string id, + string createdAt, + string updatedAt, + string userId, + string appId, + string cimdUrl, + List scopes, + List resources, + string authorizationDetails, + string expire + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + UserId = userId; + AppId = appId; + CimdUrl = cimdUrl; + Scopes = scopes; + Resources = resources; + AuthorizationDetails = authorizationDetails; + Expire = expire; + } + + public static Oauth2Consent From(Dictionary map) => new Oauth2Consent( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + userId: map["userId"].ToString(), + appId: map["appId"].ToString(), + cimdUrl: map["cimdUrl"].ToString(), + scopes: map["scopes"].ConvertToList(), + resources: map["resources"].ConvertToList(), + authorizationDetails: map["authorizationDetails"].ToString(), + expire: map["expire"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "userId", UserId }, + { "appId", AppId }, + { "cimdUrl", CimdUrl }, + { "scopes", Scopes }, + { "resources", Resources }, + { "authorizationDetails", AuthorizationDetails }, + { "expire", Expire } + }; + } +} diff --git a/Appwrite/Models/Oauth2ConsentList.cs b/Appwrite/Models/Oauth2ConsentList.cs new file mode 100644 index 00000000..cdeef9ff --- /dev/null +++ b/Appwrite/Models/Oauth2ConsentList.cs @@ -0,0 +1,40 @@ + +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 Oauth2ConsentList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("consents")] + public List Consents { get; private set; } + + public Oauth2ConsentList( + long total, + List consents + ) + { + Total = total; + Consents = consents; + } + + public static Oauth2ConsentList From(Dictionary map) => new Oauth2ConsentList( + total: Convert.ToInt64(map["total"]), + consents: map["consents"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Consent.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "consents", Consents?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Oauth2ConsentToken.cs b/Appwrite/Models/Oauth2ConsentToken.cs new file mode 100644 index 00000000..40abe8da --- /dev/null +++ b/Appwrite/Models/Oauth2ConsentToken.cs @@ -0,0 +1,103 @@ + +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 Oauth2ConsentToken + { + [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("consentId")] + public string ConsentId { get; private set; } + + [JsonPropertyName("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("cimdUrl")] + public string CimdUrl { get; private set; } + + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("authorizationDetails")] + public string AuthorizationDetails { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + public Oauth2ConsentToken( + string id, + string createdAt, + string updatedAt, + string consentId, + string userId, + string appId, + string cimdUrl, + List scopes, + List resources, + string authorizationDetails, + string expire + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + ConsentId = consentId; + UserId = userId; + AppId = appId; + CimdUrl = cimdUrl; + Scopes = scopes; + Resources = resources; + AuthorizationDetails = authorizationDetails; + Expire = expire; + } + + public static Oauth2ConsentToken From(Dictionary map) => new Oauth2ConsentToken( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + consentId: map["consentId"].ToString(), + userId: map["userId"].ToString(), + appId: map["appId"].ToString(), + cimdUrl: map["cimdUrl"].ToString(), + scopes: map["scopes"].ConvertToList(), + resources: map["resources"].ConvertToList(), + authorizationDetails: map["authorizationDetails"].ToString(), + expire: map["expire"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "consentId", ConsentId }, + { "userId", UserId }, + { "appId", AppId }, + { "cimdUrl", CimdUrl }, + { "scopes", Scopes }, + { "resources", Resources }, + { "authorizationDetails", AuthorizationDetails }, + { "expire", Expire } + }; + } +} diff --git a/Appwrite/Models/Oauth2ConsentTokenList.cs b/Appwrite/Models/Oauth2ConsentTokenList.cs new file mode 100644 index 00000000..87703e57 --- /dev/null +++ b/Appwrite/Models/Oauth2ConsentTokenList.cs @@ -0,0 +1,40 @@ + +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 Oauth2ConsentTokenList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("tokens")] + public List Tokens { get; private set; } + + public Oauth2ConsentTokenList( + long total, + List tokens + ) + { + Total = total; + Tokens = tokens; + } + + public static Oauth2ConsentTokenList From(Dictionary map) => new Oauth2ConsentTokenList( + total: Convert.ToInt64(map["total"]), + tokens: map["tokens"].ConvertToList>().Select(it => Appwrite.Models.Oauth2ConsentToken.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "tokens", Tokens?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Oauth2DeviceAuthorization.cs b/Appwrite/Models/Oauth2DeviceAuthorization.cs new file mode 100644 index 00000000..78c9631f --- /dev/null +++ b/Appwrite/Models/Oauth2DeviceAuthorization.cs @@ -0,0 +1,68 @@ + +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 Oauth2DeviceAuthorization + { + [JsonPropertyName("device_code")] + public string DeviceCode { get; private set; } + + [JsonPropertyName("user_code")] + public string UserCode { get; private set; } + + [JsonPropertyName("verification_uri")] + public string VerificationUri { get; private set; } + + [JsonPropertyName("verification_uri_complete")] + public string VerificationUriComplete { get; private set; } + + [JsonPropertyName("expires_in")] + public long ExpiresIn { get; private set; } + + [JsonPropertyName("interval")] + public long Interval { get; private set; } + + public Oauth2DeviceAuthorization( + string deviceCode, + string userCode, + string verificationUri, + string verificationUriComplete, + long expiresIn, + long interval + ) + { + DeviceCode = deviceCode; + UserCode = userCode; + VerificationUri = verificationUri; + VerificationUriComplete = verificationUriComplete; + ExpiresIn = expiresIn; + Interval = interval; + } + + public static Oauth2DeviceAuthorization From(Dictionary map) => new Oauth2DeviceAuthorization( + deviceCode: map["device_code"].ToString(), + userCode: map["user_code"].ToString(), + verificationUri: map["verification_uri"].ToString(), + verificationUriComplete: map["verification_uri_complete"].ToString(), + expiresIn: Convert.ToInt64(map["expires_in"]), + interval: Convert.ToInt64(map["interval"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "device_code", DeviceCode }, + { "user_code", UserCode }, + { "verification_uri", VerificationUri }, + { "verification_uri_complete", VerificationUriComplete }, + { "expires_in", ExpiresIn }, + { "interval", Interval } + }; + } +} diff --git a/Appwrite/Models/Oauth2Grant.cs b/Appwrite/Models/Oauth2Grant.cs new file mode 100644 index 00000000..8b3e074e --- /dev/null +++ b/Appwrite/Models/Oauth2Grant.cs @@ -0,0 +1,110 @@ + +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 Oauth2Grant + { + [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("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("appId")] + public string AppId { get; private set; } + + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + + [JsonPropertyName("resources")] + public List Resources { get; private set; } + + [JsonPropertyName("authorizationDetails")] + public string AuthorizationDetails { get; private set; } + + [JsonPropertyName("prompt")] + public string Prompt { get; private set; } + + [JsonPropertyName("redirectUri")] + public string RedirectUri { get; private set; } + + [JsonPropertyName("authTime")] + public long AuthTime { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + public Oauth2Grant( + string id, + string createdAt, + string updatedAt, + string userId, + string appId, + List scopes, + List resources, + string authorizationDetails, + string prompt, + string redirectUri, + long authTime, + string expire + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + UserId = userId; + AppId = appId; + Scopes = scopes; + Resources = resources; + AuthorizationDetails = authorizationDetails; + Prompt = prompt; + RedirectUri = redirectUri; + AuthTime = authTime; + Expire = expire; + } + + public static Oauth2Grant From(Dictionary map) => new Oauth2Grant( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + userId: map["userId"].ToString(), + appId: map["appId"].ToString(), + scopes: map["scopes"].ConvertToList(), + resources: map["resources"].ConvertToList(), + authorizationDetails: map["authorizationDetails"].ToString(), + prompt: map["prompt"].ToString(), + redirectUri: map["redirectUri"].ToString(), + authTime: Convert.ToInt64(map["authTime"]), + expire: map["expire"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "userId", UserId }, + { "appId", AppId }, + { "scopes", Scopes }, + { "resources", Resources }, + { "authorizationDetails", AuthorizationDetails }, + { "prompt", Prompt }, + { "redirectUri", RedirectUri }, + { "authTime", AuthTime }, + { "expire", Expire } + }; + } +} diff --git a/Appwrite/Models/Oauth2Organization.cs b/Appwrite/Models/Oauth2Organization.cs new file mode 100644 index 00000000..60c5e10f --- /dev/null +++ b/Appwrite/Models/Oauth2Organization.cs @@ -0,0 +1,33 @@ + +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 Oauth2Organization + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + public Oauth2Organization( + string id + ) + { + Id = id; + } + + public static Oauth2Organization From(Dictionary map) => new Oauth2Organization( + id: map["$id"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id } + }; + } +} diff --git a/Appwrite/Models/Oauth2OrganizationList.cs b/Appwrite/Models/Oauth2OrganizationList.cs new file mode 100644 index 00000000..d2db18c1 --- /dev/null +++ b/Appwrite/Models/Oauth2OrganizationList.cs @@ -0,0 +1,40 @@ + +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 Oauth2OrganizationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("organizations")] + public List Organizations { get; private set; } + + public Oauth2OrganizationList( + long total, + List organizations + ) + { + Total = total; + Organizations = organizations; + } + + public static Oauth2OrganizationList From(Dictionary map) => new Oauth2OrganizationList( + total: Convert.ToInt64(map["total"]), + organizations: map["organizations"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Organization.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "organizations", Organizations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Oauth2PAR.cs b/Appwrite/Models/Oauth2PAR.cs new file mode 100644 index 00000000..08e630c3 --- /dev/null +++ b/Appwrite/Models/Oauth2PAR.cs @@ -0,0 +1,40 @@ + +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 Oauth2PAR + { + [JsonPropertyName("request_uri")] + public string RequestUri { get; private set; } + + [JsonPropertyName("expires_in")] + public long ExpiresIn { get; private set; } + + public Oauth2PAR( + string requestUri, + long expiresIn + ) + { + RequestUri = requestUri; + ExpiresIn = expiresIn; + } + + public static Oauth2PAR From(Dictionary map) => new Oauth2PAR( + requestUri: map["request_uri"].ToString(), + expiresIn: Convert.ToInt64(map["expires_in"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "request_uri", RequestUri }, + { "expires_in", ExpiresIn } + }; + } +} diff --git a/Appwrite/Models/Oauth2Project.cs b/Appwrite/Models/Oauth2Project.cs new file mode 100644 index 00000000..7378f28f --- /dev/null +++ b/Appwrite/Models/Oauth2Project.cs @@ -0,0 +1,47 @@ + +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 Oauth2Project + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("region")] + public string Region { get; private set; } + + [JsonPropertyName("endpoint")] + public string Endpoint { get; private set; } + + public Oauth2Project( + string id, + string region, + string endpoint + ) + { + Id = id; + Region = region; + Endpoint = endpoint; + } + + public static Oauth2Project From(Dictionary map) => new Oauth2Project( + id: map["$id"].ToString(), + region: map["region"].ToString(), + endpoint: map["endpoint"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "region", Region }, + { "endpoint", Endpoint } + }; + } +} diff --git a/Appwrite/Models/Oauth2ProjectList.cs b/Appwrite/Models/Oauth2ProjectList.cs new file mode 100644 index 00000000..91c24435 --- /dev/null +++ b/Appwrite/Models/Oauth2ProjectList.cs @@ -0,0 +1,40 @@ + +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 Oauth2ProjectList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("projects")] + public List Projects { get; private set; } + + public Oauth2ProjectList( + long total, + List projects + ) + { + Total = total; + Projects = projects; + } + + public static Oauth2ProjectList From(Dictionary map) => new Oauth2ProjectList( + total: Convert.ToInt64(map["total"]), + projects: map["projects"].ConvertToList>().Select(it => Appwrite.Models.Oauth2Project.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "projects", Projects?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Oauth2Reject.cs b/Appwrite/Models/Oauth2Reject.cs new file mode 100644 index 00000000..edc64a6e --- /dev/null +++ b/Appwrite/Models/Oauth2Reject.cs @@ -0,0 +1,33 @@ + +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 Oauth2Reject + { + [JsonPropertyName("redirectUrl")] + public string RedirectUrl { get; private set; } + + public Oauth2Reject( + string redirectUrl + ) + { + RedirectUrl = redirectUrl; + } + + public static Oauth2Reject From(Dictionary map) => new Oauth2Reject( + redirectUrl: map["redirectUrl"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "redirectUrl", RedirectUrl } + }; + } +} diff --git a/Appwrite/Models/Oauth2Token.cs b/Appwrite/Models/Oauth2Token.cs new file mode 100644 index 00000000..3d18e113 --- /dev/null +++ b/Appwrite/Models/Oauth2Token.cs @@ -0,0 +1,75 @@ + +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 Oauth2Token + { + [JsonPropertyName("access_token")] + public string AccessToken { get; private set; } + + [JsonPropertyName("token_type")] + public string TokenType { get; private set; } + + [JsonPropertyName("expires_in")] + public long ExpiresIn { get; private set; } + + [JsonPropertyName("refresh_token")] + public string RefreshToken { get; private set; } + + [JsonPropertyName("scope")] + public string Scope { get; private set; } + + [JsonPropertyName("authorization_details")] + public string? AuthorizationDetails { get; private set; } + + [JsonPropertyName("id_token")] + public string? IdToken { get; private set; } + + public Oauth2Token( + string accessToken, + string tokenType, + long expiresIn, + string refreshToken, + string scope, + string? authorizationDetails, + string? idToken + ) + { + AccessToken = accessToken; + TokenType = tokenType; + ExpiresIn = expiresIn; + RefreshToken = refreshToken; + Scope = scope; + AuthorizationDetails = authorizationDetails; + IdToken = idToken; + } + + public static Oauth2Token From(Dictionary map) => new Oauth2Token( + accessToken: map["access_token"].ToString(), + tokenType: map["token_type"].ToString(), + expiresIn: Convert.ToInt64(map["expires_in"]), + refreshToken: map["refresh_token"].ToString(), + scope: map["scope"].ToString(), + authorizationDetails: map.TryGetValue("authorization_details", out var authorizationDetails) ? authorizationDetails?.ToString() : null, + idToken: map.TryGetValue("id_token", out var idToken) ? idToken?.ToString() : null + ); + + public Dictionary ToMap() => new Dictionary() + { + { "access_token", AccessToken }, + { "token_type", TokenType }, + { "expires_in", ExpiresIn }, + { "refresh_token", RefreshToken }, + { "scope", Scope }, + { "authorization_details", AuthorizationDetails }, + { "id_token", IdToken } + }; + } +} diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 10b325e8..08735680 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -92,6 +92,9 @@ public class Project [JsonPropertyName("consoleAccessedAt")] public string ConsoleAccessedAt { get; private set; } + [JsonPropertyName("wafEnabled")] + public bool WafEnabled { get; private set; } + [JsonPropertyName("billingLimits")] public BillingLimits? BillingLimits { get; private set; } @@ -122,6 +125,9 @@ public class Project [JsonPropertyName("oAuth2ServerPublicRefreshTokenDuration")] public long? OAuth2ServerPublicRefreshTokenDuration { get; private set; } + [JsonPropertyName("oAuth2ServerInstallationAccessTokenDuration")] + public long? OAuth2ServerInstallationAccessTokenDuration { get; private set; } + [JsonPropertyName("oAuth2ServerConfidentialPkce")] public bool? OAuth2ServerConfidentialPkce { get; private set; } @@ -168,6 +174,7 @@ public Project( List protocols, List blocks, string consoleAccessedAt, + bool wafEnabled, BillingLimits? billingLimits, bool? oAuth2ServerEnabled, string? oAuth2ServerAuthorizationUrl, @@ -178,6 +185,7 @@ public Project( long? oAuth2ServerRefreshTokenDuration, long? oAuth2ServerPublicAccessTokenDuration, long? oAuth2ServerPublicRefreshTokenDuration, + long? oAuth2ServerInstallationAccessTokenDuration, bool? oAuth2ServerConfidentialPkce, string? oAuth2ServerVerificationUrl, long? oAuth2ServerUserCodeLength, @@ -213,6 +221,7 @@ public Project( Protocols = protocols; Blocks = blocks; ConsoleAccessedAt = consoleAccessedAt; + WafEnabled = wafEnabled; BillingLimits = billingLimits; OAuth2ServerEnabled = oAuth2ServerEnabled; OAuth2ServerAuthorizationUrl = oAuth2ServerAuthorizationUrl; @@ -223,6 +232,7 @@ public Project( OAuth2ServerRefreshTokenDuration = oAuth2ServerRefreshTokenDuration; OAuth2ServerPublicAccessTokenDuration = oAuth2ServerPublicAccessTokenDuration; OAuth2ServerPublicRefreshTokenDuration = oAuth2ServerPublicRefreshTokenDuration; + OAuth2ServerInstallationAccessTokenDuration = oAuth2ServerInstallationAccessTokenDuration; OAuth2ServerConfidentialPkce = oAuth2ServerConfidentialPkce; OAuth2ServerVerificationUrl = oAuth2ServerVerificationUrl; OAuth2ServerUserCodeLength = oAuth2ServerUserCodeLength; @@ -259,44 +269,48 @@ public Project( protocols: map["protocols"].ConvertToList>().Select(it => Appwrite.Models.ProjectProtocol.From(map: it)).ToList(), blocks: map["blocks"].ConvertToList>().Select(it => Appwrite.Models.Block.From(map: it)).ToList(), consoleAccessedAt: map["consoleAccessedAt"].ToString(), - billingLimits: map.TryGetValue("billingLimits", out var objectRaw28) && objectRaw28 != null - ? Appwrite.Models.BillingLimits.From(map: objectRaw28 is JsonElement jsonObj28 ? jsonObj28.Deserialize>()! : (Dictionary)objectRaw28) + wafEnabled: (bool)map["wafEnabled"], + billingLimits: map.TryGetValue("billingLimits", out var objectRaw29) && objectRaw29 != null + ? Appwrite.Models.BillingLimits.From(map: objectRaw29 is JsonElement jsonObj29 ? jsonObj29.Deserialize>()! : (Dictionary)objectRaw29) : null, - oAuth2ServerEnabled: map.TryGetValue("oAuth2ServerEnabled", out var boolRaw29) && boolRaw29 != null - ? (bool?)boolRaw29 + oAuth2ServerEnabled: map.TryGetValue("oAuth2ServerEnabled", out var boolRaw30) && boolRaw30 != null + ? (bool?)boolRaw30 : null, oAuth2ServerAuthorizationUrl: map.TryGetValue("oAuth2ServerAuthorizationUrl", out var oAuth2ServerAuthorizationUrl) ? oAuth2ServerAuthorizationUrl?.ToString() : null, - oAuth2ServerScopes: map.TryGetValue("oAuth2ServerScopes", out var arrayRaw31) && arrayRaw31 != null - ? arrayRaw31.ConvertToList() - : null, - oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw32) && arrayRaw32 != null + oAuth2ServerScopes: map.TryGetValue("oAuth2ServerScopes", out var arrayRaw32) && arrayRaw32 != null ? arrayRaw32.ConvertToList() : null, - oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw33) && arrayRaw33 != null + oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw33) && arrayRaw33 != null ? arrayRaw33.ConvertToList() : null, - oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw34) && numberRaw34 != null - ? Convert.ToInt64(numberRaw34) - : null, - oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw35) && numberRaw35 != null + oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw34) && arrayRaw34 != null + ? arrayRaw34.ConvertToList() + : null, + oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw35) && numberRaw35 != null ? Convert.ToInt64(numberRaw35) : null, - oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw36) && numberRaw36 != null + oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw36) && numberRaw36 != null ? Convert.ToInt64(numberRaw36) : null, - oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw37) && numberRaw37 != null + oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw37) && numberRaw37 != null ? Convert.ToInt64(numberRaw37) : null, - oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw38) && boolRaw38 != null - ? (bool?)boolRaw38 + oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw38) && numberRaw38 != null + ? Convert.ToInt64(numberRaw38) + : null, + oAuth2ServerInstallationAccessTokenDuration: map.TryGetValue("oAuth2ServerInstallationAccessTokenDuration", out var numberRaw39) && numberRaw39 != null + ? Convert.ToInt64(numberRaw39) + : null, + oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw40) && boolRaw40 != null + ? (bool?)boolRaw40 : null, oAuth2ServerVerificationUrl: map.TryGetValue("oAuth2ServerVerificationUrl", out var oAuth2ServerVerificationUrl) ? oAuth2ServerVerificationUrl?.ToString() : null, - oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw40) && numberRaw40 != null - ? Convert.ToInt64(numberRaw40) + oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw42) && numberRaw42 != null + ? Convert.ToInt64(numberRaw42) : null, oAuth2ServerUserCodeFormat: map.TryGetValue("oAuth2ServerUserCodeFormat", out var oAuth2ServerUserCodeFormat) ? oAuth2ServerUserCodeFormat?.ToString() : null, - oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw42) && numberRaw42 != null - ? Convert.ToInt64(numberRaw42) + oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw44) && numberRaw44 != null + ? Convert.ToInt64(numberRaw44) : null, oAuth2ServerDiscoveryUrl: map.TryGetValue("oAuth2ServerDiscoveryUrl", out var oAuth2ServerDiscoveryUrl) ? oAuth2ServerDiscoveryUrl?.ToString() : null ); @@ -330,6 +344,7 @@ public Project( { "protocols", Protocols?.Select(it => it.ToMap()).ToList() }, { "blocks", Blocks?.Select(it => it.ToMap()).ToList() }, { "consoleAccessedAt", ConsoleAccessedAt }, + { "wafEnabled", WafEnabled }, { "billingLimits", BillingLimits?.ToMap() }, { "oAuth2ServerEnabled", OAuth2ServerEnabled }, { "oAuth2ServerAuthorizationUrl", OAuth2ServerAuthorizationUrl }, @@ -340,6 +355,7 @@ public Project( { "oAuth2ServerRefreshTokenDuration", OAuth2ServerRefreshTokenDuration }, { "oAuth2ServerPublicAccessTokenDuration", OAuth2ServerPublicAccessTokenDuration }, { "oAuth2ServerPublicRefreshTokenDuration", OAuth2ServerPublicRefreshTokenDuration }, + { "oAuth2ServerInstallationAccessTokenDuration", OAuth2ServerInstallationAccessTokenDuration }, { "oAuth2ServerConfidentialPkce", OAuth2ServerConfidentialPkce }, { "oAuth2ServerVerificationUrl", OAuth2ServerVerificationUrl }, { "oAuth2ServerUserCodeLength", OAuth2ServerUserCodeLength }, diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 9adf981b..4770a4bb 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -90,6 +90,216 @@ static Models.User Convert(Dictionary it) } + /// + /// Get a list of the OAuth2 consents the current user has given to third-party + /// apps. + /// + /// + public Task ListConsents(List? queries = null, bool? total = null) + { + var apiPath = "/account/consents"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Oauth2ConsentList Convert(Dictionary it) + { + return Models.Oauth2ConsentList.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 an OAuth2 consent the current user has given to a third-party app by + /// its unique ID. + /// + /// + public Task GetConsent(string consentId) + { + var apiPath = "/account/consents/{consentId}" + .Replace("{consentId}", consentId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Consent Convert(Dictionary it) + { + return Models.Oauth2Consent.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 OAuth2 consent by its unique ID. All token families issued under + /// the consent are revoked, and the app must ask for consent again to regain + /// access. + /// + /// + public Task DeleteConsent(string consentId) + { + var apiPath = "/account/consents/{consentId}" + .Replace("{consentId}", consentId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Get a list of the token families issued under an OAuth2 consent. Each entry + /// represents one authorized device or session; the token secrets themselves + /// are never returned. + /// + /// + public Task ListConsentTokens(string consentId, List? queries = null, bool? total = null) + { + var apiPath = "/account/consents/{consentId}/tokens" + .Replace("{consentId}", consentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Oauth2ConsentTokenList Convert(Dictionary it) + { + return Models.Oauth2ConsentTokenList.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 a token family issued under an OAuth2 consent by its unique ID. The + /// token secrets themselves are never returned. + /// + /// + public Task GetConsentToken(string consentId, string tokenId) + { + var apiPath = "/account/consents/{consentId}/tokens/{tokenId}" + .Replace("{consentId}", consentId) + .Replace("{tokenId}", tokenId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Oauth2ConsentToken Convert(Dictionary it) + { + return Models.Oauth2ConsentToken.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 a token family issued under an OAuth2 consent by its unique ID. The + /// access and refresh tokens of the family stop working immediately; other + /// token families and the consent itself are unaffected. + /// + /// + public Task DeleteConsentToken(string consentId, string tokenId) + { + var apiPath = "/account/consents/{consentId}/tokens/{tokenId}" + .Replace("{consentId}", consentId) + .Replace("{tokenId}", tokenId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + /// /// Update currently logged in user account email address. After changing user /// address, the user confirmation status will get reset. A new confirmation diff --git a/Appwrite/Services/Apps.cs b/Appwrite/Services/Apps.cs new file mode 100644 index 00000000..1d61f420 --- /dev/null +++ b/Appwrite/Services/Apps.cs @@ -0,0 +1,784 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Apps : Service + { + public Apps(Client client) : base(client) + { + } + + /// + /// List applications. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/apps"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppsList Convert(Dictionary it) + { + return Models.AppsList.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 application. + /// + /// + public Task Create(string appId, string name, List redirectUris, string? description = null, string? clientUri = null, string? logoUri = null, string? privacyPolicyUrl = null, string? termsUrl = null, List? contacts = null, string? tagline = null, List? tags = null, List? images = null, string? supportUrl = null, string? dataDeletionUrl = null, List? postLogoutRedirectUris = null, bool? enabled = null, string? type = null, bool? deviceFlow = null, string? teamId = null) + { + var apiPath = "/apps"; + + var apiParameters = new Dictionary() + { + { "appId", appId }, + { "name", name }, + { "description", description }, + { "clientUri", clientUri }, + { "logoUri", logoUri }, + { "privacyPolicyUrl", privacyPolicyUrl }, + { "termsUrl", termsUrl }, + { "contacts", contacts }, + { "tagline", tagline }, + { "tags", tags }, + { "images", images }, + { "supportUrl", supportUrl }, + { "dataDeletionUrl", dataDeletionUrl }, + { "redirectUris", redirectUris }, + { "postLogoutRedirectUris", postLogoutRedirectUris }, + { "enabled", enabled }, + { "type", type }, + { "deviceFlow", deviceFlow }, + { "teamId", teamId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.App Convert(Dictionary it) + { + return Models.App.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 scopes an application can request when installed on a team. + /// + /// + public Task ListInstallationScopes() + { + var apiPath = "/apps/scopes/installations"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppScopeList Convert(Dictionary it) + { + return Models.AppScopeList.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); + + } + + /// + /// List scopes an application can request during the OAuth2 flow. + /// + /// + public Task ListOAuth2Scopes() + { + var apiPath = "/apps/scopes/oauth2"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppScopeList Convert(Dictionary it) + { + return Models.AppScopeList.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 an application by its unique ID. + /// + /// + public Task Get(string appId) + { + var apiPath = "/apps/{appId}" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.App Convert(Dictionary it) + { + return Models.App.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 application by its unique ID. + /// + /// + public Task Update(string appId, string name, string? description = null, string? clientUri = null, string? logoUri = null, string? privacyPolicyUrl = null, string? termsUrl = null, List? contacts = null, string? tagline = null, List? tags = null, List? images = null, string? supportUrl = null, string? dataDeletionUrl = null, bool? enabled = null, List? redirectUris = null, List? postLogoutRedirectUris = null, string? type = null, bool? deviceFlow = null, List? installationScopes = null, string? installationRedirectUrl = null) + { + var apiPath = "/apps/{appId}" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "description", description }, + { "clientUri", clientUri }, + { "logoUri", logoUri }, + { "privacyPolicyUrl", privacyPolicyUrl }, + { "termsUrl", termsUrl }, + { "contacts", contacts }, + { "tagline", tagline }, + { "tags", tags }, + { "images", images }, + { "supportUrl", supportUrl }, + { "dataDeletionUrl", dataDeletionUrl }, + { "enabled", enabled }, + { "redirectUris", redirectUris }, + { "postLogoutRedirectUris", postLogoutRedirectUris }, + { "type", type }, + { "deviceFlow", deviceFlow }, + { "installationScopes", installationScopes }, + { "installationRedirectUrl", installationRedirectUrl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.App Convert(Dictionary it) + { + return Models.App.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete an application by its unique ID. + /// + /// + public Task Delete(string appId) + { + var apiPath = "/apps/{appId}" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 installations of an application. Requires an app key sent in the + /// `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + /// + /// + public Task ListInstallations(string appId, List? queries = null, bool? total = null) + { + var apiPath = "/apps/{appId}/installations" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallationList Convert(Dictionary it) + { + return Models.AppInstallationList.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 an installation of an application by its unique ID. Requires an app key + /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + /// + /// + public Task GetInstallation(string appId, string installationId) + { + var apiPath = "/apps/{appId}/installations/{installationId}" + .Replace("{appId}", appId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.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 token for an installation of an application. Requires an app key + /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + /// The returned token carries the scopes and authorization details granted to + /// the installation, and can be used as an `Authorization: Bearer` header + /// everywhere OAuth2 access tokens are accepted. Multiple tokens can be active + /// for the same installation at once; each token stays valid until it expires + /// or the installation is updated or deleted. + /// + /// + public Task CreateInstallationToken(string appId, string installationId) + { + var apiPath = "/apps/{appId}/installations/{installationId}/tokens" + .Replace("{appId}", appId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Token Convert(Dictionary it) + { + return Models.Oauth2Token.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 app keys for an application. + /// + /// + public Task ListKeys(string appId, List? queries = null, bool? total = null) + { + var apiPath = "/apps/{appId}/keys" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppKeyList Convert(Dictionary it) + { + return Models.AppKeyList.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 app key for an application. App keys carry no scopes; send one + /// in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to + /// list the application's installations and create installation access tokens. + /// + /// + public Task CreateKey(string appId) + { + var apiPath = "/apps/{appId}/keys" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppKey Convert(Dictionary it) + { + return Models.AppKey.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 an app key by its unique ID. + /// + /// + public Task GetKey(string appId, string keyId) + { + var apiPath = "/apps/{appId}/keys/{keyId}" + .Replace("{appId}", appId) + .Replace("{keyId}", keyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppKey Convert(Dictionary it) + { + return Models.AppKey.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 app key by its unique ID. + /// + /// + public Task DeleteKey(string appId, string keyId) + { + var apiPath = "/apps/{appId}/keys/{keyId}" + .Replace("{appId}", appId) + .Replace("{keyId}", keyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Update the labels of an application. Labels are read-only for clients; only + /// a server SDK using a project API key can set them. Replaces the previous + /// labels. + /// + /// + public Task UpdateLabels(string appId, List labels) + { + var apiPath = "/apps/{appId}/labels" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "labels", labels } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.App Convert(Dictionary it) + { + return Models.App.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// List client secrets for an application. + /// + /// + public Task ListSecrets(string appId, List? queries = null, bool? total = null) + { + var apiPath = "/apps/{appId}/secrets" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppSecretList Convert(Dictionary it) + { + return Models.AppSecretList.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 client secret for an application. + /// + /// + public Task CreateSecret(string appId) + { + var apiPath = "/apps/{appId}/secrets" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppSecretPlaintext Convert(Dictionary it) + { + return Models.AppSecretPlaintext.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 an application client secret by its unique ID. + /// + /// + public Task GetSecret(string appId, string secretId) + { + var apiPath = "/apps/{appId}/secrets/{secretId}" + .Replace("{appId}", appId) + .Replace("{secretId}", secretId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppSecret Convert(Dictionary it) + { + return Models.AppSecret.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 application client secret by its unique ID. + /// + /// + public Task DeleteSecret(string appId, string secretId) + { + var apiPath = "/apps/{appId}/secrets/{secretId}" + .Replace("{appId}", appId) + .Replace("{secretId}", secretId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Transfer an application to another team by its unique ID. + /// + /// + public Task UpdateTeam(string appId, string teamId) + { + var apiPath = "/apps/{appId}/team" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + { "teamId", teamId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.App Convert(Dictionary it) + { + return Models.App.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); + + } + + /// + /// Revoke all tokens for an application by its unique ID. + /// + /// + public Task DeleteTokens(string appId) + { + var apiPath = "/apps/{appId}/tokens" + .Replace("{appId}", appId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + } +} diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs index fd199d91..8aed4965 100644 --- a/Appwrite/Services/Backups.cs +++ b/Appwrite/Services/Backups.cs @@ -328,18 +328,33 @@ public Task DeletePolicy(string policyId) /// /// Create and trigger a new restoration for a backup on a project. /// - /// When restoring a DocumentsDB or VectorsDB database to a new resource, pass - /// `newSpecification` to provision the restored database on a different - /// specification than the archived one (for example, restoring onto a larger - /// or smaller dedicated database). Use `serverless` to restore onto the shared - /// pool, or a dedicated specification slug to restore onto a dedicated - /// database of that size. The specification must be permitted by the - /// organization's plan. `newSpecification` is not supported for - /// legacy/TablesDB databases or for bucket restores. + /// For a backup of one database, the restoration resolves its destination + /// before it is queued. Pass `newResourceId` to restore into that database ID, + /// including the archived database ID to overwrite it. When `newResourceId` is + /// omitted, a new database ID is generated and returned in `options`. + /// + /// The restoration migration records the archived database in `resourceId` and + /// `resourceType`, and the resolved database in `destinationResourceId` and + /// `destinationResourceType`. Database types are stored canonically as + /// `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave + /// these fields empty because they do not have a single source or destination + /// database. + /// + /// To list every migration related to one database, use its canonical type in + /// a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and + /// destination relation pairs: `(resourceType, resourceId)`, + /// `(parentResourceType, parentResourceId)`, and `(destinationResourceType, + /// destinationResourceId)`. Legacy and TablesDB databases use `database`; the + /// operational `resourceType` of a table migration is not rewritten to + /// `tablesdb`. + /// + /// When restoring a DocumentsDB or VectorsDB database to a new resource from a + /// dedicated source, the restore provisions a fresh dedicated backing database + /// at the source database's own specification. /// /// /// - public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null, string? newSpecification = null) + public Task CreateRestoration(string archiveId, List services, string? newResourceId = null, string? newResourceName = null) { var apiPath = "/backups/restoration"; @@ -348,8 +363,7 @@ public Task DeletePolicy(string policyId) { "archiveId", archiveId }, { "services", services?.Select(e => e.Value).ToList() }, { "newResourceId", newResourceId }, - { "newResourceName", newResourceName }, - { "newSpecification", newSpecification } + { "newResourceName", newResourceName } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/Oauth2.cs b/Appwrite/Services/Oauth2.cs new file mode 100644 index 00000000..534c1ab0 --- /dev/null +++ b/Appwrite/Services/Oauth2.cs @@ -0,0 +1,515 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Oauth2 : Service + { + public Oauth2(Client client) : base(client) + { + } + + /// + /// Approve an OAuth2 grant after the user gives consent. Returns the + /// `redirectUrl` the end user should be sent to. The consent screen may + /// optionally pass enriched `authorization_details` to record the concrete + /// resources the user selected. You can pass Accept header of + /// `application/json` to receive a JSON response instead of a redirect. + /// + /// + public Task Approve(string grantId, string? authorizationDetails = null, string? scope = null) + { + var apiPath = "/oauth2/{project_id}/approve" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "grant_id", grantId }, + { "authorization_details", authorizationDetails }, + { "scope", scope } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Approve Convert(Dictionary it) + { + return Models.Oauth2Approve.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); + + } + + /// + /// Begin the OAuth2 authorization flow. When called without a session, the + /// user is redirected to the consent screen without grant ID. When called with + /// a session, the redirect URL includes param for grant ID. You can pass + /// Accept header of `application/json` to receive a JSON response instead of a + /// redirect. + /// + /// + public Task Authorize(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null, string? requestUri = null) + { + var apiPath = "/oauth2/{project_id}/authorize" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "client_id", clientId }, + { "redirect_uri", redirectUri }, + { "response_type", responseType }, + { "scope", scope }, + { "state", state }, + { "nonce", nonce }, + { "code_challenge", codeChallenge }, + { "code_challenge_method", codeChallengeMethod }, + { "prompt", prompt }, + { "max_age", maxAge }, + { "authorization_details", authorizationDetails }, + { "resource", resource }, + { "audience", audience }, + { "request_uri", requestUri } + }; + + var apiHeaders = new Dictionary() + { + { "accept", "application/json" } + }; + + + static Models.Oauth2Authorize Convert(Dictionary it) + { + return Models.Oauth2Authorize.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); + + } + + /// + /// Begin the OAuth2 authorization flow. When called without a session, the + /// user is redirected to the consent screen without grant ID. When called with + /// a session, the redirect URL includes param for grant ID. You can pass + /// Accept header of `application/json` to receive a JSON response instead of a + /// redirect. + /// + /// + public Task AuthorizePost(string? clientId = null, string? redirectUri = null, string? responseType = null, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null, string? requestUri = null) + { + var apiPath = "/oauth2/{project_id}/authorize" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "client_id", clientId }, + { "redirect_uri", redirectUri }, + { "response_type", responseType }, + { "scope", scope }, + { "state", state }, + { "nonce", nonce }, + { "code_challenge", codeChallenge }, + { "code_challenge_method", codeChallengeMethod }, + { "prompt", prompt }, + { "max_age", maxAge }, + { "authorization_details", authorizationDetails }, + { "resource", resource }, + { "audience", audience }, + { "request_uri", requestUri } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Authorize Convert(Dictionary it) + { + return Models.Oauth2Authorize.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); + + } + + /// + /// Start the OAuth2 Device Authorization Grant. Returns the device code, user + /// code, verification URL, expiration, and polling interval. + /// + /// + public Task CreateDeviceAuthorization(string? clientId = null, string? scope = null, string? authorizationDetails = null, string? resource = null, string? audience = null) + { + var apiPath = "/oauth2/{project_id}/device_authorization" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "client_id", clientId }, + { "scope", scope }, + { "authorization_details", authorizationDetails }, + { "resource", resource }, + { "audience", audience } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2DeviceAuthorization Convert(Dictionary it) + { + return Models.Oauth2DeviceAuthorization.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); + + } + + /// + /// Exchange a device flow user code for an OAuth2 grant. The authenticated + /// user is bound to the pending grant. Pass the returned grant ID to the get + /// grant endpoint to render the consent screen, then to the approve or reject + /// endpoint to complete the flow. + /// + /// + public Task CreateGrant(string userCode) + { + var apiPath = "/oauth2/{project_id}/grants" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "user_code", userCode } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Grant Convert(Dictionary it) + { + return Models.Oauth2Grant.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 an OAuth2 grant by its ID. Used by the consent screen to display the + /// details of the authorization the user is being asked to approve. A grant + /// can only be read by the user it belongs to, or by server SDK. + /// + /// + public Task GetGrant(string grantId) + { + var apiPath = "/oauth2/{project_id}/grants/{grant_id}" + .Replace("{project_id}", _client.GetConfig("project")) + .Replace("{grant_id}", grantId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "accept", "application/json" } + }; + + + static Models.Oauth2Grant Convert(Dictionary it) + { + return Models.Oauth2Grant.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); + + } + + /// + /// List the organizations the OAuth2 access token can access. Resolves the + /// token's `organization` authorization details, expanding the `*` wildcard + /// into the concrete set of organizations the user can see. + /// + /// + public Task ListOrganizations(long? limit = null, long? offset = null, string? search = null) + { + var apiPath = "/oauth2/{project_id}/organizations" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "limit", limit }, + { "offset", offset }, + { "search", search } + }; + + var apiHeaders = new Dictionary() + { + { "accept", "application/json" } + }; + + + static Models.Oauth2OrganizationList Convert(Dictionary it) + { + return Models.Oauth2OrganizationList.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); + + } + + /// + /// Store an OAuth2 authorization request server-side and receive a short-lived + /// request_uri handle for the authorize endpoint. + /// + /// + public Task CreatePAR(string clientId, string redirectUri, string responseType, string? scope = null, string? state = null, string? nonce = null, string? codeChallenge = null, string? codeChallengeMethod = null, string? prompt = null, long? maxAge = null, string? authorizationDetails = null, string? resource = null, string? audience = null) + { + var apiPath = "/oauth2/{project_id}/par" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "client_id", clientId }, + { "redirect_uri", redirectUri }, + { "response_type", responseType }, + { "scope", scope }, + { "state", state }, + { "nonce", nonce }, + { "code_challenge", codeChallenge }, + { "code_challenge_method", codeChallengeMethod }, + { "prompt", prompt }, + { "max_age", maxAge }, + { "authorization_details", authorizationDetails }, + { "resource", resource }, + { "audience", audience } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2PAR Convert(Dictionary it) + { + return Models.Oauth2PAR.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 the projects the OAuth2 access token can access. Resolves the token's + /// `project` authorization details, expanding the `*` wildcard into the + /// concrete set of projects the user can see. + /// + /// + public Task ListProjects(long? limit = null, long? offset = null, string? search = null) + { + var apiPath = "/oauth2/{project_id}/projects" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "limit", limit }, + { "offset", offset }, + { "search", search } + }; + + var apiHeaders = new Dictionary() + { + { "accept", "application/json" } + }; + + + static Models.Oauth2ProjectList Convert(Dictionary it) + { + return Models.Oauth2ProjectList.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); + + } + + /// + /// Reject an OAuth2 grant when the user denies consent. Returns the + /// `redirectUrl` the end user should be sent to with an `access_denied` error. + /// You can pass Accept header of `application/json` to receive a JSON response + /// instead of a redirect. + /// + /// + public Task Reject(string grantId) + { + var apiPath = "/oauth2/{project_id}/reject" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "grant_id", grantId } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Reject Convert(Dictionary it) + { + return Models.Oauth2Reject.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); + + } + + /// + /// Revoke an OAuth2 access token or refresh token. + /// + /// + public Task Revoke(string token, string? tokenTypeHint = null, string? clientId = null, string? clientSecret = null) + { + var apiPath = "/oauth2/{project_id}/revoke" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "token", token }, + { "token_type_hint", tokenTypeHint }, + { "client_id", clientId }, + { "client_secret", clientSecret } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Exchange an OAuth2 authorization code, refresh token, or device code for + /// access and refresh tokens. + /// + /// + public Task CreateToken(string grantType, string? code = null, string? refreshToken = null, string? deviceCode = null, string? clientId = null, string? clientSecret = null, string? codeVerifier = null, string? redirectUri = null, string? resource = null, string? audience = null) + { + var apiPath = "/oauth2/{project_id}/token" + .Replace("{project_id}", _client.GetConfig("project")); + + var apiParameters = new Dictionary() + { + { "grant_type", grantType }, + { "code", code }, + { "refresh_token", refreshToken }, + { "device_code", deviceCode }, + { "client_id", clientId }, + { "client_secret", clientSecret }, + { "code_verifier", codeVerifier }, + { "redirect_uri", redirectUri }, + { "resource", resource }, + { "audience", audience } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Oauth2Token Convert(Dictionary it) + { + return Models.Oauth2Token.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); + + } + + } +} diff --git a/Appwrite/Services/Organization.cs b/Appwrite/Services/Organization.cs index be43215d..91e2ceb4 100644 --- a/Appwrite/Services/Organization.cs +++ b/Appwrite/Services/Organization.cs @@ -102,6 +102,186 @@ public Task Delete() + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// List app installations on the organization. Any organization member can + /// read installations. + /// + /// + public Task ListInstallations(List? queries = null, bool? total = null) + { + var apiPath = "/organization/installations"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallationList Convert(Dictionary it) + { + return Models.AppInstallationList.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); + + } + + /// + /// Install an app on the organization. Only organization members with the + /// owner role can install apps. The installation is granted the scopes the app + /// currently requests. + /// + /// + public Task CreateInstallation(string appId, string? authorizationDetails = null) + { + var apiPath = "/organization/installations"; + + var apiParameters = new Dictionary() + { + { "appId", appId }, + { "authorizationDetails", authorizationDetails } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.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 an app installation on the organization by its unique ID. Any + /// organization member can read installations. + /// + /// + public Task GetInstallation(string installationId) + { + var apiPath = "/organization/installations/{installationId}" + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.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 app installation on the organization. Only organization members + /// with the owner role can update installations. The installation's granted + /// scopes are refreshed to the scopes the app currently requests; previously + /// issued installation access tokens are revoked. + /// + /// + public Task UpdateInstallation(string installationId, string? authorizationDetails = null) + { + var apiPath = "/organization/installations/{installationId}" + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + { "authorizationDetails", authorizationDetails } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Uninstall an app from the organization by its installation ID. Only + /// organization members with the owner role can remove installations. + /// Previously issued installation access tokens are revoked. + /// + /// + public Task DeleteInstallation(string installationId) + { + var apiPath = "/organization/installations/{installationId}" + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + return _client.Call( method: "DELETE", path: apiPath, diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index a3c7d922..e8512f23 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -582,7 +582,7 @@ static Models.OAuth2ProviderList Convert(Dictionary it) /// Update the OAuth2 server (OIDC provider) configuration. /// /// - public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, List? authorizationDetailsTypes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, bool? confidentialPkce = null, string? verificationUrl = null, long? userCodeLength = null, string? userCodeFormat = null, long? deviceCodeDuration = null, List? defaultScopes = null) + public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, List? authorizationDetailsTypes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, long? installationAccessTokenDuration = null, bool? confidentialPkce = null, string? verificationUrl = null, long? userCodeLength = null, string? userCodeFormat = null, long? deviceCodeDuration = null, List? defaultScopes = null) { var apiPath = "/project/oauth2-server"; @@ -596,6 +596,7 @@ static Models.OAuth2ProviderList Convert(Dictionary it) { "refreshTokenDuration", refreshTokenDuration }, { "publicAccessTokenDuration", publicAccessTokenDuration }, { "publicRefreshTokenDuration", publicRefreshTokenDuration }, + { "installationAccessTokenDuration", installationAccessTokenDuration }, { "confidentialPkce", confidentialPkce }, { "verificationUrl", verificationUrl }, { "userCodeLength", userCodeLength }, diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index 4cd3038c..b088f975 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -613,7 +613,7 @@ public Task DeleteDeployment(string siteId, string deploymentId) /// browser to start downloading the file to user downloads directory. /// /// - public Task GetDeploymentDownload(string siteId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null) + public Task GetDeploymentDownload(string siteId, string deploymentId, Appwrite.Enums.DeploymentDownloadType? type = null, string? token = null) { var apiPath = "/sites/{siteId}/deployments/{deploymentId}/download" .Replace("{siteId}", siteId) @@ -621,7 +621,8 @@ public Task GetDeploymentDownload(string siteId, string deploymentId, Ap var apiParameters = new Dictionary() { - { "type", type?.Value } + { "type", type?.Value }, + { "token", token } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index 5b9eda7c..698efe09 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -55,7 +55,7 @@ static Models.DatabaseList Convert(Dictionary it) /// /// /// - public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null) + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null) { var apiPath = "/tablesdb"; @@ -64,7 +64,8 @@ static Models.DatabaseList Convert(Dictionary it) { "databaseId", databaseId }, { "name", name }, { "enabled", enabled }, - { "specification", specification } + { "specification", specification }, + { "replicas", replicas } }; var apiHeaders = new Dictionary() @@ -89,6 +90,41 @@ static Models.Database Convert(Dictionary it) } + /// + /// List the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/tablesdb/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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); + + } + /// /// List transactions across all databases. /// @@ -333,7 +369,7 @@ static Models.Database Convert(Dictionary it) /// Update a database by its unique ID. /// /// - public Task Update(string databaseId, string? name = null, bool? enabled = null) + public Task Update(string databaseId, string? name = null, bool? enabled = null, long? replicas = null) { var apiPath = "/tablesdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -341,7 +377,8 @@ static Models.Database Convert(Dictionary it) var apiParameters = new Dictionary() { { "name", name }, - { "enabled", enabled } + { "enabled", enabled }, + { "replicas", replicas } }; var apiHeaders = new Dictionary() @@ -396,6 +433,115 @@ public Task Delete(string databaseId) } + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/tablesdb/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/tablesdb/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/tablesdb/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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 a list of all tables that belong to the provided databaseId. You can /// use the search parameter to filter your results. diff --git a/Appwrite/Services/Teams.cs b/Appwrite/Services/Teams.cs index 4710d6af..f47c7630 100644 --- a/Appwrite/Services/Teams.cs +++ b/Appwrite/Services/Teams.cs @@ -181,6 +181,191 @@ public Task Delete(string teamId) + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// List app installations on a team. Any team member can read installations. + /// + /// + public Task ListInstallations(string teamId, List? queries = null, bool? total = null) + { + var apiPath = "/teams/{teamId}/installations" + .Replace("{teamId}", teamId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallationList Convert(Dictionary it) + { + return Models.AppInstallationList.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); + + } + + /// + /// Install an app on a team. When authenticated as a user, only team members + /// with the owner role can install apps. Requests using an API key or in admin + /// mode can install apps on any team. The installation is granted the scopes + /// the app currently requests. + /// + /// + public Task CreateInstallation(string teamId, string appId, string? authorizationDetails = null) + { + var apiPath = "/teams/{teamId}/installations" + .Replace("{teamId}", teamId); + + var apiParameters = new Dictionary() + { + { "appId", appId }, + { "authorizationDetails", authorizationDetails } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.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 an app installation on a team by its unique ID. Any team member can + /// read installations. + /// + /// + public Task GetInstallation(string teamId, string installationId) + { + var apiPath = "/teams/{teamId}/installations/{installationId}" + .Replace("{teamId}", teamId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.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 app installation on a team. Only team members with the owner role + /// can update installations. The installation's granted scopes are refreshed + /// to the scopes the app currently requests; previously issued installation + /// access tokens are revoked. + /// + /// + public Task UpdateInstallation(string teamId, string installationId, string? authorizationDetails = null) + { + var apiPath = "/teams/{teamId}/installations/{installationId}" + .Replace("{teamId}", teamId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + { "authorizationDetails", authorizationDetails } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.AppInstallation Convert(Dictionary it) + { + return Models.AppInstallation.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Uninstall an app from a team by its installation ID. Only team members with + /// the owner role can remove installations. Previously issued installation + /// access tokens are revoked. + /// + /// + public Task DeleteInstallation(string teamId, string installationId) + { + var apiPath = "/teams/{teamId}/installations/{installationId}" + .Replace("{teamId}", teamId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + return _client.Call( method: "DELETE", path: apiPath, diff --git a/CHANGELOG.md b/CHANGELOG.md index 30de9067..ebaa0a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 6.1.0 + +* Added: `Apps` service for managing OAuth2 applications, keys, and installations +* Added: `OAuth2` service with authorize, grant, device authorization, and consent flows +* Added: `Account` OAuth2 consent methods `ListConsents`, `GetConsent`, `DeleteConsent`, and consent token methods +* Added: app installation management methods to `Organization` and `Teams` services +* Added: `installationAccessTokenDuration` parameter to `Project.UpdateOAuth2Server` +* Added: `token` parameter to `Sites.GetDeploymentDownload` +* Added: `oauth2.introspect` and organization installation key scopes + ## 6.0.0 * Breaking: Removed `Health` service with all its models and enums diff --git a/README.md b/README.md index e1163250..403299bf 100644 --- a/README.md +++ b/README.md @@ -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 6.0.0 +Install-Package Appwrite -Version 6.1.0 # or .NET CLI -dotnet add package Appwrite --version 6.0.0 +dotnet add package Appwrite --version 6.1.0 ``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md new file mode 100644 index 00000000..a99b4f30 --- /dev/null +++ b/docs/examples/account/delete-consent-token.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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteConsentToken( + consentId: "", + tokenId: "" +);``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md new file mode 100644 index 00000000..9b053f70 --- /dev/null +++ b/docs/examples/account/delete-consent.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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteConsent( + consentId: "" +);``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md new file mode 100644 index 00000000..2cb00b16 --- /dev/null +++ b/docs/examples/account/get-consent-token.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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Oauth2ConsentToken result = await account.GetConsentToken( + consentId: "", + tokenId: "" +);``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md new file mode 100644 index 00000000..cb364047 --- /dev/null +++ b/docs/examples/account/get-consent.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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Oauth2Consent result = await account.GetConsent( + consentId: "" +);``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md new file mode 100644 index 00000000..451b8f21 --- /dev/null +++ b/docs/examples/account/list-consent-tokens.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Oauth2ConsentTokenList result = await account.ListConsentTokens( + consentId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md new file mode 100644 index 00000000..b9ebfcef --- /dev/null +++ b/docs/examples/account/list-consents.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 + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Oauth2ConsentList result = await account.ListConsents( + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md new file mode 100644 index 00000000..9205d289 --- /dev/null +++ b/docs/examples/apps/create-installation-token.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 + +Apps apps = new Apps(client); + +Oauth2Token result = await apps.CreateInstallationToken( + appId: "", + installationId: "" +);``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md new file mode 100644 index 00000000..e8089591 --- /dev/null +++ b/docs/examples/apps/create-key.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppKey result = await apps.CreateKey( + appId: "" +);``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md new file mode 100644 index 00000000..d5204290 --- /dev/null +++ b/docs/examples/apps/create-secret.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppSecretPlaintext result = await apps.CreateSecret( + appId: "" +);``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md new file mode 100644 index 00000000..596b31cc --- /dev/null +++ b/docs/examples/apps/create.md @@ -0,0 +1,33 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +App result = await apps.Create( + appId: "", + name: "", + redirectUris: new List(), + description: "", // optional + clientUri: "https://example.com", // optional + logoUri: "https://example.com", // optional + privacyPolicyUrl: "https://example.com", // optional + termsUrl: "https://example.com", // optional + contacts: new List(), // optional + tagline: "", // optional + tags: new List(), // optional + images: new List(), // optional + supportUrl: "https://example.com", // optional + dataDeletionUrl: "https://example.com", // optional + postLogoutRedirectUris: new List(), // optional + enabled: false, // optional + type: "public", // optional + deviceFlow: false, // optional + teamId: "" // optional +);``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md new file mode 100644 index 00000000..352e036f --- /dev/null +++ b/docs/examples/apps/delete-key.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +await apps.DeleteKey( + appId: "", + keyId: "" +);``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md new file mode 100644 index 00000000..c97148a7 --- /dev/null +++ b/docs/examples/apps/delete-secret.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +await apps.DeleteSecret( + appId: "", + secretId: "" +);``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md new file mode 100644 index 00000000..ebe444be --- /dev/null +++ b/docs/examples/apps/delete-tokens.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +await apps.DeleteTokens( + appId: "" +);``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md new file mode 100644 index 00000000..0942bb2f --- /dev/null +++ b/docs/examples/apps/delete.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +await apps.Delete( + appId: "" +);``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md new file mode 100644 index 00000000..1a353ec1 --- /dev/null +++ b/docs/examples/apps/get-installation.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 + +Apps apps = new Apps(client); + +AppInstallation result = await apps.GetInstallation( + appId: "", + installationId: "" +);``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md new file mode 100644 index 00000000..17adf20f --- /dev/null +++ b/docs/examples/apps/get-key.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppKey result = await apps.GetKey( + appId: "", + keyId: "" +);``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md new file mode 100644 index 00000000..3e8b9925 --- /dev/null +++ b/docs/examples/apps/get-secret.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppSecret result = await apps.GetSecret( + appId: "", + secretId: "" +);``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md new file mode 100644 index 00000000..a9ee6a0f --- /dev/null +++ b/docs/examples/apps/get.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +App result = await apps.Get( + appId: "" +);``` diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md new file mode 100644 index 00000000..72aaa4fa --- /dev/null +++ b/docs/examples/apps/list-installation-scopes.md @@ -0,0 +1,14 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppScopeList result = await apps.ListInstallationScopes(); +``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md new file mode 100644 index 00000000..fbb59ab0 --- /dev/null +++ b/docs/examples/apps/list-installations.md @@ -0,0 +1,17 @@ +```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 + +Apps apps = new Apps(client); + +AppInstallationList result = await apps.ListInstallations( + appId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md new file mode 100644 index 00000000..6d164d32 --- /dev/null +++ b/docs/examples/apps/list-keys.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppKeyList result = await apps.ListKeys( + appId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md new file mode 100644 index 00000000..f9382134 --- /dev/null +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -0,0 +1,14 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppScopeList result = await apps.ListOAuth2Scopes(); +``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md new file mode 100644 index 00000000..fe394026 --- /dev/null +++ b/docs/examples/apps/list-secrets.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppSecretList result = await apps.ListSecrets( + appId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md new file mode 100644 index 00000000..1dffb6a0 --- /dev/null +++ b/docs/examples/apps/list.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +AppsList result = await apps.List( + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md new file mode 100644 index 00000000..ac99b7b8 --- /dev/null +++ b/docs/examples/apps/update-labels.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 + +Apps apps = new Apps(client); + +App result = await apps.UpdateLabels( + appId: "", + labels: new List() +);``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md new file mode 100644 index 00000000..18084338 --- /dev/null +++ b/docs/examples/apps/update-team.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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +App result = await apps.UpdateTeam( + appId: "", + teamId: "" +);``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md new file mode 100644 index 00000000..d6af16a9 --- /dev/null +++ b/docs/examples/apps/update.md @@ -0,0 +1,34 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Apps apps = new Apps(client); + +App result = await apps.Update( + appId: "", + name: "", + description: "", // optional + clientUri: "https://example.com", // optional + logoUri: "https://example.com", // optional + privacyPolicyUrl: "https://example.com", // optional + termsUrl: "https://example.com", // optional + contacts: new List(), // optional + tagline: "", // optional + tags: new List(), // optional + images: new List(), // optional + supportUrl: "https://example.com", // optional + dataDeletionUrl: "https://example.com", // optional + enabled: false, // optional + redirectUris: new List(), // optional + postLogoutRedirectUris: new List(), // optional + type: "public", // optional + deviceFlow: false, // optional + installationScopes: new List(), // optional + installationRedirectUrl: "https://example.com" // optional +);``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 25de7452..80ec86a1 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -15,6 +15,5 @@ BackupRestoration result = await backups.CreateRestoration( archiveId: "", services: new List<BackupServices> { BackupServices.Databases }, newResourceId: "", // optional - newResourceName: "", // optional - newSpecification: "serverless" // optional + newResourceName: "" // optional );``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md new file mode 100644 index 00000000..887fab55 --- /dev/null +++ b/docs/examples/oauth2/approve.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Approve result = await oauth2.Approve( + grant_id: "", + authorization_details: "", // optional + scope: "" // optional +);``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md new file mode 100644 index 00000000..72f43d1a --- /dev/null +++ b/docs/examples/oauth2/authorize-post.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Authorize result = await oauth2.AuthorizePost( + client_id: "", // optional + redirect_uri: "https://example.com", // optional + response_type: "", // optional + scope: "", // optional + state: "", // optional + nonce: "", // optional + code_challenge: "", // optional + code_challenge_method: "s256", // optional + prompt: "", // optional + max_age: 0, // optional + authorization_details: "", // optional + resource: "", // optional + audience: "", // optional + request_uri: "" // optional +);``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md new file mode 100644 index 00000000..10d68bd1 --- /dev/null +++ b/docs/examples/oauth2/authorize.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Authorize result = await oauth2.Authorize( + client_id: "", // optional + redirect_uri: "https://example.com", // optional + response_type: "", // optional + scope: "", // optional + state: "", // optional + nonce: "", // optional + code_challenge: "", // optional + code_challenge_method: "s256", // optional + prompt: "", // optional + max_age: 0, // optional + authorization_details: "", // optional + resource: "", // optional + audience: "", // optional + request_uri: "" // optional +);``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md new file mode 100644 index 00000000..248fbf89 --- /dev/null +++ b/docs/examples/oauth2/create-device-authorization.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 + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2DeviceAuthorization result = await oauth2.CreateDeviceAuthorization( + client_id: "", // optional + scope: "", // optional + authorization_details: "", // optional + resource: "", // optional + audience: "" // optional +);``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md new file mode 100644 index 00000000..627e290d --- /dev/null +++ b/docs/examples/oauth2/create-grant.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 + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Grant result = await oauth2.CreateGrant( + user_code: "" +);``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md new file mode 100644 index 00000000..306c995c --- /dev/null +++ b/docs/examples/oauth2/create-par.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2PAR result = await oauth2.CreatePAR( + client_id: "", + redirect_uri: "https://example.com", + response_type: "code", + scope: "", // optional + state: "", // optional + nonce: "", // optional + code_challenge: "", // optional + code_challenge_method: "s256", // optional + prompt: "", // optional + max_age: 0, // optional + authorization_details: "", // optional + resource: "", // optional + audience: "" // optional +);``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md new file mode 100644 index 00000000..6afac7ed --- /dev/null +++ b/docs/examples/oauth2/create-token.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Token result = await oauth2.CreateToken( + grant_type: "", + code: "", // optional + refresh_token: "", // optional + device_code: "", // optional + client_id: "", // optional + client_secret: "", // optional + code_verifier: "", // optional + redirect_uri: "https://example.com", // optional + resource: "", // optional + audience: "" // optional +);``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md new file mode 100644 index 00000000..a7cf5f9a --- /dev/null +++ b/docs/examples/oauth2/get-grant.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 + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Grant result = await oauth2.GetGrant( + grant_id: "" +);``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md new file mode 100644 index 00000000..59a30b97 --- /dev/null +++ b/docs/examples/oauth2/list-organizations.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2OrganizationList result = await oauth2.ListOrganizations( + limit: 1, // optional + offset: 0, // optional + search: "" // optional +);``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md new file mode 100644 index 00000000..cfe7b8ca --- /dev/null +++ b/docs/examples/oauth2/list-projects.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2ProjectList result = await oauth2.ListProjects( + limit: 1, // optional + offset: 0, // optional + search: "" // optional +);``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md new file mode 100644 index 00000000..bf32913e --- /dev/null +++ b/docs/examples/oauth2/reject.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 + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + +Oauth2Reject result = await oauth2.Reject( + grant_id: "" +);``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md new file mode 100644 index 00000000..322ba30a --- /dev/null +++ b/docs/examples/oauth2/revoke.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetSession("") // The user session to authenticate with + .SetProject(""); // Your project ID + +Oauth2 oauth2 = new Oauth2(client); + + result = await oauth2.Revoke( + token: "", + token_type_hint: "access_token", // optional + client_id: "", // optional + client_secret: "" // optional +);``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md new file mode 100644 index 00000000..1545dc73 --- /dev/null +++ b/docs/examples/organization/create-installation.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 + .SetSession(""); // The user session to authenticate with + +Organization organization = new Organization(client); + +AppInstallation result = await organization.CreateInstallation( + appId: "", + authorizationDetails: "" // optional +);``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md new file mode 100644 index 00000000..d295bbd5 --- /dev/null +++ b/docs/examples/organization/delete-installation.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 + .SetSession(""); // The user session to authenticate with + +Organization organization = new Organization(client); + +await organization.DeleteInstallation( + installationId: "" +);``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md new file mode 100644 index 00000000..13de6238 --- /dev/null +++ b/docs/examples/organization/get-installation.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 + .SetSession(""); // The user session to authenticate with + +Organization organization = new Organization(client); + +AppInstallation result = await organization.GetInstallation( + installationId: "" +);``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md new file mode 100644 index 00000000..843302a7 --- /dev/null +++ b/docs/examples/organization/list-installations.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 + .SetSession(""); // The user session to authenticate with + +Organization organization = new Organization(client); + +AppInstallationList result = await organization.ListInstallations( + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md new file mode 100644 index 00000000..9799ebfa --- /dev/null +++ b/docs/examples/organization/update-installation.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 + .SetSession(""); // The user session to authenticate with + +Organization organization = new Organization(client); + +AppInstallation result = await organization.UpdateInstallation( + installationId: "", + authorizationDetails: "" // optional +);``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index a43abfd3..5c66be76 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -19,6 +19,7 @@ Project result = await project.UpdateOAuth2Server( refreshTokenDuration: 60, // optional publicAccessTokenDuration: 60, // optional publicRefreshTokenDuration: 60, // optional + installationAccessTokenDuration: 60, // optional confidentialPkce: false, // optional verificationUrl: "https://example.com", // optional userCodeLength: 6, // optional diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 25bc376b..457f1532 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -14,5 +14,6 @@ Sites sites = new Sites(client); byte[] result = await sites.GetDeploymentDownload( siteId: "", deploymentId: "", - type: DeploymentDownloadType.Source // optional + type: DeploymentDownloadType.Source, // optional + token: "" // optional );``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md new file mode 100644 index 00000000..897e9df9 --- /dev/null +++ b/docs/examples/tablesdb/create-failover.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 + +TablesDB tablesDB = new TablesDB(client); + +DedicatedDatabase result = await tablesDB.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 03f9ab32..a5a42f36 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -14,5 +14,6 @@ Database result = await tablesDB.Create( databaseId: "", name: "", enabled: false, // optional - specification: "serverless" // optional + specification: "serverless", // optional + replicas: 0 // optional );``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md new file mode 100644 index 00000000..1001b30e --- /dev/null +++ b/docs/examples/tablesdb/get-replicas.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 + +TablesDB tablesDB = new TablesDB(client); + +DedicatedDatabaseReplicas result = await tablesDB.GetReplicas( + databaseId: "" +);``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md new file mode 100644 index 00000000..73917886 --- /dev/null +++ b/docs/examples/tablesdb/get-status.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 + +TablesDB tablesDB = new TablesDB(client); + +DatabaseStatus result = await tablesDB.GetStatus( + databaseId: "" +);``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md new file mode 100644 index 00000000..4672e263 --- /dev/null +++ b/docs/examples/tablesdb/list-specifications.md @@ -0,0 +1,14 @@ +```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 + +TablesDB tablesDB = new TablesDB(client); + +DedicatedDatabaseSpecificationList result = await tablesDB.ListSpecifications(); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index e03329dd..ebd66bec 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -13,5 +13,6 @@ TablesDB tablesDB = new TablesDB(client); Database result = await tablesDB.Update( databaseId: "", name: "", // optional - enabled: false // optional + enabled: false, // optional + replicas: 0 // optional );``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md new file mode 100644 index 00000000..8cc34ef6 --- /dev/null +++ b/docs/examples/teams/create-installation.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +AppInstallation result = await teams.CreateInstallation( + teamId: "", + appId: "", + authorizationDetails: "" // optional +);``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md new file mode 100644 index 00000000..b2a63291 --- /dev/null +++ b/docs/examples/teams/delete-installation.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 + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +await teams.DeleteInstallation( + teamId: "", + installationId: "" +);``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md new file mode 100644 index 00000000..48546fe8 --- /dev/null +++ b/docs/examples/teams/get-installation.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 + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +AppInstallation result = await teams.GetInstallation( + teamId: "", + installationId: "" +);``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md new file mode 100644 index 00000000..7f29bdca --- /dev/null +++ b/docs/examples/teams/list-installations.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +AppInstallationList result = await teams.ListInstallations( + teamId: "", + queries: new List(), // optional + total: false // optional +);``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md new file mode 100644 index 00000000..d64faf09 --- /dev/null +++ b/docs/examples/teams/update-installation.md @@ -0,0 +1,17 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +AppInstallation result = await teams.UpdateInstallation( + teamId: "", + installationId: "", + authorizationDetails: "" // optional +);``` From 7fb942206d190add34c319f28849366ed86c0e28 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 23 Jul 2026 17:02:29 +0530 Subject: [PATCH 05/10] chore: update .NET SDK to 6.1.0 --- .github/workflows/publish.yml | 4 ++-- Appwrite/Appwrite.csproj | 2 +- Appwrite/Models/AppInstallation.cs | 2 +- Appwrite/Models/AttributeBigint.cs | 6 +++--- Appwrite/Models/AttributeBoolean.cs | 6 +++--- Appwrite/Models/AttributeDatetime.cs | 6 +++--- Appwrite/Models/AttributeEmail.cs | 6 +++--- Appwrite/Models/AttributeEnum.cs | 6 +++--- Appwrite/Models/AttributeFloat.cs | 6 +++--- Appwrite/Models/AttributeInteger.cs | 6 +++--- Appwrite/Models/AttributeIp.cs | 6 +++--- Appwrite/Models/AttributeLine.cs | 6 +++--- Appwrite/Models/AttributeLongtext.cs | 6 +++--- Appwrite/Models/AttributeMediumtext.cs | 6 +++--- Appwrite/Models/AttributePoint.cs | 6 +++--- Appwrite/Models/AttributePolygon.cs | 6 +++--- Appwrite/Models/AttributeRelationship.cs | 6 +++--- Appwrite/Models/AttributeString.cs | 6 +++--- Appwrite/Models/AttributeText.cs | 6 +++--- Appwrite/Models/AttributeUrl.cs | 6 +++--- Appwrite/Models/AttributeVarchar.cs | 6 +++--- Appwrite/Models/BillingPlan.cs | 6 +++--- Appwrite/Models/ColumnBigint.cs | 6 +++--- Appwrite/Models/ColumnBoolean.cs | 6 +++--- Appwrite/Models/ColumnDatetime.cs | 6 +++--- Appwrite/Models/ColumnEmail.cs | 6 +++--- Appwrite/Models/ColumnEnum.cs | 6 +++--- Appwrite/Models/ColumnFloat.cs | 6 +++--- Appwrite/Models/ColumnInteger.cs | 6 +++--- Appwrite/Models/ColumnIp.cs | 6 +++--- Appwrite/Models/ColumnLine.cs | 6 +++--- Appwrite/Models/ColumnLongtext.cs | 6 +++--- Appwrite/Models/ColumnMediumtext.cs | 6 +++--- Appwrite/Models/ColumnPoint.cs | 6 +++--- Appwrite/Models/ColumnPolygon.cs | 6 +++--- Appwrite/Models/ColumnRelationship.cs | 6 +++--- Appwrite/Models/ColumnString.cs | 6 +++--- Appwrite/Models/ColumnText.cs | 6 +++--- Appwrite/Models/ColumnUrl.cs | 6 +++--- Appwrite/Models/ColumnVarchar.cs | 6 +++--- Appwrite/Models/Database.cs | 12 ++++++------ Appwrite/Models/Deployment.cs | 6 +++--- Appwrite/Models/Execution.cs | 12 ++++++------ Appwrite/Models/Index.cs | 6 +++--- Appwrite/Models/InsightCTA.cs | 2 +- Appwrite/Models/Message.cs | 8 ++++---- Appwrite/Models/PlatformAndroid.cs | 6 +++--- Appwrite/Models/PlatformApple.cs | 6 +++--- Appwrite/Models/PlatformLinux.cs | 6 +++--- Appwrite/Models/PlatformWeb.cs | 6 +++--- Appwrite/Models/PlatformWindows.cs | 6 +++--- Appwrite/Models/Presence.cs | 2 +- Appwrite/Models/Project.cs | 2 +- Appwrite/Models/ProjectAuthMethod.cs | 6 +++--- Appwrite/Models/ProjectProtocol.cs | 6 +++--- Appwrite/Models/ProjectService.cs | 6 +++--- Appwrite/Models/Provider.cs | 4 ++-- Appwrite/Models/ProxyRule.cs | 12 ++++++------ Appwrite/Models/User.cs | 2 +- 59 files changed, 173 insertions(+), 173 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8767c005..111cb3d4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up .NET - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: '6' diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index bcbc04bf..54772716 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -20,7 +20,7 @@ - + diff --git a/Appwrite/Models/AppInstallation.cs b/Appwrite/Models/AppInstallation.cs index 6acf408b..3e80b8dd 100644 --- a/Appwrite/Models/AppInstallation.cs +++ b/Appwrite/Models/AppInstallation.cs @@ -73,7 +73,7 @@ public AppInstallation( appId: map["appId"].ToString(), teamId: map["teamId"].ToString(), scopes: map["scopes"].ConvertToList(), - authorizationDetails: map["authorizationDetails"].ToString(), + authorizationDetails: map["authorizationDetails"], createdById: map["createdById"].ToString(), createdByName: map["createdByName"].ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null diff --git a/Appwrite/Models/AttributeBigint.cs b/Appwrite/Models/AttributeBigint.cs index dc1feff9..416ef66c 100644 --- a/Appwrite/Models/AttributeBigint.cs +++ b/Appwrite/Models/AttributeBigint.cs @@ -18,7 +18,7 @@ public class AttributeBigint public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeBigint public AttributeBigint( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeBigint( public static AttributeBigint From(Dictionary map) => new AttributeBigint( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeBoolean.cs b/Appwrite/Models/AttributeBoolean.cs index 1c955c6d..bd5b8b1e 100644 --- a/Appwrite/Models/AttributeBoolean.cs +++ b/Appwrite/Models/AttributeBoolean.cs @@ -18,7 +18,7 @@ public class AttributeBoolean public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class AttributeBoolean public AttributeBoolean( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public AttributeBoolean( public static AttributeBoolean From(Dictionary map) => new AttributeBoolean( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeDatetime.cs b/Appwrite/Models/AttributeDatetime.cs index 4eeb1701..214f32e9 100644 --- a/Appwrite/Models/AttributeDatetime.cs +++ b/Appwrite/Models/AttributeDatetime.cs @@ -18,7 +18,7 @@ public class AttributeDatetime public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeDatetime public AttributeDatetime( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeDatetime( public static AttributeDatetime From(Dictionary map) => new AttributeDatetime( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeEmail.cs b/Appwrite/Models/AttributeEmail.cs index 7ea11286..a3cb390d 100644 --- a/Appwrite/Models/AttributeEmail.cs +++ b/Appwrite/Models/AttributeEmail.cs @@ -18,7 +18,7 @@ public class AttributeEmail public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeEmail public AttributeEmail( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeEmail( public static AttributeEmail From(Dictionary map) => new AttributeEmail( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeEnum.cs b/Appwrite/Models/AttributeEnum.cs index 474baaa6..387a4947 100644 --- a/Appwrite/Models/AttributeEnum.cs +++ b/Appwrite/Models/AttributeEnum.cs @@ -18,7 +18,7 @@ public class AttributeEnum public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeEnum public AttributeEnum( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeEnum( public static AttributeEnum From(Dictionary map) => new AttributeEnum( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeFloat.cs b/Appwrite/Models/AttributeFloat.cs index 21353a09..ec166677 100644 --- a/Appwrite/Models/AttributeFloat.cs +++ b/Appwrite/Models/AttributeFloat.cs @@ -18,7 +18,7 @@ public class AttributeFloat public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeFloat public AttributeFloat( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeFloat( public static AttributeFloat From(Dictionary map) => new AttributeFloat( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeInteger.cs b/Appwrite/Models/AttributeInteger.cs index 37718dce..db12d723 100644 --- a/Appwrite/Models/AttributeInteger.cs +++ b/Appwrite/Models/AttributeInteger.cs @@ -18,7 +18,7 @@ public class AttributeInteger public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeInteger public AttributeInteger( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeInteger( public static AttributeInteger From(Dictionary map) => new AttributeInteger( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeIp.cs b/Appwrite/Models/AttributeIp.cs index 85368219..ca2d5275 100644 --- a/Appwrite/Models/AttributeIp.cs +++ b/Appwrite/Models/AttributeIp.cs @@ -18,7 +18,7 @@ public class AttributeIp public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeIp public AttributeIp( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeIp( public static AttributeIp From(Dictionary map) => new AttributeIp( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeLine.cs b/Appwrite/Models/AttributeLine.cs index 8180fa75..4d7c00a6 100644 --- a/Appwrite/Models/AttributeLine.cs +++ b/Appwrite/Models/AttributeLine.cs @@ -18,7 +18,7 @@ public class AttributeLine public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class AttributeLine public AttributeLine( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public AttributeLine( public static AttributeLine From(Dictionary map) => new AttributeLine( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeLongtext.cs b/Appwrite/Models/AttributeLongtext.cs index 0efc01f6..68026989 100644 --- a/Appwrite/Models/AttributeLongtext.cs +++ b/Appwrite/Models/AttributeLongtext.cs @@ -18,7 +18,7 @@ public class AttributeLongtext public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeLongtext public AttributeLongtext( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeLongtext( public static AttributeLongtext From(Dictionary map) => new AttributeLongtext( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeMediumtext.cs b/Appwrite/Models/AttributeMediumtext.cs index e21bb3f3..9bd21121 100644 --- a/Appwrite/Models/AttributeMediumtext.cs +++ b/Appwrite/Models/AttributeMediumtext.cs @@ -18,7 +18,7 @@ public class AttributeMediumtext public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeMediumtext public AttributeMediumtext( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeMediumtext( public static AttributeMediumtext From(Dictionary map) => new AttributeMediumtext( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributePoint.cs b/Appwrite/Models/AttributePoint.cs index 80256bd2..0d0baf53 100644 --- a/Appwrite/Models/AttributePoint.cs +++ b/Appwrite/Models/AttributePoint.cs @@ -18,7 +18,7 @@ public class AttributePoint public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class AttributePoint public AttributePoint( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public AttributePoint( public static AttributePoint From(Dictionary map) => new AttributePoint( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributePolygon.cs b/Appwrite/Models/AttributePolygon.cs index 4934c95e..dc8dc60a 100644 --- a/Appwrite/Models/AttributePolygon.cs +++ b/Appwrite/Models/AttributePolygon.cs @@ -18,7 +18,7 @@ public class AttributePolygon public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class AttributePolygon public AttributePolygon( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public AttributePolygon( public static AttributePolygon From(Dictionary map) => new AttributePolygon( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeRelationship.cs b/Appwrite/Models/AttributeRelationship.cs index b94014f8..3945bc1e 100644 --- a/Appwrite/Models/AttributeRelationship.cs +++ b/Appwrite/Models/AttributeRelationship.cs @@ -18,7 +18,7 @@ public class AttributeRelationship public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -56,7 +56,7 @@ public class AttributeRelationship public AttributeRelationship( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -89,7 +89,7 @@ string side public static AttributeRelationship From(Dictionary map) => new AttributeRelationship( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeString.cs b/Appwrite/Models/AttributeString.cs index 28f3019a..23bfd3ae 100644 --- a/Appwrite/Models/AttributeString.cs +++ b/Appwrite/Models/AttributeString.cs @@ -18,7 +18,7 @@ public class AttributeString public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeString public AttributeString( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeString( public static AttributeString From(Dictionary map) => new AttributeString( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeText.cs b/Appwrite/Models/AttributeText.cs index 79c8828c..231cf4a5 100644 --- a/Appwrite/Models/AttributeText.cs +++ b/Appwrite/Models/AttributeText.cs @@ -18,7 +18,7 @@ public class AttributeText public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeText public AttributeText( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeText( public static AttributeText From(Dictionary map) => new AttributeText( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeUrl.cs b/Appwrite/Models/AttributeUrl.cs index 0114ec52..68b5ebb7 100644 --- a/Appwrite/Models/AttributeUrl.cs +++ b/Appwrite/Models/AttributeUrl.cs @@ -18,7 +18,7 @@ public class AttributeUrl public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class AttributeUrl public AttributeUrl( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public AttributeUrl( public static AttributeUrl From(Dictionary map) => new AttributeUrl( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/AttributeVarchar.cs b/Appwrite/Models/AttributeVarchar.cs index 5d16aa0a..a3f407b0 100644 --- a/Appwrite/Models/AttributeVarchar.cs +++ b/Appwrite/Models/AttributeVarchar.cs @@ -18,7 +18,7 @@ public class AttributeVarchar public string Type { get; private set; } [JsonPropertyName("status")] - public AttributeStatus Status { get; private set; } + public Appwrite.Enums.AttributeStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class AttributeVarchar public AttributeVarchar( string key, string type, - AttributeStatus status, + Appwrite.Enums.AttributeStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public AttributeVarchar( public static AttributeVarchar From(Dictionary map) => new AttributeVarchar( key: map["key"].ToString(), type: map["type"].ToString(), - status: new AttributeStatus(map["status"].ToString()!), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index 9911795a..ac8c218e 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -210,7 +210,7 @@ public class BillingPlan public BillingPlanLimits? Limits { get; private set; } [JsonPropertyName("group")] - public BillingPlanGroup Group { get; private set; } + public Appwrite.Enums.BillingPlanGroup Group { get; private set; } [JsonPropertyName("program")] public Program? Program { get; private set; } @@ -285,7 +285,7 @@ public BillingPlan( long buildSize, bool databasesAllowEncrypt, BillingPlanLimits? limits, - BillingPlanGroup @group, + Appwrite.Enums.BillingPlanGroup @group, Program? program, BillingPlanDedicatedDatabaseLimits? dedicatedDatabases ) @@ -432,7 +432,7 @@ public BillingPlan( limits: map.TryGetValue("limits", out var objectRaw66) && objectRaw66 != null ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw66 is JsonElement jsonObj66 ? jsonObj66.Deserialize>()! : (Dictionary)objectRaw66) : null, - @group: new BillingPlanGroup(map["group"].ToString()!), + @group: new Appwrite.Enums.BillingPlanGroup(map["group"].ToString()!), program: map.TryGetValue("program", out var objectRaw68) && objectRaw68 != null ? Appwrite.Models.Program.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) : null, diff --git a/Appwrite/Models/ColumnBigint.cs b/Appwrite/Models/ColumnBigint.cs index d4408c40..22b344bd 100644 --- a/Appwrite/Models/ColumnBigint.cs +++ b/Appwrite/Models/ColumnBigint.cs @@ -18,7 +18,7 @@ public class ColumnBigint public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnBigint public ColumnBigint( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnBigint( public static ColumnBigint From(Dictionary map) => new ColumnBigint( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnBoolean.cs b/Appwrite/Models/ColumnBoolean.cs index 57fcb64e..f6fb093a 100644 --- a/Appwrite/Models/ColumnBoolean.cs +++ b/Appwrite/Models/ColumnBoolean.cs @@ -18,7 +18,7 @@ public class ColumnBoolean public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class ColumnBoolean public ColumnBoolean( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public ColumnBoolean( public static ColumnBoolean From(Dictionary map) => new ColumnBoolean( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnDatetime.cs b/Appwrite/Models/ColumnDatetime.cs index 1baefc45..3eb55e51 100644 --- a/Appwrite/Models/ColumnDatetime.cs +++ b/Appwrite/Models/ColumnDatetime.cs @@ -18,7 +18,7 @@ public class ColumnDatetime public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnDatetime public ColumnDatetime( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnDatetime( public static ColumnDatetime From(Dictionary map) => new ColumnDatetime( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnEmail.cs b/Appwrite/Models/ColumnEmail.cs index 9a907a84..96a5a952 100644 --- a/Appwrite/Models/ColumnEmail.cs +++ b/Appwrite/Models/ColumnEmail.cs @@ -18,7 +18,7 @@ public class ColumnEmail public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnEmail public ColumnEmail( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnEmail( public static ColumnEmail From(Dictionary map) => new ColumnEmail( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnEnum.cs b/Appwrite/Models/ColumnEnum.cs index f99c8f3f..9686f6f8 100644 --- a/Appwrite/Models/ColumnEnum.cs +++ b/Appwrite/Models/ColumnEnum.cs @@ -18,7 +18,7 @@ public class ColumnEnum public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnEnum public ColumnEnum( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnEnum( public static ColumnEnum From(Dictionary map) => new ColumnEnum( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnFloat.cs b/Appwrite/Models/ColumnFloat.cs index 75e6c747..98636303 100644 --- a/Appwrite/Models/ColumnFloat.cs +++ b/Appwrite/Models/ColumnFloat.cs @@ -18,7 +18,7 @@ public class ColumnFloat public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnFloat public ColumnFloat( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnFloat( public static ColumnFloat From(Dictionary map) => new ColumnFloat( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnInteger.cs b/Appwrite/Models/ColumnInteger.cs index 52b99cd7..21b6d927 100644 --- a/Appwrite/Models/ColumnInteger.cs +++ b/Appwrite/Models/ColumnInteger.cs @@ -18,7 +18,7 @@ public class ColumnInteger public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnInteger public ColumnInteger( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnInteger( public static ColumnInteger From(Dictionary map) => new ColumnInteger( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnIp.cs b/Appwrite/Models/ColumnIp.cs index dac7ded9..ce1e4675 100644 --- a/Appwrite/Models/ColumnIp.cs +++ b/Appwrite/Models/ColumnIp.cs @@ -18,7 +18,7 @@ public class ColumnIp public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnIp public ColumnIp( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnIp( public static ColumnIp From(Dictionary map) => new ColumnIp( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnLine.cs b/Appwrite/Models/ColumnLine.cs index a941803d..2f22e9d2 100644 --- a/Appwrite/Models/ColumnLine.cs +++ b/Appwrite/Models/ColumnLine.cs @@ -18,7 +18,7 @@ public class ColumnLine public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class ColumnLine public ColumnLine( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public ColumnLine( public static ColumnLine From(Dictionary map) => new ColumnLine( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnLongtext.cs b/Appwrite/Models/ColumnLongtext.cs index 304da072..68bad03d 100644 --- a/Appwrite/Models/ColumnLongtext.cs +++ b/Appwrite/Models/ColumnLongtext.cs @@ -18,7 +18,7 @@ public class ColumnLongtext public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnLongtext public ColumnLongtext( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnLongtext( public static ColumnLongtext From(Dictionary map) => new ColumnLongtext( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnMediumtext.cs b/Appwrite/Models/ColumnMediumtext.cs index f54b9e3c..6a16f369 100644 --- a/Appwrite/Models/ColumnMediumtext.cs +++ b/Appwrite/Models/ColumnMediumtext.cs @@ -18,7 +18,7 @@ public class ColumnMediumtext public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnMediumtext public ColumnMediumtext( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnMediumtext( public static ColumnMediumtext From(Dictionary map) => new ColumnMediumtext( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnPoint.cs b/Appwrite/Models/ColumnPoint.cs index 55968a40..77450962 100644 --- a/Appwrite/Models/ColumnPoint.cs +++ b/Appwrite/Models/ColumnPoint.cs @@ -18,7 +18,7 @@ public class ColumnPoint public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class ColumnPoint public ColumnPoint( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public ColumnPoint( public static ColumnPoint From(Dictionary map) => new ColumnPoint( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnPolygon.cs b/Appwrite/Models/ColumnPolygon.cs index 6ed47a6c..8d5c7256 100644 --- a/Appwrite/Models/ColumnPolygon.cs +++ b/Appwrite/Models/ColumnPolygon.cs @@ -18,7 +18,7 @@ public class ColumnPolygon public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -41,7 +41,7 @@ public class ColumnPolygon public ColumnPolygon( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -64,7 +64,7 @@ public ColumnPolygon( public static ColumnPolygon From(Dictionary map) => new ColumnPolygon( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnRelationship.cs b/Appwrite/Models/ColumnRelationship.cs index 6cf3d2dc..fb9d77a2 100644 --- a/Appwrite/Models/ColumnRelationship.cs +++ b/Appwrite/Models/ColumnRelationship.cs @@ -18,7 +18,7 @@ public class ColumnRelationship public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -56,7 +56,7 @@ public class ColumnRelationship public ColumnRelationship( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -89,7 +89,7 @@ string side public static ColumnRelationship From(Dictionary map) => new ColumnRelationship( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnString.cs b/Appwrite/Models/ColumnString.cs index f4bdbff9..974ff69a 100644 --- a/Appwrite/Models/ColumnString.cs +++ b/Appwrite/Models/ColumnString.cs @@ -18,7 +18,7 @@ public class ColumnString public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnString public ColumnString( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnString( public static ColumnString From(Dictionary map) => new ColumnString( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnText.cs b/Appwrite/Models/ColumnText.cs index 75cdc4a5..da4d9806 100644 --- a/Appwrite/Models/ColumnText.cs +++ b/Appwrite/Models/ColumnText.cs @@ -18,7 +18,7 @@ public class ColumnText public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnText public ColumnText( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnText( public static ColumnText From(Dictionary map) => new ColumnText( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnUrl.cs b/Appwrite/Models/ColumnUrl.cs index 092029b0..7250ade6 100644 --- a/Appwrite/Models/ColumnUrl.cs +++ b/Appwrite/Models/ColumnUrl.cs @@ -18,7 +18,7 @@ public class ColumnUrl public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -44,7 +44,7 @@ public class ColumnUrl public ColumnUrl( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -69,7 +69,7 @@ public ColumnUrl( public static ColumnUrl From(Dictionary map) => new ColumnUrl( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/ColumnVarchar.cs b/Appwrite/Models/ColumnVarchar.cs index f37860b7..7659a677 100644 --- a/Appwrite/Models/ColumnVarchar.cs +++ b/Appwrite/Models/ColumnVarchar.cs @@ -18,7 +18,7 @@ public class ColumnVarchar public string Type { get; private set; } [JsonPropertyName("status")] - public ColumnStatus Status { get; private set; } + public Appwrite.Enums.ColumnStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public class ColumnVarchar public ColumnVarchar( string key, string type, - ColumnStatus status, + Appwrite.Enums.ColumnStatus status, string error, bool required, bool? array, @@ -74,7 +74,7 @@ public ColumnVarchar( public static ColumnVarchar From(Dictionary map) => new ColumnVarchar( key: map["key"].ToString(), type: map["type"].ToString(), - status: new ColumnStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ColumnStatus(map["status"].ToString()!), error: map["error"].ToString(), required: (bool)map["required"], array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index 8d7ee677..c1ade276 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -27,10 +27,10 @@ public class Database public bool Enabled { get; private set; } [JsonPropertyName("type")] - public DatabaseType Type { get; private set; } + public Appwrite.Enums.DatabaseType Type { get; private set; } [JsonPropertyName("status")] - public DatabaseStatus? Status { get; private set; } + public Appwrite.Enums.DatabaseStatus? Status { get; private set; } [JsonPropertyName("engine")] public string? Engine { get; private set; } @@ -53,8 +53,8 @@ public Database( string createdAt, string updatedAt, bool enabled, - DatabaseType type, - DatabaseStatus? status, + Appwrite.Enums.DatabaseType type, + Appwrite.Enums.DatabaseStatus? status, string? engine, string? specification, long? replicas, @@ -82,11 +82,11 @@ public Database( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), enabled: (bool)map["enabled"], - type: new DatabaseType(map["type"].ToString()!), + type: new Appwrite.Enums.DatabaseType(map["type"].ToString()!), status: map.TryGetValue("status", out var enumRaw7) ? enumRaw7 == null ? null - : new DatabaseStatus(enumRaw7.ToString()!) + : new Appwrite.Enums.DatabaseStatus(enumRaw7.ToString()!) : null, engine: map.TryGetValue("engine", out var engine) ? engine?.ToString() : null, specification: map.TryGetValue("specification", out var specification) ? specification?.ToString() : null, diff --git a/Appwrite/Models/Deployment.cs b/Appwrite/Models/Deployment.cs index 6a3786b2..79f43f76 100644 --- a/Appwrite/Models/Deployment.cs +++ b/Appwrite/Models/Deployment.cs @@ -54,7 +54,7 @@ public class Deployment public string ScreenshotDark { get; private set; } [JsonPropertyName("status")] - public DeploymentStatus Status { get; private set; } + public Appwrite.Enums.DeploymentStatus Status { get; private set; } [JsonPropertyName("buildLogs")] public string BuildLogs { get; private set; } @@ -107,7 +107,7 @@ public Deployment( bool activate, string screenshotLight, string screenshotDark, - DeploymentStatus status, + Appwrite.Enums.DeploymentStatus status, string buildLogs, long buildDuration, string providerRepositoryName, @@ -166,7 +166,7 @@ string providerBranchUrl activate: (bool)map["activate"], screenshotLight: map["screenshotLight"].ToString(), screenshotDark: map["screenshotDark"].ToString(), - status: new DeploymentStatus(map["status"].ToString()!), + status: new Appwrite.Enums.DeploymentStatus(map["status"].ToString()!), buildLogs: map["buildLogs"].ToString(), buildDuration: Convert.ToInt64(map["buildDuration"]), providerRepositoryName: map["providerRepositoryName"].ToString(), diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index 04c39e47..2393dbc0 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -30,10 +30,10 @@ public class Execution public string DeploymentId { get; private set; } [JsonPropertyName("trigger")] - public ExecutionTrigger Trigger { get; private set; } + public Appwrite.Enums.ExecutionTrigger Trigger { get; private set; } [JsonPropertyName("status")] - public ExecutionStatus Status { get; private set; } + public Appwrite.Enums.ExecutionStatus Status { get; private set; } [JsonPropertyName("requestMethod")] public string RequestMethod { get; private set; } @@ -72,8 +72,8 @@ public Execution( List permissions, string functionId, string deploymentId, - ExecutionTrigger trigger, - ExecutionStatus status, + Appwrite.Enums.ExecutionTrigger trigger, + Appwrite.Enums.ExecutionStatus status, string requestMethod, string requestPath, List requestHeaders, @@ -113,8 +113,8 @@ public Execution( permissions: map["$permissions"].ConvertToList(), functionId: map["functionId"].ToString(), deploymentId: map["deploymentId"].ToString(), - trigger: new ExecutionTrigger(map["trigger"].ToString()!), - status: new ExecutionStatus(map["status"].ToString()!), + trigger: new Appwrite.Enums.ExecutionTrigger(map["trigger"].ToString()!), + status: new Appwrite.Enums.ExecutionStatus(map["status"].ToString()!), requestMethod: map["requestMethod"].ToString(), requestPath: map["requestPath"].ToString(), requestHeaders: map["requestHeaders"].ConvertToList>().Select(it => Appwrite.Models.Headers.From(map: it)).ToList(), diff --git a/Appwrite/Models/Index.cs b/Appwrite/Models/Index.cs index 12f897d7..ddebe855 100644 --- a/Appwrite/Models/Index.cs +++ b/Appwrite/Models/Index.cs @@ -27,7 +27,7 @@ public class Index public string Type { get; private set; } [JsonPropertyName("status")] - public IndexStatus Status { get; private set; } + public Appwrite.Enums.IndexStatus Status { get; private set; } [JsonPropertyName("error")] public string Error { get; private set; } @@ -47,7 +47,7 @@ public Index( string updatedAt, string key, string type, - IndexStatus status, + Appwrite.Enums.IndexStatus status, string error, List attributes, List lengths, @@ -72,7 +72,7 @@ public Index( updatedAt: map["$updatedAt"].ToString(), key: map["key"].ToString(), type: map["type"].ToString(), - status: new IndexStatus(map["status"].ToString()!), + status: new Appwrite.Enums.IndexStatus(map["status"].ToString()!), error: map["error"].ToString(), attributes: map["attributes"].ConvertToList(), lengths: map["lengths"].ConvertToList(), diff --git a/Appwrite/Models/InsightCTA.cs b/Appwrite/Models/InsightCTA.cs index 516cae98..3fa87ddf 100644 --- a/Appwrite/Models/InsightCTA.cs +++ b/Appwrite/Models/InsightCTA.cs @@ -40,7 +40,7 @@ object @params label: map["label"].ToString(), service: map["service"].ToString(), method: map["method"].ToString(), - @params: map["params"].ToString() + @params: map["params"] ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Message.cs b/Appwrite/Models/Message.cs index b90570b6..7ef49fca 100644 --- a/Appwrite/Models/Message.cs +++ b/Appwrite/Models/Message.cs @@ -48,7 +48,7 @@ public class Message public object Data { get; private set; } [JsonPropertyName("status")] - public MessageStatus Status { get; private set; } + public Appwrite.Enums.MessageStatus Status { get; private set; } public Message( string id, @@ -63,7 +63,7 @@ public Message( List? deliveryErrors, long deliveredTotal, object data, - MessageStatus status + Appwrite.Enums.MessageStatus status ) { Id = id; @@ -95,8 +95,8 @@ MessageStatus status ? arrayRaw10.ConvertToList() : null, deliveredTotal: Convert.ToInt64(map["deliveredTotal"]), - data: map["data"].ToString(), - status: new MessageStatus(map["status"].ToString()!) + data: map["data"], + status: new Appwrite.Enums.MessageStatus(map["status"].ToString()!) ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/PlatformAndroid.cs b/Appwrite/Models/PlatformAndroid.cs index a0295637..e671a8c7 100644 --- a/Appwrite/Models/PlatformAndroid.cs +++ b/Appwrite/Models/PlatformAndroid.cs @@ -24,7 +24,7 @@ public class PlatformAndroid public string Name { get; private set; } [JsonPropertyName("type")] - public PlatformType Type { get; private set; } + public Appwrite.Enums.PlatformType Type { get; private set; } [JsonPropertyName("applicationId")] public string ApplicationId { get; private set; } @@ -34,7 +34,7 @@ public PlatformAndroid( string createdAt, string updatedAt, string name, - PlatformType type, + Appwrite.Enums.PlatformType type, string applicationId ) { @@ -51,7 +51,7 @@ string applicationId createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), name: map["name"].ToString(), - type: new PlatformType(map["type"].ToString()!), + type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), applicationId: map["applicationId"].ToString() ); diff --git a/Appwrite/Models/PlatformApple.cs b/Appwrite/Models/PlatformApple.cs index e0aadfcb..3e470808 100644 --- a/Appwrite/Models/PlatformApple.cs +++ b/Appwrite/Models/PlatformApple.cs @@ -24,7 +24,7 @@ public class PlatformApple public string Name { get; private set; } [JsonPropertyName("type")] - public PlatformType Type { get; private set; } + public Appwrite.Enums.PlatformType Type { get; private set; } [JsonPropertyName("bundleIdentifier")] public string BundleIdentifier { get; private set; } @@ -34,7 +34,7 @@ public PlatformApple( string createdAt, string updatedAt, string name, - PlatformType type, + Appwrite.Enums.PlatformType type, string bundleIdentifier ) { @@ -51,7 +51,7 @@ string bundleIdentifier createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), name: map["name"].ToString(), - type: new PlatformType(map["type"].ToString()!), + type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), bundleIdentifier: map["bundleIdentifier"].ToString() ); diff --git a/Appwrite/Models/PlatformLinux.cs b/Appwrite/Models/PlatformLinux.cs index e6ef8666..7442840d 100644 --- a/Appwrite/Models/PlatformLinux.cs +++ b/Appwrite/Models/PlatformLinux.cs @@ -24,7 +24,7 @@ public class PlatformLinux public string Name { get; private set; } [JsonPropertyName("type")] - public PlatformType Type { get; private set; } + public Appwrite.Enums.PlatformType Type { get; private set; } [JsonPropertyName("packageName")] public string PackageName { get; private set; } @@ -34,7 +34,7 @@ public PlatformLinux( string createdAt, string updatedAt, string name, - PlatformType type, + Appwrite.Enums.PlatformType type, string packageName ) { @@ -51,7 +51,7 @@ string packageName createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), name: map["name"].ToString(), - type: new PlatformType(map["type"].ToString()!), + type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), packageName: map["packageName"].ToString() ); diff --git a/Appwrite/Models/PlatformWeb.cs b/Appwrite/Models/PlatformWeb.cs index 73c6f8fb..5d06a206 100644 --- a/Appwrite/Models/PlatformWeb.cs +++ b/Appwrite/Models/PlatformWeb.cs @@ -24,7 +24,7 @@ public class PlatformWeb public string Name { get; private set; } [JsonPropertyName("type")] - public PlatformType Type { get; private set; } + public Appwrite.Enums.PlatformType Type { get; private set; } [JsonPropertyName("hostname")] public string Hostname { get; private set; } @@ -34,7 +34,7 @@ public PlatformWeb( string createdAt, string updatedAt, string name, - PlatformType type, + Appwrite.Enums.PlatformType type, string hostname ) { @@ -51,7 +51,7 @@ string hostname createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), name: map["name"].ToString(), - type: new PlatformType(map["type"].ToString()!), + type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), hostname: map["hostname"].ToString() ); diff --git a/Appwrite/Models/PlatformWindows.cs b/Appwrite/Models/PlatformWindows.cs index d488de38..321f4d65 100644 --- a/Appwrite/Models/PlatformWindows.cs +++ b/Appwrite/Models/PlatformWindows.cs @@ -24,7 +24,7 @@ public class PlatformWindows public string Name { get; private set; } [JsonPropertyName("type")] - public PlatformType Type { get; private set; } + public Appwrite.Enums.PlatformType Type { get; private set; } [JsonPropertyName("packageIdentifierName")] public string PackageIdentifierName { get; private set; } @@ -34,7 +34,7 @@ public PlatformWindows( string createdAt, string updatedAt, string name, - PlatformType type, + Appwrite.Enums.PlatformType type, string packageIdentifierName ) { @@ -51,7 +51,7 @@ string packageIdentifierName createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), name: map["name"].ToString(), - type: new PlatformType(map["type"].ToString()!), + type: new Appwrite.Enums.PlatformType(map["type"].ToString()!), packageIdentifierName: map["packageIdentifierName"].ToString() ); diff --git a/Appwrite/Models/Presence.cs b/Appwrite/Models/Presence.cs index 58d27464..c9ee35fa 100644 --- a/Appwrite/Models/Presence.cs +++ b/Appwrite/Models/Presence.cs @@ -70,7 +70,7 @@ public Presence( status: map.TryGetValue("status", out var status) ? status?.ToString() : null, source: map["source"].ToString(), expiresAt: map.TryGetValue("expiresAt", out var expiresAt) ? expiresAt?.ToString() : null, - metadata: map.TryGetValue("metadata", out var metadata) ? metadata?.ToString() : null + metadata: map.TryGetValue("metadata", out var objectRaw9) ? objectRaw9 : null ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 08735680..e1ac7125 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -263,7 +263,7 @@ public Project( pingedAt: map["pingedAt"].ToString(), labels: map["labels"].ConvertToList(), status: map["status"].ToString(), - onboarding: map["onboarding"].ToString(), + onboarding: map["onboarding"], authMethods: map["authMethods"].ConvertToList>().Select(it => Appwrite.Models.ProjectAuthMethod.From(map: it)).ToList(), services: map["services"].ConvertToList>().Select(it => Appwrite.Models.ProjectService.From(map: it)).ToList(), protocols: map["protocols"].ConvertToList>().Select(it => Appwrite.Models.ProjectProtocol.From(map: it)).ToList(), diff --git a/Appwrite/Models/ProjectAuthMethod.cs b/Appwrite/Models/ProjectAuthMethod.cs index e6705325..f2813c8c 100644 --- a/Appwrite/Models/ProjectAuthMethod.cs +++ b/Appwrite/Models/ProjectAuthMethod.cs @@ -12,13 +12,13 @@ namespace Appwrite.Models public class ProjectAuthMethod { [JsonPropertyName("$id")] - public ProjectAuthMethodId Id { get; private set; } + public Appwrite.Enums.ProjectAuthMethodId Id { get; private set; } [JsonPropertyName("enabled")] public bool Enabled { get; private set; } public ProjectAuthMethod( - ProjectAuthMethodId id, + Appwrite.Enums.ProjectAuthMethodId id, bool enabled ) { @@ -27,7 +27,7 @@ bool enabled } public static ProjectAuthMethod From(Dictionary map) => new ProjectAuthMethod( - id: new ProjectAuthMethodId(map["$id"].ToString()!), + id: new Appwrite.Enums.ProjectAuthMethodId(map["$id"].ToString()!), enabled: (bool)map["enabled"] ); diff --git a/Appwrite/Models/ProjectProtocol.cs b/Appwrite/Models/ProjectProtocol.cs index b794986f..7f6782e5 100644 --- a/Appwrite/Models/ProjectProtocol.cs +++ b/Appwrite/Models/ProjectProtocol.cs @@ -12,13 +12,13 @@ namespace Appwrite.Models public class ProjectProtocol { [JsonPropertyName("$id")] - public ProjectProtocolId Id { get; private set; } + public Appwrite.Enums.ProjectProtocolId Id { get; private set; } [JsonPropertyName("enabled")] public bool Enabled { get; private set; } public ProjectProtocol( - ProjectProtocolId id, + Appwrite.Enums.ProjectProtocolId id, bool enabled ) { @@ -27,7 +27,7 @@ bool enabled } public static ProjectProtocol From(Dictionary map) => new ProjectProtocol( - id: new ProjectProtocolId(map["$id"].ToString()!), + id: new Appwrite.Enums.ProjectProtocolId(map["$id"].ToString()!), enabled: (bool)map["enabled"] ); diff --git a/Appwrite/Models/ProjectService.cs b/Appwrite/Models/ProjectService.cs index fca62cd5..bd862e5f 100644 --- a/Appwrite/Models/ProjectService.cs +++ b/Appwrite/Models/ProjectService.cs @@ -12,13 +12,13 @@ namespace Appwrite.Models public class ProjectService { [JsonPropertyName("$id")] - public ProjectServiceId Id { get; private set; } + public Appwrite.Enums.ProjectServiceId Id { get; private set; } [JsonPropertyName("enabled")] public bool Enabled { get; private set; } public ProjectService( - ProjectServiceId id, + Appwrite.Enums.ProjectServiceId id, bool enabled ) { @@ -27,7 +27,7 @@ bool enabled } public static ProjectService From(Dictionary map) => new ProjectService( - id: new ProjectServiceId(map["$id"].ToString()!), + id: new Appwrite.Enums.ProjectServiceId(map["$id"].ToString()!), enabled: (bool)map["enabled"] ); diff --git a/Appwrite/Models/Provider.cs b/Appwrite/Models/Provider.cs index 2f4671de..55365349 100644 --- a/Appwrite/Models/Provider.cs +++ b/Appwrite/Models/Provider.cs @@ -69,8 +69,8 @@ public Provider( provider: map["provider"].ToString(), enabled: (bool)map["enabled"], type: map["type"].ToString(), - credentials: map["credentials"].ToString(), - options: map.TryGetValue("options", out var options) ? options?.ToString() : null + credentials: map["credentials"], + options: map.TryGetValue("options", out var objectRaw9) ? objectRaw9 : null ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/ProxyRule.cs b/Appwrite/Models/ProxyRule.cs index 1cbe0b7e..0043d6e0 100644 --- a/Appwrite/Models/ProxyRule.cs +++ b/Appwrite/Models/ProxyRule.cs @@ -39,7 +39,7 @@ public class ProxyRule public string DeploymentId { get; private set; } [JsonPropertyName("deploymentResourceType")] - public ProxyRuleDeploymentResourceType? DeploymentResourceType { get; private set; } + public Appwrite.Enums.ProxyRuleDeploymentResourceType? DeploymentResourceType { get; private set; } [JsonPropertyName("deploymentResourceId")] public string DeploymentResourceId { get; private set; } @@ -48,7 +48,7 @@ public class ProxyRule public string DeploymentVcsProviderBranch { get; private set; } [JsonPropertyName("status")] - public ProxyRuleStatus Status { get; private set; } + public Appwrite.Enums.ProxyRuleStatus Status { get; private set; } [JsonPropertyName("logs")] public string Logs { get; private set; } @@ -66,10 +66,10 @@ public ProxyRule( string redirectUrl, long redirectStatusCode, string deploymentId, - ProxyRuleDeploymentResourceType? deploymentResourceType, + Appwrite.Enums.ProxyRuleDeploymentResourceType? deploymentResourceType, string deploymentResourceId, string deploymentVcsProviderBranch, - ProxyRuleStatus status, + Appwrite.Enums.ProxyRuleStatus status, string logs, string renewAt ) @@ -104,11 +104,11 @@ string renewAt deploymentResourceType: map.TryGetValue("deploymentResourceType", out var enumRaw10) ? enumRaw10 == null ? null - : new ProxyRuleDeploymentResourceType(enumRaw10.ToString()!) + : new Appwrite.Enums.ProxyRuleDeploymentResourceType(enumRaw10.ToString()!) : null, deploymentResourceId: map["deploymentResourceId"].ToString(), deploymentVcsProviderBranch: map["deploymentVcsProviderBranch"].ToString(), - status: new ProxyRuleStatus(map["status"].ToString()!), + status: new Appwrite.Enums.ProxyRuleStatus(map["status"].ToString()!), logs: map["logs"].ToString(), renewAt: map["renewAt"].ToString() ); diff --git a/Appwrite/Models/User.cs b/Appwrite/Models/User.cs index f3440fc7..0d52e34e 100644 --- a/Appwrite/Models/User.cs +++ b/Appwrite/Models/User.cs @@ -153,7 +153,7 @@ public User( name: map["name"].ToString(), password: map.TryGetValue("password", out var password) ? password?.ToString() : null, hash: map.TryGetValue("hash", out var hash) ? hash?.ToString() : null, - hashOptions: map.TryGetValue("hashOptions", out var hashOptions) ? hashOptions?.ToString() : null, + hashOptions: map.TryGetValue("hashOptions", out var objectRaw7) ? objectRaw7 : null, registration: map["registration"].ToString(), status: (bool)map["status"], labels: map["labels"].ConvertToList(), From e2a3cf0eee71fb3579bbe73b56ad87fccf0e936e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 13:42:46 +0530 Subject: [PATCH 06/10] chore: update .NET SDK to 7.0.0 --- Appwrite/Appwrite.csproj | 4 +- Appwrite/Client.cs | 14 +- Appwrite/Enums/AuthenticationFactor.cs | 1 + Appwrite/Enums/BuildRuntime.cs | 1 + Appwrite/Enums/EmbeddingModel.cs | 19 ++ Appwrite/Enums/InvalidationType.cs | 18 ++ Appwrite/Enums/ProjectKeyScopes.cs | 2 + Appwrite/Enums/ProjectPolicyId.cs | 1 + Appwrite/Enums/Runtime.cs | 1 + Appwrite/Models/BillingPlan.cs | 32 ++- Appwrite/Models/BillingPlanAddon.cs | 16 +- Appwrite/Models/BillingPlanAddonDetails.cs | 6 +- Appwrite/Models/DatabaseMigration.cs | 138 ++++++++++ Appwrite/Models/DatabaseMigrationList.cs | 40 +++ Appwrite/Models/DatabaseStatus.cs | 44 ++++ Appwrite/Models/DedicatedDatabase.cs | 7 - Appwrite/Models/DedicatedDatabaseMember.cs | 8 +- Appwrite/Models/DedicatedDatabaseOperation.cs | 103 ++++++++ .../Models/DedicatedDatabaseOperationList.cs | 40 +++ Appwrite/Models/DedicatedDatabaseReplicas.cs | 37 +++ .../DedicatedDatabaseSpecificationPricing.cs | 7 - Appwrite/Models/Embedding.cs | 54 ++++ Appwrite/Models/EmbeddingList.cs | 40 +++ Appwrite/Models/File.cs | 14 ++ Appwrite/Models/MfaChallengeSecret.cs | 61 +++++ Appwrite/Models/MfaFactors.cs | 13 +- Appwrite/Models/Organization.cs | 74 +++--- Appwrite/Models/PolicyMfaFactors.cs | 61 +++++ Appwrite/Models/Project.cs | 37 +-- Appwrite/Models/ProxyInvalidation.cs | 54 ++++ Appwrite/Models/UsageBillingPlan.cs | 24 +- Appwrite/Services/Account.cs | 39 --- Appwrite/Services/Activities.cs | 2 +- Appwrite/Services/Apps.cs | 52 +++- Appwrite/Services/Backups.cs | 18 +- Appwrite/Services/Embeddings.cs | 56 +++++ Appwrite/Services/Project.cs | 101 ++++---- Appwrite/Services/Proxy.cs | 41 +++ Appwrite/Services/Storage.cs | 5 +- Appwrite/Services/TablesDB.cs | 237 +++++++++++++++++- Appwrite/Services/Users.cs | 36 +++ CHANGELOG.md | 18 ++ README.md | 8 +- docs/examples/activities/list-events.md | 2 +- .../apps/create-installation-token.md | 2 +- .../delete-installation.md} | 7 +- docs/examples/apps/get-installation.md | 2 +- docs/examples/apps/list-installations.md | 2 +- .../embeddings/create-text-embeddings.md | 17 ++ ...te-key.md => update-mfa-factors-policy.md} | 11 +- .../project/update-o-auth-2-server.md | 3 +- .../project/update-session-duration-policy.md | 2 +- .../project/update-user-limit-policy.md | 2 +- docs/examples/proxy/create-invalidation.md | 18 ++ docs/examples/storage/create-file.md | 3 +- docs/examples/tablesdb/create-migration.md | 17 ++ docs/examples/tablesdb/create.md | 3 +- docs/examples/tablesdb/cutover-migration.md | 16 ++ docs/examples/tablesdb/delete-migration.md | 16 ++ docs/examples/tablesdb/get-migration.md | 16 ++ docs/examples/tablesdb/list-migrations.md | 15 ++ docs/examples/tablesdb/list-operations.md | 18 ++ docs/examples/tablesdb/update.md | 4 +- docs/examples/users/get-mfa-challenge.md | 16 ++ 64 files changed, 1539 insertions(+), 237 deletions(-) create mode 100644 Appwrite/Enums/EmbeddingModel.cs create mode 100644 Appwrite/Enums/InvalidationType.cs create mode 100644 Appwrite/Models/DatabaseMigration.cs create mode 100644 Appwrite/Models/DatabaseMigrationList.cs create mode 100644 Appwrite/Models/DedicatedDatabaseOperation.cs create mode 100644 Appwrite/Models/DedicatedDatabaseOperationList.cs create mode 100644 Appwrite/Models/Embedding.cs create mode 100644 Appwrite/Models/EmbeddingList.cs create mode 100644 Appwrite/Models/MfaChallengeSecret.cs create mode 100644 Appwrite/Models/PolicyMfaFactors.cs create mode 100644 Appwrite/Models/ProxyInvalidation.cs create mode 100644 Appwrite/Services/Embeddings.cs rename docs/examples/{account/create-jwt.md => apps/delete-installation.md} (71%) create mode 100644 docs/examples/embeddings/create-text-embeddings.md rename docs/examples/project/{create-key.md => update-mfa-factors-policy.md} (58%) create mode 100644 docs/examples/proxy/create-invalidation.md create mode 100644 docs/examples/tablesdb/create-migration.md create mode 100644 docs/examples/tablesdb/cutover-migration.md create mode 100644 docs/examples/tablesdb/delete-migration.md create mode 100644 docs/examples/tablesdb/get-migration.md create mode 100644 docs/examples/tablesdb/list-migrations.md create mode 100644 docs/examples/tablesdb/list-operations.md create mode 100644 docs/examples/users/get-mfa-challenge.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 54772716..dcd11786 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 6.1.0 + 7.0.0 Appwrite Team Appwrite Team @@ -20,7 +20,7 @@ - + diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 4754333e..ec1fbd4a 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -76,12 +76,12 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/6.1.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/7.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "6.1.0"}, - { "X-Appwrite-Response-Format", "1.9.5" } + { "x-sdk-version", "7.0.0"}, + { "X-Appwrite-Response-Format", "1.9.6" } }; _config = new Dictionary(); @@ -131,6 +131,14 @@ public Client SetKey(string value) { return this; } + /// Your organization ID + public Client SetOrganization(string value) { + _config["organization"] = value; + AddHeader("X-Appwrite-Organization", value); + + return this; + } + /// Your secret JSON Web Token public Client SetJWT(string value) { _config["jWT"] = value; diff --git a/Appwrite/Enums/AuthenticationFactor.cs b/Appwrite/Enums/AuthenticationFactor.cs index 8e971451..c3f989ac 100644 --- a/Appwrite/Enums/AuthenticationFactor.cs +++ b/Appwrite/Enums/AuthenticationFactor.cs @@ -15,5 +15,6 @@ public AuthenticationFactor(string value) public static AuthenticationFactor Phone => new AuthenticationFactor("phone"); public static AuthenticationFactor Totp => new AuthenticationFactor("totp"); public static AuthenticationFactor Recoverycode => new AuthenticationFactor("recoverycode"); + public static AuthenticationFactor Custom => new AuthenticationFactor("custom"); } } diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index d9d2b853..573e60f1 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -21,6 +21,7 @@ public BuildRuntime(string value) public static BuildRuntime Node23 => new BuildRuntime("node-23"); public static BuildRuntime Node24 => new BuildRuntime("node-24"); public static BuildRuntime Node25 => new BuildRuntime("node-25"); + public static BuildRuntime Node26 => new BuildRuntime("node-26"); public static BuildRuntime Php80 => new BuildRuntime("php-8.0"); public static BuildRuntime Php81 => new BuildRuntime("php-8.1"); public static BuildRuntime Php82 => new BuildRuntime("php-8.2"); diff --git a/Appwrite/Enums/EmbeddingModel.cs b/Appwrite/Enums/EmbeddingModel.cs new file mode 100644 index 00000000..d4d52921 --- /dev/null +++ b/Appwrite/Enums/EmbeddingModel.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class EmbeddingModel : IEnum + { + public string Value { get; private set; } + + public EmbeddingModel(string value) + { + Value = value; + } + + public static EmbeddingModel NomicEmbedText => new EmbeddingModel("nomic-embed-text"); + public static EmbeddingModel EmbeddingGemma => new EmbeddingModel("embedding-gemma"); + public static EmbeddingModel AllMinilm => new EmbeddingModel("all-minilm"); + public static EmbeddingModel BgeSmall => new EmbeddingModel("bge-small"); + } +} diff --git a/Appwrite/Enums/InvalidationType.cs b/Appwrite/Enums/InvalidationType.cs new file mode 100644 index 00000000..dd9193f2 --- /dev/null +++ b/Appwrite/Enums/InvalidationType.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class InvalidationType : IEnum + { + public string Value { get; private set; } + + public InvalidationType(string value) + { + Value = value; + } + + public static InvalidationType Tag => new InvalidationType("tag"); + public static InvalidationType Path => new InvalidationType("path"); + public static InvalidationType All => new InvalidationType("all"); + } +} diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index e728151f..3ba4874b 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -45,6 +45,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes IndexesWrite => new ProjectKeyScopes("indexes.write"); public static ProjectKeyScopes RowsRead => new ProjectKeyScopes("rows.read"); public static ProjectKeyScopes RowsWrite => new ProjectKeyScopes("rows.write"); + public static ProjectKeyScopes EmbeddingsWrite => new ProjectKeyScopes("embeddings.write"); public static ProjectKeyScopes CollectionsRead => new ProjectKeyScopes("collections.read"); public static ProjectKeyScopes CollectionsWrite => new ProjectKeyScopes("collections.write"); public static ProjectKeyScopes AttributesRead => new ProjectKeyScopes("attributes.read"); @@ -109,6 +110,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes WafRulesRead => new ProjectKeyScopes("wafRules.read"); public static ProjectKeyScopes WafRulesWrite => new ProjectKeyScopes("wafRules.write"); public static ProjectKeyScopes EventsRead => new ProjectKeyScopes("events.read"); + public static ProjectKeyScopes ProxyInvalidationsWrite => new ProjectKeyScopes("proxy.invalidations.write"); public static ProjectKeyScopes AppsRead => new ProjectKeyScopes("apps.read"); public static ProjectKeyScopes AppsWrite => new ProjectKeyScopes("apps.write"); public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); diff --git a/Appwrite/Enums/ProjectPolicyId.cs b/Appwrite/Enums/ProjectPolicyId.cs index af6c3509..f3049a93 100644 --- a/Appwrite/Enums/ProjectPolicyId.cs +++ b/Appwrite/Enums/ProjectPolicyId.cs @@ -21,6 +21,7 @@ public ProjectPolicyId(string value) public static ProjectPolicyId SessionLimit => new ProjectPolicyId("session-limit"); public static ProjectPolicyId UserLimit => new ProjectPolicyId("user-limit"); public static ProjectPolicyId MembershipPrivacy => new ProjectPolicyId("membership-privacy"); + public static ProjectPolicyId MfaFactors => new ProjectPolicyId("mfa-factors"); public static ProjectPolicyId DenyAliasedEmail => new ProjectPolicyId("deny-aliased-email"); public static ProjectPolicyId DenyDisposableEmail => new ProjectPolicyId("deny-disposable-email"); public static ProjectPolicyId DenyFreeEmail => new ProjectPolicyId("deny-free-email"); diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index e2645dec..fe288085 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -21,6 +21,7 @@ public Runtime(string value) public static Runtime Node23 => new Runtime("node-23"); public static Runtime Node24 => new Runtime("node-24"); public static Runtime Node25 => new Runtime("node-25"); + public static Runtime Node26 => new Runtime("node-26"); public static Runtime Php80 => new Runtime("php-8.0"); public static Runtime Php81 => new Runtime("php-8.1"); public static Runtime Php82 => new Runtime("php-8.2"); diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index ac8c218e..3d7bd37f 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -42,7 +42,7 @@ public class BillingPlan public long ScreenshotsGenerated { get; private set; } [JsonPropertyName("members")] - public long Members { get; private set; } + public long? Members { get; private set; } [JsonPropertyName("webhooks")] public long Webhooks { get; private set; } @@ -114,7 +114,7 @@ public class BillingPlan public long Domains { get; private set; } [JsonPropertyName("activityLogs")] - public long ActivityLogs { get; private set; } + public long? ActivityLogs { get; private set; } [JsonPropertyName("usageLogs")] public long UsageLogs { get; private set; } @@ -186,7 +186,7 @@ public class BillingPlan public bool SupportsProjectSpecificRoles { get; private set; } [JsonPropertyName("backupsEnabled")] - public bool BackupsEnabled { get; private set; } + public bool? BackupsEnabled { get; private set; } [JsonPropertyName("usagePerProject")] public bool UsagePerProject { get; private set; } @@ -195,7 +195,7 @@ public class BillingPlan public BillingPlanSupportedAddons SupportedAddons { get; private set; } [JsonPropertyName("backupPolicies")] - public long BackupPolicies { get; private set; } + public long? BackupPolicies { get; private set; } [JsonPropertyName("deploymentSize")] public long DeploymentSize { get; private set; } @@ -229,7 +229,7 @@ public BillingPlan( long storage, long imageTransformations, long screenshotsGenerated, - long members, + long? members, long webhooks, long wafRules, long projects, @@ -253,7 +253,7 @@ public BillingPlan( long topics, long authPhone, long domains, - long activityLogs, + long? activityLogs, long usageLogs, List? usageLogsIntervals, long projectInactivityDays, @@ -277,10 +277,10 @@ public BillingPlan( bool supportsFreeEmailValidation, bool supportsCorporateEmailValidation, bool supportsProjectSpecificRoles, - bool backupsEnabled, + bool? backupsEnabled, bool usagePerProject, BillingPlanSupportedAddons supportedAddons, - long backupPolicies, + long? backupPolicies, long deploymentSize, long buildSize, bool databasesAllowEncrypt, @@ -372,7 +372,9 @@ public BillingPlan( storage: Convert.ToInt64(map["storage"]), imageTransformations: Convert.ToInt64(map["imageTransformations"]), screenshotsGenerated: Convert.ToInt64(map["screenshotsGenerated"]), - members: Convert.ToInt64(map["members"]), + members: map.TryGetValue("members", out var numberRaw11) && numberRaw11 != null + ? Convert.ToInt64(numberRaw11) + : null, webhooks: Convert.ToInt64(map["webhooks"]), wafRules: Convert.ToInt64(map["wafRules"]), projects: Convert.ToInt64(map["projects"]), @@ -396,7 +398,9 @@ public BillingPlan( topics: Convert.ToInt64(map["topics"]), authPhone: Convert.ToInt64(map["authPhone"]), domains: Convert.ToInt64(map["domains"]), - activityLogs: Convert.ToInt64(map["activityLogs"]), + activityLogs: map.TryGetValue("activityLogs", out var numberRaw35) && numberRaw35 != null + ? Convert.ToInt64(numberRaw35) + : null, usageLogs: Convert.ToInt64(map["usageLogs"]), usageLogsIntervals: map.TryGetValue("usageLogsIntervals", out var arrayRaw37) && arrayRaw37 != null ? arrayRaw37.ConvertToList() @@ -422,10 +426,14 @@ public BillingPlan( supportsFreeEmailValidation: (bool)map["supportsFreeEmailValidation"], supportsCorporateEmailValidation: (bool)map["supportsCorporateEmailValidation"], supportsProjectSpecificRoles: (bool)map["supportsProjectSpecificRoles"], - backupsEnabled: (bool)map["backupsEnabled"], + backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw59) && boolRaw59 != null + ? (bool?)boolRaw59 + : null, usagePerProject: (bool)map["usagePerProject"], supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj61 ? jsonObj61.Deserialize>()! : (Dictionary)map["supportedAddons"]), - backupPolicies: Convert.ToInt64(map["backupPolicies"]), + backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw62) && numberRaw62 != null + ? Convert.ToInt64(numberRaw62) + : null, deploymentSize: Convert.ToInt64(map["deploymentSize"]), buildSize: Convert.ToInt64(map["buildSize"]), databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], diff --git a/Appwrite/Models/BillingPlanAddon.cs b/Appwrite/Models/BillingPlanAddon.cs index 7871d6c3..b5e5046d 100644 --- a/Appwrite/Models/BillingPlanAddon.cs +++ b/Appwrite/Models/BillingPlanAddon.cs @@ -12,14 +12,14 @@ namespace Appwrite.Models public class BillingPlanAddon { [JsonPropertyName("seats")] - public BillingPlanAddonDetails Seats { get; private set; } + public BillingPlanAddonDetails? Seats { get; private set; } [JsonPropertyName("projects")] - public BillingPlanAddonDetails Projects { get; private set; } + public BillingPlanAddonDetails? Projects { get; private set; } public BillingPlanAddon( - BillingPlanAddonDetails seats, - BillingPlanAddonDetails projects + BillingPlanAddonDetails? seats, + BillingPlanAddonDetails? projects ) { Seats = seats; @@ -27,8 +27,12 @@ BillingPlanAddonDetails projects } public static BillingPlanAddon From(Dictionary map) => new BillingPlanAddon( - seats: Appwrite.Models.BillingPlanAddonDetails.From(map: map["seats"] is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)map["seats"]), - projects: Appwrite.Models.BillingPlanAddonDetails.From(map: map["projects"] is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)map["projects"]) + seats: map.TryGetValue("seats", out var objectRaw1) && objectRaw1 != null + ? Appwrite.Models.BillingPlanAddonDetails.From(map: objectRaw1 is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)objectRaw1) + : null, + projects: map.TryGetValue("projects", out var objectRaw2) && objectRaw2 != null + ? Appwrite.Models.BillingPlanAddonDetails.From(map: objectRaw2 is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)objectRaw2) + : null ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/BillingPlanAddonDetails.cs b/Appwrite/Models/BillingPlanAddonDetails.cs index 620c7cf2..4f39803d 100644 --- a/Appwrite/Models/BillingPlanAddonDetails.cs +++ b/Appwrite/Models/BillingPlanAddonDetails.cs @@ -24,7 +24,7 @@ public class BillingPlanAddonDetails public string Type { get; private set; } [JsonPropertyName("currency")] - public string Currency { get; private set; } + public string? Currency { get; private set; } [JsonPropertyName("price")] public double Price { get; private set; } @@ -40,7 +40,7 @@ public BillingPlanAddonDetails( long planIncluded, long limit, string type, - string currency, + string? currency, double price, long @value, string invoiceDesc @@ -61,7 +61,7 @@ string invoiceDesc planIncluded: Convert.ToInt64(map["planIncluded"]), limit: Convert.ToInt64(map["limit"]), type: map["type"].ToString(), - currency: map["currency"].ToString(), + currency: map.TryGetValue("currency", out var currency) ? currency?.ToString() : null, price: Convert.ToDouble(map["price"]), @value: Convert.ToInt64(map["value"]), invoiceDesc: map["invoiceDesc"].ToString() diff --git a/Appwrite/Models/DatabaseMigration.cs b/Appwrite/Models/DatabaseMigration.cs new file mode 100644 index 00000000..f6132288 --- /dev/null +++ b/Appwrite/Models/DatabaseMigration.cs @@ -0,0 +1,138 @@ + +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 DatabaseMigration + { + [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("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("specification")] + public string Specification { get; private set; } + + [JsonPropertyName("phase")] + public string Phase { get; private set; } + + [JsonPropertyName("attempt")] + public long Attempt { get; private set; } + + [JsonPropertyName("lastError")] + public string LastError { get; private set; } + + [JsonPropertyName("lagDocuments")] + public long LagDocuments { get; private set; } + + [JsonPropertyName("verifiedAt")] + public string VerifiedAt { get; private set; } + + [JsonPropertyName("cutoverAt")] + public string CutoverAt { get; private set; } + + [JsonPropertyName("soakUntil")] + public string SoakUntil { get; private set; } + + [JsonPropertyName("autoCutover")] + public bool AutoCutover { get; private set; } + + [JsonPropertyName("cutoverRequested")] + public bool CutoverRequested { get; private set; } + + [JsonPropertyName("paused")] + public bool Paused { get; private set; } + + public DatabaseMigration( + string id, + string createdAt, + string updatedAt, + string projectId, + string databaseId, + string specification, + string phase, + long attempt, + string lastError, + long lagDocuments, + string verifiedAt, + string cutoverAt, + string soakUntil, + bool autoCutover, + bool cutoverRequested, + bool paused + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + ProjectId = projectId; + DatabaseId = databaseId; + Specification = specification; + Phase = phase; + Attempt = attempt; + LastError = lastError; + LagDocuments = lagDocuments; + VerifiedAt = verifiedAt; + CutoverAt = cutoverAt; + SoakUntil = soakUntil; + AutoCutover = autoCutover; + CutoverRequested = cutoverRequested; + Paused = paused; + } + + public static DatabaseMigration From(Dictionary map) => new DatabaseMigration( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + projectId: map["projectId"].ToString(), + databaseId: map["databaseId"].ToString(), + specification: map["specification"].ToString(), + phase: map["phase"].ToString(), + attempt: Convert.ToInt64(map["attempt"]), + lastError: map["lastError"].ToString(), + lagDocuments: Convert.ToInt64(map["lagDocuments"]), + verifiedAt: map["verifiedAt"].ToString(), + cutoverAt: map["cutoverAt"].ToString(), + soakUntil: map["soakUntil"].ToString(), + autoCutover: (bool)map["autoCutover"], + cutoverRequested: (bool)map["cutoverRequested"], + paused: (bool)map["paused"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "projectId", ProjectId }, + { "databaseId", DatabaseId }, + { "specification", Specification }, + { "phase", Phase }, + { "attempt", Attempt }, + { "lastError", LastError }, + { "lagDocuments", LagDocuments }, + { "verifiedAt", VerifiedAt }, + { "cutoverAt", CutoverAt }, + { "soakUntil", SoakUntil }, + { "autoCutover", AutoCutover }, + { "cutoverRequested", CutoverRequested }, + { "paused", Paused } + }; + } +} diff --git a/Appwrite/Models/DatabaseMigrationList.cs b/Appwrite/Models/DatabaseMigrationList.cs new file mode 100644 index 00000000..e7634bff --- /dev/null +++ b/Appwrite/Models/DatabaseMigrationList.cs @@ -0,0 +1,40 @@ + +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 DatabaseMigrationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("migrations")] + public List Migrations { get; private set; } + + public DatabaseMigrationList( + long total, + List migrations + ) + { + Total = total; + Migrations = migrations; + } + + public static DatabaseMigrationList From(Dictionary map) => new DatabaseMigrationList( + total: Convert.ToInt64(map["total"]), + migrations: map["migrations"].ConvertToList>().Select(it => Appwrite.Models.DatabaseMigration.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "migrations", Migrations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DatabaseStatus.cs b/Appwrite/Models/DatabaseStatus.cs index e5abcad2..ab6fb06e 100644 --- a/Appwrite/Models/DatabaseStatus.cs +++ b/Appwrite/Models/DatabaseStatus.cs @@ -29,6 +29,24 @@ public class DatabaseStatus [JsonPropertyName("connections")] public DatabaseStatusConnections Connections { get; private set; } + [JsonPropertyName("syncMode")] + public string SyncMode { get; private set; } + + [JsonPropertyName("effectiveSyncMode")] + public string? EffectiveSyncMode { get; private set; } + + [JsonPropertyName("syncDegraded")] + public bool SyncDegraded { get; private set; } + + [JsonPropertyName("syncAcknowledgements")] + public long SyncAcknowledgements { get; private set; } + + [JsonPropertyName("syncStandbyCount")] + public long SyncStandbyCount { get; private set; } + + [JsonPropertyName("syncStateConfirmed")] + public bool? SyncStateConfirmed { get; private set; } + [JsonPropertyName("replicas")] public List Replicas { get; private set; } @@ -42,6 +60,12 @@ public DatabaseStatus( string version, long uptime, DatabaseStatusConnections connections, + string syncMode, + string? effectiveSyncMode, + bool syncDegraded, + long syncAcknowledgements, + long syncStandbyCount, + bool? syncStateConfirmed, List replicas, List volumes ) @@ -52,6 +76,12 @@ List volumes Version = version; Uptime = uptime; Connections = connections; + SyncMode = syncMode; + EffectiveSyncMode = effectiveSyncMode; + SyncDegraded = syncDegraded; + SyncAcknowledgements = syncAcknowledgements; + SyncStandbyCount = syncStandbyCount; + SyncStateConfirmed = syncStateConfirmed; Replicas = replicas; Volumes = volumes; } @@ -63,6 +93,14 @@ List volumes version: map["version"].ToString(), uptime: Convert.ToInt64(map["uptime"]), connections: Appwrite.Models.DatabaseStatusConnections.From(map: map["connections"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["connections"]), + syncMode: map["syncMode"].ToString(), + effectiveSyncMode: map.TryGetValue("effectiveSyncMode", out var effectiveSyncMode) ? effectiveSyncMode?.ToString() : null, + syncDegraded: (bool)map["syncDegraded"], + syncAcknowledgements: Convert.ToInt64(map["syncAcknowledgements"]), + syncStandbyCount: Convert.ToInt64(map["syncStandbyCount"]), + syncStateConfirmed: map.TryGetValue("syncStateConfirmed", out var boolRaw12) && boolRaw12 != null + ? (bool?)boolRaw12 + : null, replicas: map["replicas"].ConvertToList>().Select(it => Appwrite.Models.DatabaseStatusReplica.From(map: it)).ToList(), volumes: map["volumes"].ConvertToList>().Select(it => Appwrite.Models.DatabaseStatusVolume.From(map: it)).ToList() ); @@ -75,6 +113,12 @@ List volumes { "version", Version }, { "uptime", Uptime }, { "connections", Connections?.ToMap() }, + { "syncMode", SyncMode }, + { "effectiveSyncMode", EffectiveSyncMode }, + { "syncDegraded", SyncDegraded }, + { "syncAcknowledgements", SyncAcknowledgements }, + { "syncStandbyCount", SyncStandbyCount }, + { "syncStateConfirmed", SyncStateConfirmed }, { "replicas", Replicas?.Select(it => it.ToMap()).ToList() }, { "volumes", Volumes?.Select(it => it.ToMap()).ToList() } }; diff --git a/Appwrite/Models/DedicatedDatabase.cs b/Appwrite/Models/DedicatedDatabase.cs index 23c8fd07..f9a6ec28 100644 --- a/Appwrite/Models/DedicatedDatabase.cs +++ b/Appwrite/Models/DedicatedDatabase.cs @@ -101,9 +101,6 @@ public class DedicatedDatabase [JsonPropertyName("syncMode")] public string SyncMode { get; private set; } - [JsonPropertyName("crossRegionReplicas")] - public long CrossRegionReplicas { get; private set; } - [JsonPropertyName("networkMaxConnections")] public long NetworkMaxConnections { get; private set; } @@ -189,7 +186,6 @@ public DedicatedDatabase( string nodePool, long replicas, string syncMode, - long crossRegionReplicas, long networkMaxConnections, long networkIdleTimeoutSeconds, List networkIPAllowlist, @@ -240,7 +236,6 @@ string error NodePool = nodePool; Replicas = replicas; SyncMode = syncMode; - CrossRegionReplicas = crossRegionReplicas; NetworkMaxConnections = networkMaxConnections; NetworkIdleTimeoutSeconds = networkIdleTimeoutSeconds; NetworkIPAllowlist = networkIPAllowlist; @@ -292,7 +287,6 @@ string error nodePool: map["nodePool"].ToString(), replicas: Convert.ToInt64(map["replicas"]), syncMode: map["syncMode"].ToString(), - crossRegionReplicas: Convert.ToInt64(map["crossRegionReplicas"]), networkMaxConnections: Convert.ToInt64(map["networkMaxConnections"]), networkIdleTimeoutSeconds: Convert.ToInt64(map["networkIdleTimeoutSeconds"]), networkIPAllowlist: map["networkIPAllowlist"].ConvertToList(), @@ -345,7 +339,6 @@ string error { "nodePool", NodePool }, { "replicas", Replicas }, { "syncMode", SyncMode }, - { "crossRegionReplicas", CrossRegionReplicas }, { "networkMaxConnections", NetworkMaxConnections }, { "networkIdleTimeoutSeconds", NetworkIdleTimeoutSeconds }, { "networkIPAllowlist", NetworkIPAllowlist }, diff --git a/Appwrite/Models/DedicatedDatabaseMember.cs b/Appwrite/Models/DedicatedDatabaseMember.cs index 5a3875a8..942fc564 100644 --- a/Appwrite/Models/DedicatedDatabaseMember.cs +++ b/Appwrite/Models/DedicatedDatabaseMember.cs @@ -21,13 +21,13 @@ public class DedicatedDatabaseMember public string Status { get; private set; } [JsonPropertyName("lagSeconds")] - public double LagSeconds { get; private set; } + public double? LagSeconds { get; private set; } public DedicatedDatabaseMember( string id, string role, string status, - double lagSeconds + double? lagSeconds ) { Id = id; @@ -40,7 +40,9 @@ double lagSeconds id: map["$id"].ToString(), role: map["role"].ToString(), status: map["status"].ToString(), - lagSeconds: Convert.ToDouble(map["lagSeconds"]) + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null + ? Convert.ToDouble(numberRaw4) + : null ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Models/DedicatedDatabaseOperation.cs b/Appwrite/Models/DedicatedDatabaseOperation.cs new file mode 100644 index 00000000..9828e6e5 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseOperation.cs @@ -0,0 +1,103 @@ + +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 DedicatedDatabaseOperation + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("attempts")] + public long Attempts { get; private set; } + + [JsonPropertyName("requestedAt")] + public string? RequestedAt { get; private set; } + + [JsonPropertyName("startedAt")] + public string? StartedAt { get; private set; } + + [JsonPropertyName("completedAt")] + public string? CompletedAt { get; private set; } + + [JsonPropertyName("errorCode")] + public string ErrorCode { get; private set; } + + [JsonPropertyName("errorMessage")] + public string ErrorMessage { get; private set; } + + public DedicatedDatabaseOperation( + string id, + string createdAt, + string databaseId, + string type, + string status, + long attempts, + string? requestedAt, + string? startedAt, + string? completedAt, + string errorCode, + string errorMessage + ) + { + Id = id; + CreatedAt = createdAt; + DatabaseId = databaseId; + Type = type; + Status = status; + Attempts = attempts; + RequestedAt = requestedAt; + StartedAt = startedAt; + CompletedAt = completedAt; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + } + + public static DedicatedDatabaseOperation From(Dictionary map) => new DedicatedDatabaseOperation( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + databaseId: map["databaseId"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + attempts: Convert.ToInt64(map["attempts"]), + requestedAt: map.TryGetValue("requestedAt", out var requestedAt) ? requestedAt?.ToString() : null, + startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, + completedAt: map.TryGetValue("completedAt", out var completedAt) ? completedAt?.ToString() : null, + errorCode: map["errorCode"].ToString(), + errorMessage: map["errorMessage"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "databaseId", DatabaseId }, + { "type", Type }, + { "status", Status }, + { "attempts", Attempts }, + { "requestedAt", RequestedAt }, + { "startedAt", StartedAt }, + { "completedAt", CompletedAt }, + { "errorCode", ErrorCode }, + { "errorMessage", ErrorMessage } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseOperationList.cs b/Appwrite/Models/DedicatedDatabaseOperationList.cs new file mode 100644 index 00000000..bc99f453 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseOperationList.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseOperationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("operations")] + public List Operations { get; private set; } + + public DedicatedDatabaseOperationList( + long total, + List operations + ) + { + Total = total; + Operations = operations; + } + + public static DedicatedDatabaseOperationList From(Dictionary map) => new DedicatedDatabaseOperationList( + total: Convert.ToInt64(map["total"]), + operations: map["operations"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseOperation.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "operations", Operations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseReplicas.cs b/Appwrite/Models/DedicatedDatabaseReplicas.cs index caaa5990..f4a81a8f 100644 --- a/Appwrite/Models/DedicatedDatabaseReplicas.cs +++ b/Appwrite/Models/DedicatedDatabaseReplicas.cs @@ -17,23 +17,55 @@ public class DedicatedDatabaseReplicas [JsonPropertyName("syncMode")] public string SyncMode { get; private set; } + [JsonPropertyName("effectiveSyncMode")] + public string? EffectiveSyncMode { get; private set; } + + [JsonPropertyName("syncDegraded")] + public bool SyncDegraded { get; private set; } + + [JsonPropertyName("syncAcknowledgements")] + public long SyncAcknowledgements { get; private set; } + + [JsonPropertyName("syncStandbyCount")] + public long SyncStandbyCount { get; private set; } + + [JsonPropertyName("syncStateConfirmed")] + public bool? SyncStateConfirmed { get; private set; } + [JsonPropertyName("members")] public List Members { get; private set; } public DedicatedDatabaseReplicas( long replicas, string syncMode, + string? effectiveSyncMode, + bool syncDegraded, + long syncAcknowledgements, + long syncStandbyCount, + bool? syncStateConfirmed, List members ) { Replicas = replicas; SyncMode = syncMode; + EffectiveSyncMode = effectiveSyncMode; + SyncDegraded = syncDegraded; + SyncAcknowledgements = syncAcknowledgements; + SyncStandbyCount = syncStandbyCount; + SyncStateConfirmed = syncStateConfirmed; Members = members; } public static DedicatedDatabaseReplicas From(Dictionary map) => new DedicatedDatabaseReplicas( replicas: Convert.ToInt64(map["replicas"]), syncMode: map["syncMode"].ToString(), + effectiveSyncMode: map.TryGetValue("effectiveSyncMode", out var effectiveSyncMode) ? effectiveSyncMode?.ToString() : null, + syncDegraded: (bool)map["syncDegraded"], + syncAcknowledgements: Convert.ToInt64(map["syncAcknowledgements"]), + syncStandbyCount: Convert.ToInt64(map["syncStandbyCount"]), + syncStateConfirmed: map.TryGetValue("syncStateConfirmed", out var boolRaw7) && boolRaw7 != null + ? (bool?)boolRaw7 + : null, members: map["members"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseMember.From(map: it)).ToList() ); @@ -41,6 +73,11 @@ List members { { "replicas", Replicas }, { "syncMode", SyncMode }, + { "effectiveSyncMode", EffectiveSyncMode }, + { "syncDegraded", SyncDegraded }, + { "syncAcknowledgements", SyncAcknowledgements }, + { "syncStandbyCount", SyncStandbyCount }, + { "syncStateConfirmed", SyncStateConfirmed }, { "members", Members?.Select(it => it.ToMap()).ToList() } }; } diff --git a/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs b/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs index ccf587aa..80948c58 100644 --- a/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs +++ b/Appwrite/Models/DedicatedDatabaseSpecificationPricing.cs @@ -20,9 +20,6 @@ public class DedicatedDatabaseSpecificationPricing [JsonPropertyName("replicaRate")] public double ReplicaRate { get; private set; } - [JsonPropertyName("crossRegionReplicaRate")] - public double CrossRegionReplicaRate { get; private set; } - [JsonPropertyName("pitrRate")] public double PitrRate { get; private set; } @@ -30,14 +27,12 @@ public DedicatedDatabaseSpecificationPricing( double storageOverageRate, double bandwidthOverageRate, double replicaRate, - double crossRegionReplicaRate, double pitrRate ) { StorageOverageRate = storageOverageRate; BandwidthOverageRate = bandwidthOverageRate; ReplicaRate = replicaRate; - CrossRegionReplicaRate = crossRegionReplicaRate; PitrRate = pitrRate; } @@ -45,7 +40,6 @@ double pitrRate storageOverageRate: Convert.ToDouble(map["storageOverageRate"]), bandwidthOverageRate: Convert.ToDouble(map["bandwidthOverageRate"]), replicaRate: Convert.ToDouble(map["replicaRate"]), - crossRegionReplicaRate: Convert.ToDouble(map["crossRegionReplicaRate"]), pitrRate: Convert.ToDouble(map["pitrRate"]) ); @@ -54,7 +48,6 @@ double pitrRate { "storageOverageRate", StorageOverageRate }, { "bandwidthOverageRate", BandwidthOverageRate }, { "replicaRate", ReplicaRate }, - { "crossRegionReplicaRate", CrossRegionReplicaRate }, { "pitrRate", PitrRate } }; } diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs new file mode 100644 index 00000000..e4490112 --- /dev/null +++ b/Appwrite/Models/Embedding.cs @@ -0,0 +1,54 @@ + +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 Embedding + { + [JsonPropertyName("model")] + public string Model { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + [JsonPropertyName("embedding")] + public List XEmbedding { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public Embedding( + string model, + long dimension, + List embedding, + string error + ) + { + Model = model; + Dimension = dimension; + XEmbedding = embedding; + Error = error; + } + + public static Embedding From(Dictionary map) => new Embedding( + model: map["model"].ToString(), + dimension: Convert.ToInt64(map["dimension"]), + embedding: map["embedding"].ConvertToList(), + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "model", Model }, + { "dimension", Dimension }, + { "embedding", XEmbedding }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs new file mode 100644 index 00000000..98dc63b6 --- /dev/null +++ b/Appwrite/Models/EmbeddingList.cs @@ -0,0 +1,40 @@ + +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 EmbeddingList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("embeddings")] + public List Embeddings { get; private set; } + + public EmbeddingList( + long total, + List embeddings + ) + { + Total = total; + Embeddings = embeddings; + } + + public static EmbeddingList From(Dictionary map) => new EmbeddingList( + total: Convert.ToInt64(map["total"]), + embeddings: map["embeddings"].ConvertToList>().Select(it => Appwrite.Models.Embedding.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "embeddings", Embeddings?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/File.cs b/Appwrite/Models/File.cs index d6f0ebbd..12b6ca3c 100644 --- a/Appwrite/Models/File.cs +++ b/Appwrite/Models/File.cs @@ -29,6 +29,12 @@ public class File [JsonPropertyName("name")] public string Name { get; private set; } + [JsonPropertyName("folder")] + public string Folder { get; private set; } + + [JsonPropertyName("key")] + public string Key { get; private set; } + [JsonPropertyName("signature")] public string Signature { get; private set; } @@ -60,6 +66,8 @@ public File( string updatedAt, List permissions, string name, + string folder, + string key, string signature, string mimeType, long sizeOriginal, @@ -76,6 +84,8 @@ string compression UpdatedAt = updatedAt; Permissions = permissions; Name = name; + Folder = folder; + Key = key; Signature = signature; MimeType = mimeType; SizeOriginal = sizeOriginal; @@ -93,6 +103,8 @@ string compression updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"].ConvertToList(), name: map["name"].ToString(), + folder: map["folder"].ToString(), + key: map["key"].ToString(), signature: map["signature"].ToString(), mimeType: map["mimeType"].ToString(), sizeOriginal: Convert.ToInt64(map["sizeOriginal"]), @@ -111,6 +123,8 @@ string compression { "$updatedAt", UpdatedAt }, { "$permissions", Permissions }, { "name", Name }, + { "folder", Folder }, + { "key", Key }, { "signature", Signature }, { "mimeType", MimeType }, { "sizeOriginal", SizeOriginal }, diff --git a/Appwrite/Models/MfaChallengeSecret.cs b/Appwrite/Models/MfaChallengeSecret.cs new file mode 100644 index 00000000..67570421 --- /dev/null +++ b/Appwrite/Models/MfaChallengeSecret.cs @@ -0,0 +1,61 @@ + +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 MfaChallengeSecret + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("userId")] + public string UserId { get; private set; } + + [JsonPropertyName("expire")] + public string Expire { get; private set; } + + [JsonPropertyName("code")] + public string Code { get; private set; } + + public MfaChallengeSecret( + string id, + string createdAt, + string userId, + string expire, + string code + ) + { + Id = id; + CreatedAt = createdAt; + UserId = userId; + Expire = expire; + Code = code; + } + + public static MfaChallengeSecret From(Dictionary map) => new MfaChallengeSecret( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + userId: map["userId"].ToString(), + expire: map["expire"].ToString(), + code: map["code"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "userId", UserId }, + { "expire", Expire }, + { "code", Code } + }; + } +} diff --git a/Appwrite/Models/MfaFactors.cs b/Appwrite/Models/MfaFactors.cs index 98e1c0c3..91685829 100644 --- a/Appwrite/Models/MfaFactors.cs +++ b/Appwrite/Models/MfaFactors.cs @@ -23,24 +23,30 @@ public class MfaFactors [JsonPropertyName("recoveryCode")] public bool RecoveryCode { get; private set; } + [JsonPropertyName("custom")] + public bool Custom { get; private set; } + public MfaFactors( bool totp, bool phone, bool email, - bool recoveryCode + bool recoveryCode, + bool custom ) { Totp = totp; Phone = phone; Email = email; RecoveryCode = recoveryCode; + Custom = custom; } public static MfaFactors From(Dictionary map) => new MfaFactors( totp: (bool)map["totp"], phone: (bool)map["phone"], email: (bool)map["email"], - recoveryCode: (bool)map["recoveryCode"] + recoveryCode: (bool)map["recoveryCode"], + custom: (bool)map["custom"] ); public Dictionary ToMap() => new Dictionary() @@ -48,7 +54,8 @@ bool recoveryCode { "totp", Totp }, { "phone", Phone }, { "email", Email }, - { "recoveryCode", RecoveryCode } + { "recoveryCode", RecoveryCode }, + { "custom", Custom } }; } } diff --git a/Appwrite/Models/Organization.cs b/Appwrite/Models/Organization.cs index babb60f2..41ecc876 100644 --- a/Appwrite/Models/Organization.cs +++ b/Appwrite/Models/Organization.cs @@ -30,7 +30,7 @@ public class Organization public Preferences Prefs { get; private set; } [JsonPropertyName("billingBudget")] - public long BillingBudget { get; private set; } + public long? BillingBudget { get; private set; } [JsonPropertyName("budgetAlerts")] public List BudgetAlerts { get; private set; } @@ -57,7 +57,7 @@ public class Organization public string BillingNextInvoiceDate { get; private set; } [JsonPropertyName("billingTrialStartDate")] - public string BillingTrialStartDate { get; private set; } + public string? BillingTrialStartDate { get; private set; } [JsonPropertyName("billingTrialDays")] public long BillingTrialDays { get; private set; } @@ -72,40 +72,40 @@ public class Organization public string PaymentMethodId { get; private set; } [JsonPropertyName("billingAddressId")] - public string BillingAddressId { get; private set; } + public string? BillingAddressId { get; private set; } [JsonPropertyName("backupPaymentMethodId")] - public string BackupPaymentMethodId { get; private set; } + public string? BackupPaymentMethodId { get; private set; } [JsonPropertyName("status")] public string Status { get; private set; } [JsonPropertyName("remarks")] - public string Remarks { get; private set; } + public string? Remarks { get; private set; } [JsonPropertyName("agreementBAA")] - public string AgreementBAA { get; private set; } + public string? AgreementBAA { get; private set; } [JsonPropertyName("programManagerName")] - public string ProgramManagerName { get; private set; } + public string? ProgramManagerName { get; private set; } [JsonPropertyName("programManagerCalendar")] - public string ProgramManagerCalendar { get; private set; } + public string? ProgramManagerCalendar { get; private set; } [JsonPropertyName("programDiscordChannelName")] - public string ProgramDiscordChannelName { get; private set; } + public string? ProgramDiscordChannelName { get; private set; } [JsonPropertyName("programDiscordChannelUrl")] - public string ProgramDiscordChannelUrl { get; private set; } + public string? ProgramDiscordChannelUrl { get; private set; } [JsonPropertyName("billingLimits")] public BillingLimits? BillingLimits { get; private set; } [JsonPropertyName("billingPlanDowngrade")] - public string BillingPlanDowngrade { get; private set; } + public string? BillingPlanDowngrade { get; private set; } [JsonPropertyName("billingTaxId")] - public string BillingTaxId { get; private set; } + public string? BillingTaxId { get; private set; } [JsonPropertyName("markedForDeletion")] public bool MarkedForDeletion { get; private set; } @@ -123,7 +123,7 @@ public Organization( string name, long total, Preferences prefs, - long billingBudget, + long? billingBudget, List budgetAlerts, string billingPlan, string billingPlanId, @@ -132,23 +132,23 @@ public Organization( string billingStartDate, string billingCurrentInvoiceDate, string billingNextInvoiceDate, - string billingTrialStartDate, + string? billingTrialStartDate, long billingTrialDays, string billingAggregationId, string billingInvoiceId, string paymentMethodId, - string billingAddressId, - string backupPaymentMethodId, + string? billingAddressId, + string? backupPaymentMethodId, string status, - string remarks, - string agreementBAA, - string programManagerName, - string programManagerCalendar, - string programDiscordChannelName, - string programDiscordChannelUrl, + string? remarks, + string? agreementBAA, + string? programManagerName, + string? programManagerCalendar, + string? programDiscordChannelName, + string? programDiscordChannelUrl, BillingLimits? billingLimits, - string billingPlanDowngrade, - string billingTaxId, + string? billingPlanDowngrade, + string? billingTaxId, bool markedForDeletion, string platform, List projects @@ -198,7 +198,9 @@ List projects name: map["name"].ToString(), total: Convert.ToInt64(map["total"]), prefs: Appwrite.Models.Preferences.From(map: map["prefs"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["prefs"]), - billingBudget: Convert.ToInt64(map["billingBudget"]), + billingBudget: map.TryGetValue("billingBudget", out var numberRaw7) && numberRaw7 != null + ? Convert.ToInt64(numberRaw7) + : null, budgetAlerts: map["budgetAlerts"].ConvertToList(), billingPlan: map["billingPlan"].ToString(), billingPlanId: map["billingPlanId"].ToString(), @@ -207,25 +209,25 @@ List projects billingStartDate: map["billingStartDate"].ToString(), billingCurrentInvoiceDate: map["billingCurrentInvoiceDate"].ToString(), billingNextInvoiceDate: map["billingNextInvoiceDate"].ToString(), - billingTrialStartDate: map["billingTrialStartDate"].ToString(), + billingTrialStartDate: map.TryGetValue("billingTrialStartDate", out var billingTrialStartDate) ? billingTrialStartDate?.ToString() : null, billingTrialDays: Convert.ToInt64(map["billingTrialDays"]), billingAggregationId: map["billingAggregationId"].ToString(), billingInvoiceId: map["billingInvoiceId"].ToString(), paymentMethodId: map["paymentMethodId"].ToString(), - billingAddressId: map["billingAddressId"].ToString(), - backupPaymentMethodId: map["backupPaymentMethodId"].ToString(), + billingAddressId: map.TryGetValue("billingAddressId", out var billingAddressId) ? billingAddressId?.ToString() : null, + backupPaymentMethodId: map.TryGetValue("backupPaymentMethodId", out var backupPaymentMethodId) ? backupPaymentMethodId?.ToString() : null, status: map["status"].ToString(), - remarks: map["remarks"].ToString(), - agreementBAA: map["agreementBAA"].ToString(), - programManagerName: map["programManagerName"].ToString(), - programManagerCalendar: map["programManagerCalendar"].ToString(), - programDiscordChannelName: map["programDiscordChannelName"].ToString(), - programDiscordChannelUrl: map["programDiscordChannelUrl"].ToString(), + remarks: map.TryGetValue("remarks", out var remarks) ? remarks?.ToString() : null, + agreementBAA: map.TryGetValue("agreementBAA", out var agreementBAA) ? agreementBAA?.ToString() : null, + programManagerName: map.TryGetValue("programManagerName", out var programManagerName) ? programManagerName?.ToString() : null, + programManagerCalendar: map.TryGetValue("programManagerCalendar", out var programManagerCalendar) ? programManagerCalendar?.ToString() : null, + programDiscordChannelName: map.TryGetValue("programDiscordChannelName", out var programDiscordChannelName) ? programDiscordChannelName?.ToString() : null, + programDiscordChannelUrl: map.TryGetValue("programDiscordChannelUrl", out var programDiscordChannelUrl) ? programDiscordChannelUrl?.ToString() : null, billingLimits: map.TryGetValue("billingLimits", out var objectRaw30) && objectRaw30 != null ? Appwrite.Models.BillingLimits.From(map: objectRaw30 is JsonElement jsonObj30 ? jsonObj30.Deserialize>()! : (Dictionary)objectRaw30) : null, - billingPlanDowngrade: map["billingPlanDowngrade"].ToString(), - billingTaxId: map["billingTaxId"].ToString(), + billingPlanDowngrade: map.TryGetValue("billingPlanDowngrade", out var billingPlanDowngrade) ? billingPlanDowngrade?.ToString() : null, + billingTaxId: map.TryGetValue("billingTaxId", out var billingTaxId) ? billingTaxId?.ToString() : null, markedForDeletion: (bool)map["markedForDeletion"], platform: map["platform"].ToString(), projects: map["projects"].ConvertToList() diff --git a/Appwrite/Models/PolicyMfaFactors.cs b/Appwrite/Models/PolicyMfaFactors.cs new file mode 100644 index 00000000..789e7c1b --- /dev/null +++ b/Appwrite/Models/PolicyMfaFactors.cs @@ -0,0 +1,61 @@ + +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 PolicyMfaFactors + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("totp")] + public bool Totp { get; private set; } + + [JsonPropertyName("email")] + public bool Email { get; private set; } + + [JsonPropertyName("phone")] + public bool Phone { get; private set; } + + [JsonPropertyName("custom")] + public bool Custom { get; private set; } + + public PolicyMfaFactors( + string id, + bool totp, + bool email, + bool phone, + bool custom + ) + { + Id = id; + Totp = totp; + Email = email; + Phone = phone; + Custom = custom; + } + + public static PolicyMfaFactors From(Dictionary map) => new PolicyMfaFactors( + id: map["$id"].ToString(), + totp: (bool)map["totp"], + email: (bool)map["email"], + phone: (bool)map["phone"], + custom: (bool)map["custom"] + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "totp", Totp }, + { "email", Email }, + { "phone", Phone }, + { "custom", Custom } + }; + } +} diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index e1ac7125..40a48031 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -110,6 +110,9 @@ public class Project [JsonPropertyName("oAuth2ServerDefaultScopes")] public List? OAuth2ServerDefaultScopes { get; private set; } + [JsonPropertyName("oAuth2ServerInstallationScopes")] + public List? OAuth2ServerInstallationScopes { get; private set; } + [JsonPropertyName("oAuth2ServerAuthorizationDetailsTypes")] public List? OAuth2ServerAuthorizationDetailsTypes { get; private set; } @@ -180,6 +183,7 @@ public Project( string? oAuth2ServerAuthorizationUrl, List? oAuth2ServerScopes, List? oAuth2ServerDefaultScopes, + List? oAuth2ServerInstallationScopes, List? oAuth2ServerAuthorizationDetailsTypes, long? oAuth2ServerAccessTokenDuration, long? oAuth2ServerRefreshTokenDuration, @@ -227,6 +231,7 @@ public Project( OAuth2ServerAuthorizationUrl = oAuth2ServerAuthorizationUrl; OAuth2ServerScopes = oAuth2ServerScopes; OAuth2ServerDefaultScopes = oAuth2ServerDefaultScopes; + OAuth2ServerInstallationScopes = oAuth2ServerInstallationScopes; OAuth2ServerAuthorizationDetailsTypes = oAuth2ServerAuthorizationDetailsTypes; OAuth2ServerAccessTokenDuration = oAuth2ServerAccessTokenDuration; OAuth2ServerRefreshTokenDuration = oAuth2ServerRefreshTokenDuration; @@ -283,34 +288,37 @@ public Project( oAuth2ServerDefaultScopes: map.TryGetValue("oAuth2ServerDefaultScopes", out var arrayRaw33) && arrayRaw33 != null ? arrayRaw33.ConvertToList() : null, - oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw34) && arrayRaw34 != null + oAuth2ServerInstallationScopes: map.TryGetValue("oAuth2ServerInstallationScopes", out var arrayRaw34) && arrayRaw34 != null ? arrayRaw34.ConvertToList() : null, - oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw35) && numberRaw35 != null - ? Convert.ToInt64(numberRaw35) - : null, - oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw36) && numberRaw36 != null + oAuth2ServerAuthorizationDetailsTypes: map.TryGetValue("oAuth2ServerAuthorizationDetailsTypes", out var arrayRaw35) && arrayRaw35 != null + ? arrayRaw35.ConvertToList() + : null, + oAuth2ServerAccessTokenDuration: map.TryGetValue("oAuth2ServerAccessTokenDuration", out var numberRaw36) && numberRaw36 != null ? Convert.ToInt64(numberRaw36) : null, - oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw37) && numberRaw37 != null + oAuth2ServerRefreshTokenDuration: map.TryGetValue("oAuth2ServerRefreshTokenDuration", out var numberRaw37) && numberRaw37 != null ? Convert.ToInt64(numberRaw37) : null, - oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw38) && numberRaw38 != null + oAuth2ServerPublicAccessTokenDuration: map.TryGetValue("oAuth2ServerPublicAccessTokenDuration", out var numberRaw38) && numberRaw38 != null ? Convert.ToInt64(numberRaw38) : null, - oAuth2ServerInstallationAccessTokenDuration: map.TryGetValue("oAuth2ServerInstallationAccessTokenDuration", out var numberRaw39) && numberRaw39 != null + oAuth2ServerPublicRefreshTokenDuration: map.TryGetValue("oAuth2ServerPublicRefreshTokenDuration", out var numberRaw39) && numberRaw39 != null ? Convert.ToInt64(numberRaw39) : null, - oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw40) && boolRaw40 != null - ? (bool?)boolRaw40 + oAuth2ServerInstallationAccessTokenDuration: map.TryGetValue("oAuth2ServerInstallationAccessTokenDuration", out var numberRaw40) && numberRaw40 != null + ? Convert.ToInt64(numberRaw40) + : null, + oAuth2ServerConfidentialPkce: map.TryGetValue("oAuth2ServerConfidentialPkce", out var boolRaw41) && boolRaw41 != null + ? (bool?)boolRaw41 : null, oAuth2ServerVerificationUrl: map.TryGetValue("oAuth2ServerVerificationUrl", out var oAuth2ServerVerificationUrl) ? oAuth2ServerVerificationUrl?.ToString() : null, - oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw42) && numberRaw42 != null - ? Convert.ToInt64(numberRaw42) + oAuth2ServerUserCodeLength: map.TryGetValue("oAuth2ServerUserCodeLength", out var numberRaw43) && numberRaw43 != null + ? Convert.ToInt64(numberRaw43) : null, oAuth2ServerUserCodeFormat: map.TryGetValue("oAuth2ServerUserCodeFormat", out var oAuth2ServerUserCodeFormat) ? oAuth2ServerUserCodeFormat?.ToString() : null, - oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw44) && numberRaw44 != null - ? Convert.ToInt64(numberRaw44) + oAuth2ServerDeviceCodeDuration: map.TryGetValue("oAuth2ServerDeviceCodeDuration", out var numberRaw45) && numberRaw45 != null + ? Convert.ToInt64(numberRaw45) : null, oAuth2ServerDiscoveryUrl: map.TryGetValue("oAuth2ServerDiscoveryUrl", out var oAuth2ServerDiscoveryUrl) ? oAuth2ServerDiscoveryUrl?.ToString() : null ); @@ -350,6 +358,7 @@ public Project( { "oAuth2ServerAuthorizationUrl", OAuth2ServerAuthorizationUrl }, { "oAuth2ServerScopes", OAuth2ServerScopes }, { "oAuth2ServerDefaultScopes", OAuth2ServerDefaultScopes }, + { "oAuth2ServerInstallationScopes", OAuth2ServerInstallationScopes }, { "oAuth2ServerAuthorizationDetailsTypes", OAuth2ServerAuthorizationDetailsTypes }, { "oAuth2ServerAccessTokenDuration", OAuth2ServerAccessTokenDuration }, { "oAuth2ServerRefreshTokenDuration", OAuth2ServerRefreshTokenDuration }, diff --git a/Appwrite/Models/ProxyInvalidation.cs b/Appwrite/Models/ProxyInvalidation.cs new file mode 100644 index 00000000..50c8d53b --- /dev/null +++ b/Appwrite/Models/ProxyInvalidation.cs @@ -0,0 +1,54 @@ + +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 ProxyInvalidation + { + [JsonPropertyName("domain")] + public string Domain { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("reference")] + public string Reference { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + public ProxyInvalidation( + string domain, + string type, + string reference, + string status + ) + { + Domain = domain; + Type = type; + Reference = reference; + Status = status; + } + + public static ProxyInvalidation From(Dictionary map) => new ProxyInvalidation( + domain: map["domain"].ToString(), + type: map["type"].ToString(), + reference: map["reference"].ToString(), + status: map["status"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "domain", Domain }, + { "type", Type }, + { "reference", Reference }, + { "status", Status } + }; + } +} diff --git a/Appwrite/Models/UsageBillingPlan.cs b/Appwrite/Models/UsageBillingPlan.cs index 978141f0..f2007f1f 100644 --- a/Appwrite/Models/UsageBillingPlan.cs +++ b/Appwrite/Models/UsageBillingPlan.cs @@ -18,7 +18,7 @@ public class UsageBillingPlan public AdditionalResource Executions { get; private set; } [JsonPropertyName("member")] - public AdditionalResource Member { get; private set; } + public AdditionalResource? Member { get; private set; } [JsonPropertyName("realtime")] public AdditionalResource Realtime { get; private set; } @@ -27,7 +27,7 @@ public class UsageBillingPlan public AdditionalResource RealtimeMessages { get; private set; } [JsonPropertyName("realtimeBandwidth")] - public AdditionalResource RealtimeBandwidth { get; private set; } + public AdditionalResource? RealtimeBandwidth { get; private set; } [JsonPropertyName("storage")] public AdditionalResource Storage { get; private set; } @@ -42,20 +42,20 @@ public class UsageBillingPlan public AdditionalResource ImageTransformations { get; private set; } [JsonPropertyName("credits")] - public AdditionalResource Credits { get; private set; } + public AdditionalResource? Credits { get; private set; } public UsageBillingPlan( AdditionalResource bandwidth, AdditionalResource executions, - AdditionalResource member, + AdditionalResource? member, AdditionalResource realtime, AdditionalResource realtimeMessages, - AdditionalResource realtimeBandwidth, + AdditionalResource? realtimeBandwidth, AdditionalResource storage, AdditionalResource users, AdditionalResource gBHours, AdditionalResource imageTransformations, - AdditionalResource credits + AdditionalResource? credits ) { Bandwidth = bandwidth; @@ -74,15 +74,21 @@ AdditionalResource credits public static UsageBillingPlan From(Dictionary map) => new UsageBillingPlan( bandwidth: Appwrite.Models.AdditionalResource.From(map: map["bandwidth"] is JsonElement jsonObj1 ? jsonObj1.Deserialize>()! : (Dictionary)map["bandwidth"]), executions: Appwrite.Models.AdditionalResource.From(map: map["executions"] is JsonElement jsonObj2 ? jsonObj2.Deserialize>()! : (Dictionary)map["executions"]), - member: Appwrite.Models.AdditionalResource.From(map: map["member"] is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)map["member"]), + member: map.TryGetValue("member", out var objectRaw3) && objectRaw3 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw3 is JsonElement jsonObj3 ? jsonObj3.Deserialize>()! : (Dictionary)objectRaw3) + : null, realtime: Appwrite.Models.AdditionalResource.From(map: map["realtime"] is JsonElement jsonObj4 ? jsonObj4.Deserialize>()! : (Dictionary)map["realtime"]), realtimeMessages: Appwrite.Models.AdditionalResource.From(map: map["realtimeMessages"] is JsonElement jsonObj5 ? jsonObj5.Deserialize>()! : (Dictionary)map["realtimeMessages"]), - realtimeBandwidth: Appwrite.Models.AdditionalResource.From(map: map["realtimeBandwidth"] is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)map["realtimeBandwidth"]), + realtimeBandwidth: map.TryGetValue("realtimeBandwidth", out var objectRaw6) && objectRaw6 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw6 is JsonElement jsonObj6 ? jsonObj6.Deserialize>()! : (Dictionary)objectRaw6) + : null, storage: Appwrite.Models.AdditionalResource.From(map: map["storage"] is JsonElement jsonObj7 ? jsonObj7.Deserialize>()! : (Dictionary)map["storage"]), users: Appwrite.Models.AdditionalResource.From(map: map["users"] is JsonElement jsonObj8 ? jsonObj8.Deserialize>()! : (Dictionary)map["users"]), gBHours: Appwrite.Models.AdditionalResource.From(map: map["GBHours"] is JsonElement jsonObj9 ? jsonObj9.Deserialize>()! : (Dictionary)map["GBHours"]), imageTransformations: Appwrite.Models.AdditionalResource.From(map: map["imageTransformations"] is JsonElement jsonObj10 ? jsonObj10.Deserialize>()! : (Dictionary)map["imageTransformations"]), - credits: Appwrite.Models.AdditionalResource.From(map: map["credits"] is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)map["credits"]) + credits: map.TryGetValue("credits", out var objectRaw11) && objectRaw11 != null + ? Appwrite.Models.AdditionalResource.From(map: objectRaw11 is JsonElement jsonObj11 ? jsonObj11.Deserialize>()! : (Dictionary)objectRaw11) + : null ); public Dictionary ToMap() => new Dictionary() diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index 4770a4bb..22a13925 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -407,45 +407,6 @@ public Task DeleteIdentity(string identityId) } - /// - /// Use this endpoint to create a JSON Web Token. You can use the resulting JWT - /// to authenticate on behalf of the current user when working with the - /// Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes - /// from its creation and will be invalid if the user will logout in that time - /// frame. - /// - /// - public Task CreateJWT(long? duration = null) - { - var apiPath = "/account/jwts"; - - var apiParameters = new Dictionary() - { - { "duration", duration } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" }, - { "accept", "application/json" } - }; - - - static Models.JWT Convert(Dictionary it) - { - return Models.JWT.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 the list of latest security activity logs for the currently logged in /// user. Each log returns user IP address, location and date and time of log. diff --git a/Appwrite/Services/Activities.cs b/Appwrite/Services/Activities.cs index 7fe45333..59d25d56 100644 --- a/Appwrite/Services/Activities.cs +++ b/Appwrite/Services/Activities.cs @@ -17,7 +17,7 @@ public Activities(Client client) : base(client) /// List all events for selected filters. /// /// - public Task ListEvents(string? queries = null) + public Task ListEvents(List? queries = null) { var apiPath = "/activities/events"; diff --git a/Appwrite/Services/Apps.cs b/Appwrite/Services/Apps.cs index 1d61f420..99d6a64a 100644 --- a/Appwrite/Services/Apps.cs +++ b/Appwrite/Services/Apps.cs @@ -287,7 +287,8 @@ public Task Delete(string appId) /// /// List installations of an application. Requires an app key sent in the - /// `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + /// `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller + /// with update access to the app. /// /// public Task ListInstallations(string appId, List? queries = null, bool? total = null) @@ -324,7 +325,8 @@ static Models.AppInstallationList Convert(Dictionary it) /// /// Get an installation of an application by its unique ID. Requires an app key - /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, + /// or a caller with update access to the app. /// /// public Task GetInstallation(string appId, string installationId) @@ -358,14 +360,48 @@ static Models.AppInstallation Convert(Dictionary it) } + /// + /// Delete an installation of an application by its unique ID. Requires a + /// caller with update access to the app. Previously issued installation access + /// tokens are revoked. + /// + /// + public Task DeleteInstallation(string appId, string installationId) + { + var apiPath = "/apps/{appId}/installations/{installationId}" + .Replace("{appId}", appId) + .Replace("{installationId}", installationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 a token for an installation of an application. Requires an app key - /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. - /// The returned token carries the scopes and authorization details granted to - /// the installation, and can be used as an `Authorization: Bearer` header - /// everywhere OAuth2 access tokens are accepted. Multiple tokens can be active - /// for the same installation at once; each token stays valid until it expires - /// or the installation is updated or deleted. + /// sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, + /// or a caller with update access to the app. The returned token carries the + /// scopes and authorization details granted to the installation, and can be + /// used as an `Authorization: Bearer` header everywhere OAuth2 access tokens + /// are accepted. Multiple tokens can be active for the same installation at + /// once; each token stays valid until it expires or the installation is + /// updated or deleted. /// /// public Task CreateInstallationToken(string appId, string installationId) diff --git a/Appwrite/Services/Backups.cs b/Appwrite/Services/Backups.cs index 8aed4965..d8ddb688 100644 --- a/Appwrite/Services/Backups.cs +++ b/Appwrite/Services/Backups.cs @@ -329,9 +329,10 @@ public Task DeletePolicy(string policyId) /// Create and trigger a new restoration for a backup on a project. /// /// For a backup of one database, the restoration resolves its destination - /// before it is queued. Pass `newResourceId` to restore into that database ID, - /// including the archived database ID to overwrite it. When `newResourceId` is - /// omitted, a new database ID is generated and returned in `options`. + /// before it is queued. When `newResourceId` is omitted, the archived database + /// is restored in place and its own ID is returned in `options`. Pass a + /// different `newResourceId` to restore alongside it as a new database + /// instead. /// /// The restoration migration records the archived database in `resourceId` and /// `resourceType`, and the resolved database in `destinationResourceId` and @@ -348,9 +349,14 @@ public Task DeletePolicy(string policyId) /// operational `resourceType` of a table migration is not rewritten to /// `tablesdb`. /// - /// When restoring a DocumentsDB or VectorsDB database to a new resource from a - /// dedicated source, the restore provisions a fresh dedicated backing database - /// at the source database's own specification. + /// When restoring a DocumentsDB or VectorsDB database from a dedicated source, + /// the restore provisions a fresh dedicated backing database at the source + /// database's own specification and lands the data there. An in-place restore + /// swaps the database onto that backing only once the restore has succeeded, + /// and retires the backing it displaced only once that swap is confirmed, so + /// the source keeps serving its own data until the restored data is in place + /// and any failure leaves it untouched. A serverless source has no dedicated + /// backing to clone and restores onto the archived database instead. /// /// /// diff --git a/Appwrite/Services/Embeddings.cs b/Appwrite/Services/Embeddings.cs new file mode 100644 index 00000000..32066ac4 --- /dev/null +++ b/Appwrite/Services/Embeddings.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Embeddings : Service + { + public Embeddings(Client client) : base(client) + { + } + + /// + /// Generate vector embeddings for an array of text using the selected + /// embedding model. Use the returned vectors to power semantic search and + /// similarity queries against your vector collections. + /// + /// + /// + public Task CreateTextEmbeddings(List texts, Appwrite.Enums.EmbeddingModel? model = null) + { + var apiPath = "/embeddings/text"; + + var apiParameters = new Dictionary() + { + { "texts", texts }, + { "model", model?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.EmbeddingList Convert(Dictionary it) + { + return Models.EmbeddingList.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); + + } + + } +} diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index e8512f23..7b77c5d4 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -145,48 +145,6 @@ static Models.KeyList Convert(Dictionary it) } - /// - /// Create a new API key. It's recommended to have multiple API keys with - /// strict scopes for separate functions within your project. - /// - /// You can also create an ephemeral API key if you need a short-lived key - /// instead. - /// - /// - public Task CreateKey(string keyId, string name, List scopes, string? expire = null) - { - var apiPath = "/project/keys"; - - var apiParameters = new Dictionary() - { - { "keyId", keyId }, - { "name", name }, - { "scopes", scopes?.Select(e => e.Value).ToList() }, - { "expire", expire } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" }, - { "accept", "application/json" } - }; - - - static Models.Key Convert(Dictionary it) - { - return Models.Key.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); - - } - /// /// Create a new ephemeral API key. It's recommended to have multiple API keys /// with strict scopes for separate functions within your project. @@ -582,7 +540,7 @@ static Models.OAuth2ProviderList Convert(Dictionary it) /// Update the OAuth2 server (OIDC provider) configuration. /// /// - public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, List? authorizationDetailsTypes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, long? installationAccessTokenDuration = null, bool? confidentialPkce = null, string? verificationUrl = null, long? userCodeLength = null, string? userCodeFormat = null, long? deviceCodeDuration = null, List? defaultScopes = null) + public Task UpdateOAuth2Server(bool enabled, string authorizationUrl, List? scopes = null, List? authorizationDetailsTypes = null, long? accessTokenDuration = null, long? refreshTokenDuration = null, long? publicAccessTokenDuration = null, long? publicRefreshTokenDuration = null, long? installationAccessTokenDuration = null, bool? confidentialPkce = null, string? verificationUrl = null, long? userCodeLength = null, string? userCodeFormat = null, long? deviceCodeDuration = null, List? defaultScopes = null, List? installationScopes = null) { var apiPath = "/project/oauth2-server"; @@ -602,7 +560,8 @@ static Models.OAuth2ProviderList Convert(Dictionary it) { "userCodeLength", userCodeLength }, { "userCodeFormat", userCodeFormat }, { "deviceCodeDuration", deviceCodeDuration }, - { "defaultScopes", defaultScopes } + { "defaultScopes", defaultScopes }, + { "installationScopes", installationScopes } }; var apiHeaders = new Dictionary() @@ -3158,6 +3117,48 @@ static Models.Project Convert(Dictionary it) } + /// + /// Updating this policy allows you to control which factors users can use to + /// complete an MFA challenge. Disabled factors cannot be used to create a + /// challenge and are reported as unavailable when listing factors. The custom + /// factor is disabled by default; enable it to deliver challenge codes through + /// your own channel. Recovery codes always remain available as a fallback. + /// + /// + public Task UpdateMFAFactorsPolicy(bool? totp = null, bool? email = null, bool? phone = null, bool? custom = null) + { + var apiPath = "/project/policies/mfa-factors"; + + var apiParameters = new Dictionary() + { + { "totp", totp }, + { "email", email }, + { "phone", phone }, + { "custom", custom } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Project Convert(Dictionary it) + { + return Models.Project.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); + + } + /// /// Updating this policy allows you to control if new passwords are checked /// against most common passwords dictionary. When enabled, and user changes @@ -3563,19 +3564,23 @@ static object Convert(Dictionary it) { return Appwrite.Models.PolicyMembershipPrivacy.From(map: it); } - if (it.TryGetValue("$id", out var idValue11) && idValue11?.ToString() == "deny-aliased-email") + if (it.TryGetValue("$id", out var idValue11) && idValue11?.ToString() == "mfa-factors") + { + return Appwrite.Models.PolicyMfaFactors.From(map: it); + } + if (it.TryGetValue("$id", out var idValue12) && idValue12?.ToString() == "deny-aliased-email") { return Appwrite.Models.PolicyDenyAliasedEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue12) && idValue12?.ToString() == "deny-disposable-email") + if (it.TryGetValue("$id", out var idValue13) && idValue13?.ToString() == "deny-disposable-email") { return Appwrite.Models.PolicyDenyDisposableEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue13) && idValue13?.ToString() == "deny-free-email") + if (it.TryGetValue("$id", out var idValue14) && idValue14?.ToString() == "deny-free-email") { return Appwrite.Models.PolicyDenyFreeEmail.From(map: it); } - if (it.TryGetValue("$id", out var idValue14) && idValue14?.ToString() == "deny-corporate-email") + if (it.TryGetValue("$id", out var idValue15) && idValue15?.ToString() == "deny-corporate-email") { return Appwrite.Models.PolicyDenyCorporateEmail.From(map: it); } diff --git a/Appwrite/Services/Proxy.cs b/Appwrite/Services/Proxy.cs index 9f1e2a6d..b64feee0 100644 --- a/Appwrite/Services/Proxy.cs +++ b/Appwrite/Services/Proxy.cs @@ -13,6 +13,47 @@ public Proxy(Client client) : base(client) { } + /// + /// Create a new CDN cache invalidation for a domain. Executes a hard purge of + /// cached content. + /// + /// Depending on type, the invalidation purges a single cache tag, a single URL + /// path, or all cached content for the domain. + /// + /// + public Task CreateInvalidation(string domain, Appwrite.Enums.InvalidationType type, string? reference = null) + { + var apiPath = "/proxy/invalidations"; + + var apiParameters = new Dictionary() + { + { "domain", domain }, + { "type", type?.Value }, + { "reference", reference } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.ProxyInvalidation Convert(Dictionary it) + { + return Models.ProxyInvalidation.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 list of all the proxy rules. You can use the query params to filter /// your results. diff --git a/Appwrite/Services/Storage.cs b/Appwrite/Services/Storage.cs index 22608c88..0e6a1ebe 100644 --- a/Appwrite/Services/Storage.cs +++ b/Appwrite/Services/Storage.cs @@ -263,7 +263,7 @@ static Models.FileList Convert(Dictionary it) /// /// /// - public Task CreateFile(string bucketId, string fileId, InputFile file, List? permissions = null, Action? onProgress = null) + public Task CreateFile(string bucketId, string fileId, InputFile file, List? permissions = null, string? folder = null, Action? onProgress = null) { var apiPath = "/storage/buckets/{bucketId}/files" .Replace("{bucketId}", bucketId); @@ -272,7 +272,8 @@ static Models.FileList Convert(Dictionary it) { { "fileId", fileId }, { "file", file }, - { "permissions", permissions } + { "permissions", permissions }, + { "folder", folder } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index 698efe09..d3ca30db 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -55,7 +55,7 @@ static Models.DatabaseList Convert(Dictionary it) /// /// /// - public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null) + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) { var apiPath = "/tablesdb"; @@ -65,7 +65,8 @@ static Models.DatabaseList Convert(Dictionary it) { "name", name }, { "enabled", enabled }, { "specification", specification }, - { "replicas", replicas } + { "replicas", replicas }, + { "syncMode", syncMode } }; var apiHeaders = new Dictionary() @@ -369,7 +370,7 @@ static Models.Database Convert(Dictionary it) /// Update a database by its unique ID. /// /// - public Task Update(string databaseId, string? name = null, bool? enabled = null, long? replicas = null) + public Task Update(string databaseId, string? name = null, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) { var apiPath = "/tablesdb/{databaseId}" .Replace("{databaseId}", databaseId); @@ -378,7 +379,9 @@ static Models.Database Convert(Dictionary it) { { "name", name }, { "enabled", enabled }, - { "replicas", replicas } + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } }; var apiHeaders = new Dictionary() @@ -436,7 +439,9 @@ public Task Delete(string databaseId) /// /// Trigger a manual failover for a dedicated database with high availability /// enabled. Promotes a replica to primary. The failover runs asynchronously; - /// poll the database document for status updates. + /// poll the database document for status updates. A database left + /// mid-operation by a failover that did not finish also accepts this call as a + /// repair, provided `targetReplicaId` names the member to promote. /// /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) @@ -471,6 +476,228 @@ static Models.DedicatedDatabase Convert(Dictionary it) } + /// + /// List the dedicated migrations for a TablesDB database. A database has at + /// most one in-flight migration. + /// + /// + public Task ListMigrations(string databaseId) + { + var apiPath = "/tablesdb/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseMigrationList Convert(Dictionary it) + { + return Models.DatabaseMigrationList.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); + + } + + /// + /// Start migrating a serverless TablesDB database onto a dedicated MySQL + /// compute. Data is copied to the target while the source stays live, with a + /// brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string specification, bool? autoCutover = null) + { + var apiPath = "/tablesdb/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "specification", specification }, + { "autoCutover", autoCutover } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DatabaseMigration Convert(Dictionary it) + { + return Models.DatabaseMigration.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 single dedicated migration for a TablesDB database by its ID. + /// + /// + public Task GetMigration(string databaseId, string migrationId) + { + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}" + .Replace("{databaseId}", databaseId) + .Replace("{migrationId}", migrationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseMigration Convert(Dictionary it) + { + return Models.DatabaseMigration.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); + + } + + /// + /// Abort an in-flight TablesDB dedicated migration. Only allowed before + /// cutover; once the migration has cut over it cannot be aborted. + /// + /// + public Task DeleteMigration(string databaseId, string migrationId) + { + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}" + .Replace("{databaseId}", databaseId) + .Replace("{migrationId}", migrationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Cut a verified TablesDB migration over to its dedicated compute. Only + /// applies to a migration created with `autoCutover` disabled, which waits at + /// `ready_to_cutover` until this is called. The routing flip happens shortly + /// after this returns, with a brief read-only window. One call buys one + /// attempt: a cutover that fails a check returns the migration to `verifying` + /// and parks it again, so call this once more to retry. + /// + /// + public Task CutoverMigration(string databaseId, string migrationId) + { + var apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}/cutover" + .Replace("{databaseId}", databaseId) + .Replace("{migrationId}", migrationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DatabaseMigration Convert(Dictionary it) + { + return Models.DatabaseMigration.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/tablesdb/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 high availability status for a dedicated database. Returns replica /// statuses, replication lag, and sync mode. diff --git a/Appwrite/Services/Users.cs b/Appwrite/Services/Users.cs index deee23c3..d7a8ee4d 100644 --- a/Appwrite/Services/Users.cs +++ b/Appwrite/Services/Users.cs @@ -883,6 +883,42 @@ public Task DeleteMFAAuthenticator(string userId, Appwrite.Enums.Authent } + /// + /// Get a custom MFA challenge for a user, including the code to be delivered + /// through your own channel. + /// + /// + public Task GetMFAChallenge(string userId, string challengeId) + { + var apiPath = "/users/{userId}/mfa/challenges/{challengeId}" + .Replace("{userId}", userId) + .Replace("{challengeId}", challengeId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.MfaChallengeSecret Convert(Dictionary it) + { + return Models.MfaChallengeSecret.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); + + } + /// /// List the factors available on the account to be used as a MFA challange. /// diff --git a/CHANGELOG.md b/CHANGELOG.md index ebaa0a63..7d4bd50c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 7.0.0 + +* Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either +* Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke +* Breaking: `activities.listEvents` `queries` now takes an array instead of a string +* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum +* Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` +* Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum +* Added: `apps.deleteInstallation` +* Added: `users.getMFAChallenge` and the `MfaChallengeSecret` model +* Added: `project.updateMFAFactorsPolicy` and the `PolicyMfaFactors` model +* Added: `client.setOrganization` for organization-scoped requests +* Added: `folder` parameter to `storage.createFile` +* Added: `syncMode` parameter to `tablesDB.create` and `tablesDB.update`, and `specification` to `tablesDB.update` +* Added: `installationScopes` parameter to `project.updateOAuth2Server` +* Added: `custom` authentication factor, `node-26` runtime, `mfa-factors` project policy, and the `embeddings.write` and `proxy.invalidations.write` key scopes +* Updated: response format to `1.9.6` + ## 6.1.0 * Added: `Apps` service for managing OAuth2 applications, keys, and installations diff --git a/README.md b/README.md index 403299bf..46bd11ae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite .NET SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-dotnet.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.6-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) @@ -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 6.1.0 +Install-Package Appwrite -Version 7.0.0 # or .NET CLI -dotnet add package Appwrite --version 6.1.0 +dotnet add package Appwrite --version 7.0.0 ``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index 817589b9..dc0ad42d 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -11,5 +11,5 @@ Client client = new Client() Activities activities = new Activities(client); ActivityEventList result = await activities.ListEvents( - queries: "" // optional + queries: new List() // optional );``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index 9205d289..c28cc638 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -6,7 +6,7 @@ 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 + .SetSession(""); // The user session to authenticate with Apps apps = new Apps(client); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/apps/delete-installation.md similarity index 71% rename from docs/examples/account/create-jwt.md rename to docs/examples/apps/delete-installation.md index 71ea697d..81545045 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/apps/delete-installation.md @@ -8,8 +8,9 @@ Client client = new Client() .SetProject("") // Your project ID .SetSession(""); // The user session to authenticate with -Account account = new Account(client); +Apps apps = new Apps(client); -JWT result = await account.CreateJWT( - duration: 0 // optional +await apps.DeleteInstallation( + appId: "", + installationId: "" );``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 1a353ec1..4102d094 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -6,7 +6,7 @@ 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 + .SetSession(""); // The user session to authenticate with Apps apps = new Apps(client); diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index fbb59ab0..6b800561 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -6,7 +6,7 @@ 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 + .SetSession(""); // The user session to authenticate with Apps apps = new Apps(client); diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 00000000..64848cd2 --- /dev/null +++ b/docs/examples/embeddings/create-text-embeddings.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 + +Embeddings embeddings = new Embeddings(client); + +EmbeddingList result = await embeddings.CreateTextEmbeddings( + texts: new List(), + model: EmbeddingModel.NomicEmbedText // optional +);``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/update-mfa-factors-policy.md similarity index 58% rename from docs/examples/project/create-key.md rename to docs/examples/project/update-mfa-factors-policy.md index bc4d52ab..b1d4ccf9 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -1,6 +1,5 @@ ```csharp using Appwrite; -using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -11,9 +10,9 @@ Client client = new Client() Project project = new Project(client); -Key result = await project.CreateKey( - keyId: "", - name: "", - scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, - expire: "2020-10-15T06:38:00.000+00:00" // optional +Project result = await project.UpdateMFAFactorsPolicy( + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional );``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 5c66be76..615e1621 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -25,5 +25,6 @@ Project result = await project.UpdateOAuth2Server( userCodeLength: 6, // optional userCodeFormat: "numeric", // optional deviceCodeDuration: 60, // optional - defaultScopes: new List() // optional + defaultScopes: new List(), // optional + installationScopes: new List() // optional );``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 347c9c9e..bfe9a07e 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -11,5 +11,5 @@ Client client = new Client() Project project = new Project(client); Project result = await project.UpdateSessionDurationPolicy( - duration: 5 + duration: 60 );``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index 99dc7442..aea79aaf 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -11,5 +11,5 @@ Client client = new Client() Project project = new Project(client); Project result = await project.UpdateUserLimitPolicy( - total: 1 + total: 0 );``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md new file mode 100644 index 00000000..8fe43e67 --- /dev/null +++ b/docs/examples/proxy/create-invalidation.md @@ -0,0 +1,18 @@ +```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 + +Proxy proxy = new Proxy(client); + +ProxyInvalidation result = await proxy.CreateInvalidation( + domain: "", + type: InvalidationType.Tag, + reference: "" // optional +);``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 356120e7..c471f283 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -14,5 +14,6 @@ File result = await storage.CreateFile( bucketId: "", fileId: "", file: InputFile.FromPath("./path-to-files/image.jpg"), - permissions: new List { Permission.Read(Role.Any()) } // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + folder: "" // optional );``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md new file mode 100644 index 00000000..8318f4f6 --- /dev/null +++ b/docs/examples/tablesdb/create-migration.md @@ -0,0 +1,17 @@ +```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 + +TablesDB tablesDB = new TablesDB(client); + +DatabaseMigration result = await tablesDB.CreateMigration( + databaseId: "", + specification: "s-1vcpu-1gb", + autoCutover: false // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index a5a42f36..717cca18 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -15,5 +15,6 @@ Database result = await tablesDB.Create( name: "", enabled: false, // optional specification: "serverless", // optional - replicas: 0 // optional + replicas: 0, // optional + syncMode: "async" // optional );``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md new file mode 100644 index 00000000..e82c3a25 --- /dev/null +++ b/docs/examples/tablesdb/cutover-migration.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 + +TablesDB tablesDB = new TablesDB(client); + +DatabaseMigration result = await tablesDB.CutoverMigration( + databaseId: "", + migrationId: "" +);``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md new file mode 100644 index 00000000..4be3a7cc --- /dev/null +++ b/docs/examples/tablesdb/delete-migration.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 + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteMigration( + databaseId: "", + migrationId: "" +);``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md new file mode 100644 index 00000000..9e5e1525 --- /dev/null +++ b/docs/examples/tablesdb/get-migration.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 + +TablesDB tablesDB = new TablesDB(client); + +DatabaseMigration result = await tablesDB.GetMigration( + databaseId: "", + migrationId: "" +);``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md new file mode 100644 index 00000000..4fce8998 --- /dev/null +++ b/docs/examples/tablesdb/list-migrations.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 + +TablesDB tablesDB = new TablesDB(client); + +DatabaseMigrationList result = await tablesDB.ListMigrations( + databaseId: "" +);``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md new file mode 100644 index 00000000..a4599ac5 --- /dev/null +++ b/docs/examples/tablesdb/list-operations.md @@ -0,0 +1,18 @@ +```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 + +TablesDB tablesDB = new TablesDB(client); + +DedicatedDatabaseOperationList result = await tablesDB.ListOperations( + databaseId: "", + status: "running", // optional + limit: 1, // optional + offset: 0 // optional +);``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index ebd66bec..132a1681 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -14,5 +14,7 @@ Database result = await tablesDB.Update( databaseId: "", name: "", // optional enabled: false, // optional - replicas: 0 // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional );``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md new file mode 100644 index 00000000..810ea136 --- /dev/null +++ b/docs/examples/users/get-mfa-challenge.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 + +Users users = new Users(client); + +MfaChallengeSecret result = await users.GetMFAChallenge( + userId: "", + challengeId: "" +);``` From d3ff4f8190de1f00d9e63ef6d71fc92584151c36 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 13:51:39 +0530 Subject: [PATCH 07/10] chore: update .NET SDK to 7.0.0 --- Appwrite/Enums/EmbeddingModel.cs | 19 ------- Appwrite/Models/Embedding.cs | 54 ------------------ Appwrite/Models/EmbeddingList.cs | 40 ------------- Appwrite/Services/Embeddings.cs | 56 ------------------- CHANGELOG.md | 1 - .../embeddings/create-text-embeddings.md | 17 ------ 6 files changed, 187 deletions(-) delete mode 100644 Appwrite/Enums/EmbeddingModel.cs delete mode 100644 Appwrite/Models/Embedding.cs delete mode 100644 Appwrite/Models/EmbeddingList.cs delete mode 100644 Appwrite/Services/Embeddings.cs delete mode 100644 docs/examples/embeddings/create-text-embeddings.md diff --git a/Appwrite/Enums/EmbeddingModel.cs b/Appwrite/Enums/EmbeddingModel.cs deleted file mode 100644 index d4d52921..00000000 --- a/Appwrite/Enums/EmbeddingModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Appwrite.Enums -{ - public class EmbeddingModel : IEnum - { - public string Value { get; private set; } - - public EmbeddingModel(string value) - { - Value = value; - } - - public static EmbeddingModel NomicEmbedText => new EmbeddingModel("nomic-embed-text"); - public static EmbeddingModel EmbeddingGemma => new EmbeddingModel("embedding-gemma"); - public static EmbeddingModel AllMinilm => new EmbeddingModel("all-minilm"); - public static EmbeddingModel BgeSmall => new EmbeddingModel("bge-small"); - } -} diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs deleted file mode 100644 index e4490112..00000000 --- a/Appwrite/Models/Embedding.cs +++ /dev/null @@ -1,54 +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 Embedding - { - [JsonPropertyName("model")] - public string Model { get; private set; } - - [JsonPropertyName("dimension")] - public long Dimension { get; private set; } - - [JsonPropertyName("embedding")] - public List XEmbedding { get; private set; } - - [JsonPropertyName("error")] - public string Error { get; private set; } - - public Embedding( - string model, - long dimension, - List embedding, - string error - ) - { - Model = model; - Dimension = dimension; - XEmbedding = embedding; - Error = error; - } - - public static Embedding From(Dictionary map) => new Embedding( - model: map["model"].ToString(), - dimension: Convert.ToInt64(map["dimension"]), - embedding: map["embedding"].ConvertToList(), - error: map["error"].ToString() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "model", Model }, - { "dimension", Dimension }, - { "embedding", XEmbedding }, - { "error", Error } - }; - } -} diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs deleted file mode 100644 index 98dc63b6..00000000 --- a/Appwrite/Models/EmbeddingList.cs +++ /dev/null @@ -1,40 +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 EmbeddingList - { - [JsonPropertyName("total")] - public long Total { get; private set; } - - [JsonPropertyName("embeddings")] - public List Embeddings { get; private set; } - - public EmbeddingList( - long total, - List embeddings - ) - { - Total = total; - Embeddings = embeddings; - } - - public static EmbeddingList From(Dictionary map) => new EmbeddingList( - total: Convert.ToInt64(map["total"]), - embeddings: map["embeddings"].ConvertToList>().Select(it => Appwrite.Models.Embedding.From(map: it)).ToList() - ); - - public Dictionary ToMap() => new Dictionary() - { - { "total", Total }, - { "embeddings", Embeddings?.Select(it => it.ToMap()).ToList() } - }; - } -} diff --git a/Appwrite/Services/Embeddings.cs b/Appwrite/Services/Embeddings.cs deleted file mode 100644 index 32066ac4..00000000 --- a/Appwrite/Services/Embeddings.cs +++ /dev/null @@ -1,56 +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 Embeddings : Service - { - public Embeddings(Client client) : base(client) - { - } - - /// - /// Generate vector embeddings for an array of text using the selected - /// embedding model. Use the returned vectors to power semantic search and - /// similarity queries against your vector collections. - /// - /// - /// - public Task CreateTextEmbeddings(List texts, Appwrite.Enums.EmbeddingModel? model = null) - { - var apiPath = "/embeddings/text"; - - var apiParameters = new Dictionary() - { - { "texts", texts }, - { "model", model?.Value } - }; - - var apiHeaders = new Dictionary() - { - { "X-Appwrite-Project", _client.GetConfig("project") }, - { "content-type", "application/json" }, - { "accept", "application/json" } - }; - - - static Models.EmbeddingList Convert(Dictionary it) - { - return Models.EmbeddingList.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); - - } - - } -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4bd50c..2cc6af8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either * Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke * Breaking: `activities.listEvents` `queries` now takes an array instead of a string -* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum * Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` * Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum * Added: `apps.deleteInstallation` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md deleted file mode 100644 index 64848cd2..00000000 --- a/docs/examples/embeddings/create-text-embeddings.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 - -Embeddings embeddings = new Embeddings(client); - -EmbeddingList result = await embeddings.CreateTextEmbeddings( - texts: new List(), - model: EmbeddingModel.NomicEmbedText // optional -);``` From b7da97c31ea626705fe4a23c7155d301e30f2d10 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 14:01:16 +0530 Subject: [PATCH 08/10] chore: update .NET SDK to 7.0.0 --- Appwrite/Enums/EmbeddingModel.cs | 19 +++++++ Appwrite/Models/Embedding.cs | 54 ++++++++++++++++++ Appwrite/Models/EmbeddingList.cs | 40 +++++++++++++ Appwrite/Services/Embeddings.cs | 56 +++++++++++++++++++ CHANGELOG.md | 1 + .../embeddings/create-text-embeddings.md | 17 ++++++ 6 files changed, 187 insertions(+) create mode 100644 Appwrite/Enums/EmbeddingModel.cs create mode 100644 Appwrite/Models/Embedding.cs create mode 100644 Appwrite/Models/EmbeddingList.cs create mode 100644 Appwrite/Services/Embeddings.cs create mode 100644 docs/examples/embeddings/create-text-embeddings.md diff --git a/Appwrite/Enums/EmbeddingModel.cs b/Appwrite/Enums/EmbeddingModel.cs new file mode 100644 index 00000000..d4d52921 --- /dev/null +++ b/Appwrite/Enums/EmbeddingModel.cs @@ -0,0 +1,19 @@ +using System; + +namespace Appwrite.Enums +{ + public class EmbeddingModel : IEnum + { + public string Value { get; private set; } + + public EmbeddingModel(string value) + { + Value = value; + } + + public static EmbeddingModel NomicEmbedText => new EmbeddingModel("nomic-embed-text"); + public static EmbeddingModel EmbeddingGemma => new EmbeddingModel("embedding-gemma"); + public static EmbeddingModel AllMinilm => new EmbeddingModel("all-minilm"); + public static EmbeddingModel BgeSmall => new EmbeddingModel("bge-small"); + } +} diff --git a/Appwrite/Models/Embedding.cs b/Appwrite/Models/Embedding.cs new file mode 100644 index 00000000..e4490112 --- /dev/null +++ b/Appwrite/Models/Embedding.cs @@ -0,0 +1,54 @@ + +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 Embedding + { + [JsonPropertyName("model")] + public string Model { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + [JsonPropertyName("embedding")] + public List XEmbedding { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public Embedding( + string model, + long dimension, + List embedding, + string error + ) + { + Model = model; + Dimension = dimension; + XEmbedding = embedding; + Error = error; + } + + public static Embedding From(Dictionary map) => new Embedding( + model: map["model"].ToString(), + dimension: Convert.ToInt64(map["dimension"]), + embedding: map["embedding"].ConvertToList(), + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "model", Model }, + { "dimension", Dimension }, + { "embedding", XEmbedding }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/EmbeddingList.cs b/Appwrite/Models/EmbeddingList.cs new file mode 100644 index 00000000..98dc63b6 --- /dev/null +++ b/Appwrite/Models/EmbeddingList.cs @@ -0,0 +1,40 @@ + +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 EmbeddingList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("embeddings")] + public List Embeddings { get; private set; } + + public EmbeddingList( + long total, + List embeddings + ) + { + Total = total; + Embeddings = embeddings; + } + + public static EmbeddingList From(Dictionary map) => new EmbeddingList( + total: Convert.ToInt64(map["total"]), + embeddings: map["embeddings"].ConvertToList>().Select(it => Appwrite.Models.Embedding.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "embeddings", Embeddings?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Services/Embeddings.cs b/Appwrite/Services/Embeddings.cs new file mode 100644 index 00000000..32066ac4 --- /dev/null +++ b/Appwrite/Services/Embeddings.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Embeddings : Service + { + public Embeddings(Client client) : base(client) + { + } + + /// + /// Generate vector embeddings for an array of text using the selected + /// embedding model. Use the returned vectors to power semantic search and + /// similarity queries against your vector collections. + /// + /// + /// + public Task CreateTextEmbeddings(List texts, Appwrite.Enums.EmbeddingModel? model = null) + { + var apiPath = "/embeddings/text"; + + var apiParameters = new Dictionary() + { + { "texts", texts }, + { "model", model?.Value } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.EmbeddingList Convert(Dictionary it) + { + return Models.EmbeddingList.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); + + } + + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc6af8f..7d4bd50c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either * Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke * Breaking: `activities.listEvents` `queries` now takes an array instead of a string +* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum * Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` * Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum * Added: `apps.deleteInstallation` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 00000000..64848cd2 --- /dev/null +++ b/docs/examples/embeddings/create-text-embeddings.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 + +Embeddings embeddings = new Embeddings(client); + +EmbeddingList result = await embeddings.CreateTextEmbeddings( + texts: new List(), + model: EmbeddingModel.NomicEmbedText // optional +);``` From fd3508f61bbc91652c120b411a9fc392d2667777 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 27 Aug 2026 18:01:30 +0530 Subject: [PATCH 09/10] chore: update .NET SDK to 7.1.0-rc.1 --- .editorconfig | 19 + Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 106 +- Appwrite/Enums/BuildRuntime.cs | 1 + Appwrite/Enums/DocumentsDBIndexType.cs | 18 + Appwrite/Enums/EmbeddingModel.cs | 2 - Appwrite/Enums/ExecutionResourceType.cs | 17 + Appwrite/Enums/OAuthProvider.cs | 1 + Appwrite/Enums/ProjectKeyScopes.cs | 15 +- Appwrite/Enums/ProjectOAuthProviderId.cs | 1 + Appwrite/Enums/Runtime.cs | 1 + Appwrite/Enums/VectorsDBIndexType.cs | 21 + Appwrite/Extensions/Extensions.cs | 2 +- Appwrite/Models/AppInstallation.cs | 6 +- Appwrite/Models/AttributeObject.cs | 84 + Appwrite/Models/AttributeVector.cs | 91 ++ Appwrite/Models/BillingPlan.cs | 36 +- Appwrite/Models/Database.cs | 29 +- Appwrite/Models/DatabaseMigration.cs | 7 + Appwrite/Models/DatabaseStatusReplica.cs | 13 +- Appwrite/Models/DedicatedDatabaseBackup.cs | 145 ++ .../Models/DedicatedDatabaseBackupList.cs | 40 + .../Models/DedicatedDatabaseBackupStorage.cs | 61 + Appwrite/Models/DedicatedDatabaseBranch.cs | 110 ++ .../Models/DedicatedDatabaseBranchList.cs | 40 + Appwrite/Models/DedicatedDatabaseExecution.cs | 68 + .../DedicatedDatabaseExecutionColumn.cs | 40 + .../Models/DedicatedDatabaseExtensions.cs | 47 + Appwrite/Models/DedicatedDatabaseList.cs | 40 + Appwrite/Models/DedicatedDatabaseMember.cs | 13 +- .../Models/DedicatedDatabasePITRWindows.cs | 40 + Appwrite/Models/DedicatedDatabasePooler.cs | 96 ++ .../Models/DedicatedDatabaseRestoration.cs | 110 ++ .../DedicatedDatabaseRestorationList.cs | 40 + Appwrite/Models/Execution.cs | 19 +- Appwrite/Models/OAuth2Google.cs | 2 +- Appwrite/Models/OAuth2HuggingFace.cs | 54 + Appwrite/Models/OAuth2Oidc.cs | 2 +- Appwrite/Models/OrderType.cs | 2 +- Appwrite/Models/PostgresExtension.cs | 54 + Appwrite/Models/Project.cs | 8 +- Appwrite/Models/Site.cs | 7 + Appwrite/Models/VectorsdbCollection.cs | 117 ++ Appwrite/Models/VectorsdbCollectionList.cs | 40 + Appwrite/Query.cs | 79 +- Appwrite/Services/Avatars.cs | 47 + Appwrite/Services/DocumentsDB.cs | 1413 ++++++++++++++++ Appwrite/Services/Mongo.cs | 1204 ++++++++++++++ Appwrite/Services/Mysql.cs | 1329 +++++++++++++++ Appwrite/Services/Postgresql.cs | 1437 +++++++++++++++++ Appwrite/Services/Project.cs | 75 +- Appwrite/Services/Sites.cs | 10 +- Appwrite/Services/TablesDB.cs | 8 +- Appwrite/Services/VectorsDB.cs | 1374 ++++++++++++++++ CHANGELOG.md | 14 + README.md | 6 +- .../account/create-anonymous-session.md | 2 + .../account/create-email-password-session.md | 4 +- docs/examples/account/create-email-token.md | 4 +- .../account/create-email-verification.md | 4 +- .../account/create-magic-url-token.md | 4 +- .../account/create-mfa-authenticator.md | 4 +- docs/examples/account/create-mfa-challenge.md | 4 +- .../account/create-mfa-recovery-codes.md | 2 + .../examples/account/create-o-auth-2-token.md | 4 +- docs/examples/account/create-phone-token.md | 4 +- .../account/create-phone-verification.md | 2 + docs/examples/account/create-recovery.md | 4 +- docs/examples/account/create-session.md | 4 +- docs/examples/account/create-verification.md | 4 +- docs/examples/account/create.md | 4 +- docs/examples/account/delete-consent-token.md | 4 +- docs/examples/account/delete-consent.md | 4 +- docs/examples/account/delete-identity.md | 4 +- .../account/delete-mfa-authenticator.md | 4 +- docs/examples/account/delete-session.md | 4 +- docs/examples/account/delete-sessions.md | 2 + docs/examples/account/get-consent-token.md | 4 +- docs/examples/account/get-consent.md | 4 +- .../account/get-mfa-recovery-codes.md | 2 + docs/examples/account/get-prefs.md | 2 + docs/examples/account/get-session.md | 4 +- docs/examples/account/get.md | 2 + docs/examples/account/list-consent-tokens.md | 4 +- docs/examples/account/list-consents.md | 4 +- docs/examples/account/list-identities.md | 4 +- docs/examples/account/list-logs.md | 4 +- docs/examples/account/list-mfa-factors.md | 2 + docs/examples/account/list-sessions.md | 2 + .../account/update-email-verification.md | 4 +- docs/examples/account/update-email.md | 4 +- .../account/update-magic-url-session.md | 4 +- .../account/update-mfa-authenticator.md | 4 +- docs/examples/account/update-mfa-challenge.md | 4 +- .../account/update-mfa-recovery-codes.md | 2 + docs/examples/account/update-mfa.md | 4 +- docs/examples/account/update-name.md | 4 +- docs/examples/account/update-password.md | 4 +- docs/examples/account/update-phone-session.md | 4 +- .../account/update-phone-verification.md | 4 +- docs/examples/account/update-phone.md | 4 +- docs/examples/account/update-prefs.md | 4 +- docs/examples/account/update-recovery.md | 4 +- docs/examples/account/update-session.md | 4 +- docs/examples/account/update-status.md | 2 + docs/examples/account/update-verification.md | 4 +- docs/examples/activities/get-event.md | 4 +- docs/examples/activities/list-events.md | 4 +- docs/examples/advisor/delete-report.md | 4 +- docs/examples/advisor/get-insight.md | 4 +- docs/examples/advisor/get-report.md | 4 +- docs/examples/advisor/list-insights.md | 4 +- docs/examples/advisor/list-reports.md | 4 +- .../apps/create-installation-token.md | 4 +- docs/examples/apps/create-key.md | 4 +- docs/examples/apps/create-secret.md | 4 +- docs/examples/apps/create.md | 4 +- docs/examples/apps/delete-installation.md | 4 +- docs/examples/apps/delete-key.md | 4 +- docs/examples/apps/delete-secret.md | 4 +- docs/examples/apps/delete-tokens.md | 4 +- docs/examples/apps/delete.md | 4 +- docs/examples/apps/get-installation.md | 4 +- docs/examples/apps/get-key.md | 4 +- docs/examples/apps/get-secret.md | 4 +- docs/examples/apps/get.md | 4 +- .../examples/apps/list-installation-scopes.md | 2 + docs/examples/apps/list-installations.md | 4 +- docs/examples/apps/list-keys.md | 4 +- docs/examples/apps/list-o-auth-2-scopes.md | 2 + docs/examples/apps/list-secrets.md | 4 +- docs/examples/apps/list.md | 4 +- docs/examples/apps/update-labels.md | 4 +- docs/examples/apps/update-team.md | 4 +- docs/examples/apps/update.md | 4 +- docs/examples/avatars/get-browser.md | 4 +- docs/examples/avatars/get-credit-card.md | 4 +- docs/examples/avatars/get-favicon.md | 4 +- docs/examples/avatars/get-flag.md | 4 +- docs/examples/avatars/get-image.md | 4 +- docs/examples/avatars/get-initials.md | 6 +- docs/examples/avatars/get-photo.md | 24 + docs/examples/avatars/get-qr.md | 4 +- docs/examples/avatars/get-screenshot.md | 4 +- docs/examples/backups/create-archive.md | 4 +- docs/examples/backups/create-policy.md | 4 +- docs/examples/backups/create-restoration.md | 4 +- docs/examples/backups/delete-archive.md | 4 +- docs/examples/backups/delete-policy.md | 4 +- docs/examples/backups/get-archive.md | 4 +- docs/examples/backups/get-policy.md | 4 +- docs/examples/backups/get-restoration.md | 4 +- docs/examples/backups/list-archives.md | 4 +- docs/examples/backups/list-policies.md | 4 +- docs/examples/backups/list-restorations.md | 4 +- docs/examples/backups/update-policy.md | 4 +- .../databases/create-big-int-attribute.md | 8 +- .../databases/create-boolean-attribute.md | 6 +- docs/examples/databases/create-collection.md | 4 +- .../databases/create-datetime-attribute.md | 6 +- docs/examples/databases/create-document.md | 4 +- docs/examples/databases/create-documents.md | 4 +- .../databases/create-email-attribute.md | 6 +- .../databases/create-enum-attribute.md | 10 +- .../databases/create-float-attribute.md | 10 +- docs/examples/databases/create-index.md | 6 +- .../databases/create-integer-attribute.md | 10 +- .../examples/databases/create-ip-attribute.md | 8 +- .../databases/create-line-attribute.md | 6 +- .../databases/create-longtext-attribute.md | 8 +- .../databases/create-mediumtext-attribute.md | 8 +- docs/examples/databases/create-operations.md | 4 +- .../databases/create-point-attribute.md | 6 +- .../databases/create-polygon-attribute.md | 6 +- .../create-relationship-attribute.md | 8 +- .../databases/create-string-attribute.md | 8 +- .../databases/create-text-attribute.md | 8 +- docs/examples/databases/create-transaction.md | 4 +- .../databases/create-url-attribute.md | 6 +- .../databases/create-varchar-attribute.md | 8 +- docs/examples/databases/create.md | 4 +- .../databases/decrement-document-attribute.md | 8 +- docs/examples/databases/delete-attribute.md | 6 +- docs/examples/databases/delete-collection.md | 4 +- docs/examples/databases/delete-document.md | 4 +- docs/examples/databases/delete-documents.md | 4 +- docs/examples/databases/delete-index.md | 6 +- docs/examples/databases/delete-transaction.md | 4 +- docs/examples/databases/delete.md | 4 +- docs/examples/databases/get-attribute.md | 6 +- docs/examples/databases/get-collection.md | 4 +- docs/examples/databases/get-document.md | 4 +- docs/examples/databases/get-index.md | 6 +- docs/examples/databases/get-transaction.md | 4 +- docs/examples/databases/get.md | 4 +- .../databases/increment-document-attribute.md | 10 +- docs/examples/databases/list-attributes.md | 4 +- docs/examples/databases/list-collections.md | 4 +- docs/examples/databases/list-documents.md | 4 +- docs/examples/databases/list-indexes.md | 4 +- docs/examples/databases/list-transactions.md | 4 +- docs/examples/databases/list.md | 4 +- .../databases/update-big-int-attribute.md | 10 +- .../databases/update-boolean-attribute.md | 8 +- docs/examples/databases/update-collection.md | 4 +- .../databases/update-datetime-attribute.md | 8 +- docs/examples/databases/update-document.md | 4 +- docs/examples/databases/update-documents.md | 4 +- .../databases/update-email-attribute.md | 8 +- .../databases/update-enum-attribute.md | 12 +- .../databases/update-float-attribute.md | 12 +- .../databases/update-integer-attribute.md | 12 +- .../examples/databases/update-ip-attribute.md | 10 +- .../databases/update-line-attribute.md | 8 +- .../databases/update-longtext-attribute.md | 10 +- .../databases/update-mediumtext-attribute.md | 10 +- .../databases/update-point-attribute.md | 8 +- .../databases/update-polygon-attribute.md | 8 +- .../update-relationship-attribute.md | 8 +- .../databases/update-string-attribute.md | 10 +- .../databases/update-text-attribute.md | 10 +- docs/examples/databases/update-transaction.md | 4 +- .../databases/update-url-attribute.md | 8 +- .../databases/update-varchar-attribute.md | 10 +- docs/examples/databases/update.md | 4 +- docs/examples/databases/upsert-document.md | 4 +- docs/examples/databases/upsert-documents.md | 4 +- .../examples/documentsdb/create-collection.md | 24 + docs/examples/documentsdb/create-document.md | 27 + docs/examples/documentsdb/create-documents.md | 19 + docs/examples/documentsdb/create-failover.md | 18 + docs/examples/documentsdb/create-index.md | 24 + .../examples/documentsdb/create-operations.md | 28 + .../documentsdb/create-transaction.md | 17 + docs/examples/documentsdb/create.md | 22 + .../decrement-document-attribute.md | 23 + .../examples/documentsdb/delete-collection.md | 18 + docs/examples/documentsdb/delete-document.md | 20 + docs/examples/documentsdb/delete-documents.md | 20 + docs/examples/documentsdb/delete-index.md | 19 + .../documentsdb/delete-transaction.md | 17 + docs/examples/documentsdb/delete.md | 17 + docs/examples/documentsdb/get-collection.md | 18 + docs/examples/documentsdb/get-document.md | 21 + docs/examples/documentsdb/get-index.md | 19 + docs/examples/documentsdb/get-replicas.md | 17 + docs/examples/documentsdb/get-status.md | 17 + docs/examples/documentsdb/get-transaction.md | 17 + docs/examples/documentsdb/get.md | 17 + .../increment-document-attribute.md | 23 + docs/examples/documentsdb/list-collections.md | 20 + docs/examples/documentsdb/list-documents.md | 22 + docs/examples/documentsdb/list-indexes.md | 20 + docs/examples/documentsdb/list-operations.md | 20 + .../documentsdb/list-specifications.md | 16 + .../examples/documentsdb/list-transactions.md | 17 + docs/examples/documentsdb/list.md | 18 + .../examples/documentsdb/update-collection.md | 23 + docs/examples/documentsdb/update-document.md | 22 + docs/examples/documentsdb/update-documents.md | 21 + .../documentsdb/update-transaction.md | 19 + docs/examples/documentsdb/update.md | 22 + docs/examples/documentsdb/upsert-document.md | 22 + docs/examples/documentsdb/upsert-documents.md | 20 + .../embeddings/create-text-embeddings.md | 4 +- docs/examples/functions/create-deployment.md | 4 +- .../functions/create-duplicate-deployment.md | 4 +- docs/examples/functions/create-execution.md | 4 +- .../functions/create-template-deployment.md | 4 +- docs/examples/functions/create-variable.md | 4 +- .../functions/create-vcs-deployment.md | 4 +- docs/examples/functions/create.md | 10 +- docs/examples/functions/delete-deployment.md | 4 +- docs/examples/functions/delete-execution.md | 4 +- docs/examples/functions/delete-variable.md | 4 +- docs/examples/functions/delete.md | 4 +- .../functions/get-deployment-download.md | 4 +- docs/examples/functions/get-deployment.md | 4 +- docs/examples/functions/get-execution.md | 4 +- docs/examples/functions/get-variable.md | 4 +- docs/examples/functions/get.md | 4 +- docs/examples/functions/list-deployments.md | 4 +- docs/examples/functions/list-executions.md | 4 +- docs/examples/functions/list-runtimes.md | 2 + .../examples/functions/list-specifications.md | 4 +- docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/list.md | 4 +- .../functions/update-deployment-status.md | 4 +- .../functions/update-function-deployment.md | 4 +- docs/examples/functions/update-variable.md | 4 +- docs/examples/functions/update.md | 10 +- docs/examples/graphql/mutation.md | 4 +- docs/examples/graphql/query.md | 4 +- docs/examples/locale/get.md | 2 + docs/examples/locale/list-codes.md | 2 + docs/examples/locale/list-continents.md | 2 + docs/examples/locale/list-countries-eu.md | 2 + docs/examples/locale/list-countries-phones.md | 2 + docs/examples/locale/list-countries.md | 2 + docs/examples/locale/list-currencies.md | 2 + docs/examples/locale/list-languages.md | 2 + .../messaging/create-apns-provider.md | 4 +- docs/examples/messaging/create-email.md | 4 +- .../examples/messaging/create-fcm-provider.md | 4 +- .../messaging/create-mailgun-provider.md | 6 +- .../messaging/create-msg-91-provider.md | 4 +- docs/examples/messaging/create-push.md | 6 +- .../messaging/create-resend-provider.md | 4 +- .../messaging/create-sendgrid-provider.md | 4 +- .../examples/messaging/create-ses-provider.md | 4 +- docs/examples/messaging/create-sms.md | 4 +- .../messaging/create-smtp-provider.md | 6 +- docs/examples/messaging/create-subscriber.md | 4 +- .../messaging/create-telesign-provider.md | 4 +- .../messaging/create-textmagic-provider.md | 4 +- docs/examples/messaging/create-topic.md | 4 +- .../messaging/create-twilio-provider.md | 4 +- .../messaging/create-vonage-provider.md | 4 +- docs/examples/messaging/delete-provider.md | 4 +- docs/examples/messaging/delete-subscriber.md | 4 +- docs/examples/messaging/delete-topic.md | 4 +- docs/examples/messaging/delete.md | 4 +- docs/examples/messaging/get-message.md | 4 +- docs/examples/messaging/get-provider.md | 4 +- docs/examples/messaging/get-subscriber.md | 4 +- docs/examples/messaging/get-topic.md | 4 +- docs/examples/messaging/list-messages.md | 4 +- docs/examples/messaging/list-providers.md | 4 +- docs/examples/messaging/list-subscribers.md | 4 +- docs/examples/messaging/list-targets.md | 4 +- docs/examples/messaging/list-topics.md | 4 +- .../messaging/update-apns-provider.md | 4 +- docs/examples/messaging/update-email.md | 4 +- .../examples/messaging/update-fcm-provider.md | 4 +- .../messaging/update-mailgun-provider.md | 6 +- .../messaging/update-msg-91-provider.md | 4 +- docs/examples/messaging/update-push.md | 6 +- .../messaging/update-resend-provider.md | 4 +- .../messaging/update-sendgrid-provider.md | 4 +- .../examples/messaging/update-ses-provider.md | 4 +- docs/examples/messaging/update-sms.md | 4 +- .../messaging/update-smtp-provider.md | 4 +- .../messaging/update-telesign-provider.md | 4 +- .../messaging/update-textmagic-provider.md | 4 +- docs/examples/messaging/update-topic.md | 4 +- .../messaging/update-twilio-provider.md | 4 +- .../messaging/update-vonage-provider.md | 4 +- docs/examples/mongo/create-backup-policy.md | 23 + docs/examples/mongo/create-backup.md | 18 + docs/examples/mongo/create-branch.md | 19 + docs/examples/mongo/create-failover.md | 18 + docs/examples/mongo/create-migration.md | 19 + docs/examples/mongo/create-restoration.md | 21 + docs/examples/mongo/create-upgrade.md | 18 + docs/examples/mongo/create.md | 30 + docs/examples/mongo/delete-backup-policy.md | 18 + docs/examples/mongo/delete-backup.md | 18 + docs/examples/mongo/delete-branch.md | 18 + docs/examples/mongo/delete.md | 17 + docs/examples/mongo/get-backup-policy.md | 18 + docs/examples/mongo/get-backup.md | 18 + docs/examples/mongo/get-pitr.md | 17 + docs/examples/mongo/get-replicas.md | 17 + docs/examples/mongo/get-restoration.md | 18 + docs/examples/mongo/get-status.md | 17 + docs/examples/mongo/get.md | 17 + docs/examples/mongo/list-backup-policies.md | 18 + docs/examples/mongo/list-backups.md | 18 + docs/examples/mongo/list-branches.md | 17 + docs/examples/mongo/list-operations.md | 20 + docs/examples/mongo/list-restorations.md | 21 + docs/examples/mongo/list-specifications.md | 16 + docs/examples/mongo/list.md | 17 + docs/examples/mongo/update-backup-policy.md | 22 + docs/examples/mongo/update-backup-storage.md | 24 + docs/examples/mongo/update-credentials.md | 17 + docs/examples/mongo/update-maintenance.md | 19 + docs/examples/mongo/update.md | 37 + docs/examples/mysql/create-backup-policy.md | 23 + docs/examples/mysql/create-backup.md | 18 + docs/examples/mysql/create-branch.md | 19 + docs/examples/mysql/create-execution.md | 20 + docs/examples/mysql/create-failover.md | 18 + docs/examples/mysql/create-migration.md | 19 + docs/examples/mysql/create-restoration.md | 21 + docs/examples/mysql/create-upgrade.md | 18 + docs/examples/mysql/create.md | 30 + docs/examples/mysql/delete-backup-policy.md | 18 + docs/examples/mysql/delete-backup.md | 18 + docs/examples/mysql/delete-branch.md | 18 + docs/examples/mysql/delete.md | 17 + docs/examples/mysql/get-backup-policy.md | 18 + docs/examples/mysql/get-backup.md | 18 + docs/examples/mysql/get-pitr.md | 17 + docs/examples/mysql/get-pooler.md | 17 + docs/examples/mysql/get-replicas.md | 17 + docs/examples/mysql/get-restoration.md | 18 + docs/examples/mysql/get-status.md | 17 + docs/examples/mysql/get.md | 17 + docs/examples/mysql/list-backup-policies.md | 18 + docs/examples/mysql/list-backups.md | 18 + docs/examples/mysql/list-branches.md | 17 + docs/examples/mysql/list-operations.md | 20 + docs/examples/mysql/list-restorations.md | 21 + docs/examples/mysql/list-specifications.md | 16 + docs/examples/mysql/list.md | 17 + docs/examples/mysql/update-backup-policy.md | 22 + docs/examples/mysql/update-backup-storage.md | 24 + docs/examples/mysql/update-credentials.md | 17 + docs/examples/mysql/update-maintenance.md | 19 + docs/examples/mysql/update-pooler.md | 25 + docs/examples/mysql/update.md | 37 + docs/examples/oauth2/approve.md | 4 +- docs/examples/oauth2/authorize-post.md | 4 +- docs/examples/oauth2/authorize.md | 4 +- .../oauth2/create-device-authorization.md | 4 +- docs/examples/oauth2/create-grant.md | 4 +- docs/examples/oauth2/create-par.md | 4 +- docs/examples/oauth2/create-token.md | 4 +- docs/examples/oauth2/get-grant.md | 4 +- docs/examples/oauth2/list-organizations.md | 4 +- docs/examples/oauth2/list-projects.md | 4 +- docs/examples/oauth2/reject.md | 4 +- docs/examples/oauth2/revoke.md | 4 +- .../organization/create-installation.md | 4 +- docs/examples/organization/create-key.md | 4 +- .../organization/create-membership.md | 4 +- docs/examples/organization/create-project.md | 6 +- .../organization/delete-installation.md | 4 +- docs/examples/organization/delete-key.md | 4 +- .../organization/delete-membership.md | 4 +- docs/examples/organization/delete-project.md | 4 +- docs/examples/organization/delete.md | 2 + .../examples/organization/get-installation.md | 4 +- docs/examples/organization/get-key.md | 4 +- docs/examples/organization/get-membership.md | 4 +- docs/examples/organization/get-project.md | 4 +- docs/examples/organization/get.md | 2 + .../organization/list-installations.md | 4 +- docs/examples/organization/list-keys.md | 4 +- .../examples/organization/list-memberships.md | 4 +- docs/examples/organization/list-projects.md | 4 +- .../organization/update-installation.md | 4 +- docs/examples/organization/update-key.md | 4 +- .../organization/update-membership.md | 4 +- docs/examples/organization/update-project.md | 4 +- docs/examples/organization/update.md | 4 +- .../postgresql/create-backup-policy.md | 23 + docs/examples/postgresql/create-backup.md | 18 + docs/examples/postgresql/create-branch.md | 19 + docs/examples/postgresql/create-execution.md | 20 + docs/examples/postgresql/create-extension.md | 18 + docs/examples/postgresql/create-failover.md | 18 + docs/examples/postgresql/create-migration.md | 19 + .../examples/postgresql/create-restoration.md | 21 + docs/examples/postgresql/create-upgrade.md | 18 + docs/examples/postgresql/create.md | 30 + .../postgresql/delete-backup-policy.md | 18 + docs/examples/postgresql/delete-backup.md | 18 + docs/examples/postgresql/delete-branch.md | 18 + docs/examples/postgresql/delete-extension.md | 18 + docs/examples/postgresql/delete.md | 17 + docs/examples/postgresql/get-backup-policy.md | 18 + docs/examples/postgresql/get-backup.md | 18 + docs/examples/postgresql/get-pitr.md | 17 + docs/examples/postgresql/get-pooler.md | 17 + docs/examples/postgresql/get-replicas.md | 17 + docs/examples/postgresql/get-restoration.md | 18 + docs/examples/postgresql/get-status.md | 17 + docs/examples/postgresql/get.md | 17 + .../postgresql/list-backup-policies.md | 18 + docs/examples/postgresql/list-backups.md | 18 + docs/examples/postgresql/list-branches.md | 17 + docs/examples/postgresql/list-extensions.md | 17 + docs/examples/postgresql/list-operations.md | 20 + docs/examples/postgresql/list-restorations.md | 21 + .../postgresql/list-specifications.md | 16 + docs/examples/postgresql/list.md | 17 + .../postgresql/update-backup-policy.md | 22 + .../postgresql/update-backup-storage.md | 24 + .../examples/postgresql/update-credentials.md | 17 + .../examples/postgresql/update-maintenance.md | 19 + docs/examples/postgresql/update-pooler.md | 25 + docs/examples/postgresql/update.md | 37 + docs/examples/presences/delete.md | 4 +- docs/examples/presences/get.md | 4 +- docs/examples/presences/list.md | 4 +- docs/examples/presences/update.md | 4 +- docs/examples/presences/upsert.md | 4 +- .../project/create-android-platform.md | 4 +- .../examples/project/create-apple-platform.md | 4 +- docs/examples/project/create-ephemeral-key.md | 4 +- .../examples/project/create-linux-platform.md | 4 +- docs/examples/project/create-mock-phone.md | 4 +- docs/examples/project/create-smtp-test.md | 4 +- docs/examples/project/create-variable.md | 4 +- docs/examples/project/create-web-platform.md | 4 +- .../project/create-windows-platform.md | 4 +- docs/examples/project/delete-key.md | 4 +- docs/examples/project/delete-mock-phone.md | 4 +- docs/examples/project/delete-platform.md | 4 +- docs/examples/project/delete-variable.md | 4 +- docs/examples/project/delete.md | 2 + docs/examples/project/get-email-template.md | 4 +- docs/examples/project/get-key.md | 4 +- docs/examples/project/get-mock-phone.md | 4 +- .../examples/project/get-o-auth-2-provider.md | 4 +- docs/examples/project/get-platform.md | 4 +- docs/examples/project/get-policy.md | 4 +- docs/examples/project/get-variable.md | 4 +- docs/examples/project/get.md | 2 + docs/examples/project/list-email-templates.md | 4 +- docs/examples/project/list-keys.md | 4 +- docs/examples/project/list-mock-phones.md | 4 +- .../project/list-o-auth-2-providers.md | 4 +- docs/examples/project/list-platforms.md | 4 +- docs/examples/project/list-policies.md | 4 +- docs/examples/project/list-variables.md | 4 +- .../project/update-android-platform.md | 4 +- .../examples/project/update-apple-platform.md | 4 +- docs/examples/project/update-auth-method.md | 4 +- .../update-deny-aliased-email-policy.md | 4 +- .../update-deny-corporate-email-policy.md | 4 +- .../update-deny-disposable-email-policy.md | 4 +- .../project/update-deny-free-email-policy.md | 4 +- .../examples/project/update-email-template.md | 4 +- docs/examples/project/update-key.md | 4 +- docs/examples/project/update-labels.md | 4 +- .../examples/project/update-linux-platform.md | 4 +- .../update-membership-privacy-policy.md | 4 +- .../project/update-mfa-factors-policy.md | 4 +- docs/examples/project/update-mock-phone.md | 4 +- .../project/update-o-auth-2-amazon.md | 4 +- .../examples/project/update-o-auth-2-apple.md | 4 +- .../project/update-o-auth-2-appwrite.md | 4 +- .../project/update-o-auth-2-auth-0.md | 4 +- .../project/update-o-auth-2-authentik.md | 4 +- .../project/update-o-auth-2-autodesk.md | 4 +- .../project/update-o-auth-2-bitbucket.md | 4 +- .../examples/project/update-o-auth-2-bitly.md | 4 +- docs/examples/project/update-o-auth-2-box.md | 4 +- .../project/update-o-auth-2-dailymotion.md | 4 +- .../project/update-o-auth-2-discord.md | 4 +- .../project/update-o-auth-2-disqus.md | 4 +- .../project/update-o-auth-2-dropbox.md | 4 +- docs/examples/project/update-o-auth-2-etsy.md | 4 +- .../project/update-o-auth-2-facebook.md | 4 +- .../examples/project/update-o-auth-2-figma.md | 4 +- .../project/update-o-auth-2-fusion-auth.md | 4 +- .../project/update-o-auth-2-git-hub.md | 4 +- .../project/update-o-auth-2-gitlab.md | 4 +- .../project/update-o-auth-2-google.md | 4 +- .../project/update-o-auth-2-hugging-face.md | 19 + .../project/update-o-auth-2-keycloak.md | 4 +- docs/examples/project/update-o-auth-2-kick.md | 4 +- .../project/update-o-auth-2-linkedin.md | 4 +- .../project/update-o-auth-2-microsoft.md | 4 +- .../project/update-o-auth-2-notion.md | 4 +- docs/examples/project/update-o-auth-2-oidc.md | 4 +- docs/examples/project/update-o-auth-2-okta.md | 6 +- .../project/update-o-auth-2-paypal-sandbox.md | 4 +- .../project/update-o-auth-2-paypal.md | 4 +- .../examples/project/update-o-auth-2-podio.md | 4 +- .../project/update-o-auth-2-salesforce.md | 4 +- .../project/update-o-auth-2-server.md | 4 +- .../examples/project/update-o-auth-2-slack.md | 4 +- .../project/update-o-auth-2-spotify.md | 4 +- .../project/update-o-auth-2-stripe.md | 4 +- .../update-o-auth-2-tradeshift-sandbox.md | 4 +- .../project/update-o-auth-2-tradeshift.md | 4 +- .../project/update-o-auth-2-twitch.md | 4 +- .../project/update-o-auth-2-word-press.md | 4 +- .../examples/project/update-o-auth-2-yahoo.md | 4 +- .../project/update-o-auth-2-yandex.md | 4 +- docs/examples/project/update-o-auth-2-zoho.md | 4 +- docs/examples/project/update-o-auth-2-zoom.md | 4 +- docs/examples/project/update-o-auth-2x.md | 4 +- .../update-password-dictionary-policy.md | 4 +- .../project/update-password-history-policy.md | 4 +- .../update-password-personal-data-policy.md | 4 +- .../update-password-strength-policy.md | 4 +- docs/examples/project/update-protocol.md | 4 +- docs/examples/project/update-service.md | 4 +- .../project/update-session-alert-policy.md | 4 +- .../project/update-session-duration-policy.md | 4 +- .../update-session-invalidation-policy.md | 4 +- .../project/update-session-limit-policy.md | 4 +- docs/examples/project/update-smtp.md | 8 +- .../project/update-user-limit-policy.md | 4 +- docs/examples/project/update-variable.md | 4 +- docs/examples/project/update-web-platform.md | 4 +- .../project/update-windows-platform.md | 4 +- docs/examples/proxy/create-api-rule.md | 6 +- docs/examples/proxy/create-function-rule.md | 6 +- docs/examples/proxy/create-invalidation.md | 6 +- docs/examples/proxy/create-redirect-rule.md | 6 +- docs/examples/proxy/create-site-rule.md | 6 +- docs/examples/proxy/delete-rule.md | 4 +- docs/examples/proxy/get-rule.md | 4 +- docs/examples/proxy/list-rules.md | 4 +- docs/examples/proxy/update-rule-status.md | 4 +- docs/examples/sites/create-deployment.md | 4 +- .../sites/create-duplicate-deployment.md | 4 +- .../sites/create-template-deployment.md | 4 +- docs/examples/sites/create-variable.md | 4 +- docs/examples/sites/create-vcs-deployment.md | 4 +- docs/examples/sites/create.md | 11 +- docs/examples/sites/delete-deployment.md | 4 +- docs/examples/sites/delete-log.md | 4 +- docs/examples/sites/delete-variable.md | 4 +- docs/examples/sites/delete.md | 4 +- .../examples/sites/get-deployment-download.md | 4 +- docs/examples/sites/get-deployment.md | 4 +- docs/examples/sites/get-log.md | 4 +- docs/examples/sites/get-variable.md | 4 +- docs/examples/sites/get.md | 4 +- docs/examples/sites/list-deployments.md | 4 +- docs/examples/sites/list-frameworks.md | 2 + docs/examples/sites/list-logs.md | 4 +- docs/examples/sites/list-specifications.md | 4 +- docs/examples/sites/list-variables.md | 4 +- docs/examples/sites/list.md | 4 +- .../sites/update-deployment-status.md | 4 +- docs/examples/sites/update-site-deployment.md | 4 +- docs/examples/sites/update-variable.md | 4 +- docs/examples/sites/update.md | 11 +- docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 6 +- docs/examples/storage/delete-bucket.md | 4 +- docs/examples/storage/delete-file.md | 4 +- docs/examples/storage/get-bucket.md | 4 +- docs/examples/storage/get-file-download.md | 4 +- docs/examples/storage/get-file-preview.md | 8 +- docs/examples/storage/get-file-view.md | 4 +- docs/examples/storage/get-file.md | 4 +- docs/examples/storage/list-buckets.md | 4 +- docs/examples/storage/list-files.md | 4 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 4 +- .../tablesdb/create-big-int-column.md | 8 +- .../tablesdb/create-boolean-column.md | 6 +- .../tablesdb/create-datetime-column.md | 6 +- docs/examples/tablesdb/create-email-column.md | 6 +- docs/examples/tablesdb/create-enum-column.md | 10 +- docs/examples/tablesdb/create-failover.md | 4 +- docs/examples/tablesdb/create-float-column.md | 10 +- docs/examples/tablesdb/create-index.md | 6 +- .../tablesdb/create-integer-column.md | 10 +- docs/examples/tablesdb/create-ip-column.md | 8 +- docs/examples/tablesdb/create-line-column.md | 6 +- .../tablesdb/create-longtext-column.md | 8 +- .../tablesdb/create-mediumtext-column.md | 8 +- docs/examples/tablesdb/create-migration.md | 4 +- docs/examples/tablesdb/create-operations.md | 4 +- docs/examples/tablesdb/create-point-column.md | 6 +- .../tablesdb/create-polygon-column.md | 6 +- .../tablesdb/create-relationship-column.md | 8 +- docs/examples/tablesdb/create-row.md | 4 +- docs/examples/tablesdb/create-rows.md | 4 +- .../examples/tablesdb/create-string-column.md | 8 +- docs/examples/tablesdb/create-table.md | 4 +- docs/examples/tablesdb/create-text-column.md | 8 +- docs/examples/tablesdb/create-transaction.md | 4 +- docs/examples/tablesdb/create-url-column.md | 6 +- .../tablesdb/create-varchar-column.md | 8 +- docs/examples/tablesdb/create.md | 4 +- docs/examples/tablesdb/cutover-migration.md | 4 +- .../examples/tablesdb/decrement-row-column.md | 8 +- docs/examples/tablesdb/delete-column.md | 6 +- docs/examples/tablesdb/delete-index.md | 6 +- docs/examples/tablesdb/delete-migration.md | 4 +- docs/examples/tablesdb/delete-row.md | 4 +- docs/examples/tablesdb/delete-rows.md | 4 +- docs/examples/tablesdb/delete-table.md | 4 +- docs/examples/tablesdb/delete-transaction.md | 4 +- docs/examples/tablesdb/delete.md | 4 +- docs/examples/tablesdb/get-column.md | 6 +- docs/examples/tablesdb/get-index.md | 6 +- docs/examples/tablesdb/get-migration.md | 4 +- docs/examples/tablesdb/get-replicas.md | 4 +- docs/examples/tablesdb/get-row.md | 4 +- docs/examples/tablesdb/get-status.md | 4 +- docs/examples/tablesdb/get-table.md | 4 +- docs/examples/tablesdb/get-transaction.md | 4 +- docs/examples/tablesdb/get.md | 4 +- .../examples/tablesdb/increment-row-column.md | 10 +- docs/examples/tablesdb/list-columns.md | 4 +- docs/examples/tablesdb/list-indexes.md | 4 +- docs/examples/tablesdb/list-migrations.md | 4 +- docs/examples/tablesdb/list-operations.md | 6 +- docs/examples/tablesdb/list-rows.md | 4 +- docs/examples/tablesdb/list-specifications.md | 2 + docs/examples/tablesdb/list-tables.md | 4 +- docs/examples/tablesdb/list-transactions.md | 4 +- docs/examples/tablesdb/list.md | 4 +- .../tablesdb/update-big-int-column.md | 10 +- .../tablesdb/update-boolean-column.md | 8 +- .../tablesdb/update-datetime-column.md | 8 +- docs/examples/tablesdb/update-email-column.md | 8 +- docs/examples/tablesdb/update-enum-column.md | 12 +- docs/examples/tablesdb/update-float-column.md | 12 +- .../tablesdb/update-integer-column.md | 12 +- docs/examples/tablesdb/update-ip-column.md | 10 +- docs/examples/tablesdb/update-line-column.md | 8 +- .../tablesdb/update-longtext-column.md | 10 +- .../tablesdb/update-mediumtext-column.md | 10 +- docs/examples/tablesdb/update-point-column.md | 8 +- .../tablesdb/update-polygon-column.md | 8 +- .../tablesdb/update-relationship-column.md | 8 +- docs/examples/tablesdb/update-row.md | 4 +- docs/examples/tablesdb/update-rows.md | 4 +- .../examples/tablesdb/update-string-column.md | 10 +- docs/examples/tablesdb/update-table.md | 4 +- docs/examples/tablesdb/update-text-column.md | 10 +- docs/examples/tablesdb/update-transaction.md | 4 +- docs/examples/tablesdb/update-url-column.md | 8 +- .../tablesdb/update-varchar-column.md | 10 +- docs/examples/tablesdb/update.md | 4 +- docs/examples/tablesdb/upsert-row.md | 4 +- docs/examples/tablesdb/upsert-rows.md | 4 +- docs/examples/teams/create-installation.md | 4 +- docs/examples/teams/create-membership.md | 4 +- docs/examples/teams/create.md | 4 +- docs/examples/teams/delete-installation.md | 4 +- docs/examples/teams/delete-membership.md | 4 +- docs/examples/teams/delete.md | 4 +- docs/examples/teams/get-installation.md | 4 +- docs/examples/teams/get-membership.md | 4 +- docs/examples/teams/get-prefs.md | 4 +- docs/examples/teams/get.md | 4 +- docs/examples/teams/list-installations.md | 4 +- docs/examples/teams/list-memberships.md | 4 +- docs/examples/teams/list.md | 4 +- docs/examples/teams/update-installation.md | 4 +- .../teams/update-membership-status.md | 4 +- docs/examples/teams/update-membership.md | 4 +- docs/examples/teams/update-name.md | 4 +- docs/examples/teams/update-prefs.md | 4 +- docs/examples/tokens/create-file-token.md | 4 +- docs/examples/tokens/delete.md | 4 +- docs/examples/tokens/get.md | 4 +- docs/examples/tokens/list.md | 4 +- docs/examples/tokens/update.md | 4 +- docs/examples/users/create-argon-2-user.md | 4 +- docs/examples/users/create-bcrypt-user.md | 4 +- docs/examples/users/create-jwt.md | 6 +- docs/examples/users/create-md-5-user.md | 4 +- .../users/create-mfa-recovery-codes.md | 4 +- docs/examples/users/create-ph-pass-user.md | 4 +- .../users/create-scrypt-modified-user.md | 4 +- docs/examples/users/create-scrypt-user.md | 12 +- docs/examples/users/create-session.md | 4 +- docs/examples/users/create-sha-user.md | 4 +- docs/examples/users/create-target.md | 4 +- docs/examples/users/create-token.md | 4 +- docs/examples/users/create.md | 4 +- docs/examples/users/delete-identity.md | 4 +- .../users/delete-mfa-authenticator.md | 4 +- docs/examples/users/delete-session.md | 4 +- docs/examples/users/delete-sessions.md | 4 +- docs/examples/users/delete-target.md | 4 +- docs/examples/users/delete.md | 4 +- docs/examples/users/get-mfa-challenge.md | 4 +- docs/examples/users/get-mfa-recovery-codes.md | 4 +- docs/examples/users/get-prefs.md | 4 +- docs/examples/users/get-target.md | 4 +- docs/examples/users/get.md | 4 +- docs/examples/users/list-identities.md | 4 +- docs/examples/users/list-logs.md | 4 +- docs/examples/users/list-memberships.md | 4 +- docs/examples/users/list-mfa-factors.md | 4 +- docs/examples/users/list-sessions.md | 4 +- docs/examples/users/list-targets.md | 4 +- docs/examples/users/list.md | 4 +- .../users/update-email-verification.md | 4 +- docs/examples/users/update-email.md | 4 +- docs/examples/users/update-impersonator.md | 4 +- docs/examples/users/update-labels.md | 4 +- .../users/update-mfa-recovery-codes.md | 4 +- docs/examples/users/update-mfa.md | 4 +- docs/examples/users/update-name.md | 4 +- docs/examples/users/update-password.md | 4 +- .../users/update-phone-verification.md | 4 +- docs/examples/users/update-phone.md | 4 +- docs/examples/users/update-prefs.md | 4 +- docs/examples/users/update-status.md | 4 +- docs/examples/users/update-target.md | 4 +- docs/examples/vectorsdb/create-collection.md | 23 + docs/examples/vectorsdb/create-document.md | 24 + docs/examples/vectorsdb/create-documents.md | 19 + docs/examples/vectorsdb/create-failover.md | 18 + docs/examples/vectorsdb/create-index.md | 24 + docs/examples/vectorsdb/create-operations.md | 28 + docs/examples/vectorsdb/create-query.md | 22 + docs/examples/vectorsdb/create-transaction.md | 17 + docs/examples/vectorsdb/create.md | 22 + docs/examples/vectorsdb/delete-collection.md | 18 + docs/examples/vectorsdb/delete-document.md | 20 + docs/examples/vectorsdb/delete-documents.md | 20 + docs/examples/vectorsdb/delete-index.md | 19 + docs/examples/vectorsdb/delete-transaction.md | 17 + docs/examples/vectorsdb/delete.md | 17 + docs/examples/vectorsdb/get-collection.md | 18 + docs/examples/vectorsdb/get-document.md | 21 + docs/examples/vectorsdb/get-index.md | 19 + docs/examples/vectorsdb/get-replicas.md | 17 + docs/examples/vectorsdb/get-status.md | 17 + docs/examples/vectorsdb/get-transaction.md | 17 + docs/examples/vectorsdb/get.md | 17 + docs/examples/vectorsdb/list-collections.md | 20 + docs/examples/vectorsdb/list-documents.md | 22 + docs/examples/vectorsdb/list-indexes.md | 20 + docs/examples/vectorsdb/list-operations.md | 20 + .../examples/vectorsdb/list-specifications.md | 16 + docs/examples/vectorsdb/list-transactions.md | 17 + docs/examples/vectorsdb/list.md | 18 + docs/examples/vectorsdb/update-collection.md | 23 + docs/examples/vectorsdb/update-document.md | 22 + docs/examples/vectorsdb/update-documents.md | 21 + docs/examples/vectorsdb/update-transaction.md | 19 + docs/examples/vectorsdb/update.md | 22 + docs/examples/vectorsdb/upsert-document.md | 22 + docs/examples/vectorsdb/upsert-documents.md | 20 + docs/examples/webhooks/create.md | 6 +- docs/examples/webhooks/delete.md | 4 +- docs/examples/webhooks/get.md | 4 +- docs/examples/webhooks/list.md | 4 +- docs/examples/webhooks/update-secret.md | 4 +- docs/examples/webhooks/update.md | 6 +- 829 files changed, 14008 insertions(+), 920 deletions(-) create mode 100644 .editorconfig create mode 100644 Appwrite/Enums/DocumentsDBIndexType.cs create mode 100644 Appwrite/Enums/ExecutionResourceType.cs create mode 100644 Appwrite/Enums/VectorsDBIndexType.cs create mode 100644 Appwrite/Models/AttributeObject.cs create mode 100644 Appwrite/Models/AttributeVector.cs create mode 100644 Appwrite/Models/DedicatedDatabaseBackup.cs create mode 100644 Appwrite/Models/DedicatedDatabaseBackupList.cs create mode 100644 Appwrite/Models/DedicatedDatabaseBackupStorage.cs create mode 100644 Appwrite/Models/DedicatedDatabaseBranch.cs create mode 100644 Appwrite/Models/DedicatedDatabaseBranchList.cs create mode 100644 Appwrite/Models/DedicatedDatabaseExecution.cs create mode 100644 Appwrite/Models/DedicatedDatabaseExecutionColumn.cs create mode 100644 Appwrite/Models/DedicatedDatabaseExtensions.cs create mode 100644 Appwrite/Models/DedicatedDatabaseList.cs create mode 100644 Appwrite/Models/DedicatedDatabasePITRWindows.cs create mode 100644 Appwrite/Models/DedicatedDatabasePooler.cs create mode 100644 Appwrite/Models/DedicatedDatabaseRestoration.cs create mode 100644 Appwrite/Models/DedicatedDatabaseRestorationList.cs create mode 100644 Appwrite/Models/OAuth2HuggingFace.cs create mode 100644 Appwrite/Models/PostgresExtension.cs create mode 100644 Appwrite/Models/VectorsdbCollection.cs create mode 100644 Appwrite/Models/VectorsdbCollectionList.cs create mode 100644 Appwrite/Services/DocumentsDB.cs create mode 100644 Appwrite/Services/Mongo.cs create mode 100644 Appwrite/Services/Mysql.cs create mode 100644 Appwrite/Services/Postgresql.cs create mode 100644 Appwrite/Services/VectorsDB.cs create mode 100644 docs/examples/avatars/get-photo.md create mode 100644 docs/examples/documentsdb/create-collection.md create mode 100644 docs/examples/documentsdb/create-document.md create mode 100644 docs/examples/documentsdb/create-documents.md create mode 100644 docs/examples/documentsdb/create-failover.md create mode 100644 docs/examples/documentsdb/create-index.md create mode 100644 docs/examples/documentsdb/create-operations.md create mode 100644 docs/examples/documentsdb/create-transaction.md create mode 100644 docs/examples/documentsdb/create.md create mode 100644 docs/examples/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/documentsdb/delete-collection.md create mode 100644 docs/examples/documentsdb/delete-document.md create mode 100644 docs/examples/documentsdb/delete-documents.md create mode 100644 docs/examples/documentsdb/delete-index.md create mode 100644 docs/examples/documentsdb/delete-transaction.md create mode 100644 docs/examples/documentsdb/delete.md create mode 100644 docs/examples/documentsdb/get-collection.md create mode 100644 docs/examples/documentsdb/get-document.md create mode 100644 docs/examples/documentsdb/get-index.md create mode 100644 docs/examples/documentsdb/get-replicas.md create mode 100644 docs/examples/documentsdb/get-status.md create mode 100644 docs/examples/documentsdb/get-transaction.md create mode 100644 docs/examples/documentsdb/get.md create mode 100644 docs/examples/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/documentsdb/list-collections.md create mode 100644 docs/examples/documentsdb/list-documents.md create mode 100644 docs/examples/documentsdb/list-indexes.md create mode 100644 docs/examples/documentsdb/list-operations.md create mode 100644 docs/examples/documentsdb/list-specifications.md create mode 100644 docs/examples/documentsdb/list-transactions.md create mode 100644 docs/examples/documentsdb/list.md create mode 100644 docs/examples/documentsdb/update-collection.md create mode 100644 docs/examples/documentsdb/update-document.md create mode 100644 docs/examples/documentsdb/update-documents.md create mode 100644 docs/examples/documentsdb/update-transaction.md create mode 100644 docs/examples/documentsdb/update.md create mode 100644 docs/examples/documentsdb/upsert-document.md create mode 100644 docs/examples/documentsdb/upsert-documents.md create mode 100644 docs/examples/mongo/create-backup-policy.md create mode 100644 docs/examples/mongo/create-backup.md create mode 100644 docs/examples/mongo/create-branch.md create mode 100644 docs/examples/mongo/create-failover.md create mode 100644 docs/examples/mongo/create-migration.md create mode 100644 docs/examples/mongo/create-restoration.md create mode 100644 docs/examples/mongo/create-upgrade.md create mode 100644 docs/examples/mongo/create.md create mode 100644 docs/examples/mongo/delete-backup-policy.md create mode 100644 docs/examples/mongo/delete-backup.md create mode 100644 docs/examples/mongo/delete-branch.md create mode 100644 docs/examples/mongo/delete.md create mode 100644 docs/examples/mongo/get-backup-policy.md create mode 100644 docs/examples/mongo/get-backup.md create mode 100644 docs/examples/mongo/get-pitr.md create mode 100644 docs/examples/mongo/get-replicas.md create mode 100644 docs/examples/mongo/get-restoration.md create mode 100644 docs/examples/mongo/get-status.md create mode 100644 docs/examples/mongo/get.md create mode 100644 docs/examples/mongo/list-backup-policies.md create mode 100644 docs/examples/mongo/list-backups.md create mode 100644 docs/examples/mongo/list-branches.md create mode 100644 docs/examples/mongo/list-operations.md create mode 100644 docs/examples/mongo/list-restorations.md create mode 100644 docs/examples/mongo/list-specifications.md create mode 100644 docs/examples/mongo/list.md create mode 100644 docs/examples/mongo/update-backup-policy.md create mode 100644 docs/examples/mongo/update-backup-storage.md create mode 100644 docs/examples/mongo/update-credentials.md create mode 100644 docs/examples/mongo/update-maintenance.md create mode 100644 docs/examples/mongo/update.md create mode 100644 docs/examples/mysql/create-backup-policy.md create mode 100644 docs/examples/mysql/create-backup.md create mode 100644 docs/examples/mysql/create-branch.md create mode 100644 docs/examples/mysql/create-execution.md create mode 100644 docs/examples/mysql/create-failover.md create mode 100644 docs/examples/mysql/create-migration.md create mode 100644 docs/examples/mysql/create-restoration.md create mode 100644 docs/examples/mysql/create-upgrade.md create mode 100644 docs/examples/mysql/create.md create mode 100644 docs/examples/mysql/delete-backup-policy.md create mode 100644 docs/examples/mysql/delete-backup.md create mode 100644 docs/examples/mysql/delete-branch.md create mode 100644 docs/examples/mysql/delete.md create mode 100644 docs/examples/mysql/get-backup-policy.md create mode 100644 docs/examples/mysql/get-backup.md create mode 100644 docs/examples/mysql/get-pitr.md create mode 100644 docs/examples/mysql/get-pooler.md create mode 100644 docs/examples/mysql/get-replicas.md create mode 100644 docs/examples/mysql/get-restoration.md create mode 100644 docs/examples/mysql/get-status.md create mode 100644 docs/examples/mysql/get.md create mode 100644 docs/examples/mysql/list-backup-policies.md create mode 100644 docs/examples/mysql/list-backups.md create mode 100644 docs/examples/mysql/list-branches.md create mode 100644 docs/examples/mysql/list-operations.md create mode 100644 docs/examples/mysql/list-restorations.md create mode 100644 docs/examples/mysql/list-specifications.md create mode 100644 docs/examples/mysql/list.md create mode 100644 docs/examples/mysql/update-backup-policy.md create mode 100644 docs/examples/mysql/update-backup-storage.md create mode 100644 docs/examples/mysql/update-credentials.md create mode 100644 docs/examples/mysql/update-maintenance.md create mode 100644 docs/examples/mysql/update-pooler.md create mode 100644 docs/examples/mysql/update.md create mode 100644 docs/examples/postgresql/create-backup-policy.md create mode 100644 docs/examples/postgresql/create-backup.md create mode 100644 docs/examples/postgresql/create-branch.md create mode 100644 docs/examples/postgresql/create-execution.md create mode 100644 docs/examples/postgresql/create-extension.md create mode 100644 docs/examples/postgresql/create-failover.md create mode 100644 docs/examples/postgresql/create-migration.md create mode 100644 docs/examples/postgresql/create-restoration.md create mode 100644 docs/examples/postgresql/create-upgrade.md create mode 100644 docs/examples/postgresql/create.md create mode 100644 docs/examples/postgresql/delete-backup-policy.md create mode 100644 docs/examples/postgresql/delete-backup.md create mode 100644 docs/examples/postgresql/delete-branch.md create mode 100644 docs/examples/postgresql/delete-extension.md create mode 100644 docs/examples/postgresql/delete.md create mode 100644 docs/examples/postgresql/get-backup-policy.md create mode 100644 docs/examples/postgresql/get-backup.md create mode 100644 docs/examples/postgresql/get-pitr.md create mode 100644 docs/examples/postgresql/get-pooler.md create mode 100644 docs/examples/postgresql/get-replicas.md create mode 100644 docs/examples/postgresql/get-restoration.md create mode 100644 docs/examples/postgresql/get-status.md create mode 100644 docs/examples/postgresql/get.md create mode 100644 docs/examples/postgresql/list-backup-policies.md create mode 100644 docs/examples/postgresql/list-backups.md create mode 100644 docs/examples/postgresql/list-branches.md create mode 100644 docs/examples/postgresql/list-extensions.md create mode 100644 docs/examples/postgresql/list-operations.md create mode 100644 docs/examples/postgresql/list-restorations.md create mode 100644 docs/examples/postgresql/list-specifications.md create mode 100644 docs/examples/postgresql/list.md create mode 100644 docs/examples/postgresql/update-backup-policy.md create mode 100644 docs/examples/postgresql/update-backup-storage.md create mode 100644 docs/examples/postgresql/update-credentials.md create mode 100644 docs/examples/postgresql/update-maintenance.md create mode 100644 docs/examples/postgresql/update-pooler.md create mode 100644 docs/examples/postgresql/update.md create mode 100644 docs/examples/project/update-o-auth-2-hugging-face.md create mode 100644 docs/examples/vectorsdb/create-collection.md create mode 100644 docs/examples/vectorsdb/create-document.md create mode 100644 docs/examples/vectorsdb/create-documents.md create mode 100644 docs/examples/vectorsdb/create-failover.md create mode 100644 docs/examples/vectorsdb/create-index.md create mode 100644 docs/examples/vectorsdb/create-operations.md create mode 100644 docs/examples/vectorsdb/create-query.md create mode 100644 docs/examples/vectorsdb/create-transaction.md create mode 100644 docs/examples/vectorsdb/create.md create mode 100644 docs/examples/vectorsdb/delete-collection.md create mode 100644 docs/examples/vectorsdb/delete-document.md create mode 100644 docs/examples/vectorsdb/delete-documents.md create mode 100644 docs/examples/vectorsdb/delete-index.md create mode 100644 docs/examples/vectorsdb/delete-transaction.md create mode 100644 docs/examples/vectorsdb/delete.md create mode 100644 docs/examples/vectorsdb/get-collection.md create mode 100644 docs/examples/vectorsdb/get-document.md create mode 100644 docs/examples/vectorsdb/get-index.md create mode 100644 docs/examples/vectorsdb/get-replicas.md create mode 100644 docs/examples/vectorsdb/get-status.md create mode 100644 docs/examples/vectorsdb/get-transaction.md create mode 100644 docs/examples/vectorsdb/get.md create mode 100644 docs/examples/vectorsdb/list-collections.md create mode 100644 docs/examples/vectorsdb/list-documents.md create mode 100644 docs/examples/vectorsdb/list-indexes.md create mode 100644 docs/examples/vectorsdb/list-operations.md create mode 100644 docs/examples/vectorsdb/list-specifications.md create mode 100644 docs/examples/vectorsdb/list-transactions.md create mode 100644 docs/examples/vectorsdb/list.md create mode 100644 docs/examples/vectorsdb/update-collection.md create mode 100644 docs/examples/vectorsdb/update-document.md create mode 100644 docs/examples/vectorsdb/update-documents.md create mode 100644 docs/examples/vectorsdb/update-transaction.md create mode 100644 docs/examples/vectorsdb/update.md create mode 100644 docs/examples/vectorsdb/upsert-document.md create mode 100644 docs/examples/vectorsdb/upsert-documents.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..aac467e6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig for the generated .NET and Unity SDKs. +# `dotnet format whitespace` is the canonical formatter; this file records the +# layout that a clean generation must already match. +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.cs] +csharp_space_after_keywords_in_control_flow_statements = true +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_indent_preprocessor_directives = false diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index dcd11786..a22c8679 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 7.0.0 + 7.1.0-rc.1 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index ec1fbd4a..6792fdac 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,18 +69,19 @@ public Client( _http = http ?? new HttpClient(); _httpForRedirect = httpForRedirect ?? new HttpClient( - new HttpClientHandler(){ + new HttpClientHandler() + { AllowAutoRedirect = false }); _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/7.0.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent", $"AppwriteDotNetSDK/7.1.0-rc.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "7.0.0"}, + { "x-sdk-version", "7.1.0-rc.1"}, { "X-Appwrite-Response-Format", "1.9.6" } }; @@ -108,7 +109,8 @@ public Client SetSelfSigned(bool selfSigned) public Client SetEndpoint(string endpoint) { - if (!endpoint.StartsWith("http://") && !endpoint.StartsWith("https://")) { + if (!endpoint.StartsWith("http://") && !endpoint.StartsWith("https://")) + { throw new AppwriteException("Invalid endpoint URL: " + endpoint); } @@ -117,14 +119,16 @@ public Client SetEndpoint(string endpoint) } /// Your project ID - public Client SetProject(string value) { + public Client SetProject(string value) + { _config["project"] = value; return this; } /// Your secret API key - public Client SetKey(string value) { + public Client SetKey(string value) + { _config["key"] = value; AddHeader("X-Appwrite-Key", value); @@ -132,7 +136,8 @@ public Client SetKey(string value) { } /// Your organization ID - public Client SetOrganization(string value) { + public Client SetOrganization(string value) + { _config["organization"] = value; AddHeader("X-Appwrite-Organization", value); @@ -140,7 +145,8 @@ public Client SetOrganization(string value) { } /// Your secret JSON Web Token - public Client SetJWT(string value) { + public Client SetJWT(string value) + { _config["jWT"] = value; AddHeader("X-Appwrite-JWT", value); @@ -148,14 +154,16 @@ public Client SetJWT(string value) { } /// The OAuth access token to authenticate with - public Client SetBearer(string value) { + public Client SetBearer(string value) + { _config["bearer"] = value; AddHeader("Authorization", "Bearer " + value); return this; } - public Client SetLocale(string value) { + public Client SetLocale(string value) + { _config["locale"] = value; AddHeader("X-Appwrite-Locale", value); @@ -163,7 +171,8 @@ public Client SetLocale(string value) { } /// The user session to authenticate with - public Client SetSession(string value) { + public Client SetSession(string value) + { _config["session"] = value; AddHeader("X-Appwrite-Session", value); @@ -171,7 +180,8 @@ public Client SetSession(string value) { } /// The user agent string of the client that made the request - public Client SetForwardedUserAgent(string value) { + public Client SetForwardedUserAgent(string value) + { _config["forwardedUserAgent"] = value; AddHeader("X-Forwarded-User-Agent", value); @@ -179,7 +189,8 @@ public Client SetForwardedUserAgent(string value) { } /// Your secret dev API key - public Client SetDevKey(string value) { + public Client SetDevKey(string value) + { _config["devKey"] = value; AddHeader("X-Appwrite-Dev-Key", value); @@ -187,7 +198,8 @@ public Client SetDevKey(string value) { } /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. - public Client SetCookie(string value) { + public Client SetCookie(string value) + { _config["cookie"] = value; AddHeader("Cookie", value); @@ -195,7 +207,8 @@ public Client SetCookie(string value) { } /// Impersonate a user by ID - public Client SetImpersonateUserId(string value) { + public Client SetImpersonateUserId(string value) + { _config["impersonateUserId"] = value; AddHeader("X-Appwrite-Impersonate-User-Id", value); @@ -203,7 +216,8 @@ public Client SetImpersonateUserId(string value) { } /// Impersonate a user by email - public Client SetImpersonateUserEmail(string value) { + public Client SetImpersonateUserEmail(string value) + { _config["impersonateUserEmail"] = value; AddHeader("X-Appwrite-Impersonate-User-Email", value); @@ -211,7 +225,8 @@ public Client SetImpersonateUserEmail(string value) { } /// Impersonate a user by phone - public Client SetImpersonateUserPhone(string value) { + public Client SetImpersonateUserPhone(string value) + { _config["impersonateUserPhone"] = value; AddHeader("X-Appwrite-Impersonate-User-Phone", value); @@ -246,7 +261,7 @@ private HttpRequestMessage PrepareRequest( new HttpMethod(method), _endpoint + path + queryString); - if (headers.TryGetValue("content-type", out var contentType) && + if (headers.TryGetValue("content-type", out var contentType) && "multipart/form-data".Equals(contentType, StringComparison.OrdinalIgnoreCase)) { var form = new MultipartFormDataContent(); @@ -293,7 +308,8 @@ private HttpRequestMessage PrepareRequest( } else { - if (request.Headers.Contains(header.Key)) { + if (request.Headers.Contains(header.Key)) + { request.Headers.Remove(header.Key); } request.Headers.Add(header.Key, header.Value); @@ -312,7 +328,8 @@ private HttpRequestMessage PrepareRequest( } else { - if (request.Headers.Contains(header.Key)) { + if (request.Headers.Contains(header.Key)) + { request.Headers.Remove(header.Key); } request.Headers.Add(header.Key, header.Value); @@ -333,7 +350,8 @@ public async Task Redirect( var response = await _httpForRedirect.SendAsync(request); var code = (int)response.StatusCode; - if (code >= 400) { + if (code >= 400) + { var text = await response.Content.ReadAsStringAsync(); var message = ""; var type = ""; @@ -344,8 +362,9 @@ public async Task Redirect( contentType = contentTypes.FirstOrDefault() ?? string.Empty; } - if (contentType.Contains("application/json")) { - try + if (contentType.Contains("application/json")) + { + try { using var errorDoc = JsonDocument.Parse(text); message = errorDoc.RootElement.GetProperty("message").GetString() ?? ""; @@ -358,7 +377,9 @@ public async Task Redirect( { message = text; } - } else { + } + else + { message = text; } @@ -405,13 +426,15 @@ public async Task Call( var isJson = contentType.Contains("application/json"); - if (code >= 400) { + if (code >= 400) + { var text = await response.Content.ReadAsStringAsync(); var message = ""; var type = ""; - if (isJson) { - try + if (isJson) + { + try { using var errorDoc = JsonDocument.Parse(text); message = errorDoc.RootElement.GetProperty("message").GetString() ?? ""; @@ -424,7 +447,9 @@ public async Task Call( { message = text; } - } else { + } + else + { message = text; } @@ -463,16 +488,16 @@ public async Task ChunkedUpload( { if (string.IsNullOrEmpty(paramName)) throw new ArgumentException("Parameter name cannot be null or empty", nameof(paramName)); - + if (!parameters.ContainsKey(paramName)) throw new ArgumentException($"Parameter {paramName} not found", nameof(paramName)); - + var input = parameters[paramName] as InputFile; if (input == null) throw new ArgumentException($"Parameter {paramName} must be an InputFile", nameof(paramName)); - + var size = 0L; - switch(input.SourceType) + switch (input.SourceType) { case "path": var info = new FileInfo(input.Path); @@ -490,7 +515,7 @@ public async Task ChunkedUpload( throw new InvalidOperationException("Byte array data is null"); size = bytes.Length; break; - }; + } var offset = 0L; var buffer = new byte[Math.Min(size, ChunkSize)]; @@ -498,7 +523,7 @@ public async Task ChunkedUpload( if (size < ChunkSize) { - switch(input.SourceType) + switch (input.SourceType) { case "path": buffer = System.IO.File.ReadAllBytes(input.Path); @@ -534,14 +559,18 @@ public async Task ChunkedUpload( var uploadId = string.Empty; - if (!string.IsNullOrEmpty(idParamName)) + if (idParamName is not null + && idParamName.Length > 0 + && parameters.TryGetValue(idParamName, out var uploadIdValue) + && uploadIdValue != null) { + uploadId = uploadIdValue.ToString() ?? string.Empty; try { // Make a request to check if a file already exists var current = await Call>( method: "GET", - path: $"{path}/{parameters[idParamName!]}", + path: $"{path}/{uploadId}", new Dictionary { { "content-type", "application/json" } }, parameters: new Dictionary() ); @@ -550,7 +579,6 @@ public async Task ChunkedUpload( offset = Convert.ToInt64(chunksUploadedValue) * ChunkSize; } result = current; - uploadId = parameters[idParamName!]?.ToString() ?? string.Empty; } catch { @@ -565,7 +593,7 @@ async Task ReadChunkAsync(long start, long end) var length = (int)(end - start); var chunk = new byte[length]; - switch(input.SourceType) + switch (input.SourceType) { case "path": using (var chunkStream = System.IO.File.OpenRead(input.Path)) @@ -744,7 +772,7 @@ bool IsUploadComplete(Dictionary chunkResult) // Convert to non-nullable dictionary for converter var nonNullableResult = result.Where(kvp => kvp.Value != null) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value!); - + return converter(nonNullableResult); } } diff --git a/Appwrite/Enums/BuildRuntime.cs b/Appwrite/Enums/BuildRuntime.cs index 573e60f1..f2440976 100644 --- a/Appwrite/Enums/BuildRuntime.cs +++ b/Appwrite/Enums/BuildRuntime.cs @@ -89,6 +89,7 @@ public BuildRuntime(string value) public static BuildRuntime Bun11 => new BuildRuntime("bun-1.1"); public static BuildRuntime Bun12 => new BuildRuntime("bun-1.2"); public static BuildRuntime Bun13 => new BuildRuntime("bun-1.3"); + public static BuildRuntime Bun14 => new BuildRuntime("bun-1.4"); public static BuildRuntime Go123 => new BuildRuntime("go-1.23"); public static BuildRuntime Go124 => new BuildRuntime("go-1.24"); public static BuildRuntime Go125 => new BuildRuntime("go-1.25"); diff --git a/Appwrite/Enums/DocumentsDBIndexType.cs b/Appwrite/Enums/DocumentsDBIndexType.cs new file mode 100644 index 00000000..ac786c1d --- /dev/null +++ b/Appwrite/Enums/DocumentsDBIndexType.cs @@ -0,0 +1,18 @@ +using System; + +namespace Appwrite.Enums +{ + public class DocumentsDBIndexType : IEnum + { + public string Value { get; private set; } + + public DocumentsDBIndexType(string value) + { + Value = value; + } + + public static DocumentsDBIndexType Key => new DocumentsDBIndexType("key"); + public static DocumentsDBIndexType Fulltext => new DocumentsDBIndexType("fulltext"); + public static DocumentsDBIndexType Unique => new DocumentsDBIndexType("unique"); + } +} diff --git a/Appwrite/Enums/EmbeddingModel.cs b/Appwrite/Enums/EmbeddingModel.cs index d4d52921..a775a655 100644 --- a/Appwrite/Enums/EmbeddingModel.cs +++ b/Appwrite/Enums/EmbeddingModel.cs @@ -12,8 +12,6 @@ public EmbeddingModel(string value) } public static EmbeddingModel NomicEmbedText => new EmbeddingModel("nomic-embed-text"); - public static EmbeddingModel EmbeddingGemma => new EmbeddingModel("embedding-gemma"); public static EmbeddingModel AllMinilm => new EmbeddingModel("all-minilm"); - public static EmbeddingModel BgeSmall => new EmbeddingModel("bge-small"); } } diff --git a/Appwrite/Enums/ExecutionResourceType.cs b/Appwrite/Enums/ExecutionResourceType.cs new file mode 100644 index 00000000..22653ec4 --- /dev/null +++ b/Appwrite/Enums/ExecutionResourceType.cs @@ -0,0 +1,17 @@ +using System; + +namespace Appwrite.Enums +{ + public class ExecutionResourceType : IEnum + { + public string Value { get; private set; } + + public ExecutionResourceType(string value) + { + Value = value; + } + + public static ExecutionResourceType Functions => new ExecutionResourceType("functions"); + public static ExecutionResourceType Sites => new ExecutionResourceType("sites"); + } +} diff --git a/Appwrite/Enums/OAuthProvider.cs b/Appwrite/Enums/OAuthProvider.cs index 7fb67664..aa2a5ddd 100644 --- a/Appwrite/Enums/OAuthProvider.cs +++ b/Appwrite/Enums/OAuthProvider.cs @@ -31,6 +31,7 @@ public OAuthProvider(string value) public static OAuthProvider Github => new OAuthProvider("github"); public static OAuthProvider Gitlab => new OAuthProvider("gitlab"); public static OAuthProvider Google => new OAuthProvider("google"); + public static OAuthProvider Huggingface => new OAuthProvider("huggingface"); public static OAuthProvider Keycloak => new OAuthProvider("keycloak"); public static OAuthProvider Kick => new OAuthProvider("kick"); public static OAuthProvider Linkedin => new OAuthProvider("linkedin"); diff --git a/Appwrite/Enums/ProjectKeyScopes.cs b/Appwrite/Enums/ProjectKeyScopes.cs index 3ba4874b..be81354b 100644 --- a/Appwrite/Enums/ProjectKeyScopes.cs +++ b/Appwrite/Enums/ProjectKeyScopes.cs @@ -13,6 +13,7 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ProjectRead => new ProjectKeyScopes("project.read"); public static ProjectKeyScopes ProjectWrite => new ProjectKeyScopes("project.write"); + public static ProjectKeyScopes UsageRead => new ProjectKeyScopes("usage.read"); public static ProjectKeyScopes KeysRead => new ProjectKeyScopes("keys.read"); public static ProjectKeyScopes KeysWrite => new ProjectKeyScopes("keys.write"); public static ProjectKeyScopes PlatformsRead => new ProjectKeyScopes("platforms.read"); @@ -52,6 +53,18 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes AttributesWrite => new ProjectKeyScopes("attributes.write"); public static ProjectKeyScopes DocumentsRead => new ProjectKeyScopes("documents.read"); public static ProjectKeyScopes DocumentsWrite => new ProjectKeyScopes("documents.write"); + public static ProjectKeyScopes DocumentsdbRead => new ProjectKeyScopes("documentsdb.read"); + public static ProjectKeyScopes DocumentsdbWrite => new ProjectKeyScopes("documentsdb.write"); + public static ProjectKeyScopes DocumentsdbCollectionsRead => new ProjectKeyScopes("documentsdb.collections.read"); + public static ProjectKeyScopes DocumentsdbCollectionsWrite => new ProjectKeyScopes("documentsdb.collections.write"); + public static ProjectKeyScopes DocumentsdbDocumentsRead => new ProjectKeyScopes("documentsdb.documents.read"); + public static ProjectKeyScopes DocumentsdbDocumentsWrite => new ProjectKeyScopes("documentsdb.documents.write"); + public static ProjectKeyScopes VectorsdbRead => new ProjectKeyScopes("vectorsdb.read"); + public static ProjectKeyScopes VectorsdbWrite => new ProjectKeyScopes("vectorsdb.write"); + public static ProjectKeyScopes VectorsdbCollectionsRead => new ProjectKeyScopes("vectorsdb.collections.read"); + public static ProjectKeyScopes VectorsdbCollectionsWrite => new ProjectKeyScopes("vectorsdb.collections.write"); + public static ProjectKeyScopes VectorsdbDocumentsRead => new ProjectKeyScopes("vectorsdb.documents.read"); + public static ProjectKeyScopes VectorsdbDocumentsWrite => new ProjectKeyScopes("vectorsdb.documents.write"); public static ProjectKeyScopes BucketsRead => new ProjectKeyScopes("buckets.read"); public static ProjectKeyScopes BucketsWrite => new ProjectKeyScopes("buckets.write"); public static ProjectKeyScopes FilesRead => new ProjectKeyScopes("files.read"); @@ -104,7 +117,6 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes ArchivesWrite => new ProjectKeyScopes("archives.write"); public static ProjectKeyScopes RestorationsRead => new ProjectKeyScopes("restorations.read"); public static ProjectKeyScopes RestorationsWrite => new ProjectKeyScopes("restorations.write"); - public static ProjectKeyScopes DedicatedDatabasesExecute => new ProjectKeyScopes("dedicatedDatabases.execute"); public static ProjectKeyScopes DomainsRead => new ProjectKeyScopes("domains.read"); public static ProjectKeyScopes DomainsWrite => new ProjectKeyScopes("domains.write"); public static ProjectKeyScopes WafRulesRead => new ProjectKeyScopes("wafRules.read"); @@ -116,6 +128,5 @@ public ProjectKeyScopes(string value) public static ProjectKeyScopes Oauth2Read => new ProjectKeyScopes("oauth2.read"); public static ProjectKeyScopes Oauth2Write => new ProjectKeyScopes("oauth2.write"); public static ProjectKeyScopes Oauth2Introspect => new ProjectKeyScopes("oauth2.introspect"); - public static ProjectKeyScopes UsageRead => new ProjectKeyScopes("usage.read"); } } diff --git a/Appwrite/Enums/ProjectOAuthProviderId.cs b/Appwrite/Enums/ProjectOAuthProviderId.cs index 83c2af26..47ded698 100644 --- a/Appwrite/Enums/ProjectOAuthProviderId.cs +++ b/Appwrite/Enums/ProjectOAuthProviderId.cs @@ -31,6 +31,7 @@ public ProjectOAuthProviderId(string value) public static ProjectOAuthProviderId Github => new ProjectOAuthProviderId("github"); public static ProjectOAuthProviderId Gitlab => new ProjectOAuthProviderId("gitlab"); public static ProjectOAuthProviderId Google => new ProjectOAuthProviderId("google"); + public static ProjectOAuthProviderId Huggingface => new ProjectOAuthProviderId("huggingface"); public static ProjectOAuthProviderId Keycloak => new ProjectOAuthProviderId("keycloak"); public static ProjectOAuthProviderId Kick => new ProjectOAuthProviderId("kick"); public static ProjectOAuthProviderId Linkedin => new ProjectOAuthProviderId("linkedin"); diff --git a/Appwrite/Enums/Runtime.cs b/Appwrite/Enums/Runtime.cs index fe288085..6b3ddc0e 100644 --- a/Appwrite/Enums/Runtime.cs +++ b/Appwrite/Enums/Runtime.cs @@ -89,6 +89,7 @@ public Runtime(string value) public static Runtime Bun11 => new Runtime("bun-1.1"); public static Runtime Bun12 => new Runtime("bun-1.2"); public static Runtime Bun13 => new Runtime("bun-1.3"); + public static Runtime Bun14 => new Runtime("bun-1.4"); public static Runtime Go123 => new Runtime("go-1.23"); public static Runtime Go124 => new Runtime("go-1.24"); public static Runtime Go125 => new Runtime("go-1.25"); diff --git a/Appwrite/Enums/VectorsDBIndexType.cs b/Appwrite/Enums/VectorsDBIndexType.cs new file mode 100644 index 00000000..82a39739 --- /dev/null +++ b/Appwrite/Enums/VectorsDBIndexType.cs @@ -0,0 +1,21 @@ +using System; + +namespace Appwrite.Enums +{ + public class VectorsDBIndexType : IEnum + { + public string Value { get; private set; } + + public VectorsDBIndexType(string value) + { + Value = value; + } + + public static VectorsDBIndexType HnswEuclidean => new VectorsDBIndexType("hnsw_euclidean"); + public static VectorsDBIndexType HnswDot => new VectorsDBIndexType("hnsw_dot"); + public static VectorsDBIndexType HnswCosine => new VectorsDBIndexType("hnsw_cosine"); + public static VectorsDBIndexType Object => new VectorsDBIndexType("object"); + public static VectorsDBIndexType Key => new VectorsDBIndexType("key"); + public static VectorsDBIndexType Unique => new VectorsDBIndexType("unique"); + } +} diff --git a/Appwrite/Extensions/Extensions.cs b/Appwrite/Extensions/Extensions.cs index 9ca30f00..798cd932 100644 --- a/Appwrite/Extensions/Extensions.cs +++ b/Appwrite/Extensions/Extensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/Appwrite/Models/AppInstallation.cs b/Appwrite/Models/AppInstallation.cs index 3e80b8dd..d0849954 100644 --- a/Appwrite/Models/AppInstallation.cs +++ b/Appwrite/Models/AppInstallation.cs @@ -30,7 +30,7 @@ public class AppInstallation public List Scopes { get; private set; } [JsonPropertyName("authorizationDetails")] - public object AuthorizationDetails { get; private set; } + public List AuthorizationDetails { get; private set; } [JsonPropertyName("createdById")] public string CreatedById { get; private set; } @@ -48,7 +48,7 @@ public AppInstallation( string appId, string teamId, List scopes, - object authorizationDetails, + List authorizationDetails, string createdById, string createdByName, string? lastAccessedAt @@ -73,7 +73,7 @@ public AppInstallation( appId: map["appId"].ToString(), teamId: map["teamId"].ToString(), scopes: map["scopes"].ConvertToList(), - authorizationDetails: map["authorizationDetails"], + authorizationDetails: map["authorizationDetails"].ConvertToList(), createdById: map["createdById"].ToString(), createdByName: map["createdByName"].ToString(), lastAccessedAt: map.TryGetValue("lastAccessedAt", out var lastAccessedAt) ? lastAccessedAt?.ToString() : null diff --git a/Appwrite/Models/AttributeObject.cs b/Appwrite/Models/AttributeObject.cs new file mode 100644 index 00000000..844316ef --- /dev/null +++ b/Appwrite/Models/AttributeObject.cs @@ -0,0 +1,84 @@ + +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 AttributeObject + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public Appwrite.Enums.AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + public AttributeObject( + string key, + string type, + Appwrite.Enums.AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt + ) + { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + } + + public static AttributeObject From(Dictionary map) => new AttributeObject( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null + ? (bool?)boolRaw6 + : null, + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt } + }; + } +} diff --git a/Appwrite/Models/AttributeVector.cs b/Appwrite/Models/AttributeVector.cs new file mode 100644 index 00000000..632fedb8 --- /dev/null +++ b/Appwrite/Models/AttributeVector.cs @@ -0,0 +1,91 @@ + +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 AttributeVector + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public Appwrite.Enums.AttributeStatus Status { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + [JsonPropertyName("required")] + public bool Required { get; private set; } + + [JsonPropertyName("array")] + public bool? Array { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("$updatedAt")] + public string UpdatedAt { get; private set; } + + [JsonPropertyName("size")] + public long Size { get; private set; } + + public AttributeVector( + string key, + string type, + Appwrite.Enums.AttributeStatus status, + string error, + bool required, + bool? array, + string createdAt, + string updatedAt, + long size + ) + { + Key = key; + Type = type; + Status = status; + Error = error; + Required = required; + Array = array; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Size = size; + } + + public static AttributeVector From(Dictionary map) => new AttributeVector( + key: map["key"].ToString(), + type: map["type"].ToString(), + status: new Appwrite.Enums.AttributeStatus(map["status"].ToString()!), + error: map["error"].ToString(), + required: (bool)map["required"], + array: map.TryGetValue("array", out var boolRaw6) && boolRaw6 != null + ? (bool?)boolRaw6 + : null, + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + size: Convert.ToInt64(map["size"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "type", Type }, + { "status", Status.Value }, + { "error", Error }, + { "required", Required }, + { "array", Array }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "size", Size } + }; + } +} diff --git a/Appwrite/Models/BillingPlan.cs b/Appwrite/Models/BillingPlan.cs index 3d7bd37f..a1532145 100644 --- a/Appwrite/Models/BillingPlan.cs +++ b/Appwrite/Models/BillingPlan.cs @@ -170,6 +170,9 @@ public class BillingPlan [JsonPropertyName("supportsCredits")] public bool SupportsCredits { get; private set; } + [JsonPropertyName("supportsDedicatedDatabases")] + public bool SupportsDedicatedDatabases { get; private set; } + [JsonPropertyName("supportsDisposableEmailValidation")] public bool SupportsDisposableEmailValidation { get; private set; } @@ -215,6 +218,9 @@ public class BillingPlan [JsonPropertyName("program")] public Program? Program { get; private set; } + [JsonPropertyName("databaseComputeCredit")] + public double DatabaseComputeCredit { get; private set; } + [JsonPropertyName("dedicatedDatabases")] public BillingPlanDedicatedDatabaseLimits? DedicatedDatabases { get; private set; } @@ -272,6 +278,7 @@ public BillingPlan( bool supportsMockNumbers, bool supportsOrganizationRoles, bool supportsCredits, + bool supportsDedicatedDatabases, bool supportsDisposableEmailValidation, bool supportsCanonicalEmailValidation, bool supportsFreeEmailValidation, @@ -287,6 +294,7 @@ public BillingPlan( BillingPlanLimits? limits, Appwrite.Enums.BillingPlanGroup @group, Program? program, + double databaseComputeCredit, BillingPlanDedicatedDatabaseLimits? dedicatedDatabases ) { @@ -343,6 +351,7 @@ public BillingPlan( SupportsMockNumbers = supportsMockNumbers; SupportsOrganizationRoles = supportsOrganizationRoles; SupportsCredits = supportsCredits; + SupportsDedicatedDatabases = supportsDedicatedDatabases; SupportsDisposableEmailValidation = supportsDisposableEmailValidation; SupportsCanonicalEmailValidation = supportsCanonicalEmailValidation; SupportsFreeEmailValidation = supportsFreeEmailValidation; @@ -358,6 +367,7 @@ public BillingPlan( Limits = limits; Group = @group; Program = program; + DatabaseComputeCredit = databaseComputeCredit; DedicatedDatabases = dedicatedDatabases; } @@ -421,31 +431,33 @@ public BillingPlan( supportsMockNumbers: (bool)map["supportsMockNumbers"], supportsOrganizationRoles: (bool)map["supportsOrganizationRoles"], supportsCredits: (bool)map["supportsCredits"], + supportsDedicatedDatabases: (bool)map["supportsDedicatedDatabases"], supportsDisposableEmailValidation: (bool)map["supportsDisposableEmailValidation"], supportsCanonicalEmailValidation: (bool)map["supportsCanonicalEmailValidation"], supportsFreeEmailValidation: (bool)map["supportsFreeEmailValidation"], supportsCorporateEmailValidation: (bool)map["supportsCorporateEmailValidation"], supportsProjectSpecificRoles: (bool)map["supportsProjectSpecificRoles"], - backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw59) && boolRaw59 != null - ? (bool?)boolRaw59 + backupsEnabled: map.TryGetValue("backupsEnabled", out var boolRaw60) && boolRaw60 != null + ? (bool?)boolRaw60 : null, usagePerProject: (bool)map["usagePerProject"], - supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj61 ? jsonObj61.Deserialize>()! : (Dictionary)map["supportedAddons"]), - backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw62) && numberRaw62 != null - ? Convert.ToInt64(numberRaw62) + supportedAddons: Appwrite.Models.BillingPlanSupportedAddons.From(map: map["supportedAddons"] is JsonElement jsonObj62 ? jsonObj62.Deserialize>()! : (Dictionary)map["supportedAddons"]), + backupPolicies: map.TryGetValue("backupPolicies", out var numberRaw63) && numberRaw63 != null + ? Convert.ToInt64(numberRaw63) : null, deploymentSize: Convert.ToInt64(map["deploymentSize"]), buildSize: Convert.ToInt64(map["buildSize"]), databasesAllowEncrypt: (bool)map["databasesAllowEncrypt"], - limits: map.TryGetValue("limits", out var objectRaw66) && objectRaw66 != null - ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw66 is JsonElement jsonObj66 ? jsonObj66.Deserialize>()! : (Dictionary)objectRaw66) + limits: map.TryGetValue("limits", out var objectRaw67) && objectRaw67 != null + ? Appwrite.Models.BillingPlanLimits.From(map: objectRaw67 is JsonElement jsonObj67 ? jsonObj67.Deserialize>()! : (Dictionary)objectRaw67) : null, @group: new Appwrite.Enums.BillingPlanGroup(map["group"].ToString()!), - program: map.TryGetValue("program", out var objectRaw68) && objectRaw68 != null - ? Appwrite.Models.Program.From(map: objectRaw68 is JsonElement jsonObj68 ? jsonObj68.Deserialize>()! : (Dictionary)objectRaw68) + program: map.TryGetValue("program", out var objectRaw69) && objectRaw69 != null + ? Appwrite.Models.Program.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) : null, - dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw69) && objectRaw69 != null - ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw69 is JsonElement jsonObj69 ? jsonObj69.Deserialize>()! : (Dictionary)objectRaw69) + databaseComputeCredit: Convert.ToDouble(map["databaseComputeCredit"]), + dedicatedDatabases: map.TryGetValue("dedicatedDatabases", out var objectRaw71) && objectRaw71 != null + ? Appwrite.Models.BillingPlanDedicatedDatabaseLimits.From(map: objectRaw71 is JsonElement jsonObj71 ? jsonObj71.Deserialize>()! : (Dictionary)objectRaw71) : null ); @@ -504,6 +516,7 @@ public BillingPlan( { "supportsMockNumbers", SupportsMockNumbers }, { "supportsOrganizationRoles", SupportsOrganizationRoles }, { "supportsCredits", SupportsCredits }, + { "supportsDedicatedDatabases", SupportsDedicatedDatabases }, { "supportsDisposableEmailValidation", SupportsDisposableEmailValidation }, { "supportsCanonicalEmailValidation", SupportsCanonicalEmailValidation }, { "supportsFreeEmailValidation", SupportsFreeEmailValidation }, @@ -519,6 +532,7 @@ public BillingPlan( { "limits", Limits?.ToMap() }, { "group", Group.Value }, { "program", Program?.ToMap() }, + { "databaseComputeCredit", DatabaseComputeCredit }, { "dedicatedDatabases", DedicatedDatabases?.ToMap() } }; } diff --git a/Appwrite/Models/Database.cs b/Appwrite/Models/Database.cs index c1ade276..419a1e6a 100644 --- a/Appwrite/Models/Database.cs +++ b/Appwrite/Models/Database.cs @@ -41,6 +41,15 @@ public class Database [JsonPropertyName("replicas")] public long? Replicas { get; private set; } + [JsonPropertyName("error")] + public string? Error { get; private set; } + + [JsonPropertyName("containerStatus")] + public string? ContainerStatus { get; private set; } + + [JsonPropertyName("lifecycleState")] + public string? LifecycleState { get; private set; } + [JsonPropertyName("policies")] public List? Policies { get; private set; } @@ -58,6 +67,9 @@ public Database( string? engine, string? specification, long? replicas, + string? error, + string? containerStatus, + string? lifecycleState, List? policies, List? archives ) @@ -72,6 +84,9 @@ public Database( Engine = engine; Specification = specification; Replicas = replicas; + Error = error; + ContainerStatus = containerStatus; + LifecycleState = lifecycleState; Policies = policies; Archives = archives; } @@ -93,11 +108,14 @@ public Database( replicas: map.TryGetValue("replicas", out var numberRaw10) && numberRaw10 != null ? Convert.ToInt64(numberRaw10) : null, - policies: map.TryGetValue("policies", out var arrayRaw11) && arrayRaw11 != null - ? arrayRaw11.ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() + error: map.TryGetValue("error", out var error) ? error?.ToString() : null, + containerStatus: map.TryGetValue("containerStatus", out var containerStatus) ? containerStatus?.ToString() : null, + lifecycleState: map.TryGetValue("lifecycleState", out var lifecycleState) ? lifecycleState?.ToString() : null, + policies: map.TryGetValue("policies", out var arrayRaw14) && arrayRaw14 != null + ? arrayRaw14.ConvertToList>().Select(it => Appwrite.Models.BackupPolicy.From(map: it)).ToList() : null, - archives: map.TryGetValue("archives", out var arrayRaw12) && arrayRaw12 != null - ? arrayRaw12.ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() + archives: map.TryGetValue("archives", out var arrayRaw15) && arrayRaw15 != null + ? arrayRaw15.ConvertToList>().Select(it => Appwrite.Models.BackupArchive.From(map: it)).ToList() : null ); @@ -113,6 +131,9 @@ public Database( { "engine", Engine }, { "specification", Specification }, { "replicas", Replicas }, + { "error", Error }, + { "containerStatus", ContainerStatus }, + { "lifecycleState", LifecycleState }, { "policies", Policies?.Select(it => it.ToMap()).ToList() }, { "archives", Archives?.Select(it => it.ToMap()).ToList() } }; diff --git a/Appwrite/Models/DatabaseMigration.cs b/Appwrite/Models/DatabaseMigration.cs index f6132288..200e2bab 100644 --- a/Appwrite/Models/DatabaseMigration.cs +++ b/Appwrite/Models/DatabaseMigration.cs @@ -41,6 +41,9 @@ public class DatabaseMigration [JsonPropertyName("lagDocuments")] public long LagDocuments { get; private set; } + [JsonPropertyName("changelogWatermark")] + public long ChangelogWatermark { get; private set; } + [JsonPropertyName("verifiedAt")] public string VerifiedAt { get; private set; } @@ -70,6 +73,7 @@ public DatabaseMigration( long attempt, string lastError, long lagDocuments, + long changelogWatermark, string verifiedAt, string cutoverAt, string soakUntil, @@ -88,6 +92,7 @@ bool paused Attempt = attempt; LastError = lastError; LagDocuments = lagDocuments; + ChangelogWatermark = changelogWatermark; VerifiedAt = verifiedAt; CutoverAt = cutoverAt; SoakUntil = soakUntil; @@ -107,6 +112,7 @@ bool paused attempt: Convert.ToInt64(map["attempt"]), lastError: map["lastError"].ToString(), lagDocuments: Convert.ToInt64(map["lagDocuments"]), + changelogWatermark: Convert.ToInt64(map["changelogWatermark"]), verifiedAt: map["verifiedAt"].ToString(), cutoverAt: map["cutoverAt"].ToString(), soakUntil: map["soakUntil"].ToString(), @@ -127,6 +133,7 @@ bool paused { "attempt", Attempt }, { "lastError", LastError }, { "lagDocuments", LagDocuments }, + { "changelogWatermark", ChangelogWatermark }, { "verifiedAt", VerifiedAt }, { "cutoverAt", CutoverAt }, { "soakUntil", SoakUntil }, diff --git a/Appwrite/Models/DatabaseStatusReplica.cs b/Appwrite/Models/DatabaseStatusReplica.cs index b5b8442b..c197c82f 100644 --- a/Appwrite/Models/DatabaseStatusReplica.cs +++ b/Appwrite/Models/DatabaseStatusReplica.cs @@ -20,6 +20,9 @@ public class DatabaseStatusReplica [JsonPropertyName("healthy")] public bool Healthy { get; private set; } + [JsonPropertyName("replicating")] + public bool? Replicating { get; private set; } + [JsonPropertyName("lagSeconds")] public double? LagSeconds { get; private set; } @@ -27,12 +30,14 @@ public DatabaseStatusReplica( long index, string role, bool healthy, + bool? replicating, double? lagSeconds ) { Index = index; Role = role; Healthy = healthy; + Replicating = replicating; LagSeconds = lagSeconds; } @@ -40,8 +45,11 @@ public DatabaseStatusReplica( index: Convert.ToInt64(map["index"]), role: map["role"].ToString(), healthy: (bool)map["healthy"], - lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null - ? Convert.ToDouble(numberRaw4) + replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null + ? (bool?)boolRaw4 + : null, + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw5) && numberRaw5 != null + ? Convert.ToDouble(numberRaw5) : null ); @@ -50,6 +58,7 @@ public DatabaseStatusReplica( { "index", Index }, { "role", Role }, { "healthy", Healthy }, + { "replicating", Replicating }, { "lagSeconds", LagSeconds } }; } diff --git a/Appwrite/Models/DedicatedDatabaseBackup.cs b/Appwrite/Models/DedicatedDatabaseBackup.cs new file mode 100644 index 00000000..ab7cb2af --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackup.cs @@ -0,0 +1,145 @@ + +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 DedicatedDatabaseBackup + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("policyId")] + public string PolicyId { get; private set; } + + [JsonPropertyName("trigger")] + public string Trigger { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("requestedType")] + public string RequestedType { get; private set; } + + [JsonPropertyName("fallbackReason")] + public string FallbackReason { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("sizeBytes")] + public long SizeBytes { get; private set; } + + [JsonPropertyName("startedAt")] + public string? StartedAt { get; private set; } + + [JsonPropertyName("completedAt")] + public string? CompletedAt { get; private set; } + + [JsonPropertyName("verifiedAt")] + public string? VerifiedAt { get; private set; } + + [JsonPropertyName("expiresAt")] + public string? ExpiresAt { get; private set; } + + [JsonPropertyName("logPosition")] + public string? LogPosition { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public DedicatedDatabaseBackup( + string id, + string createdAt, + string databaseId, + string projectId, + string policyId, + string trigger, + string type, + string requestedType, + string fallbackReason, + string status, + long sizeBytes, + string? startedAt, + string? completedAt, + string? verifiedAt, + string? expiresAt, + string? logPosition, + string error + ) + { + Id = id; + CreatedAt = createdAt; + DatabaseId = databaseId; + ProjectId = projectId; + PolicyId = policyId; + Trigger = trigger; + Type = type; + RequestedType = requestedType; + FallbackReason = fallbackReason; + Status = status; + SizeBytes = sizeBytes; + StartedAt = startedAt; + CompletedAt = completedAt; + VerifiedAt = verifiedAt; + ExpiresAt = expiresAt; + LogPosition = logPosition; + Error = error; + } + + public static DedicatedDatabaseBackup From(Dictionary map) => new DedicatedDatabaseBackup( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + databaseId: map["databaseId"].ToString(), + projectId: map["projectId"].ToString(), + policyId: map["policyId"].ToString(), + trigger: map["trigger"].ToString(), + type: map["type"].ToString(), + requestedType: map["requestedType"].ToString(), + fallbackReason: map["fallbackReason"].ToString(), + status: map["status"].ToString(), + sizeBytes: Convert.ToInt64(map["sizeBytes"]), + startedAt: map.TryGetValue("startedAt", out var startedAt) ? startedAt?.ToString() : null, + completedAt: map.TryGetValue("completedAt", out var completedAt) ? completedAt?.ToString() : null, + verifiedAt: map.TryGetValue("verifiedAt", out var verifiedAt) ? verifiedAt?.ToString() : null, + expiresAt: map.TryGetValue("expiresAt", out var expiresAt) ? expiresAt?.ToString() : null, + logPosition: map.TryGetValue("logPosition", out var logPosition) ? logPosition?.ToString() : null, + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "databaseId", DatabaseId }, + { "projectId", ProjectId }, + { "policyId", PolicyId }, + { "trigger", Trigger }, + { "type", Type }, + { "requestedType", RequestedType }, + { "fallbackReason", FallbackReason }, + { "status", Status }, + { "sizeBytes", SizeBytes }, + { "startedAt", StartedAt }, + { "completedAt", CompletedAt }, + { "verifiedAt", VerifiedAt }, + { "expiresAt", ExpiresAt }, + { "logPosition", LogPosition }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBackupList.cs b/Appwrite/Models/DedicatedDatabaseBackupList.cs new file mode 100644 index 00000000..8793bbe5 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackupList.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseBackupList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("backups")] + public List Backups { get; private set; } + + public DedicatedDatabaseBackupList( + long total, + List backups + ) + { + Total = total; + Backups = backups; + } + + public static DedicatedDatabaseBackupList From(Dictionary map) => new DedicatedDatabaseBackupList( + total: Convert.ToInt64(map["total"]), + backups: map["backups"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBackup.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "backups", Backups?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBackupStorage.cs b/Appwrite/Models/DedicatedDatabaseBackupStorage.cs new file mode 100644 index 00000000..57b73f2f --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBackupStorage.cs @@ -0,0 +1,61 @@ + +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 DedicatedDatabaseBackupStorage + { + [JsonPropertyName("provider")] + public string Provider { get; private set; } + + [JsonPropertyName("bucket")] + public string Bucket { get; private set; } + + [JsonPropertyName("region")] + public string Region { get; private set; } + + [JsonPropertyName("prefix")] + public string Prefix { get; private set; } + + [JsonPropertyName("endpoint")] + public string Endpoint { get; private set; } + + public DedicatedDatabaseBackupStorage( + string provider, + string bucket, + string region, + string prefix, + string endpoint + ) + { + Provider = provider; + Bucket = bucket; + Region = region; + Prefix = prefix; + Endpoint = endpoint; + } + + public static DedicatedDatabaseBackupStorage From(Dictionary map) => new DedicatedDatabaseBackupStorage( + provider: map["provider"].ToString(), + bucket: map["bucket"].ToString(), + region: map["region"].ToString(), + prefix: map["prefix"].ToString(), + endpoint: map["endpoint"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "provider", Provider }, + { "bucket", Bucket }, + { "region", Region }, + { "prefix", Prefix }, + { "endpoint", Endpoint } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBranch.cs b/Appwrite/Models/DedicatedDatabaseBranch.cs new file mode 100644 index 00000000..9b52b6e0 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBranch.cs @@ -0,0 +1,110 @@ + +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 DedicatedDatabaseBranch + { + [JsonPropertyName("branchId")] + public string BranchId { get; private set; } + + [JsonPropertyName("branchName")] + public string BranchName { get; private set; } + + [JsonPropertyName("namespace")] + public string Namespace { get; private set; } + + [JsonPropertyName("expiresAt")] + public long ExpiresAt { get; private set; } + + [JsonPropertyName("host")] + public string Host { get; private set; } + + [JsonPropertyName("port")] + public long Port { get; private set; } + + [JsonPropertyName("database")] + public string Database { get; private set; } + + [JsonPropertyName("username")] + public string Username { get; private set; } + + [JsonPropertyName("password")] + public string Password { get; private set; } + + [JsonPropertyName("ssl")] + public bool Ssl { get; private set; } + + [JsonPropertyName("engine")] + public string Engine { get; private set; } + + [JsonPropertyName("connectionString")] + public string ConnectionString { get; private set; } + + public DedicatedDatabaseBranch( + string branchId, + string branchName, + string @namespace, + long expiresAt, + string host, + long port, + string database, + string username, + string password, + bool ssl, + string engine, + string connectionString + ) + { + BranchId = branchId; + BranchName = branchName; + Namespace = @namespace; + ExpiresAt = expiresAt; + Host = host; + Port = port; + Database = database; + Username = username; + Password = password; + Ssl = ssl; + Engine = engine; + ConnectionString = connectionString; + } + + public static DedicatedDatabaseBranch From(Dictionary map) => new DedicatedDatabaseBranch( + branchId: map["branchId"].ToString(), + branchName: map["branchName"].ToString(), + @namespace: map["namespace"].ToString(), + expiresAt: Convert.ToInt64(map["expiresAt"]), + host: map["host"].ToString(), + port: Convert.ToInt64(map["port"]), + database: map["database"].ToString(), + username: map["username"].ToString(), + password: map["password"].ToString(), + ssl: (bool)map["ssl"], + engine: map["engine"].ToString(), + connectionString: map["connectionString"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "branchId", BranchId }, + { "branchName", BranchName }, + { "namespace", Namespace }, + { "expiresAt", ExpiresAt }, + { "host", Host }, + { "port", Port }, + { "database", Database }, + { "username", Username }, + { "password", Password }, + { "ssl", Ssl }, + { "engine", Engine }, + { "connectionString", ConnectionString } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseBranchList.cs b/Appwrite/Models/DedicatedDatabaseBranchList.cs new file mode 100644 index 00000000..353f68a6 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseBranchList.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseBranchList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("branches")] + public List Branches { get; private set; } + + public DedicatedDatabaseBranchList( + long total, + List branches + ) + { + Total = total; + Branches = branches; + } + + public static DedicatedDatabaseBranchList From(Dictionary map) => new DedicatedDatabaseBranchList( + total: Convert.ToInt64(map["total"]), + branches: map["branches"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseBranch.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "branches", Branches?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExecution.cs b/Appwrite/Models/DedicatedDatabaseExecution.cs new file mode 100644 index 00000000..295d9800 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExecution.cs @@ -0,0 +1,68 @@ + +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 DedicatedDatabaseExecution + { + [JsonPropertyName("rows")] + public List Rows { get; private set; } + + [JsonPropertyName("rowCount")] + public long RowCount { get; private set; } + + [JsonPropertyName("columns")] + public List Columns { get; private set; } + + [JsonPropertyName("durationMs")] + public long DurationMs { get; private set; } + + [JsonPropertyName("truncated")] + public bool Truncated { get; private set; } + + [JsonPropertyName("bytes")] + public long Bytes { get; private set; } + + public DedicatedDatabaseExecution( + List rows, + long rowCount, + List columns, + long durationMs, + bool truncated, + long bytes + ) + { + Rows = rows; + RowCount = rowCount; + Columns = columns; + DurationMs = durationMs; + Truncated = truncated; + Bytes = bytes; + } + + public static DedicatedDatabaseExecution From(Dictionary map) => new DedicatedDatabaseExecution( + rows: map["rows"].ConvertToList(), + rowCount: Convert.ToInt64(map["rowCount"]), + columns: map["columns"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseExecutionColumn.From(map: it)).ToList(), + durationMs: Convert.ToInt64(map["durationMs"]), + truncated: (bool)map["truncated"], + bytes: Convert.ToInt64(map["bytes"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "rows", Rows }, + { "rowCount", RowCount }, + { "columns", Columns?.Select(it => it.ToMap()).ToList() }, + { "durationMs", DurationMs }, + { "truncated", Truncated }, + { "bytes", Bytes } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs b/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs new file mode 100644 index 00000000..14af6ade --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExecutionColumn.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseExecutionColumn + { + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + public DedicatedDatabaseExecutionColumn( + string name, + string type + ) + { + Name = name; + Type = type; + } + + public static DedicatedDatabaseExecutionColumn From(Dictionary map) => new DedicatedDatabaseExecutionColumn( + name: map["name"].ToString(), + type: map["type"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "name", Name }, + { "type", Type } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseExtensions.cs b/Appwrite/Models/DedicatedDatabaseExtensions.cs new file mode 100644 index 00000000..3a7fb94c --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseExtensions.cs @@ -0,0 +1,47 @@ + +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 DedicatedDatabaseExtensions + { + [JsonPropertyName("installed")] + public List Installed { get; private set; } + + [JsonPropertyName("available")] + public List Available { get; private set; } + + [JsonPropertyName("metadata")] + public List Metadata { get; private set; } + + public DedicatedDatabaseExtensions( + List installed, + List available, + List metadata + ) + { + Installed = installed; + Available = available; + Metadata = metadata; + } + + public static DedicatedDatabaseExtensions From(Dictionary map) => new DedicatedDatabaseExtensions( + installed: map["installed"].ConvertToList(), + available: map["available"].ConvertToList(), + metadata: map["metadata"].ConvertToList>().Select(it => Appwrite.Models.PostgresExtension.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "installed", Installed }, + { "available", Available }, + { "metadata", Metadata?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseList.cs b/Appwrite/Models/DedicatedDatabaseList.cs new file mode 100644 index 00000000..95c02b4f --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseList.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("databases")] + public List Databases { get; private set; } + + public DedicatedDatabaseList( + long total, + List databases + ) + { + Total = total; + Databases = databases; + } + + public static DedicatedDatabaseList From(Dictionary map) => new DedicatedDatabaseList( + total: Convert.ToInt64(map["total"]), + databases: map["databases"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabase.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "databases", Databases?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseMember.cs b/Appwrite/Models/DedicatedDatabaseMember.cs index 942fc564..527633e3 100644 --- a/Appwrite/Models/DedicatedDatabaseMember.cs +++ b/Appwrite/Models/DedicatedDatabaseMember.cs @@ -20,6 +20,9 @@ public class DedicatedDatabaseMember [JsonPropertyName("status")] public string Status { get; private set; } + [JsonPropertyName("replicating")] + public bool? Replicating { get; private set; } + [JsonPropertyName("lagSeconds")] public double? LagSeconds { get; private set; } @@ -27,12 +30,14 @@ public DedicatedDatabaseMember( string id, string role, string status, + bool? replicating, double? lagSeconds ) { Id = id; Role = role; Status = status; + Replicating = replicating; LagSeconds = lagSeconds; } @@ -40,8 +45,11 @@ public DedicatedDatabaseMember( id: map["$id"].ToString(), role: map["role"].ToString(), status: map["status"].ToString(), - lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw4) && numberRaw4 != null - ? Convert.ToDouble(numberRaw4) + replicating: map.TryGetValue("replicating", out var boolRaw4) && boolRaw4 != null + ? (bool?)boolRaw4 + : null, + lagSeconds: map.TryGetValue("lagSeconds", out var numberRaw5) && numberRaw5 != null + ? Convert.ToDouble(numberRaw5) : null ); @@ -50,6 +58,7 @@ public DedicatedDatabaseMember( { "$id", Id }, { "role", Role }, { "status", Status }, + { "replicating", Replicating }, { "lagSeconds", LagSeconds } }; } diff --git a/Appwrite/Models/DedicatedDatabasePITRWindows.cs b/Appwrite/Models/DedicatedDatabasePITRWindows.cs new file mode 100644 index 00000000..c28ecb80 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabasePITRWindows.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabasePITRWindows + { + [JsonPropertyName("earliest")] + public string Earliest { get; private set; } + + [JsonPropertyName("latest")] + public string Latest { get; private set; } + + public DedicatedDatabasePITRWindows( + string earliest, + string latest + ) + { + Earliest = earliest; + Latest = latest; + } + + public static DedicatedDatabasePITRWindows From(Dictionary map) => new DedicatedDatabasePITRWindows( + earliest: map["earliest"].ToString(), + latest: map["latest"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "earliest", Earliest }, + { "latest", Latest } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabasePooler.cs b/Appwrite/Models/DedicatedDatabasePooler.cs new file mode 100644 index 00000000..f68c0fd9 --- /dev/null +++ b/Appwrite/Models/DedicatedDatabasePooler.cs @@ -0,0 +1,96 @@ + +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 DedicatedDatabasePooler + { + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("mode")] + public string Mode { get; private set; } + + [JsonPropertyName("maxConnections")] + public long MaxConnections { get; private set; } + + [JsonPropertyName("defaultPoolSize")] + public long DefaultPoolSize { get; private set; } + + [JsonPropertyName("port")] + public long Port { get; private set; } + + [JsonPropertyName("readWriteSplitting")] + public bool ReadWriteSplitting { get; private set; } + + [JsonPropertyName("poolerCpuRequest")] + public string PoolerCpuRequest { get; private set; } + + [JsonPropertyName("poolerCpuLimit")] + public string PoolerCpuLimit { get; private set; } + + [JsonPropertyName("poolerMemoryRequest")] + public string PoolerMemoryRequest { get; private set; } + + [JsonPropertyName("poolerMemoryLimit")] + public string PoolerMemoryLimit { get; private set; } + + public DedicatedDatabasePooler( + bool enabled, + string mode, + long maxConnections, + long defaultPoolSize, + long port, + bool readWriteSplitting, + string poolerCpuRequest, + string poolerCpuLimit, + string poolerMemoryRequest, + string poolerMemoryLimit + ) + { + Enabled = enabled; + Mode = mode; + MaxConnections = maxConnections; + DefaultPoolSize = defaultPoolSize; + Port = port; + ReadWriteSplitting = readWriteSplitting; + PoolerCpuRequest = poolerCpuRequest; + PoolerCpuLimit = poolerCpuLimit; + PoolerMemoryRequest = poolerMemoryRequest; + PoolerMemoryLimit = poolerMemoryLimit; + } + + public static DedicatedDatabasePooler From(Dictionary map) => new DedicatedDatabasePooler( + enabled: (bool)map["enabled"], + mode: map["mode"].ToString(), + maxConnections: Convert.ToInt64(map["maxConnections"]), + defaultPoolSize: Convert.ToInt64(map["defaultPoolSize"]), + port: Convert.ToInt64(map["port"]), + readWriteSplitting: (bool)map["readWriteSplitting"], + poolerCpuRequest: map["poolerCpuRequest"].ToString(), + poolerCpuLimit: map["poolerCpuLimit"].ToString(), + poolerMemoryRequest: map["poolerMemoryRequest"].ToString(), + poolerMemoryLimit: map["poolerMemoryLimit"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "enabled", Enabled }, + { "mode", Mode }, + { "maxConnections", MaxConnections }, + { "defaultPoolSize", DefaultPoolSize }, + { "port", Port }, + { "readWriteSplitting", ReadWriteSplitting }, + { "poolerCpuRequest", PoolerCpuRequest }, + { "poolerCpuLimit", PoolerCpuLimit }, + { "poolerMemoryRequest", PoolerMemoryRequest }, + { "poolerMemoryLimit", PoolerMemoryLimit } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseRestoration.cs b/Appwrite/Models/DedicatedDatabaseRestoration.cs new file mode 100644 index 00000000..6ade83fb --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseRestoration.cs @@ -0,0 +1,110 @@ + +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 DedicatedDatabaseRestoration + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("$createdAt")] + public string CreatedAt { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("sourceDatabaseId")] + public string SourceDatabaseId { get; private set; } + + [JsonPropertyName("projectId")] + public string ProjectId { get; private set; } + + [JsonPropertyName("backupId")] + public string BackupId { get; private set; } + + [JsonPropertyName("type")] + public string Type { get; private set; } + + [JsonPropertyName("status")] + public string Status { get; private set; } + + [JsonPropertyName("targetTime")] + public string TargetTime { get; private set; } + + [JsonPropertyName("startedAt")] + public string StartedAt { get; private set; } + + [JsonPropertyName("completedAt")] + public string CompletedAt { get; private set; } + + [JsonPropertyName("error")] + public string Error { get; private set; } + + public DedicatedDatabaseRestoration( + string id, + string createdAt, + string databaseId, + string sourceDatabaseId, + string projectId, + string backupId, + string type, + string status, + string targetTime, + string startedAt, + string completedAt, + string error + ) + { + Id = id; + CreatedAt = createdAt; + DatabaseId = databaseId; + SourceDatabaseId = sourceDatabaseId; + ProjectId = projectId; + BackupId = backupId; + Type = type; + Status = status; + TargetTime = targetTime; + StartedAt = startedAt; + CompletedAt = completedAt; + Error = error; + } + + public static DedicatedDatabaseRestoration From(Dictionary map) => new DedicatedDatabaseRestoration( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + databaseId: map["databaseId"].ToString(), + sourceDatabaseId: map["sourceDatabaseId"].ToString(), + projectId: map["projectId"].ToString(), + backupId: map["backupId"].ToString(), + type: map["type"].ToString(), + status: map["status"].ToString(), + targetTime: map["targetTime"].ToString(), + startedAt: map["startedAt"].ToString(), + completedAt: map["completedAt"].ToString(), + error: map["error"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "databaseId", DatabaseId }, + { "sourceDatabaseId", SourceDatabaseId }, + { "projectId", ProjectId }, + { "backupId", BackupId }, + { "type", Type }, + { "status", Status }, + { "targetTime", TargetTime }, + { "startedAt", StartedAt }, + { "completedAt", CompletedAt }, + { "error", Error } + }; + } +} diff --git a/Appwrite/Models/DedicatedDatabaseRestorationList.cs b/Appwrite/Models/DedicatedDatabaseRestorationList.cs new file mode 100644 index 00000000..fc23597c --- /dev/null +++ b/Appwrite/Models/DedicatedDatabaseRestorationList.cs @@ -0,0 +1,40 @@ + +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 DedicatedDatabaseRestorationList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("restorations")] + public List Restorations { get; private set; } + + public DedicatedDatabaseRestorationList( + long total, + List restorations + ) + { + Total = total; + Restorations = restorations; + } + + public static DedicatedDatabaseRestorationList From(Dictionary map) => new DedicatedDatabaseRestorationList( + total: Convert.ToInt64(map["total"]), + restorations: map["restorations"].ConvertToList>().Select(it => Appwrite.Models.DedicatedDatabaseRestoration.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "restorations", Restorations?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Models/Execution.cs b/Appwrite/Models/Execution.cs index 2393dbc0..fb131efd 100644 --- a/Appwrite/Models/Execution.cs +++ b/Appwrite/Models/Execution.cs @@ -23,8 +23,11 @@ public class Execution [JsonPropertyName("$permissions")] public List Permissions { get; private set; } - [JsonPropertyName("functionId")] - public string FunctionId { get; private set; } + [JsonPropertyName("resourceId")] + public string ResourceId { get; private set; } + + [JsonPropertyName("resourceType")] + public Appwrite.Enums.ExecutionResourceType ResourceType { get; private set; } [JsonPropertyName("deploymentId")] public string DeploymentId { get; private set; } @@ -70,7 +73,8 @@ public Execution( string createdAt, string updatedAt, List permissions, - string functionId, + string resourceId, + Appwrite.Enums.ExecutionResourceType resourceType, string deploymentId, Appwrite.Enums.ExecutionTrigger trigger, Appwrite.Enums.ExecutionStatus status, @@ -90,7 +94,8 @@ public Execution( CreatedAt = createdAt; UpdatedAt = updatedAt; Permissions = permissions; - FunctionId = functionId; + ResourceId = resourceId; + ResourceType = resourceType; DeploymentId = deploymentId; Trigger = trigger; Status = status; @@ -111,7 +116,8 @@ public Execution( createdAt: map["$createdAt"].ToString(), updatedAt: map["$updatedAt"].ToString(), permissions: map["$permissions"].ConvertToList(), - functionId: map["functionId"].ToString(), + resourceId: map["resourceId"].ToString(), + resourceType: new Appwrite.Enums.ExecutionResourceType(map["resourceType"].ToString()!), deploymentId: map["deploymentId"].ToString(), trigger: new Appwrite.Enums.ExecutionTrigger(map["trigger"].ToString()!), status: new Appwrite.Enums.ExecutionStatus(map["status"].ToString()!), @@ -133,7 +139,8 @@ public Execution( { "$createdAt", CreatedAt }, { "$updatedAt", UpdatedAt }, { "$permissions", Permissions }, - { "functionId", FunctionId }, + { "resourceId", ResourceId }, + { "resourceType", ResourceType.Value }, { "deploymentId", DeploymentId }, { "trigger", Trigger.Value }, { "status", Status.Value }, diff --git a/Appwrite/Models/OAuth2Google.cs b/Appwrite/Models/OAuth2Google.cs index b8875a2e..cb8118da 100644 --- a/Appwrite/Models/OAuth2Google.cs +++ b/Appwrite/Models/OAuth2Google.cs @@ -55,7 +55,7 @@ public OAuth2Google( { "enabled", Enabled }, { "clientId", ClientId }, { "clientSecret", ClientSecret }, - { "prompt", Prompt } + { "prompt", Prompt.Select(it => it.Value).ToList() } }; } } diff --git a/Appwrite/Models/OAuth2HuggingFace.cs b/Appwrite/Models/OAuth2HuggingFace.cs new file mode 100644 index 00000000..a74c9546 --- /dev/null +++ b/Appwrite/Models/OAuth2HuggingFace.cs @@ -0,0 +1,54 @@ + +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 OAuth2HuggingFace + { + [JsonPropertyName("$id")] + public string Id { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("clientId")] + public string ClientId { get; private set; } + + [JsonPropertyName("clientSecret")] + public string ClientSecret { get; private set; } + + public OAuth2HuggingFace( + string id, + bool enabled, + string clientId, + string clientSecret + ) + { + Id = id; + Enabled = enabled; + ClientId = clientId; + ClientSecret = clientSecret; + } + + public static OAuth2HuggingFace From(Dictionary map) => new OAuth2HuggingFace( + id: map["$id"].ToString(), + enabled: (bool)map["enabled"], + clientId: map["clientId"].ToString(), + clientSecret: map["clientSecret"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "enabled", Enabled }, + { "clientId", ClientId }, + { "clientSecret", ClientSecret } + }; + } +} diff --git a/Appwrite/Models/OAuth2Oidc.cs b/Appwrite/Models/OAuth2Oidc.cs index 89d5341a..4422ce6c 100644 --- a/Appwrite/Models/OAuth2Oidc.cs +++ b/Appwrite/Models/OAuth2Oidc.cs @@ -91,7 +91,7 @@ public OAuth2Oidc( { "authorizationURL", AuthorizationURL }, { "tokenURL", TokenURL }, { "userInfoURL", UserInfoURL }, - { "prompt", Prompt }, + { "prompt", Prompt.Select(it => it.Value).ToList() }, { "maxAge", MaxAge } }; } diff --git a/Appwrite/Models/OrderType.cs b/Appwrite/Models/OrderType.cs index 6b2e9f87..e8d93959 100644 --- a/Appwrite/Models/OrderType.cs +++ b/Appwrite/Models/OrderType.cs @@ -2,7 +2,7 @@ namespace Appwrite { public enum OrderType { - ASC, + ASC, DESC } } diff --git a/Appwrite/Models/PostgresExtension.cs b/Appwrite/Models/PostgresExtension.cs new file mode 100644 index 00000000..e3e7e02a --- /dev/null +++ b/Appwrite/Models/PostgresExtension.cs @@ -0,0 +1,54 @@ + +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 PostgresExtension + { + [JsonPropertyName("key")] + public string Key { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("description")] + public string Description { get; private set; } + + [JsonPropertyName("category")] + public string Category { get; private set; } + + public PostgresExtension( + string key, + string name, + string description, + string category + ) + { + Key = key; + Name = name; + Description = description; + Category = category; + } + + public static PostgresExtension From(Dictionary map) => new PostgresExtension( + key: map["key"].ToString(), + name: map["name"].ToString(), + description: map["description"].ToString(), + category: map["category"].ToString() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "key", Key }, + { "name", Name }, + { "description", Description }, + { "category", Category } + }; + } +} diff --git a/Appwrite/Models/Project.cs b/Appwrite/Models/Project.cs index 40a48031..302fde8f 100644 --- a/Appwrite/Models/Project.cs +++ b/Appwrite/Models/Project.cs @@ -93,7 +93,7 @@ public class Project public string ConsoleAccessedAt { get; private set; } [JsonPropertyName("wafEnabled")] - public bool WafEnabled { get; private set; } + public bool? WafEnabled { get; private set; } [JsonPropertyName("billingLimits")] public BillingLimits? BillingLimits { get; private set; } @@ -177,7 +177,7 @@ public Project( List protocols, List blocks, string consoleAccessedAt, - bool wafEnabled, + bool? wafEnabled, BillingLimits? billingLimits, bool? oAuth2ServerEnabled, string? oAuth2ServerAuthorizationUrl, @@ -274,7 +274,9 @@ public Project( protocols: map["protocols"].ConvertToList>().Select(it => Appwrite.Models.ProjectProtocol.From(map: it)).ToList(), blocks: map["blocks"].ConvertToList>().Select(it => Appwrite.Models.Block.From(map: it)).ToList(), consoleAccessedAt: map["consoleAccessedAt"].ToString(), - wafEnabled: (bool)map["wafEnabled"], + wafEnabled: map.TryGetValue("wafEnabled", out var boolRaw28) && boolRaw28 != null + ? (bool?)boolRaw28 + : null, billingLimits: map.TryGetValue("billingLimits", out var objectRaw29) && objectRaw29 != null ? Appwrite.Models.BillingLimits.From(map: objectRaw29 is JsonElement jsonObj29 ? jsonObj29.Deserialize>()! : (Dictionary)objectRaw29) : null, diff --git a/Appwrite/Models/Site.cs b/Appwrite/Models/Site.cs index 1d1a70c4..9ea61b3d 100644 --- a/Appwrite/Models/Site.cs +++ b/Appwrite/Models/Site.cs @@ -59,6 +59,9 @@ public class Site [JsonPropertyName("latestDeploymentStatus")] public string LatestDeploymentStatus { get; private set; } + [JsonPropertyName("scopes")] + public List Scopes { get; private set; } + [JsonPropertyName("vars")] public List Vars { get; private set; } @@ -130,6 +133,7 @@ public Site( string latestDeploymentId, string latestDeploymentCreatedAt, string latestDeploymentStatus, + List scopes, List vars, long timeout, string installCommand, @@ -166,6 +170,7 @@ string fallbackFile LatestDeploymentId = latestDeploymentId; LatestDeploymentCreatedAt = latestDeploymentCreatedAt; LatestDeploymentStatus = latestDeploymentStatus; + Scopes = scopes; Vars = vars; Timeout = timeout; InstallCommand = installCommand; @@ -203,6 +208,7 @@ string fallbackFile latestDeploymentId: map["latestDeploymentId"].ToString(), latestDeploymentCreatedAt: map["latestDeploymentCreatedAt"].ToString(), latestDeploymentStatus: map["latestDeploymentStatus"].ToString(), + scopes: map["scopes"].ConvertToList(), vars: map["vars"].ConvertToList>().Select(it => Appwrite.Models.Variable.From(map: it)).ToList(), timeout: Convert.ToInt64(map["timeout"]), installCommand: map["installCommand"].ToString(), @@ -241,6 +247,7 @@ string fallbackFile { "latestDeploymentId", LatestDeploymentId }, { "latestDeploymentCreatedAt", LatestDeploymentCreatedAt }, { "latestDeploymentStatus", LatestDeploymentStatus }, + { "scopes", Scopes }, { "vars", Vars?.Select(it => it.ToMap()).ToList() }, { "timeout", Timeout }, { "installCommand", InstallCommand }, diff --git a/Appwrite/Models/VectorsdbCollection.cs b/Appwrite/Models/VectorsdbCollection.cs new file mode 100644 index 00000000..0d54364b --- /dev/null +++ b/Appwrite/Models/VectorsdbCollection.cs @@ -0,0 +1,117 @@ + +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 VectorsdbCollection + { + [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("$permissions")] + public List Permissions { get; private set; } + + [JsonPropertyName("databaseId")] + public string DatabaseId { get; private set; } + + [JsonPropertyName("name")] + public string Name { get; private set; } + + [JsonPropertyName("enabled")] + public bool Enabled { get; private set; } + + [JsonPropertyName("documentSecurity")] + public bool DocumentSecurity { get; private set; } + + [JsonPropertyName("attributes")] + public List Attributes { get; private set; } + + [JsonPropertyName("indexes")] + public List Indexes { get; private set; } + + [JsonPropertyName("bytesMax")] + public long BytesMax { get; private set; } + + [JsonPropertyName("bytesUsed")] + public long BytesUsed { get; private set; } + + [JsonPropertyName("dimension")] + public long Dimension { get; private set; } + + public VectorsdbCollection( + string id, + string createdAt, + string updatedAt, + List permissions, + string databaseId, + string name, + bool enabled, + bool documentSecurity, + List attributes, + List indexes, + long bytesMax, + long bytesUsed, + long dimension + ) + { + Id = id; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + Permissions = permissions; + DatabaseId = databaseId; + Name = name; + Enabled = enabled; + DocumentSecurity = documentSecurity; + Attributes = attributes; + Indexes = indexes; + BytesMax = bytesMax; + BytesUsed = bytesUsed; + Dimension = dimension; + } + + public static VectorsdbCollection From(Dictionary map) => new VectorsdbCollection( + id: map["$id"].ToString(), + createdAt: map["$createdAt"].ToString(), + updatedAt: map["$updatedAt"].ToString(), + permissions: map["$permissions"].ConvertToList(), + databaseId: map["databaseId"].ToString(), + name: map["name"].ToString(), + enabled: (bool)map["enabled"], + documentSecurity: (bool)map["documentSecurity"], + attributes: map["attributes"].ConvertToList(), + indexes: map["indexes"].ConvertToList>().Select(it => Appwrite.Models.Index.From(map: it)).ToList(), + bytesMax: Convert.ToInt64(map["bytesMax"]), + bytesUsed: Convert.ToInt64(map["bytesUsed"]), + dimension: Convert.ToInt64(map["dimension"]) + ); + + public Dictionary ToMap() => new Dictionary() + { + { "$id", Id }, + { "$createdAt", CreatedAt }, + { "$updatedAt", UpdatedAt }, + { "$permissions", Permissions }, + { "databaseId", DatabaseId }, + { "name", Name }, + { "enabled", Enabled }, + { "documentSecurity", DocumentSecurity }, + { "attributes", Attributes }, + { "indexes", Indexes?.Select(it => it.ToMap()).ToList() }, + { "bytesMax", BytesMax }, + { "bytesUsed", BytesUsed }, + { "dimension", Dimension } + }; + } +} diff --git a/Appwrite/Models/VectorsdbCollectionList.cs b/Appwrite/Models/VectorsdbCollectionList.cs new file mode 100644 index 00000000..3536d571 --- /dev/null +++ b/Appwrite/Models/VectorsdbCollectionList.cs @@ -0,0 +1,40 @@ + +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 VectorsdbCollectionList + { + [JsonPropertyName("total")] + public long Total { get; private set; } + + [JsonPropertyName("collections")] + public List Collections { get; private set; } + + public VectorsdbCollectionList( + long total, + List collections + ) + { + Total = total; + Collections = collections; + } + + public static VectorsdbCollectionList From(Dictionary map) => new VectorsdbCollectionList( + total: Convert.ToInt64(map["total"]), + collections: map["collections"].ConvertToList>().Select(it => Appwrite.Models.VectorsdbCollection.From(map: it)).ToList() + ); + + public Dictionary ToMap() => new Dictionary() + { + { "total", Total }, + { "collections", Collections?.Select(it => it.ToMap()).ToList() } + }; + } +} diff --git a/Appwrite/Query.cs b/Appwrite/Query.cs index 9142a0de..caaacb75 100644 --- a/Appwrite/Query.cs +++ b/Appwrite/Query.cs @@ -10,10 +10,10 @@ public class Query { [JsonPropertyName("method")] public string Method { get; set; } = string.Empty; - + [JsonPropertyName("attribute")] public string? Attribute { get; set; } - + [JsonPropertyName("values")] public List? Values { get; set; } @@ -156,27 +156,33 @@ public static string CursorAfter(string documentId) return new Query("cursorAfter", null, documentId).ToString(); } - public static string CursorBefore(string documentId) { + public static string CursorBefore(string documentId) + { return new Query("cursorBefore", null, documentId).ToString(); } - public static string OrderAsc(string attribute) { + public static string OrderAsc(string attribute) + { return new Query("orderAsc", attribute, null).ToString(); } - public static string OrderDesc(string attribute) { + public static string OrderDesc(string attribute) + { return new Query("orderDesc", attribute, null).ToString(); } - public static string OrderRandom() { + public static string OrderRandom() + { return new Query("orderRandom", null, null).ToString(); } - public static string Limit(int limit) { + public static string Limit(int limit) + { return new Query("limit", null, limit).ToString(); } - public static string Offset(int offset) { + public static string Offset(int offset) + { return new Query("offset", null, offset).ToString(); } @@ -185,7 +191,8 @@ public static string Offset(int offset) { /// For string attributes, checks if the string contains the substring. /// /// For array attributes, use or instead. - public static string Contains(string attribute, object value) { + public static string Contains(string attribute, object value) + { return new Query("contains", attribute, value).ToString(); } @@ -194,7 +201,8 @@ public static string Contains(string attribute, object value) { /// For array and relationship attributes, matches documents where the attribute /// contains at least one of the given values. /// - public static string ContainsAny(string attribute, IList value) { + public static string ContainsAny(string attribute, IList value) + { return new Query("containsAny", attribute, value).ToString(); } @@ -203,67 +211,83 @@ public static string ContainsAny(string attribute, IList value) { /// For array and relationship attributes, matches documents where the attribute /// contains every one of the given values. /// - public static string ContainsAll(string attribute, IList value) { + public static string ContainsAll(string attribute, IList value) + { return new Query("containsAll", attribute, value).ToString(); } - public static string NotContains(string attribute, object value) { + public static string NotContains(string attribute, object value) + { return new Query("notContains", attribute, value).ToString(); } - public static string NotSearch(string attribute, string value) { + public static string NotSearch(string attribute, string value) + { return new Query("notSearch", attribute, value).ToString(); } - public static string NotBetween(string attribute, string start, string end) { + public static string NotBetween(string attribute, string start, string end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotBetween(string attribute, int start, int end) { + public static string NotBetween(string attribute, int start, int end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotBetween(string attribute, double start, double end) { + public static string NotBetween(string attribute, double start, double end) + { return new Query("notBetween", attribute, new List { start, end }).ToString(); } - public static string NotStartsWith(string attribute, string value) { + public static string NotStartsWith(string attribute, string value) + { return new Query("notStartsWith", attribute, value).ToString(); } - public static string NotEndsWith(string attribute, string value) { + public static string NotEndsWith(string attribute, string value) + { return new Query("notEndsWith", attribute, value).ToString(); } - public static string CreatedBefore(string value) { + public static string CreatedBefore(string value) + { return LessThan("$createdAt", value); } - public static string CreatedAfter(string value) { + public static string CreatedAfter(string value) + { return GreaterThan("$createdAt", value); } - public static string CreatedBetween(string start, string end) { + public static string CreatedBetween(string start, string end) + { return Between("$createdAt", start, end); } - public static string UpdatedBefore(string value) { + public static string UpdatedBefore(string value) + { return LessThan("$updatedAt", value); } - public static string UpdatedAfter(string value) { + public static string UpdatedAfter(string value) + { return GreaterThan("$updatedAt", value); } - public static string UpdatedBetween(string start, string end) { + public static string UpdatedBetween(string start, string end) + { return Between("$updatedAt", start, end); } - public static string Or(List queries) { + public static string Or(List queries) + { return new Query("or", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } - public static string And(List queries) { + public static string And(List queries) + { return new Query("and", null, queries.Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions)).ToList()).ToString(); } @@ -273,7 +297,8 @@ public static string And(List queries) { /// The attribute containing the array to filter on. /// The list of query strings to match against array elements. /// The query string. - public static string ElemMatch(string attribute, List queries) { + public static string ElemMatch(string attribute, List queries) + { var parsed = queries .Select(q => JsonSerializer.Deserialize(q, Client.DeserializerOptions) as object) .ToList(); diff --git a/Appwrite/Services/Avatars.cs b/Appwrite/Services/Avatars.cs index 06deb177..af856579 100644 --- a/Appwrite/Services/Avatars.cs +++ b/Appwrite/Services/Avatars.cs @@ -247,6 +247,53 @@ public Task GetInitials(string? name = null, long? width = null, long? h + return _client.Call( + method: "GET", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!); + + } + + /// + /// Returns the best available profile photo for a user. The endpoint tries + /// each source in priority order and returns the first successful result: + /// OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in + /// static fallback. + /// + /// The photo resolves for the currently authenticated user unless `userId` + /// points at another user. Passing `emailHash` and/or `name` resolves the + /// avatar from those values alone: the hash is looked up on Gravatar and + /// Libravatar, the name is rendered as initials, and the user's own identity + /// photos, email, and name leave the chain so they never shadow the avatar + /// being asked for. Emails are only ever accepted pre-hashed, so no address + /// ends up in a URL. + /// + /// + public Task GetPhoto(long? width = null, long? height = null, long? quality = null, string? output = null, string? rating = null, string? userId = null, string? emailHash = null, string? name = null) + { + var apiPath = "/avatars/photo"; + + var apiParameters = new Dictionary() + { + { "width", width }, + { "height", height }, + { "quality", quality }, + { "output", output }, + { "rating", rating }, + { "userId", userId }, + { "emailHash", emailHash }, + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "image/*" } + }; + + + return _client.Call( method: "GET", path: apiPath, diff --git a/Appwrite/Services/DocumentsDB.cs b/Appwrite/Services/DocumentsDB.cs new file mode 100644 index 00000000..bf6c43d1 --- /dev/null +++ b/Appwrite/Services/DocumentsDB.cs @@ -0,0 +1,1413 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class DocumentsDB : Service + { + public DocumentsDB(Client client) : base(client) + { + } + + /// + /// Get a list of all databases from the current Appwrite project. You can use + /// the search parameter to filter your results. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseList Convert(Dictionary it) + { + return Models.DatabaseList.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 Database. + /// + /// + /// + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/documentsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/documentsdb/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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); + + } + + /// + /// List transactions across all databases. + /// + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.TransactionList Convert(Dictionary it) + { + return Models.TransactionList.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 transaction. + /// + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/documentsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 a transaction, to either commit or roll back its operations. + /// + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/documentsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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 multiple operations in a single transaction. + /// + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/documentsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 database by its unique ID. This endpoint response returns a JSON + /// object with the database metadata. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 a database by its unique ID. + /// + /// + public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a database by its unique ID. Only API keys with with databases.write + /// scope can delete a database. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Get a list of all collections that belong to the provided databaseId. You + /// can use the search parameter to filter your results. + /// + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.CollectionList Convert(Dictionary it) + { + return Models.CollectionList.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 Collection. Before using this route, you should create a new + /// database resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) + { + var apiPath = "/documentsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled }, + { "attributes", attributes }, + { "indexes", indexes } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.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 collection by its unique ID. This endpoint response returns a JSON + /// object with the collection metadata. + /// + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.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 a collection by its unique ID. + /// + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, bool? purge = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled }, + { "purge", purge } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Collection Convert(Dictionary it) + { + return Models.Collection.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a collection by its unique ID. Only users with write permissions + /// have access to delete this resource. + /// + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Get a list of all the user's documents in a given collection. You can use + /// the query params to filter your results. + /// + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 Document. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get a document by its unique ID. This endpoint response returns a JSON + /// object with the document data. + /// + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 or update a Document. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a document by its unique ID. Using the patch method you can pass + /// only specific fields that will get updated. + /// + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 document by its unique ID. + /// + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Decrement a specific column of a row by a given value. + /// + /// + public Task DecrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? min = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", @value }, + { "min", min }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Increment a specific column of a row by a given value. + /// + /// + public Task IncrementDocumentAttribute(string databaseId, string collectionId, string documentId, string attribute, double? @value = null, double? max = null, string? transactionId = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId) + .Replace("{attribute}", attribute); + + var apiParameters = new Dictionary() + { + { "value", @value }, + { "max", max }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// List indexes in the collection. + /// + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.IndexList Convert(Dictionary it) + { + return Models.IndexList.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); + + } + + /// + /// Creates an index on the attributes listed. Your index should include all + /// the attributes you will query in a single request. + /// Attributes can be `key`, `fulltext`, and `unique`. + /// + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.DocumentsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index by ID. + /// + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index. + /// + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/documentsdb/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/documentsdb/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/documentsdb/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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/Mongo.cs b/Appwrite/Services/Mongo.cs new file mode 100644 index 00000000..ed073f24 --- /dev/null +++ b/Appwrite/Services/Mongo.cs @@ -0,0 +1,1204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Mongo : Service + { + public Mongo(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/mongo"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null) + { + var apiPath = "/mongo"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/mongo/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 a dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/mongo/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/mongo/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/mongo/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mongo/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/mongo/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/mongo/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 a database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/mongo/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/mongo/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/mongo/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/mongo/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/mongo/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/mongo/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/mongo/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/mongo/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/mongo/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/mongo/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/mongo/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/mongo/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/mongo/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/mongo/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/mongo/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/mongo/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Mysql.cs b/Appwrite/Services/Mysql.cs new file mode 100644 index 00000000..2fc6e1d4 --- /dev/null +++ b/Appwrite/Services/Mysql.cs @@ -0,0 +1,1329 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Mysql : Service + { + public Mysql(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/mysql"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null) + { + var apiPath = "/mysql"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/mysql/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 a dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/mysql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/mysql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/mysql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/mysql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/mysql/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/mysql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 a database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/mysql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/mysql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/mysql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/mysql/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/mysql/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Execute SQL through the console-facing Cloud endpoint. Cloud proxies + /// through the edge platform to the per-database SQL API sidecar. Application + /// traffic should bypass cloud entirely and POST directly to the per-database + /// hostname: + /// `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with + /// an `X-Appwrite-Key` header — that path scales to the whole DB fleet + /// without a per-query cloud round-trip. The statement type must be on the + /// database's configured allow-list. Use bound parameters for any + /// user-supplied values — the API does not interpolate raw strings. + /// + /// + public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) + { + var apiPath = "/mysql/{databaseId}/executions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "sql", sql }, + { "bindings", bindings }, + { "timeoutSeconds", timeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExecution Convert(Dictionary it) + { + return Models.DedicatedDatabaseExecution.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); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/mysql/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/mysql/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/mysql/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/mysql/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/mysql/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 connection pooler configuration for a dedicated database. Returns + /// pooler mode, max connections, and pool size settings. + /// + /// + public Task GetPooler(string databaseId) + { + var apiPath = "/mysql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 the connection pooler configuration for a dedicated database. + /// Configure pool mode, max connections, and pool sizes. + /// + /// + public Task UpdatePooler(string databaseId, string? mode = null, long? maxConnections = null, long? defaultPoolSize = null, bool? readWriteSplitting = null, string? poolerCpuRequest = null, string? poolerCpuLimit = null, string? poolerMemoryRequest = null, string? poolerMemoryLimit = null) + { + var apiPath = "/mysql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "mode", mode }, + { "maxConnections", maxConnections }, + { "defaultPoolSize", defaultPoolSize }, + { "readWriteSplitting", readWriteSplitting }, + { "poolerCpuRequest", poolerCpuRequest }, + { "poolerCpuLimit", poolerCpuLimit }, + { "poolerMemoryRequest", poolerMemoryRequest }, + { "poolerMemoryLimit", poolerMemoryLimit } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/mysql/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/mysql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/mysql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/mysql/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/mysql/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/mysql/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Postgresql.cs b/Appwrite/Services/Postgresql.cs new file mode 100644 index 00000000..a45fc9b8 --- /dev/null +++ b/Appwrite/Services/Postgresql.cs @@ -0,0 +1,1437 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class Postgresql : Service + { + public Postgresql(Client client) : base(client) + { + } + + /// + /// List all dedicated databases. Results support pagination. + /// + /// + public Task List(List? queries = null) + { + var apiPath = "/postgresql"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseList Convert(Dictionary it) + { + return Models.DedicatedDatabaseList.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 dedicated database with the chosen engine and configuration. + /// Status will be 'provisioning' until the database is ready. + /// + /// + public Task Create(string databaseId, string name, string? version = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null) + { + var apiPath = "/postgresql"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "version", version }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/postgresql/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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 a dedicated database by its unique ID. Returns the database + /// configuration and current status. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 a dedicated database configuration. All changes are applied with + /// zero downtime. Specification changes (cpu, memory, storage) are handled via + /// rolling cutover. Storage expansion is done online. All other settings are + /// applied in-place. + /// + /// + public Task Update(string databaseId, string? name = null, string? status = null, string? specification = null, long? replicas = null, string? syncMode = null, long? networkIdleTimeoutSeconds = null, List? networkIPAllowlist = null, long? idleTimeoutMinutes = null, bool? pitr = null, long? pitrRetentionDays = null, bool? storageAutoscaling = null, long? storageAutoscalingThresholdPercent = null, long? storageAutoscalingMaxGb = null, double? metricsTraceSampleRate = null, long? metricsSlowQueryLogThresholdMs = null, bool? sqlApiEnabled = null, List? sqlApiAllowedStatements = null, long? sqlApiMaxRows = null, long? sqlApiMaxBytes = null, long? sqlApiTimeoutSeconds = null) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "status", status }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode }, + { "networkIdleTimeoutSeconds", networkIdleTimeoutSeconds }, + { "networkIPAllowlist", networkIPAllowlist }, + { "idleTimeoutMinutes", idleTimeoutMinutes }, + { "pitr", pitr }, + { "pitrRetentionDays", pitrRetentionDays }, + { "storageAutoscaling", storageAutoscaling }, + { "storageAutoscalingThresholdPercent", storageAutoscalingThresholdPercent }, + { "storageAutoscalingMaxGb", storageAutoscalingMaxGb }, + { "metricsTraceSampleRate", metricsTraceSampleRate }, + { "metricsSlowQueryLogThresholdMs", metricsSlowQueryLogThresholdMs }, + { "sqlApiEnabled", sqlApiEnabled }, + { "sqlApiAllowedStatements", sqlApiAllowedStatements }, + { "sqlApiMaxRows", sqlApiMaxRows }, + { "sqlApiMaxBytes", sqlApiMaxBytes }, + { "sqlApiTimeoutSeconds", sqlApiTimeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 dedicated database. This action is irreversible. The database + /// status will be set to 'deleting' and all resources will be cleaned up. + /// Deletion is allowed from any state, and repeating the call re-dispatches + /// the cleanup. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/postgresql/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 backups for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListBackups(string databaseId, List? queries = null) + { + var apiPath = "/postgresql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupList.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 manual backup of a dedicated database. The backup will be created + /// asynchronously and its status can be checked via the get backup endpoint. + /// + /// + public Task CreateBackup(string databaseId, string? type = null) + { + var apiPath = "/postgresql/{databaseId}/backups" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 scheduled backup policies for a dedicated database. + /// + /// + public Task ListBackupPolicies(string databaseId, List? queries = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicyList Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task CreateBackupPolicy(string databaseId, string policyId, string name, string schedule, long retention, string? type = null, bool? enabled = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "policyId", policyId }, + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "type", type }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. + /// + /// + public Task GetBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 a scheduled backup policy for a dedicated database. + /// + /// + public Task UpdateBackupPolicy(string databaseId, string policyId, string? name = null, string? schedule = null, long? retention = null, bool? enabled = null) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "schedule", schedule }, + { "retention", retention }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.BackupPolicy Convert(Dictionary it) + { + return 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 scheduled backup policy for a dedicated database. Backups already + /// taken by the policy are kept until their retention expires. + /// + /// + public Task DeleteBackupPolicy(string databaseId, string policyId) + { + var apiPath = "/postgresql/{databaseId}/backups/policies/{policyId}" + .Replace("{databaseId}", databaseId) + .Replace("{policyId}", policyId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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)!); + + } + + /// + /// Configure off-cluster backup storage for a dedicated database. Supports S3, + /// GCS, and Azure Blob Storage destinations. Backups will be stored to the + /// configured destination in addition to on-cluster storage. + /// + /// + public Task UpdateBackupStorage(string databaseId, string provider, string bucket, string accessKey, string secretKey, string? region = null, string? prefix = null, string? endpoint = null) + { + var apiPath = "/postgresql/{databaseId}/backups/storage" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "provider", provider }, + { "bucket", bucket }, + { "region", region }, + { "prefix", prefix }, + { "endpoint", endpoint }, + { "accessKey", accessKey }, + { "secretKey", secretKey } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackupStorage Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackupStorage.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Get details of a specific database backup including its status, size, and + /// timestamps. + /// + /// + public Task GetBackup(string databaseId, string backupId) + { + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBackup Convert(Dictionary it) + { + return Models.DedicatedDatabaseBackup.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 a database backup. This will permanently remove the backup from + /// storage and cannot be undone. + /// + /// + public Task DeleteBackup(string databaseId, string backupId) + { + var apiPath = "/postgresql/{databaseId}/backups/{backupId}" + .Replace("{databaseId}", databaseId) + .Replace("{backupId}", backupId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "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 ephemeral branches for a dedicated database. Returns branch + /// metadata including ID, name, namespace, and expiration time. + /// + /// + public Task ListBranches(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseBranchList Convert(Dictionary it) + { + return Models.DedicatedDatabaseBranchList.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 an ephemeral database branch from the primary via PVC snapshot. The + /// branch is a full copy of the database at the current point in time, useful + /// for testing schema migrations or running experiments without affecting + /// production data. Branches expire after the configured TTL (default 24 + /// hours). The branch is created asynchronously. + /// + /// + public Task CreateBranch(string databaseId, string? branchId = null, long? ttl = null) + { + var apiPath = "/postgresql/{databaseId}/branches" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "branchId", branchId }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Delete an ephemeral database branch. This removes the branch namespace, its + /// PVC, and the associated VolumeSnapshot. The deletion runs asynchronously + /// and is irreversible. + /// + /// + public Task DeleteBranch(string databaseId, string branchId) + { + var apiPath = "/postgresql/{databaseId}/branches/{branchId}" + .Replace("{databaseId}", databaseId) + .Replace("{branchId}", branchId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Rotate the primary connection credentials for a dedicated database. + /// Generates a new password and updates the database atomically. Previous + /// credentials stop working immediately. Returns the database with a refreshed + /// connection string carrying the new password. + /// + /// + public Task UpdateCredentials(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/credentials" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Execute SQL through the console-facing Cloud endpoint. Cloud proxies + /// through the edge platform to the per-database SQL API sidecar. Application + /// traffic should bypass cloud entirely and POST directly to the per-database + /// hostname: + /// `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with + /// an `X-Appwrite-Key` header — that path scales to the whole DB fleet + /// without a per-query cloud round-trip. The statement type must be on the + /// database's configured allow-list. Use bound parameters for any + /// user-supplied values — the API does not interpolate raw strings. + /// + /// + public Task CreateExecution(string databaseId, string sql, object? bindings = null, long? timeoutSeconds = null) + { + var apiPath = "/postgresql/{databaseId}/executions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "sql", sql }, + { "bindings", bindings }, + { "timeoutSeconds", timeoutSeconds } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExecution Convert(Dictionary it) + { + return Models.DedicatedDatabaseExecution.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 installed and available extensions for a PostgreSQL database. + /// + /// + public Task ListExtensions(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/extensions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseExtensions Convert(Dictionary it) + { + return Models.DedicatedDatabaseExtensions.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); + + } + + /// + /// Install a database extension. Only available for PostgreSQL databases. The + /// install runs asynchronously; poll the extensions list endpoint for status. + /// + /// + public Task CreateExtension(string databaseId, string name) + { + var apiPath = "/postgresql/{databaseId}/extensions" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Uninstall a database extension from a PostgreSQL database. The uninstall + /// runs asynchronously; poll the extensions list endpoint for status. + /// + /// + public Task DeleteExtension(string databaseId, string extensionName) + { + var apiPath = "/postgresql/{databaseId}/extensions/{extensionName}" + .Replace("{databaseId}", databaseId) + .Replace("{extensionName}", extensionName); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.From(map: it); + } + + return _client.Call( + method: "DELETE", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/postgresql/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Update the maintenance window for a dedicated database. Maintenance + /// operations like minor version upgrades will be performed during this + /// window. + /// + /// + public Task UpdateMaintenance(string databaseId, string day, long hourUtc) + { + var apiPath = "/postgresql/{databaseId}/maintenance" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "day", day }, + { "hourUtc", hourUtc } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + /// + /// Migrate a database between shared and dedicated types. Shared to dedicated + /// provisions an always-on dedicated instance; dedicated to shared converts to + /// a serverless instance that scales to zero when idle. Data is copied to the + /// target with a brief read-only window during cutover. + /// + /// + public Task CreateMigration(string databaseId, string targetType, string? specification = null) + { + var apiPath = "/postgresql/{databaseId}/migrations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetType", targetType }, + { "specification", specification } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/postgresql/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 available point-in-time recovery windows for a dedicated database. + /// Returns the earliest and latest recovery points. + /// + /// + public Task GetPitr(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/pitr" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePITRWindows Convert(Dictionary it) + { + return Models.DedicatedDatabasePITRWindows.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 connection pooler configuration for a dedicated database. Returns + /// pooler mode, max connections, and pool size settings. + /// + /// + public Task GetPooler(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 the connection pooler configuration for a dedicated database. + /// Configure pool mode, max connections, and pool sizes. + /// + /// + public Task UpdatePooler(string databaseId, string? mode = null, long? maxConnections = null, long? defaultPoolSize = null, bool? readWriteSplitting = null, string? poolerCpuRequest = null, string? poolerCpuLimit = null, string? poolerMemoryRequest = null, string? poolerMemoryLimit = null) + { + var apiPath = "/postgresql/{databaseId}/pooler" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "mode", mode }, + { "maxConnections", maxConnections }, + { "defaultPoolSize", defaultPoolSize }, + { "readWriteSplitting", readWriteSplitting }, + { "poolerCpuRequest", poolerCpuRequest }, + { "poolerCpuLimit", poolerCpuLimit }, + { "poolerMemoryRequest", poolerMemoryRequest }, + { "poolerMemoryLimit", poolerMemoryLimit } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabasePooler Convert(Dictionary it) + { + return Models.DedicatedDatabasePooler.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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); + + } + + /// + /// List all restorations for a dedicated database. Results can be filtered by + /// status and type. + /// + /// + public Task ListRestorations(string databaseId, string? status = null, string? type = null, long? limit = null, long? offset = null) + { + var apiPath = "/postgresql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "type", type }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestorationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestorationList.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); + + } + + /// + /// Restore a database from a backup or to a specific point in time (PITR). For + /// backup restoration, provide a backupId. For PITR, provide a targetTime as + /// an ISO 8601 datetime. PITR requires the database to have PITR enabled and + /// is only available for enterprise databases. + /// + /// + public Task CreateRestoration(string databaseId, string? type = null, string? backupId = null, string? targetDatabaseId = null, string? targetTime = null) + { + var apiPath = "/postgresql/{databaseId}/restorations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "type", type }, + { "backupId", backupId }, + { "targetDatabaseId", targetDatabaseId }, + { "targetTime", targetTime } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 details of a specific database restoration including its status, type, + /// and timestamps. + /// + /// + public Task GetRestoration(string databaseId, string restorationId) + { + var apiPath = "/postgresql/{databaseId}/restorations/{restorationId}" + .Replace("{databaseId}", databaseId) + .Replace("{restorationId}", restorationId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseRestoration Convert(Dictionary it) + { + return Models.DedicatedDatabaseRestoration.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/postgresql/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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); + + } + + /// + /// Upgrade a dedicated database to a new engine version. Uses blue-green + /// deployment for zero-downtime cutover. + /// + /// + public Task CreateUpgrade(string databaseId, string targetVersion) + { + var apiPath = "/postgresql/{databaseId}/upgrades" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetVersion", targetVersion } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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); + + } + + } +} diff --git a/Appwrite/Services/Project.cs b/Appwrite/Services/Project.cs index 7b77c5d4..6eff7b13 100644 --- a/Appwrite/Services/Project.cs +++ b/Appwrite/Services/Project.cs @@ -1333,6 +1333,43 @@ static Models.OAuth2Google Convert(Dictionary it) } + /// + /// Update the project OAuth2 Hugging Face configuration. + /// + /// + public Task UpdateOAuth2HuggingFace(string? clientId = null, string? clientSecret = null, bool? enabled = null) + { + var apiPath = "/project/oauth2/huggingface"; + + var apiParameters = new Dictionary() + { + { "clientId", clientId }, + { "clientSecret", clientSecret }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.OAuth2HuggingFace Convert(Dictionary it) + { + return Models.OAuth2HuggingFace.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); + + } + /// /// Update the project OAuth2 Keycloak configuration. /// @@ -2310,71 +2347,75 @@ static object Convert(Dictionary it) { return Appwrite.Models.OAuth2Yahoo.From(map: it); } - if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "linkedin") + if (it.TryGetValue("$id", out var idValue24) && idValue24?.ToString() == "huggingface") + { + return Appwrite.Models.OAuth2HuggingFace.From(map: it); + } + if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "linkedin") { return Appwrite.Models.OAuth2Linkedin.From(map: it); } - if (it.TryGetValue("$id", out var idValue25) && idValue25?.ToString() == "disqus") + if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "disqus") { return Appwrite.Models.OAuth2Disqus.From(map: it); } - if (it.TryGetValue("$id", out var idValue26) && idValue26?.ToString() == "amazon") + if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "amazon") { return Appwrite.Models.OAuth2Amazon.From(map: it); } - if (it.TryGetValue("$id", out var idValue27) && idValue27?.ToString() == "etsy") + if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "etsy") { return Appwrite.Models.OAuth2Etsy.From(map: it); } - if (it.TryGetValue("$id", out var idValue28) && idValue28?.ToString() == "facebook") + if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "facebook") { return Appwrite.Models.OAuth2Facebook.From(map: it); } - if (it.TryGetValue("$id", out var idValue29) && idValue29?.ToString() == "tradeshiftBox") + if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "tradeshiftBox") { return Appwrite.Models.OAuth2Tradeshift.From(map: it); } - if (it.TryGetValue("$id", out var idValue30) && idValue30?.ToString() == "paypalSandbox") + if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "paypalSandbox") { return Appwrite.Models.OAuth2Paypal.From(map: it); } - if (it.TryGetValue("$id", out var idValue31) && idValue31?.ToString() == "gitlab") + if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "gitlab") { return Appwrite.Models.OAuth2Gitlab.From(map: it); } - if (it.TryGetValue("$id", out var idValue32) && idValue32?.ToString() == "authentik") + if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "authentik") { return Appwrite.Models.OAuth2Authentik.From(map: it); } - if (it.TryGetValue("$id", out var idValue33) && idValue33?.ToString() == "auth0") + if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "auth0") { return Appwrite.Models.OAuth2Auth0.From(map: it); } - if (it.TryGetValue("$id", out var idValue34) && idValue34?.ToString() == "fusionauth") + if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "fusionauth") { return Appwrite.Models.OAuth2FusionAuth.From(map: it); } - if (it.TryGetValue("$id", out var idValue35) && idValue35?.ToString() == "keycloak") + if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "keycloak") { return Appwrite.Models.OAuth2Keycloak.From(map: it); } - if (it.TryGetValue("$id", out var idValue36) && idValue36?.ToString() == "oidc") + if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "oidc") { return Appwrite.Models.OAuth2Oidc.From(map: it); } - if (it.TryGetValue("$id", out var idValue37) && idValue37?.ToString() == "apple") + if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "apple") { return Appwrite.Models.OAuth2Apple.From(map: it); } - if (it.TryGetValue("$id", out var idValue38) && idValue38?.ToString() == "okta") + if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "okta") { return Appwrite.Models.OAuth2Okta.From(map: it); } - if (it.TryGetValue("$id", out var idValue39) && idValue39?.ToString() == "kick") + if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "kick") { return Appwrite.Models.OAuth2Kick.From(map: it); } - if (it.TryGetValue("$id", out var idValue40) && idValue40?.ToString() == "microsoft") + if (it.TryGetValue("$id", out var idValue41) && idValue41?.ToString() == "microsoft") { return Appwrite.Models.OAuth2Microsoft.From(map: it); } diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index b088f975..b6a939cf 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -54,7 +54,7 @@ static Models.SiteList Convert(Dictionary it) /// Create a new site. /// /// - public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) + public Task Create(string siteId, string name, Appwrite.Enums.Framework framework, Appwrite.Enums.BuildRuntime buildRuntime, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.Adapter? adapter = null, string? installationId = null, string? fallbackFile = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null, List? scopes = null) { var apiPath = "/sites"; @@ -82,7 +82,8 @@ static Models.SiteList Convert(Dictionary it) { "providerPaths", providerPaths }, { "buildSpecification", buildSpecification }, { "runtimeSpecification", runtimeSpecification }, - { "deploymentRetention", deploymentRetention } + { "deploymentRetention", deploymentRetention }, + { "scopes", scopes?.Select(e => e.Value).ToList() } }; var apiHeaders = new Dictionary() @@ -213,7 +214,7 @@ static Models.Site Convert(Dictionary it) /// Update site by its unique ID. /// /// - public Task Update(string siteId, string name, Appwrite.Enums.Framework framework, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.BuildRuntime? buildRuntime = null, Appwrite.Enums.Adapter? adapter = null, string? fallbackFile = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null) + public Task Update(string siteId, string name, Appwrite.Enums.Framework framework, bool? enabled = null, bool? logging = null, long? timeout = null, string? installCommand = null, string? buildCommand = null, string? startCommand = null, string? outputDirectory = null, Appwrite.Enums.BuildRuntime? buildRuntime = null, Appwrite.Enums.Adapter? adapter = null, string? fallbackFile = null, string? installationId = null, string? providerRepositoryId = null, string? providerBranch = null, bool? providerSilentMode = null, string? providerRootDirectory = null, List? providerBranches = null, List? providerPaths = null, string? buildSpecification = null, string? runtimeSpecification = null, long? deploymentRetention = null, List? scopes = null) { var apiPath = "/sites/{siteId}" .Replace("{siteId}", siteId); @@ -241,7 +242,8 @@ static Models.Site Convert(Dictionary it) { "providerPaths", providerPaths }, { "buildSpecification", buildSpecification }, { "runtimeSpecification", runtimeSpecification }, - { "deploymentRetention", deploymentRetention } + { "deploymentRetention", deploymentRetention }, + { "scopes", scopes?.Select(e => e.Value).ToList() } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index d3ca30db..3b9d1894 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -440,8 +440,12 @@ public Task Delete(string databaseId) /// Trigger a manual failover for a dedicated database with high availability /// enabled. Promotes a replica to primary. The failover runs asynchronously; /// poll the database document for status updates. A database left - /// mid-operation by a failover that did not finish also accepts this call as a - /// repair, provided `targetReplicaId` names the member to promote. + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. /// /// public Task CreateFailover(string databaseId, string? targetReplicaId = null) diff --git a/Appwrite/Services/VectorsDB.cs b/Appwrite/Services/VectorsDB.cs new file mode 100644 index 00000000..845df101 --- /dev/null +++ b/Appwrite/Services/VectorsDB.cs @@ -0,0 +1,1374 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Appwrite.Models; +using Appwrite.Enums; + +namespace Appwrite.Services +{ + public class VectorsDB : Service + { + public VectorsDB(Client client) : base(client) + { + } + + /// + /// Get a list of all databases from the current Appwrite project. You can use + /// the search parameter to filter your results. + /// + /// + public Task List(List? queries = null, bool? total = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseList Convert(Dictionary it) + { + return Models.DatabaseList.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 Database. + /// + /// + /// + public Task Create(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/vectorsdb"; + + var apiParameters = new Dictionary() + { + { "databaseId", databaseId }, + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 the dedicated database specifications available on the current plan. + /// Each specification reports its resource limits, pricing, and whether it is + /// enabled for the organization. + /// + /// + public Task ListSpecifications() + { + var apiPath = "/vectorsdb/specifications"; + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseSpecificationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseSpecificationList.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); + + } + + /// + /// List transactions across all databases. + /// + /// + public Task ListTransactions(List? queries = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "queries", queries } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.TransactionList Convert(Dictionary it) + { + return Models.TransactionList.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 transaction. + /// + /// + public Task CreateTransaction(long? ttl = null) + { + var apiPath = "/vectorsdb/transactions"; + + var apiParameters = new Dictionary() + { + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task GetTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 a transaction, to either commit or roll back its operations. + /// + /// + public Task UpdateTransaction(string transactionId, bool? commit = null, bool? rollback = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "commit", commit }, + { "rollback", rollback } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 transaction by its unique ID. + /// + /// + public Task DeleteTransaction(string transactionId) + { + var apiPath = "/vectorsdb/transactions/{transactionId}" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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 multiple operations in a single transaction. + /// + /// + public Task CreateOperations(string transactionId, List? operations = null) + { + var apiPath = "/vectorsdb/transactions/{transactionId}/operations" + .Replace("{transactionId}", transactionId); + + var apiParameters = new Dictionary() + { + { "operations", operations } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Transaction Convert(Dictionary it) + { + return Models.Transaction.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 database by its unique ID. This endpoint response returns a JSON + /// object with the database metadata. + /// + /// + public Task Get(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.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 a database by its unique ID. + /// + /// + public Task Update(string databaseId, string name, bool? enabled = null, string? specification = null, long? replicas = null, string? syncMode = null) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "enabled", enabled }, + { "specification", specification }, + { "replicas", replicas }, + { "syncMode", syncMode } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Database Convert(Dictionary it) + { + return Models.Database.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a database by its unique ID. Only API keys with with databases.write + /// scope can delete a database. + /// + /// + public Task Delete(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Get a list of all collections that belong to the provided databaseId. You + /// can use the search parameter to filter your results. + /// + /// + public Task ListCollections(string databaseId, List? queries = null, string? search = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "search", search }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollectionList Convert(Dictionary it) + { + return Models.VectorsdbCollectionList.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 Collection. Before using this route, you should create a new + /// database resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateCollection(string databaseId, string collectionId, string name, long dimension, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "collectionId", collectionId }, + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.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 collection by its unique ID. This endpoint response returns a JSON + /// object with the collection metadata. + /// + /// + public Task GetCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.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 a collection by its unique ID. + /// + /// + public Task UpdateCollection(string databaseId, string collectionId, string name, long? dimension = null, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "name", name }, + { "dimension", dimension }, + { "permissions", permissions }, + { "documentSecurity", documentSecurity }, + { "enabled", enabled } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.VectorsdbCollection Convert(Dictionary it) + { + return Models.VectorsdbCollection.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Delete a collection by its unique ID. Only users with write permissions + /// have access to delete this resource. + /// + /// + public Task DeleteCollection(string databaseId, string collectionId) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Get a list of all the user's documents in a given collection. You can use + /// the query params to filter your results. + /// + /// + public Task ListDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 Document. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocument(string databaseId, string collectionId, string documentId, object data, List? permissions = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documentId", documentId }, + { "data", data }, + { "permissions", permissions } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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); + + } + + /// + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task CreateDocuments(string databaseId, string collectionId, List documents) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + /// + public Task UpsertDocuments(string databaseId, string collectionId, List documents, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "documents", documents }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + /// + /// + public Task UpdateDocuments(string databaseId, string collectionId, object? data = null, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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); + + } + + /// + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + /// + /// + public Task DeleteDocuments(string databaseId, string collectionId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.From(map: it); + } + + return _client.Call( + method: "DELETE", + 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 using a POST + /// request. This behaves identically to the list documents endpoint but + /// accepts the queries in the request body, allowing much larger `queries` + /// arrays than can fit in a URL query string. + /// + /// + /// + public Task CreateQuery(string databaseId, string collectionId, List? queries = null, string? transactionId = null, bool? total = null, long? ttl = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/query" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId }, + { "total", total }, + { "ttl", ttl } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DocumentList Convert(Dictionary it) + { + return Models.DocumentList.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 document by its unique ID. This endpoint response returns a JSON + /// object with the document data. + /// + /// + public Task GetDocument(string databaseId, string collectionId, string documentId, List? queries = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 or update a Document. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) + /// API or directly from your database console. + /// + /// + public Task UpsertDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.From(map: it); + } + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Update a document by its unique ID. Using the patch method you can pass + /// only specific fields that will get updated. + /// + /// + public Task UpdateDocument(string databaseId, string collectionId, string documentId, object? data = null, List? permissions = null, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "data", data }, + { "permissions", permissions }, + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Document Convert(Dictionary it) + { + return Models.Document.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 document by its unique ID. + /// + /// + public Task DeleteDocument(string databaseId, string collectionId, string documentId, string? transactionId = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{documentId}", documentId); + + var apiParameters = new Dictionary() + { + { "transactionId", transactionId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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 indexes in the collection. + /// + /// + public Task ListIndexes(string databaseId, string collectionId, List? queries = null, bool? total = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "queries", queries }, + { "total", total } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.IndexList Convert(Dictionary it) + { + return Models.IndexList.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); + + } + + /// + /// Creates an index on the attributes listed. Your index should include all + /// the attributes you will query in a single request. + /// Attributes can be `key`, `fulltext`, and `unique`. + /// + /// + public Task CreateIndex(string databaseId, string collectionId, string key, Appwrite.Enums.VectorsDBIndexType type, List attributes, List? orders = null, List? lengths = null) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId); + + var apiParameters = new Dictionary() + { + { "key", key }, + { "type", type?.Value }, + { "attributes", attributes }, + { "orders", orders?.Select(e => e.Value).ToList() }, + { "lengths", lengths } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index by ID. + /// + /// + public Task GetIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.Index Convert(Dictionary it) + { + return Models.Index.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 index. + /// + /// + public Task DeleteIndex(string databaseId, string collectionId, string key) + { + var apiPath = "/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}" + .Replace("{databaseId}", databaseId) + .Replace("{collectionId}", collectionId) + .Replace("{key}", key); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "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)!); + + } + + /// + /// Trigger a manual failover for a dedicated database with high availability + /// enabled. Promotes a replica to primary. The failover runs asynchronously; + /// poll the database document for status updates. A database left + /// mid-operation also accepts this call as a repair once nothing is driving + /// the operation it is stuck in. Repairing a failover that did not finish, a + /// `failed` database, a stranded upgrade or migrate, or a stranded compute + /// resize additionally requires `targetReplicaId` to name the member to + /// promote, because the default target may be the member that operation + /// already promoted. + /// + /// + public Task CreateFailover(string databaseId, string? targetReplicaId = null) + { + var apiPath = "/vectorsdb/{databaseId}/failovers" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "targetReplicaId", targetReplicaId } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "content-type", "application/json" }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabase Convert(Dictionary it) + { + return Models.DedicatedDatabase.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 the lifecycle operations recorded for a dedicated database, newest + /// first. Every provision, update, restore, backup and replication action is + /// recorded here with its outcome, including an attempt that was abandoned + /// because another worker took over the database. + /// + /// + public Task ListOperations(string databaseId, string? status = null, long? limit = null, long? offset = null) + { + var apiPath = "/vectorsdb/{databaseId}/operations" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + { "status", status }, + { "limit", limit }, + { "offset", offset } + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseOperationList Convert(Dictionary it) + { + return Models.DedicatedDatabaseOperationList.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 high availability status for a dedicated database. Returns replica + /// statuses, replication lag, and sync mode. + /// + /// + public Task GetReplicas(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}/replicas" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DedicatedDatabaseReplicas Convert(Dictionary it) + { + return Models.DedicatedDatabaseReplicas.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 real-time health and status information for a dedicated database. + /// Returns health status, readiness, uptime, connection info, replica status, + /// and volume information. + /// + /// + public Task GetStatus(string databaseId) + { + var apiPath = "/vectorsdb/{databaseId}/status" + .Replace("{databaseId}", databaseId); + + var apiParameters = new Dictionary() + { + }; + + var apiHeaders = new Dictionary() + { + { "X-Appwrite-Project", _client.GetConfig("project") }, + { "accept", "application/json" } + }; + + + static Models.DatabaseStatus Convert(Dictionary it) + { + return Models.DatabaseStatus.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/CHANGELOG.md b/CHANGELOG.md index 7d4bd50c..dfadaca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## 7.1.0-rc.1 + +* Added: `documentsDB`, `vectorsDB`, `mysql`, `postgresql`, and `mongo` services, no longer hidden from server SDKs +* Added: `DocumentsDBIndexType` and `VectorsDBIndexType` enums +* Added: dedicated database models for branches, backups, restorations, poolers, PITR windows, extensions, and executions +* Added: `PostgresExtension`, `VectorsdbCollection`, `AttributeObject`, and `AttributeVector` models +* Added: `ExecutionResourceType` enum and `resourceType` on the `Execution` model +* Added: `OAuth2HuggingFace` model and the `huggingface` OAuth provider +* Added: `userId`, `emailHash`, and `name` parameters to `avatars.getPhoto` +* Added: `error`, `containerStatus`, and `lifecycleState` on the `Database` model +* Added: `changelogWatermark` on the `DatabaseMigration` model +* Added: `total` on the `DedicatedDatabaseBranchList` model +* Updated: `DedicatedDatabaseOperation.status` documents the new `queued` state + ## 7.0.0 * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either diff --git a/README.md b/README.md index 46bd11ae..e1c9ec98 100644 --- a/README.md +++ b/README.md @@ -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 7.0.0 +Install-Package Appwrite -Version 7.1.0-rc.1 # or .NET CLI -dotnet add package Appwrite --version 7.0.0 +dotnet add package Appwrite --version 7.1.0-rc.1 ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 47a2fc6d..35b3aab4 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); Session result = await account.CreateAnonymousSession(); + + ``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index a2408cdc..f24e35ca 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.CreateEmailPasswordSession( email: "email@example.com", password: "password" -);``` +); + +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index dd012ac0..be003ffe 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -14,4 +14,6 @@ Token result = await account.CreateEmailToken( userId: "", email: "email@example.com", phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index ca242970..b5c4aad4 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -12,4 +12,6 @@ Account account = new Account(client); Token result = await account.CreateEmailVerification( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index f1d22ded..85e77164 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -15,4 +15,6 @@ Token result = await account.CreateMagicURLToken( email: "email@example.com", url: "https://example.com", // optional phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 4bea1f21..74e3d105 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -13,4 +13,6 @@ Account account = new Account(client); MfaType result = await account.CreateMFAAuthenticator( type: AuthenticatorType.Totp -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index afd90663..8f7a9208 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -13,4 +13,6 @@ Account account = new Account(client); MfaChallenge result = await account.CreateMFAChallenge( factor: AuthenticationFactor.Email -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 89985468..6869828d 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 891bf4ff..f47f7e5e 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -16,4 +16,6 @@ await account.CreateOAuth2Token( success: "https://example.com", // optional failure: "https://example.com", // optional scopes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index af5747b3..e296f8ed 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.CreatePhoneToken( userId: "", phone: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 177ea7f7..e5f1144d 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); Token result = await account.CreatePhoneVerification(); + + ``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e236ddf5..7951fcb6 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.CreateRecovery( email: "email@example.com", url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 5d2c1d2e..9cd8558a 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.CreateSession( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 49be6750..a25aa0de 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -12,4 +12,6 @@ Account account = new Account(client); Token result = await account.CreateVerification( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 3488b4a4..b068e0c3 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -15,4 +15,6 @@ User result = await account.Create( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md index a99b4f30..0080afa9 100644 --- a/docs/examples/account/delete-consent-token.md +++ b/docs/examples/account/delete-consent-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); await account.DeleteConsentToken( consentId: "", tokenId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md index 9b053f70..34adec2b 100644 --- a/docs/examples/account/delete-consent.md +++ b/docs/examples/account/delete-consent.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteConsent( consentId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index d68919c4..bc4938d6 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteIdentity( identityId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 1a552019..58aa3af1 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -13,4 +13,6 @@ Account account = new Account(client); await account.DeleteMFAAuthenticator( type: AuthenticatorType.Totp -);``` +); + +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index fa546c00..9c8e9c1f 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); await account.DeleteSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index d6051e83..31bd03a1 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); await account.DeleteSessions(); + + ``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index 2cb00b16..d348e155 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -13,4 +13,6 @@ Account account = new Account(client); Oauth2ConsentToken result = await account.GetConsentToken( consentId: "", tokenId: "" -);``` +); + +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index cb364047..816f6d5e 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -12,4 +12,6 @@ Account account = new Account(client); Oauth2Consent result = await account.GetConsent( consentId: "" -);``` +); + +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index f2ba2fa7..54ffda45 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 75d0984b..fb891b6e 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); Preferences result = await account.GetPrefs(); + + ``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 903360ae..dee7ad1b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); Session result = await account.GetSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 0184bb9e..ba7c848b 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); User result = await account.Get(); + + ``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 451b8f21..5f1f36d4 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -14,4 +14,6 @@ Oauth2ConsentTokenList result = await account.ListConsentTokens( consentId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md index b9ebfcef..ca7eb65a 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -13,4 +13,6 @@ Account account = new Account(client); Oauth2ConsentList result = await account.ListConsents( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3d0b024b..f64b03b0 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -13,4 +13,6 @@ Account account = new Account(client); IdentityList result = await account.ListIdentities( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index d73311bc..99f6bea0 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -13,4 +13,6 @@ Account account = new Account(client); LogList result = await account.ListLogs( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 37bd907e..5fa29c29 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaFactors result = await account.ListMFAFactors(); + + ``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 791af973..81402bcc 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); SessionList result = await account.ListSessions(); + + ``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index ef431989..3b4214e6 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdateEmailVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 5dbb8ee6..9135dc1c 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -13,4 +13,6 @@ Account account = new Account(client); User result = await account.UpdateEmail( email: "email@example.com", password: "password" -);``` +); + +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index f123e72b..06f707ee 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.UpdateMagicURLSession( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 6950ba6f..a9cdba19 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -14,4 +14,6 @@ Account account = new Account(client); User result = await account.UpdateMFAAuthenticator( type: AuthenticatorType.Totp, otp: "" -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index c7108fef..d74d8d58 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.UpdateMFAChallenge( challengeId: "", otp: "" -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 3f2943d9..eefede0f 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 3480ee42..449edcb3 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -12,4 +12,6 @@ Account account = new Account(client); User result = await account.UpdateMFA( mfa: false -);``` +); + +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index cdbf82c2..bf88c662 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -12,4 +12,6 @@ Account account = new Account(client); User result = await account.UpdateName( name: "" -);``` +); + +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 17e459e1..323934ab 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -13,4 +13,6 @@ Account account = new Account(client); User result = await account.UpdatePassword( password: "password", oldPassword: "password" // optional -);``` +); + +``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index d1aada97..dd7ab048 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -13,4 +13,6 @@ Account account = new Account(client); Session result = await account.UpdatePhoneSession( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index fd99865b..c2b7eebb 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdatePhoneVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 558fd1c8..d2b7276b 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -13,4 +13,6 @@ Account account = new Account(client); User result = await account.UpdatePhone( phone: "+12065550100", password: "password" -);``` +); + +``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 4c43263b..105e6988 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -16,4 +16,6 @@ User result = await account.UpdatePrefs( timezone = "UTC", darkTheme = true } -);``` +); + +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index ea571253..5875c5b0 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -14,4 +14,6 @@ Token result = await account.UpdateRecovery( userId: "", secret: "", password: "password" -);``` +); + +``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 48adb6c0..d49e556f 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -12,4 +12,6 @@ Account account = new Account(client); Session result = await account.UpdateSession( sessionId: "" -);``` +); + +``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 1ea1fc4b..95ac938d 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -11,4 +11,6 @@ Client client = new Client() Account account = new Account(client); User result = await account.UpdateStatus(); + + ``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 60c397bc..16fbc2ce 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -13,4 +13,6 @@ Account account = new Account(client); Token result = await account.UpdateVerification( userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 0855c8b4..82e50a0b 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -12,4 +12,6 @@ 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 index dc0ad42d..c3d2ba2f 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -12,4 +12,6 @@ Activities activities = new Activities(client); ActivityEventList result = await activities.ListEvents( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/advisor/delete-report.md b/docs/examples/advisor/delete-report.md index 188f2334..4e8f4123 100644 --- a/docs/examples/advisor/delete-report.md +++ b/docs/examples/advisor/delete-report.md @@ -12,4 +12,6 @@ Advisor advisor = new Advisor(client); await advisor.DeleteReport( reportId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index cd5c72a5..29543bdc 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -13,4 +13,6 @@ Advisor advisor = new Advisor(client); Insight result = await advisor.GetInsight( reportId: "", insightId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 9e8834f5..2143cbc0 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -12,4 +12,6 @@ Advisor advisor = new Advisor(client); Report result = await advisor.GetReport( reportId: "" -);``` +); + +``` diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 7e2c6479..00322495 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -14,4 +14,6 @@ InsightList result = await advisor.ListInsights( reportId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index ba3266da..e610e521 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -13,4 +13,6 @@ Advisor advisor = new Advisor(client); ReportList result = await advisor.ListReports( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index c28cc638..0aabf4b1 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); Oauth2Token result = await apps.CreateInstallationToken( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index e8089591..a4e53d1e 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); AppKey result = await apps.CreateKey( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index d5204290..12553ab6 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); AppSecretPlaintext result = await apps.CreateSecret( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 596b31cc..18adab45 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -30,4 +30,6 @@ App result = await apps.Create( type: "public", // optional deviceFlow: false, // optional teamId: "" // optional -);``` +); + +``` diff --git a/docs/examples/apps/delete-installation.md b/docs/examples/apps/delete-installation.md index 81545045..b55d8b31 100644 --- a/docs/examples/apps/delete-installation.md +++ b/docs/examples/apps/delete-installation.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteInstallation( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md index 352e036f..d816e061 100644 --- a/docs/examples/apps/delete-key.md +++ b/docs/examples/apps/delete-key.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteKey( appId: "", keyId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md index c97148a7..762390a2 100644 --- a/docs/examples/apps/delete-secret.md +++ b/docs/examples/apps/delete-secret.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); await apps.DeleteSecret( appId: "", secretId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md index ebe444be..4be6c113 100644 --- a/docs/examples/apps/delete-tokens.md +++ b/docs/examples/apps/delete-tokens.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); await apps.DeleteTokens( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md index 0942bb2f..973b9f43 100644 --- a/docs/examples/apps/delete.md +++ b/docs/examples/apps/delete.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); await apps.Delete( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 4102d094..16221bdc 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppInstallation result = await apps.GetInstallation( appId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index 17adf20f..4bfe168c 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppKey result = await apps.GetKey( appId: "", keyId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index 3e8b9925..e1f6e4fc 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppSecret result = await apps.GetSecret( appId: "", secretId: "" -);``` +); + +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index a9ee6a0f..df6aefd0 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -12,4 +12,6 @@ Apps apps = new Apps(client); App result = await apps.Get( appId: "" -);``` +); + +``` diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md index 72aaa4fa..2ba341f0 100644 --- a/docs/examples/apps/list-installation-scopes.md +++ b/docs/examples/apps/list-installation-scopes.md @@ -11,4 +11,6 @@ Client client = new Client() Apps apps = new Apps(client); AppScopeList result = await apps.ListInstallationScopes(); + + ``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 6b800561..1a1bdf8d 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -14,4 +14,6 @@ AppInstallationList result = await apps.ListInstallations( appId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md index 6d164d32..e6e8522f 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -14,4 +14,6 @@ AppKeyList result = await apps.ListKeys( appId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md index f9382134..6efd8503 100644 --- a/docs/examples/apps/list-o-auth-2-scopes.md +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -11,4 +11,6 @@ Client client = new Client() Apps apps = new Apps(client); AppScopeList result = await apps.ListOAuth2Scopes(); + + ``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index fe394026..ab831c0a 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -14,4 +14,6 @@ AppSecretList result = await apps.ListSecrets( appId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md index 1dffb6a0..724cfd91 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); AppsList result = await apps.List( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md index ac99b7b8..3a311d25 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); App result = await apps.UpdateLabels( appId: "", labels: new List() -);``` +); + +``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md index 18084338..ac6fc92d 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -13,4 +13,6 @@ Apps apps = new Apps(client); App result = await apps.UpdateTeam( appId: "", teamId: "" -);``` +); + +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index d6af16a9..20de7ef0 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -31,4 +31,6 @@ App result = await apps.Update( deviceFlow: false, // optional installationScopes: new List(), // optional installationRedirectUrl: "https://example.com" // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index f17be7dd..4b53a3e4 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetBrowser( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 6d1647ee..924d4b6c 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetCreditCard( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 4443daf4..d7179748 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -12,4 +12,6 @@ Avatars avatars = new Avatars(client); byte[] result = await avatars.GetFavicon( url: "https://example.com" -);``` +); + +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 2242497a..8480c6fb 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -16,4 +16,6 @@ byte[] result = await avatars.GetFlag( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 99518bed..86ef67f7 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -14,4 +14,6 @@ byte[] result = await avatars.GetImage( url: "https://example.com", width: 0, // optional height: 0 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 8f6f1cd4..3c6d7dd1 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -14,5 +14,7 @@ byte[] result = await avatars.GetInitials( name: "", // optional width: 0, // optional height: 0, // optional - background: "" // optional -);``` + background: "FFFFFF" // optional +); + +``` diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md new file mode 100644 index 00000000..0f65e539 --- /dev/null +++ b/docs/examples/avatars/get-photo.md @@ -0,0 +1,24 @@ +```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 + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: "png", // optional + rating: "g", // optional + userId: "current()", // optional + emailHash: "", // optional + name: "" // optional +); + +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index 2414e3d5..0be679e6 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -15,4 +15,6 @@ byte[] result = await avatars.GetQR( size: 1, // optional margin: 0, // optional download: false // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index eaa39c8d..92828bf7 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -35,4 +35,6 @@ byte[] result = await avatars.GetScreenshot( height: 600, // optional quality: 85, // optional output: ImageFormat.Jpeg // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index 4eee7308..6cb21045 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -14,4 +14,6 @@ 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 index a357c855..cee682ed 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -19,4 +19,6 @@ BackupPolicy result = await backups.CreatePolicy( name: "", // optional resourceId: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 80ec86a1..f3649c17 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -16,4 +16,6 @@ BackupRestoration result = await backups.CreateRestoration( 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 index 2fe98e06..650e2a01 100644 --- a/docs/examples/backups/delete-archive.md +++ b/docs/examples/backups/delete-archive.md @@ -12,4 +12,6 @@ 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 index cc154823..cacac41f 100644 --- a/docs/examples/backups/delete-policy.md +++ b/docs/examples/backups/delete-policy.md @@ -12,4 +12,6 @@ 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 index d06e0bc5..15c9b83d 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -12,4 +12,6 @@ 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 index 427fcfa0..0fe94d97 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -12,4 +12,6 @@ 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 index bed028bb..e48d04ee 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -12,4 +12,6 @@ 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 index ddc46339..15f69c28 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -12,4 +12,6 @@ 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 index 8ebdffdf..f1695519 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -12,4 +12,6 @@ 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 index 7d9712d6..ee286a75 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -12,4 +12,6 @@ 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 index acba52a3..93d1233b 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -16,4 +16,6 @@ BackupPolicy result = await backups.UpdatePolicy( retention: 1, // optional schedule: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index 405bdfdd..db06ba5d 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeBigint result = await databases.CreateBigIntAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional + max: 1000000, // optional default: 0, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 7a2a8038..ba2df46c 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeBoolean result = await databases.CreateBooleanAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 51398280..8fbf9538 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -19,4 +19,6 @@ Collection result = await databases.CreateCollection( enabled: false, // optional attributes: new List(), // optional indexes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 85d2e095..f9248808 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeDatetime result = await databases.CreateDatetimeAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f2eb911c..54730c8d 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -23,4 +23,6 @@ Document result = await databases.CreateDocument( }, permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index f026a31a..e490a0b8 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -15,4 +15,6 @@ DocumentList result = await databases.CreateDocuments( collectionId: "", documents: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index a08ca0b3..94757f04 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeEmail result = await databases.CreateEmailAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "email@example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 5a27fbca..d66cb3ac 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeEnum result = await databases.CreateEnumAttribute( databaseId: "", collectionId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", // optional + default: "active", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 2c8f71ed..26fb95a7 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeFloat result = await databases.CreateFloatAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10.5, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 3d653021..748394d9 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -14,9 +14,11 @@ Databases databases = new Databases(client); Index result = await databases.CreateIndex( databaseId: "", collectionId: "", - key: "", + key: "", type: DatabasesIndexType.Key, attributes: new List(), orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 71a02566..04678b94 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeInteger result = await databases.CreateIntegerAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 666ae483..b5de19be 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeIp result = await databases.CreateIpAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "192.0.2.0", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index ac36d800..53f1ada4 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributeLine result = await databases.CreateLineAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 95bc8112..3bf127aa 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeLongtext result = await databases.CreateLongtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index c2e321f0..2e758f7b 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeMediumtext result = await databases.CreateMediumtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 689678a0..7b150194 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -23,4 +23,6 @@ Transaction result = await databases.CreateOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 66e87640..a08e2b9a 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributePoint result = await databases.CreatePointAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 66c44b12..917a45c9 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -13,7 +13,9 @@ Databases databases = new Databases(client); AttributePolygon result = await databases.CreatePolygonAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index a5262ffe..6f8ac621 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -17,7 +17,9 @@ AttributeRelationship result = await databases.CreateRelationshipAttribute( relatedCollectionId: "", type: RelationshipType.OneToOne, twoWay: false, // optional - key: "", // optional - twoWayKey: "", // optional + key: "", // optional + twoWayKey: "", // optional onDelete: RelationMutate.Cascade // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 9e7be5f6..ea547aaa 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeString result = await databases.CreateStringAttribute( databaseId: "", collectionId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index c31955d7..dd6fe3cb 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeText result = await databases.CreateTextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index affe6894..29b18cd4 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); Transaction result = await databases.CreateTransaction( ttl: 60 // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 2f278ed1..dd0e356b 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeUrl result = await databases.CreateUrlAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "https://example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 215c6a71..4c3f3a1e 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeVarchar result = await databases.CreateVarcharAttribute( databaseId: "", collectionId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 534cd64f..6d0a504c 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -14,4 +14,6 @@ Database result = await databases.Create( databaseId: "", name: "", enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 4dc89d8e..46dd163d 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -14,8 +14,10 @@ Document result = await databases.DecrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", - attribute: "", - value: 0, // optional + attribute: "", + value: 1, // optional min: 0, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index fdf5b395..05fb3e78 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); await databases.DeleteAttribute( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 50d6e4e7..ecebab3a 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -13,4 +13,6 @@ Databases databases = new Databases(client); await databases.DeleteCollection( databaseId: "", collectionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index fda3b456..02adf999 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -15,4 +15,6 @@ await databases.DeleteDocument( collectionId: "", documentId: "", transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index d6c85c9a..4b14b138 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -15,4 +15,6 @@ await databases.DeleteDocuments( collectionId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 5dce6650..60303458 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); await databases.DeleteIndex( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 692245f6..2c3b947f 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); await databases.DeleteTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 2c4d440b..519bcab3 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); await databases.Delete( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 3e0832c3..d131b814 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); object result = await databases.GetAttribute( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 90bcbd5b..0798f68e 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -13,4 +13,6 @@ Databases databases = new Databases(client); Collection result = await databases.GetCollection( databaseId: "", collectionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 404aeaa2..102cbb5b 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -16,4 +16,6 @@ Document result = await databases.GetDocument( documentId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index fb11f427..ad06f1fb 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -13,5 +13,7 @@ Databases databases = new Databases(client); Index result = await databases.GetIndex( databaseId: "", collectionId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 38441e99..fe449961 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); Transaction result = await databases.GetTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index ff8ff6ba..91d9a0ec 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); Database result = await databases.Get( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 3a6eaa2b..230784d7 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -14,8 +14,10 @@ Document result = await databases.IncrementDocumentAttribute( databaseId: "", collectionId: "", documentId: "", - attribute: "", - value: 0, // optional - max: 0, // optional + attribute: "", + value: 1, // optional + max: 100, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index b0ac39a0..ff57878c 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -15,4 +15,6 @@ AttributeList result = await databases.ListAttributes( collectionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 9cc4aeff..ed856f6e 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -15,4 +15,6 @@ CollectionList result = await databases.ListCollections( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index cb2d2dbe..d8cdff0a 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -17,4 +17,6 @@ DocumentList result = await databases.ListDocuments( transactionId: "", // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 207d060b..80f4bcf2 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -15,4 +15,6 @@ IndexList result = await databases.ListIndexes( collectionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 1213629c..fc141674 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -12,4 +12,6 @@ Databases databases = new Databases(client); TransactionList result = await databases.ListTransactions( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 52aa1970..57095184 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -14,4 +14,6 @@ DatabaseList result = await databases.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 14dba131..7fea78b5 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeBigint result = await databases.UpdateBigIntAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: 0, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 1000000, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 0b5caaa2..52b0a767 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeBoolean result = await databases.UpdateBooleanAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: false, - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index ab058806..7e3378fa 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -18,4 +18,6 @@ Collection result = await databases.UpdateCollection( documentSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index a2da8980..2a1df23f 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeDatetime result = await databases.UpdateDatetimeAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 58d268ba..e18a6ef9 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -23,4 +23,6 @@ Document result = await databases.UpdateDocument( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index add1deb6..db3133df 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -22,4 +22,6 @@ DocumentList result = await databases.UpdateDocuments( }, // optional queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 543e95be..b1f0e37f 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeEmail result = await databases.UpdateEmailAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "email@example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index e71c4bdb..d009b5c7 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeEnum result = await databases.UpdateEnumAttribute( databaseId: "", collectionId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", - newKey: "" // optional -);``` + default: "active", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 14723431..fd8dc427 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeFloat result = await databases.UpdateFloatAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: 0, + default: 10.5, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 75764af7..17a0cc8b 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -13,10 +13,12 @@ Databases databases = new Databases(client); AttributeInteger result = await databases.UpdateIntegerAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: 0, + default: 10, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d0b25c7c..432bb4d4 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeIp result = await databases.UpdateIpAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "192.0.2.0", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index eb3a8e76..11dc3840 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeLine result = await databases.UpdateLineAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index ad74738f..2dba9171 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeLongtext result = await databases.UpdateLongtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index b85055ef..ba356254 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeMediumtext result = await databases.UpdateMediumtextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index cb8d54b6..7bbf9fb6 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributePoint result = await databases.UpdatePointAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [1, 2], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 5c893799..f35fdcff 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributePolygon result = await databases.UpdatePolygonAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 5d260d97..aa7fd030 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -14,7 +14,9 @@ Databases databases = new Databases(client); AttributeRelationship result = await databases.UpdateRelationshipAttribute( databaseId: "", collectionId: "", - key: "", + key: "", onDelete: RelationMutate.Cascade, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 08337fc2..00bf4aed 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeString result = await databases.UpdateStringAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 2ead38d2..e041f96e 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeText result = await databases.UpdateTextAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index afa8362a..b3058935 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -14,4 +14,6 @@ Transaction result = await databases.UpdateTransaction( transactionId: "", commit: false, // optional rollback: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 2c78b794..4beafd13 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -13,8 +13,10 @@ Databases databases = new Databases(client); AttributeUrl result = await databases.UpdateUrlAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, default: "https://example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 201c17de..2d721512 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -13,9 +13,11 @@ Databases databases = new Databases(client); AttributeVarchar result = await databases.UpdateVarcharAttribute( databaseId: "", collectionId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 7a6c2e4c..1439c1ce 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -14,4 +14,6 @@ Database result = await databases.Update( databaseId: "", name: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index a4714099..3eff270e 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -23,4 +23,6 @@ Document result = await databases.UpsertDocument( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 8223f8ab..d22184b8 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -15,4 +15,6 @@ DocumentList result = await databases.UpsertDocuments( collectionId: "", documents: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md new file mode 100644 index 00000000..5c42dc56 --- /dev/null +++ b/docs/examples/documentsdb/create-collection.md @@ -0,0 +1,24 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: new List(), // optional + indexes: new List() // optional +); + +``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md new file mode 100644 index 00000000..4c71e2f7 --- /dev/null +++ b/docs/examples/documentsdb/create-document.md @@ -0,0 +1,27 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +); + +``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md new file mode 100644 index 00000000..8e5c33a9 --- /dev/null +++ b/docs/examples/documentsdb/create-documents.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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +); + +``` diff --git a/docs/examples/documentsdb/create-failover.md b/docs/examples/documentsdb/create-failover.md new file mode 100644 index 00000000..5a22d1c7 --- /dev/null +++ b/docs/examples/documentsdb/create-failover.md @@ -0,0 +1,18 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabase result = await documentsDB.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md new file mode 100644 index 00000000..31a06292 --- /dev/null +++ b/docs/examples/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: DocumentsDBIndexType.Key, + attributes: new List(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List() // optional +); + +``` diff --git a/docs/examples/documentsdb/create-operations.md b/docs/examples/documentsdb/create-operations.md new file mode 100644 index 00000000..abe507f3 --- /dev/null +++ b/docs/examples/documentsdb/create-operations.md @@ -0,0 +1,28 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md new file mode 100644 index 00000000..a948934b --- /dev/null +++ b/docs/examples/documentsdb/create-transaction.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md new file mode 100644 index 00000000..8c1fa6b5 --- /dev/null +++ b/docs/examples/documentsdb/create.md @@ -0,0 +1,22 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Create( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 00000000..5ab49cdd --- /dev/null +++ b/docs/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,23 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.DecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md new file mode 100644 index 00000000..ce55d795 --- /dev/null +++ b/docs/examples/documentsdb/delete-collection.md @@ -0,0 +1,18 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md new file mode 100644 index 00000000..eeca145b --- /dev/null +++ b/docs/examples/documentsdb/delete-document.md @@ -0,0 +1,20 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md new file mode 100644 index 00000000..c1c885aa --- /dev/null +++ b/docs/examples/documentsdb/delete-documents.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md new file mode 100644 index 00000000..fed0c3cc --- /dev/null +++ b/docs/examples/documentsdb/delete-index.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md new file mode 100644 index 00000000..5ad20ffd --- /dev/null +++ b/docs/examples/documentsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md new file mode 100644 index 00000000..12696db2 --- /dev/null +++ b/docs/examples/documentsdb/delete.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md new file mode 100644 index 00000000..f50e03a1 --- /dev/null +++ b/docs/examples/documentsdb/get-collection.md @@ -0,0 +1,18 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.GetCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md new file mode 100644 index 00000000..1e3bfa5c --- /dev/null +++ b/docs/examples/documentsdb/get-document.md @@ -0,0 +1,21 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md new file mode 100644 index 00000000..e8c99e38 --- /dev/null +++ b/docs/examples/documentsdb/get-index.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/documentsdb/get-replicas.md b/docs/examples/documentsdb/get-replicas.md new file mode 100644 index 00000000..abe66999 --- /dev/null +++ b/docs/examples/documentsdb/get-replicas.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseReplicas result = await documentsDB.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-status.md b/docs/examples/documentsdb/get-status.md new file mode 100644 index 00000000..418a7613 --- /dev/null +++ b/docs/examples/documentsdb/get-status.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DatabaseStatus result = await documentsDB.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md new file mode 100644 index 00000000..800897c2 --- /dev/null +++ b/docs/examples/documentsdb/get-transaction.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.GetTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md new file mode 100644 index 00000000..f8d06919 --- /dev/null +++ b/docs/examples/documentsdb/get.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 00000000..fc9d0795 --- /dev/null +++ b/docs/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,23 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.IncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md new file mode 100644 index 00000000..1227361b --- /dev/null +++ b/docs/examples/documentsdb/list-collections.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +CollectionList result = await documentsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +); + +``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md new file mode 100644 index 00000000..0838c9c1 --- /dev/null +++ b/docs/examples/documentsdb/list-documents.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md new file mode 100644 index 00000000..aa8435ca --- /dev/null +++ b/docs/examples/documentsdb/list-indexes.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +IndexList result = await documentsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/documentsdb/list-operations.md b/docs/examples/documentsdb/list-operations.md new file mode 100644 index 00000000..5e274792 --- /dev/null +++ b/docs/examples/documentsdb/list-operations.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseOperationList result = await documentsDB.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/documentsdb/list-specifications.md b/docs/examples/documentsdb/list-specifications.md new file mode 100644 index 00000000..33e4c32a --- /dev/null +++ b/docs/examples/documentsdb/list-specifications.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DedicatedDatabaseSpecificationList result = await documentsDB.ListSpecifications(); + + +``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md new file mode 100644 index 00000000..84539069 --- /dev/null +++ b/docs/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +TransactionList result = await documentsDB.ListTransactions( + queries: new List() // optional +); + +``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md new file mode 100644 index 00000000..79bfce24 --- /dev/null +++ b/docs/examples/documentsdb/list.md @@ -0,0 +1,18 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DatabaseList result = await documentsDB.List( + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md new file mode 100644 index 00000000..093d9db9 --- /dev/null +++ b/docs/examples/documentsdb/update-collection.md @@ -0,0 +1,23 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); + +``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md new file mode 100644 index 00000000..87172a6e --- /dev/null +++ b/docs/examples/documentsdb/update-document.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md new file mode 100644 index 00000000..f325b2ea --- /dev/null +++ b/docs/examples/documentsdb/update-documents.md @@ -0,0 +1,21 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md new file mode 100644 index 00000000..b4a30687 --- /dev/null +++ b/docs/examples/documentsdb/update-transaction.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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.UpdateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md new file mode 100644 index 00000000..e9fd54c5 --- /dev/null +++ b/docs/examples/documentsdb/update.md @@ -0,0 +1,22 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Update( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md new file mode 100644 index 00000000..a5de788f --- /dev/null +++ b/docs/examples/documentsdb/upsert-document.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md new file mode 100644 index 00000000..66f738cf --- /dev/null +++ b/docs/examples/documentsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```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 + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +); + +``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 64848cd2..95b97cc0 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -14,4 +14,6 @@ Embeddings embeddings = new Embeddings(client); EmbeddingList result = await embeddings.CreateTextEmbeddings( texts: new List(), model: EmbeddingModel.NomicEmbedText // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index ec99b73c..a445e35f 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -16,4 +16,6 @@ Deployment result = await functions.CreateDeployment( activate: false, entrypoint: "", // optional commands: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index e906e373..20ba6fab 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -14,4 +14,6 @@ Deployment result = await functions.CreateDuplicateDeployment( functionId: "", deploymentId: "", buildId: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 11a6b73a..38e0b69b 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -19,4 +19,6 @@ Execution result = await functions.CreateExecution( method: ExecutionMethod.GET, // optional headers: [object], // optional scheduledAt: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index 18cb1c7b..47edfa96 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -19,4 +19,6 @@ Deployment result = await functions.CreateTemplateDeployment( type: TemplateReferenceType.Commit, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index dfb84f44..7e3d32f6 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -16,4 +16,6 @@ Variable result = await functions.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 02761724..bfc06888 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -16,4 +16,6 @@ Deployment result = await functions.CreateVcsDeployment( type: VCSReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 5df83e1d..741a659a 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -17,7 +17,7 @@ Function result = await functions.Create( runtime: Runtime.Node145, execute: ["any"], // optional events: new List(), // optional - schedule: "", // optional + schedule: "0 0 * * *", // optional timeout: 1, // optional enabled: false, // optional logging: false, // optional @@ -31,7 +31,9 @@ Function result = await functions.Create( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 89ed174d..673fc1c8 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 0d5958be..28882815 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteExecution( functionId: "", executionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 2c69a588..7dcb9a9a 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); await functions.DeleteVariable( functionId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 104a7485..c814f321 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); await functions.Delete( functionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 64cff1ac..0756473a 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -16,4 +16,6 @@ byte[] result = await functions.GetDeploymentDownload( deploymentId: "", type: DeploymentDownloadType.Source, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 4bca044d..fb0905f5 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Deployment result = await functions.GetDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index a4705dc9..6f2871b4 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Execution result = await functions.GetExecution( functionId: "", executionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index fb4bd217..7b383b0b 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Variable result = await functions.GetVariable( functionId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 1c8ab331..86ffaa29 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); Function result = await functions.Get( functionId: "" -);``` +); + +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index ae2a3f7b..8e368f9f 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -15,4 +15,6 @@ DeploymentList result = await functions.ListDeployments( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index e3e838e1..85cc2ab4 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -14,4 +14,6 @@ ExecutionList result = await functions.ListExecutions( functionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index c0a58ab6..b0b68625 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -11,4 +11,6 @@ Client client = new Client() Functions functions = new Functions(client); RuntimeList result = await functions.ListRuntimes(); + + ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index cacd502b..b97f4cf4 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -12,4 +12,6 @@ Functions functions = new Functions(client); SpecificationList result = await functions.ListSpecifications( type: "runtimes" // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 4e540e7b..df8029e3 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -14,4 +14,6 @@ VariableList result = await functions.ListVariables( functionId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index f8da87f8..b09d8ee6 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -14,4 +14,6 @@ FunctionList result = await functions.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 819221cb..ee782aed 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Deployment result = await functions.UpdateDeploymentStatus( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index 1045b455..563d5a21 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -13,4 +13,6 @@ Functions functions = new Functions(client); Function result = await functions.UpdateFunctionDeployment( functionId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index af7eb84a..a1fd20ee 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -16,4 +16,6 @@ Variable result = await functions.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 3d5aaeae..10d4a96b 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -17,7 +17,7 @@ Function result = await functions.Update( runtime: Runtime.Node145, // optional execute: ["any"], // optional events: new List(), // optional - schedule: "", // optional + schedule: "0 0 * * *", // optional timeout: 1, // optional enabled: false, // optional logging: false, // optional @@ -31,7 +31,9 @@ Function result = await functions.Update( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 4280455f..0145c03c 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -12,4 +12,6 @@ Graphql graphql = new Graphql(client); Any result = await graphql.Mutation( query: [object] -);``` +); + +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 6d1c447e..88c82162 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -12,4 +12,6 @@ Graphql graphql = new Graphql(client); Any result = await graphql.Query( query: [object] -);``` +); + +``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index c8bd51ea..a1dcbcc9 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); Locale result = await locale.Get(); + + ``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index ec8da7d6..a3bfeff5 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); LocaleCodeList result = await locale.ListCodes(); + + ``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index b53a4a1f..02b86116 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); ContinentList result = await locale.ListContinents(); + + ``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index aa85c781..9452cd0e 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CountryList result = await locale.ListCountriesEU(); + + ``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 6a600fc5..e3b5346e 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); PhoneList result = await locale.ListCountriesPhones(); + + ``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index ce3e0f53..c9c1fb94 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CountryList result = await locale.ListCountries(); + + ``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 526d6180..18d04a69 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); CurrencyList result = await locale.ListCurrencies(); + + ``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index bd9cd058..83ed0241 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -11,4 +11,6 @@ Client client = new Client() Locale locale = new Locale(client); LanguageList result = await locale.ListLanguages(); + + ``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 8f1e99d0..55be57aa 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateAPNSProvider( bundleId: "", // optional sandbox: false, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index a748744c..03c71b14 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -23,4 +23,6 @@ Message result = await messaging.CreateEmail( draft: false, // optional html: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index e07bfe9a..4ef0b591 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -15,4 +15,6 @@ Provider result = await messaging.CreateFCMProvider( name: "", serviceAccountJSON: [object], // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 352bd504..ba278efe 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -14,11 +14,13 @@ Provider result = await messaging.CreateMailgunProvider( providerId: "", name: "", apiKey: "", // optional - domain: "", // optional + domain: "example.com", // optional isEuRegion: false, // optional fromName: "", // optional fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 6abd30bc..e7638b6e 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateMsg91Provider( senderId: "", // optional authKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index a7c31e20..3ee6e423 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -25,10 +25,12 @@ Message result = await messaging.CreatePush( sound: "", // optional color: "", // optional tag: "", // optional - badge: 0, // optional + badge: 1, // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional priority: MessagePriority.Normal // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index ea6ff5ec..e2400c9f 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateResendProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 9df34e0a..f18e9a05 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.CreateSendgridProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index 5750c3a6..ef569769 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -21,4 +21,6 @@ Provider result = await messaging.CreateSesProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index f6677ab8..2756f28c 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -18,4 +18,6 @@ Message result = await messaging.CreateSMS( targets: new List(), // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 4ec4314f..bbe34356 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -15,7 +15,7 @@ Provider result = await messaging.CreateSMTPProvider( providerId: "", name: "", host: "", - port: 1, // optional + port: 587, // optional username: "", // optional password: "password", // optional encryption: SmtpEncryption.None, // optional @@ -26,4 +26,6 @@ Provider result = await messaging.CreateSMTPProvider( replyToName: "", // optional replyToEmail: "email@example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index cfb3d159..619abf20 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -14,4 +14,6 @@ Subscriber result = await messaging.CreateSubscriber( topicId: "", subscriberId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 14770eb5..68c37c33 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTelesignProvider( customerId: "", // optional apiKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 2fbea11a..d549516c 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTextmagicProvider( username: "", // optional apiKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index d9b8370b..9b4338dc 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -14,4 +14,6 @@ Topic result = await messaging.CreateTopic( topicId: "", name: "", subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 4eba8078..a8a5d8c9 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateTwilioProvider( accountSid: "", // optional authToken: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 1407190e..8fc8335b 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.CreateVonageProvider( apiKey: "", // optional apiSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 06dbf22f..fb8bca39 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteProvider( providerId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index ee4b8dc4..81f1d1ce 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -13,4 +13,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteSubscriber( topicId: "", subscriberId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index a27b4036..579cce5b 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.DeleteTopic( topicId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 8e2777a1..a04d0334 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); await messaging.Delete( messageId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 6e7d6a82..53597127 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Message result = await messaging.GetMessage( messageId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index e30778d7..fb9c334e 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Provider result = await messaging.GetProvider( providerId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 91f76b88..79e6bb07 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -13,4 +13,6 @@ Messaging messaging = new Messaging(client); Subscriber result = await messaging.GetSubscriber( topicId: "", subscriberId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 8236a966..6fc890d0 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -12,4 +12,6 @@ Messaging messaging = new Messaging(client); Topic result = await messaging.GetTopic( topicId: "" -);``` +); + +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index dfdf9056..6bc43ea9 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -14,4 +14,6 @@ MessageList result = await messaging.ListMessages( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 3823f052..5d286744 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -14,4 +14,6 @@ ProviderList result = await messaging.ListProviders( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 22a267e7..15773d00 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -15,4 +15,6 @@ SubscriberList result = await messaging.ListSubscribers( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index d6e99c9a..e5b2cd94 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -14,4 +14,6 @@ TargetList result = await messaging.ListTargets( messageId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1002a4d9..4fa6f4df 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -14,4 +14,6 @@ TopicList result = await messaging.ListTopics( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 51550098..d8a04a49 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateAPNSProvider( teamId: "", // optional bundleId: "", // optional sandbox: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index b795cda1..5e87deeb 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -23,4 +23,6 @@ Message result = await messaging.UpdateEmail( bcc: new List(), // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional attachments: new List() // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 43478a5a..c7381ed2 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -15,4 +15,6 @@ Provider result = await messaging.UpdateFCMProvider( name: "", // optional enabled: false, // optional serviceAccountJSON: [object] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 2cf3a83e..95b8466d 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -14,11 +14,13 @@ Provider result = await messaging.UpdateMailgunProvider( providerId: "", name: "", // optional apiKey: "", // optional - domain: "", // optional + domain: "example.com", // optional isEuRegion: false, // optional enabled: false, // optional fromName: "", // optional fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 7a651250..3652c6a0 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateMsg91Provider( templateId: "", // optional senderId: "", // optional authKey: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 95de201c..6a151cca 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -25,10 +25,12 @@ Message result = await messaging.UpdatePush( sound: "", // optional color: "", // optional tag: "", // optional - badge: 0, // optional + badge: 1, // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional contentAvailable: false, // optional critical: false, // optional priority: MessagePriority.Normal // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index d6d42c85..9bef411a 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateResendProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 03d1972d..b98feaa1 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -19,4 +19,6 @@ Provider result = await messaging.UpdateSendgridProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index 32a67f01..982cd549 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -21,4 +21,6 @@ Provider result = await messaging.UpdateSesProvider( fromEmail: "email@example.com", // optional replyToName: "", // optional replyToEmail: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index db9795dd..3d38d9fb 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -18,4 +18,6 @@ Message result = await messaging.UpdateSMS( content: "", // optional draft: false, // optional scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 9789829c..2d9da6ca 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -26,4 +26,6 @@ Provider result = await messaging.UpdateSMTPProvider( replyToName: "", // optional replyToEmail: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index e9ebd80e..5a7048b1 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTelesignProvider( customerId: "", // optional apiKey: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index b5b7b8af..4f0a7a0d 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTextmagicProvider( username: "", // optional apiKey: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 361a2396..aa45f99b 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -14,4 +14,6 @@ Topic result = await messaging.UpdateTopic( topicId: "", name: "", // optional subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 594bdee8..a1d51e9e 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateTwilioProvider( accountSid: "", // optional authToken: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 61e8c848..d26a17dd 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -17,4 +17,6 @@ Provider result = await messaging.UpdateVonageProvider( apiKey: "", // optional apiSecret: "", // optional from: "" // optional -);``` +); + +``` diff --git a/docs/examples/mongo/create-backup-policy.md b/docs/examples/mongo/create-backup-policy.md new file mode 100644 index 00000000..41e2ed4b --- /dev/null +++ b/docs/examples/mongo/create-backup-policy.md @@ -0,0 +1,23 @@ +```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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mongo/create-backup.md b/docs/examples/mongo/create-backup.md new file mode 100644 index 00000000..e25efa99 --- /dev/null +++ b/docs/examples/mongo/create-backup.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackup result = await mongo.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/mongo/create-branch.md b/docs/examples/mongo/create-branch.md new file mode 100644 index 00000000..8c01df43 --- /dev/null +++ b/docs/examples/mongo/create-branch.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/mongo/create-failover.md b/docs/examples/mongo/create-failover.md new file mode 100644 index 00000000..d4a6686e --- /dev/null +++ b/docs/examples/mongo/create-failover.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/mongo/create-migration.md b/docs/examples/mongo/create-migration.md new file mode 100644 index 00000000..b7fbcc7a --- /dev/null +++ b/docs/examples/mongo/create-migration.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/mongo/create-restoration.md b/docs/examples/mongo/create-restoration.md new file mode 100644 index 00000000..8e9358eb --- /dev/null +++ b/docs/examples/mongo/create-restoration.md @@ -0,0 +1,21 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestoration result = await mongo.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/mongo/create-upgrade.md b/docs/examples/mongo/create-upgrade.md new file mode 100644 index 00000000..c18e2d62 --- /dev/null +++ b/docs/examples/mongo/create-upgrade.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/mongo/create.md b/docs/examples/mongo/create.md new file mode 100644 index 00000000..c6ef970c --- /dev/null +++ b/docs/examples/mongo/create.md @@ -0,0 +1,30 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/mongo/delete-backup-policy.md b/docs/examples/mongo/delete-backup-policy.md new file mode 100644 index 00000000..923bea41 --- /dev/null +++ b/docs/examples/mongo/delete-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mongo/delete-backup.md b/docs/examples/mongo/delete-backup.md new file mode 100644 index 00000000..48529d97 --- /dev/null +++ b/docs/examples/mongo/delete-backup.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mongo/delete-branch.md b/docs/examples/mongo/delete-branch.md new file mode 100644 index 00000000..a17780fd --- /dev/null +++ b/docs/examples/mongo/delete-branch.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +await mongo.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/mongo/delete.md b/docs/examples/mongo/delete.md new file mode 100644 index 00000000..e014f378 --- /dev/null +++ b/docs/examples/mongo/delete.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +await mongo.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-backup-policy.md b/docs/examples/mongo/get-backup-policy.md new file mode 100644 index 00000000..d05d979d --- /dev/null +++ b/docs/examples/mongo/get-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mongo/get-backup.md b/docs/examples/mongo/get-backup.md new file mode 100644 index 00000000..ced57a21 --- /dev/null +++ b/docs/examples/mongo/get-backup.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackup result = await mongo.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mongo/get-pitr.md b/docs/examples/mongo/get-pitr.md new file mode 100644 index 00000000..55a1e64e --- /dev/null +++ b/docs/examples/mongo/get-pitr.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabasePITRWindows result = await mongo.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-replicas.md b/docs/examples/mongo/get-replicas.md new file mode 100644 index 00000000..7c52ecee --- /dev/null +++ b/docs/examples/mongo/get-replicas.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseReplicas result = await mongo.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get-restoration.md b/docs/examples/mongo/get-restoration.md new file mode 100644 index 00000000..32e83008 --- /dev/null +++ b/docs/examples/mongo/get-restoration.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestoration result = await mongo.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/mongo/get-status.md b/docs/examples/mongo/get-status.md new file mode 100644 index 00000000..883f3b97 --- /dev/null +++ b/docs/examples/mongo/get-status.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DatabaseStatus result = await mongo.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/get.md b/docs/examples/mongo/get.md new file mode 100644 index 00000000..86e0b80c --- /dev/null +++ b/docs/examples/mongo/get.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/list-backup-policies.md b/docs/examples/mongo/list-backup-policies.md new file mode 100644 index 00000000..9b56913a --- /dev/null +++ b/docs/examples/mongo/list-backup-policies.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +BackupPolicyList result = await mongo.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/list-backups.md b/docs/examples/mongo/list-backups.md new file mode 100644 index 00000000..6da449f8 --- /dev/null +++ b/docs/examples/mongo/list-backups.md @@ -0,0 +1,18 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackupList result = await mongo.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/list-branches.md b/docs/examples/mongo/list-branches.md new file mode 100644 index 00000000..f68102dc --- /dev/null +++ b/docs/examples/mongo/list-branches.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBranchList result = await mongo.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/list-operations.md b/docs/examples/mongo/list-operations.md new file mode 100644 index 00000000..c2dc679f --- /dev/null +++ b/docs/examples/mongo/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseOperationList result = await mongo.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mongo/list-restorations.md b/docs/examples/mongo/list-restorations.md new file mode 100644 index 00000000..b5655c37 --- /dev/null +++ b/docs/examples/mongo/list-restorations.md @@ -0,0 +1,21 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseRestorationList result = await mongo.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mongo/list-specifications.md b/docs/examples/mongo/list-specifications.md new file mode 100644 index 00000000..474e6123 --- /dev/null +++ b/docs/examples/mongo/list-specifications.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseSpecificationList result = await mongo.ListSpecifications(); + + +``` diff --git a/docs/examples/mongo/list.md b/docs/examples/mongo/list.md new file mode 100644 index 00000000..bd222419 --- /dev/null +++ b/docs/examples/mongo/list.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseList result = await mongo.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/mongo/update-backup-policy.md b/docs/examples/mongo/update-backup-policy.md new file mode 100644 index 00000000..7bec7bf3 --- /dev/null +++ b/docs/examples/mongo/update-backup-policy.md @@ -0,0 +1,22 @@ +```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 + +Mongo mongo = new Mongo(client); + +BackupPolicy result = await mongo.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mongo/update-backup-storage.md b/docs/examples/mongo/update-backup-storage.md new file mode 100644 index 00000000..27f365d4 --- /dev/null +++ b/docs/examples/mongo/update-backup-storage.md @@ -0,0 +1,24 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabaseBackupStorage result = await mongo.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/mongo/update-credentials.md b/docs/examples/mongo/update-credentials.md new file mode 100644 index 00000000..268c4348 --- /dev/null +++ b/docs/examples/mongo/update-credentials.md @@ -0,0 +1,17 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/mongo/update-maintenance.md b/docs/examples/mongo/update-maintenance.md new file mode 100644 index 00000000..e64faec6 --- /dev/null +++ b/docs/examples/mongo/update-maintenance.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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/mongo/update.md b/docs/examples/mongo/update.md new file mode 100644 index 00000000..6c9b8d0a --- /dev/null +++ b/docs/examples/mongo/update.md @@ -0,0 +1,37 @@ +```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 + +Mongo mongo = new Mongo(client); + +DedicatedDatabase result = await mongo.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/mysql/create-backup-policy.md b/docs/examples/mysql/create-backup-policy.md new file mode 100644 index 00000000..ca410dc0 --- /dev/null +++ b/docs/examples/mysql/create-backup-policy.md @@ -0,0 +1,23 @@ +```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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mysql/create-backup.md b/docs/examples/mysql/create-backup.md new file mode 100644 index 00000000..f5e271df --- /dev/null +++ b/docs/examples/mysql/create-backup.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackup result = await mysql.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/mysql/create-branch.md b/docs/examples/mysql/create-branch.md new file mode 100644 index 00000000..a4d9283f --- /dev/null +++ b/docs/examples/mysql/create-branch.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/mysql/create-execution.md b/docs/examples/mysql/create-execution.md new file mode 100644 index 00000000..364fd302 --- /dev/null +++ b/docs/examples/mysql/create-execution.md @@ -0,0 +1,20 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseExecution result = await mysql.CreateExecution( + databaseId: "", + sql: "", + bindings: [object], // optional + timeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/mysql/create-failover.md b/docs/examples/mysql/create-failover.md new file mode 100644 index 00000000..e30720ba --- /dev/null +++ b/docs/examples/mysql/create-failover.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/mysql/create-migration.md b/docs/examples/mysql/create-migration.md new file mode 100644 index 00000000..c0b943c8 --- /dev/null +++ b/docs/examples/mysql/create-migration.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/mysql/create-restoration.md b/docs/examples/mysql/create-restoration.md new file mode 100644 index 00000000..d6f1fa35 --- /dev/null +++ b/docs/examples/mysql/create-restoration.md @@ -0,0 +1,21 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestoration result = await mysql.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/mysql/create-upgrade.md b/docs/examples/mysql/create-upgrade.md new file mode 100644 index 00000000..4b408cee --- /dev/null +++ b/docs/examples/mysql/create-upgrade.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/mysql/create.md b/docs/examples/mysql/create.md new file mode 100644 index 00000000..23bcc79e --- /dev/null +++ b/docs/examples/mysql/create.md @@ -0,0 +1,30 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/mysql/delete-backup-policy.md b/docs/examples/mysql/delete-backup-policy.md new file mode 100644 index 00000000..b9edb4ce --- /dev/null +++ b/docs/examples/mysql/delete-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mysql/delete-backup.md b/docs/examples/mysql/delete-backup.md new file mode 100644 index 00000000..dca510ca --- /dev/null +++ b/docs/examples/mysql/delete-backup.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mysql/delete-branch.md b/docs/examples/mysql/delete-branch.md new file mode 100644 index 00000000..1fc078f7 --- /dev/null +++ b/docs/examples/mysql/delete-branch.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +await mysql.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/mysql/delete.md b/docs/examples/mysql/delete.md new file mode 100644 index 00000000..4da3ff7f --- /dev/null +++ b/docs/examples/mysql/delete.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +await mysql.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-backup-policy.md b/docs/examples/mysql/get-backup-policy.md new file mode 100644 index 00000000..524bd066 --- /dev/null +++ b/docs/examples/mysql/get-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/mysql/get-backup.md b/docs/examples/mysql/get-backup.md new file mode 100644 index 00000000..1c81ffc4 --- /dev/null +++ b/docs/examples/mysql/get-backup.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackup result = await mysql.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/mysql/get-pitr.md b/docs/examples/mysql/get-pitr.md new file mode 100644 index 00000000..3f1d3fcc --- /dev/null +++ b/docs/examples/mysql/get-pitr.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePITRWindows result = await mysql.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-pooler.md b/docs/examples/mysql/get-pooler.md new file mode 100644 index 00000000..c88ec9c8 --- /dev/null +++ b/docs/examples/mysql/get-pooler.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePooler result = await mysql.GetPooler( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-replicas.md b/docs/examples/mysql/get-replicas.md new file mode 100644 index 00000000..4033dc58 --- /dev/null +++ b/docs/examples/mysql/get-replicas.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseReplicas result = await mysql.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get-restoration.md b/docs/examples/mysql/get-restoration.md new file mode 100644 index 00000000..11f18fc1 --- /dev/null +++ b/docs/examples/mysql/get-restoration.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestoration result = await mysql.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/mysql/get-status.md b/docs/examples/mysql/get-status.md new file mode 100644 index 00000000..a6adb9a2 --- /dev/null +++ b/docs/examples/mysql/get-status.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DatabaseStatus result = await mysql.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/get.md b/docs/examples/mysql/get.md new file mode 100644 index 00000000..0ae1db33 --- /dev/null +++ b/docs/examples/mysql/get.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/list-backup-policies.md b/docs/examples/mysql/list-backup-policies.md new file mode 100644 index 00000000..546c276a --- /dev/null +++ b/docs/examples/mysql/list-backup-policies.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +BackupPolicyList result = await mysql.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/list-backups.md b/docs/examples/mysql/list-backups.md new file mode 100644 index 00000000..11fda3e8 --- /dev/null +++ b/docs/examples/mysql/list-backups.md @@ -0,0 +1,18 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackupList result = await mysql.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/list-branches.md b/docs/examples/mysql/list-branches.md new file mode 100644 index 00000000..471fecec --- /dev/null +++ b/docs/examples/mysql/list-branches.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBranchList result = await mysql.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/list-operations.md b/docs/examples/mysql/list-operations.md new file mode 100644 index 00000000..5b3f342a --- /dev/null +++ b/docs/examples/mysql/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseOperationList result = await mysql.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mysql/list-restorations.md b/docs/examples/mysql/list-restorations.md new file mode 100644 index 00000000..0238c2ce --- /dev/null +++ b/docs/examples/mysql/list-restorations.md @@ -0,0 +1,21 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseRestorationList result = await mysql.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/mysql/list-specifications.md b/docs/examples/mysql/list-specifications.md new file mode 100644 index 00000000..a469ff04 --- /dev/null +++ b/docs/examples/mysql/list-specifications.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseSpecificationList result = await mysql.ListSpecifications(); + + +``` diff --git a/docs/examples/mysql/list.md b/docs/examples/mysql/list.md new file mode 100644 index 00000000..f49707d1 --- /dev/null +++ b/docs/examples/mysql/list.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseList result = await mysql.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/mysql/update-backup-policy.md b/docs/examples/mysql/update-backup-policy.md new file mode 100644 index 00000000..c812e9ea --- /dev/null +++ b/docs/examples/mysql/update-backup-policy.md @@ -0,0 +1,22 @@ +```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 + +Mysql mysql = new Mysql(client); + +BackupPolicy result = await mysql.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/mysql/update-backup-storage.md b/docs/examples/mysql/update-backup-storage.md new file mode 100644 index 00000000..6efbdc49 --- /dev/null +++ b/docs/examples/mysql/update-backup-storage.md @@ -0,0 +1,24 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabaseBackupStorage result = await mysql.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/mysql/update-credentials.md b/docs/examples/mysql/update-credentials.md new file mode 100644 index 00000000..581a13e9 --- /dev/null +++ b/docs/examples/mysql/update-credentials.md @@ -0,0 +1,17 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/mysql/update-maintenance.md b/docs/examples/mysql/update-maintenance.md new file mode 100644 index 00000000..4a28819a --- /dev/null +++ b/docs/examples/mysql/update-maintenance.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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/mysql/update-pooler.md b/docs/examples/mysql/update-pooler.md new file mode 100644 index 00000000..455b6d2b --- /dev/null +++ b/docs/examples/mysql/update-pooler.md @@ -0,0 +1,25 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabasePooler result = await mysql.UpdatePooler( + databaseId: "", + mode: "transaction", // optional + maxConnections: 10, // optional + defaultPoolSize: 1, // optional + readWriteSplitting: false, // optional + poolerCpuRequest: "", // optional + poolerCpuLimit: "", // optional + poolerMemoryRequest: "", // optional + poolerMemoryLimit: "" // optional +); + +``` diff --git a/docs/examples/mysql/update.md b/docs/examples/mysql/update.md new file mode 100644 index 00000000..4e9e8adb --- /dev/null +++ b/docs/examples/mysql/update.md @@ -0,0 +1,37 @@ +```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 + +Mysql mysql = new Mysql(client); + +DedicatedDatabase result = await mysql.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index 887fab55..b59de4dd 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -14,4 +14,6 @@ Oauth2Approve result = await oauth2.Approve( grant_id: "", authorization_details: "", // optional scope: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index 72f43d1a..b2269a0e 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -25,4 +25,6 @@ Oauth2Authorize result = await oauth2.AuthorizePost( resource: "", // optional audience: "", // optional request_uri: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index 10d68bd1..056859ea 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -25,4 +25,6 @@ Oauth2Authorize result = await oauth2.Authorize( resource: "", // optional audience: "", // optional request_uri: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index 248fbf89..a6697fe0 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -16,4 +16,6 @@ Oauth2DeviceAuthorization result = await oauth2.CreateDeviceAuthorization( authorization_details: "", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 627e290d..856a8815 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Grant result = await oauth2.CreateGrant( user_code: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index 306c995c..2d8827f3 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -24,4 +24,6 @@ Oauth2PAR result = await oauth2.CreatePAR( authorization_details: "", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index 6afac7ed..a4b2d762 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -21,4 +21,6 @@ Oauth2Token result = await oauth2.CreateToken( redirect_uri: "https://example.com", // optional resource: "", // optional audience: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index a7cf5f9a..389e5005 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Grant result = await oauth2.GetGrant( grant_id: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index 59a30b97..d2787675 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -14,4 +14,6 @@ Oauth2OrganizationList result = await oauth2.ListOrganizations( limit: 1, // optional offset: 0, // optional search: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index cfe7b8ca..cff6d2a9 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -14,4 +14,6 @@ Oauth2ProjectList result = await oauth2.ListProjects( limit: 1, // optional offset: 0, // optional search: "" // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index bf32913e..9a92b2c7 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -12,4 +12,6 @@ Oauth2 oauth2 = new Oauth2(client); Oauth2Reject result = await oauth2.Reject( grant_id: "" -);``` +); + +``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 322ba30a..eb902a05 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -15,4 +15,6 @@ Oauth2 oauth2 = new Oauth2(client); token_type_hint: "access_token", // optional client_id: "", // optional client_secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index 1545dc73..78aa2c38 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.CreateInstallation( appId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md index e7354082..85288ad8 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-key.md @@ -16,4 +16,6 @@ Key result = await organization.CreateKey( name: "", scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index 07f723aa..bbeb4a1f 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -17,4 +17,6 @@ Membership result = await organization.CreateMembership( phone: "+12065550100", // optional url: "https://example.com", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index ba736acd..c4f2e627 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -12,7 +12,9 @@ Client client = new Client() Organization organization = new Organization(client); Project result = await organization.CreateProject( - projectId: "", + projectId: "", name: "", region: Region.Fra // optional -);``` +); + +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md index d295bbd5..2bfb9f04 100644 --- a/docs/examples/organization/delete-installation.md +++ b/docs/examples/organization/delete-installation.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteInstallation( installationId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md index e6d088bb..78ff5b81 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-key.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-membership.md b/docs/examples/organization/delete-membership.md index 0c3b257f..efcf35cc 100644 --- a/docs/examples/organization/delete-membership.md +++ b/docs/examples/organization/delete-membership.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteMembership( membershipId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md index 89581192..df9eb153 100644 --- a/docs/examples/organization/delete-project.md +++ b/docs/examples/organization/delete-project.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); await organization.DeleteProject( projectId: "" -);``` +); + +``` diff --git a/docs/examples/organization/delete.md b/docs/examples/organization/delete.md index 702750fe..5b034aa8 100644 --- a/docs/examples/organization/delete.md +++ b/docs/examples/organization/delete.md @@ -11,4 +11,6 @@ Client client = new Client() Organization organization = new Organization(client); await organization.Delete(); + + ``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index 13de6238..c324528b 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.GetInstallation( installationId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md index a254c99e..c240dbc0 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-key.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Key result = await organization.GetKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 60426303..44d6363e 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Membership result = await organization.GetMembership( membershipId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index b69b0d14..3d64fe0c 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Project result = await organization.GetProject( projectId: "" -);``` +); + +``` diff --git a/docs/examples/organization/get.md b/docs/examples/organization/get.md index ab20af7d..4c3c2b76 100644 --- a/docs/examples/organization/get.md +++ b/docs/examples/organization/get.md @@ -11,4 +11,6 @@ Client client = new Client() Organization organization = new Organization(client); Organization result = await organization.Get(); + + ``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 843302a7..2890e336 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallationList result = await organization.ListInstallations( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md index 9f7a3f1d..4671782d 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-keys.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); KeyList result = await organization.ListKeys( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index 00a7c736..69c357b7 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -14,4 +14,6 @@ MembershipList result = await organization.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index 2c09826d..c61a3341 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -14,4 +14,6 @@ ProjectList result = await organization.ListProjects( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index 9799ebfa..c79ee8b5 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); AppInstallation result = await organization.UpdateInstallation( installationId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md index b07ddeaa..d22ee7f6 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-key.md @@ -16,4 +16,6 @@ Key result = await organization.UpdateKey( name: "", scopes: new List<OrganizationKeyScopes> { OrganizationKeyScopes.ProjectsRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index de696dc5..d1faf7f0 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); Membership result = await organization.UpdateMembership( membershipId: "", roles: new List() -);``` +); + +``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index de55bb5d..ae8e2664 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -13,4 +13,6 @@ Organization organization = new Organization(client); Project result = await organization.UpdateProject( projectId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index 2db709e5..8b559ce1 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -12,4 +12,6 @@ Organization organization = new Organization(client); Organization result = await organization.Update( name: "" -);``` +); + +``` diff --git a/docs/examples/postgresql/create-backup-policy.md b/docs/examples/postgresql/create-backup-policy.md new file mode 100644 index 00000000..ba827ae7 --- /dev/null +++ b/docs/examples/postgresql/create-backup-policy.md @@ -0,0 +1,23 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.CreateBackupPolicy( + databaseId: "", + policyId: "", + name: "", + schedule: "", + retention: 1, + type: "full", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/postgresql/create-backup.md b/docs/examples/postgresql/create-backup.md new file mode 100644 index 00000000..de70d5c5 --- /dev/null +++ b/docs/examples/postgresql/create-backup.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackup result = await postgresql.CreateBackup( + databaseId: "", + type: "full" // optional +); + +``` diff --git a/docs/examples/postgresql/create-branch.md b/docs/examples/postgresql/create-branch.md new file mode 100644 index 00000000..f4e8d566 --- /dev/null +++ b/docs/examples/postgresql/create-branch.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateBranch( + databaseId: "", + branchId: "", // optional + ttl: 300 // optional +); + +``` diff --git a/docs/examples/postgresql/create-execution.md b/docs/examples/postgresql/create-execution.md new file mode 100644 index 00000000..14804cc0 --- /dev/null +++ b/docs/examples/postgresql/create-execution.md @@ -0,0 +1,20 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseExecution result = await postgresql.CreateExecution( + databaseId: "", + sql: "", + bindings: [object], // optional + timeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/postgresql/create-extension.md b/docs/examples/postgresql/create-extension.md new file mode 100644 index 00000000..d7a6e6fd --- /dev/null +++ b/docs/examples/postgresql/create-extension.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateExtension( + databaseId: "", + name: "" +); + +``` diff --git a/docs/examples/postgresql/create-failover.md b/docs/examples/postgresql/create-failover.md new file mode 100644 index 00000000..b798844f --- /dev/null +++ b/docs/examples/postgresql/create-failover.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/postgresql/create-migration.md b/docs/examples/postgresql/create-migration.md new file mode 100644 index 00000000..1868ba84 --- /dev/null +++ b/docs/examples/postgresql/create-migration.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateMigration( + databaseId: "", + targetType: "shared", + specification: "" // optional +); + +``` diff --git a/docs/examples/postgresql/create-restoration.md b/docs/examples/postgresql/create-restoration.md new file mode 100644 index 00000000..fdd09484 --- /dev/null +++ b/docs/examples/postgresql/create-restoration.md @@ -0,0 +1,21 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestoration result = await postgresql.CreateRestoration( + databaseId: "", + type: "backup", // optional + backupId: "", // optional + targetDatabaseId: "", // optional + targetTime: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/docs/examples/postgresql/create-upgrade.md b/docs/examples/postgresql/create-upgrade.md new file mode 100644 index 00000000..c81ca922 --- /dev/null +++ b/docs/examples/postgresql/create-upgrade.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.CreateUpgrade( + databaseId: "", + targetVersion: "" +); + +``` diff --git a/docs/examples/postgresql/create.md b/docs/examples/postgresql/create.md new file mode 100644 index 00000000..b4c3a49b --- /dev/null +++ b/docs/examples/postgresql/create.md @@ -0,0 +1,30 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Create( + databaseId: "", + name: "", + version: "17", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/delete-backup-policy.md b/docs/examples/postgresql/delete-backup-policy.md new file mode 100644 index 00000000..0610c1a1 --- /dev/null +++ b/docs/examples/postgresql/delete-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-backup.md b/docs/examples/postgresql/delete-backup.md new file mode 100644 index 00000000..45d01366 --- /dev/null +++ b/docs/examples/postgresql/delete-backup.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-branch.md b/docs/examples/postgresql/delete-branch.md new file mode 100644 index 00000000..31419ede --- /dev/null +++ b/docs/examples/postgresql/delete-branch.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteBranch( + databaseId: "", + branchId: "" +); + +``` diff --git a/docs/examples/postgresql/delete-extension.md b/docs/examples/postgresql/delete-extension.md new file mode 100644 index 00000000..b625a039 --- /dev/null +++ b/docs/examples/postgresql/delete-extension.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.DeleteExtension( + databaseId: "", + extensionName: "" +); + +``` diff --git a/docs/examples/postgresql/delete.md b/docs/examples/postgresql/delete.md new file mode 100644 index 00000000..e6e7201e --- /dev/null +++ b/docs/examples/postgresql/delete.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +await postgresql.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-backup-policy.md b/docs/examples/postgresql/get-backup-policy.md new file mode 100644 index 00000000..e58d4e21 --- /dev/null +++ b/docs/examples/postgresql/get-backup-policy.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.GetBackupPolicy( + databaseId: "", + policyId: "" +); + +``` diff --git a/docs/examples/postgresql/get-backup.md b/docs/examples/postgresql/get-backup.md new file mode 100644 index 00000000..4091ac39 --- /dev/null +++ b/docs/examples/postgresql/get-backup.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackup result = await postgresql.GetBackup( + databaseId: "", + backupId: "" +); + +``` diff --git a/docs/examples/postgresql/get-pitr.md b/docs/examples/postgresql/get-pitr.md new file mode 100644 index 00000000..aaabade0 --- /dev/null +++ b/docs/examples/postgresql/get-pitr.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePITRWindows result = await postgresql.GetPitr( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-pooler.md b/docs/examples/postgresql/get-pooler.md new file mode 100644 index 00000000..b42fd780 --- /dev/null +++ b/docs/examples/postgresql/get-pooler.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePooler result = await postgresql.GetPooler( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-replicas.md b/docs/examples/postgresql/get-replicas.md new file mode 100644 index 00000000..62475f36 --- /dev/null +++ b/docs/examples/postgresql/get-replicas.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseReplicas result = await postgresql.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get-restoration.md b/docs/examples/postgresql/get-restoration.md new file mode 100644 index 00000000..40a23f03 --- /dev/null +++ b/docs/examples/postgresql/get-restoration.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestoration result = await postgresql.GetRestoration( + databaseId: "", + restorationId: "" +); + +``` diff --git a/docs/examples/postgresql/get-status.md b/docs/examples/postgresql/get-status.md new file mode 100644 index 00000000..0101abcb --- /dev/null +++ b/docs/examples/postgresql/get-status.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DatabaseStatus result = await postgresql.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/get.md b/docs/examples/postgresql/get.md new file mode 100644 index 00000000..67bd780f --- /dev/null +++ b/docs/examples/postgresql/get.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-backup-policies.md b/docs/examples/postgresql/list-backup-policies.md new file mode 100644 index 00000000..7fe5d3f7 --- /dev/null +++ b/docs/examples/postgresql/list-backup-policies.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicyList result = await postgresql.ListBackupPolicies( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/list-backups.md b/docs/examples/postgresql/list-backups.md new file mode 100644 index 00000000..f3b66895 --- /dev/null +++ b/docs/examples/postgresql/list-backups.md @@ -0,0 +1,18 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackupList result = await postgresql.ListBackups( + databaseId: "", + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/list-branches.md b/docs/examples/postgresql/list-branches.md new file mode 100644 index 00000000..1c092d45 --- /dev/null +++ b/docs/examples/postgresql/list-branches.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBranchList result = await postgresql.ListBranches( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-extensions.md b/docs/examples/postgresql/list-extensions.md new file mode 100644 index 00000000..a7ca3908 --- /dev/null +++ b/docs/examples/postgresql/list-extensions.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseExtensions result = await postgresql.ListExtensions( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/list-operations.md b/docs/examples/postgresql/list-operations.md new file mode 100644 index 00000000..cb745eaa --- /dev/null +++ b/docs/examples/postgresql/list-operations.md @@ -0,0 +1,20 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseOperationList result = await postgresql.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/list-restorations.md b/docs/examples/postgresql/list-restorations.md new file mode 100644 index 00000000..2663a1f8 --- /dev/null +++ b/docs/examples/postgresql/list-restorations.md @@ -0,0 +1,21 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseRestorationList result = await postgresql.ListRestorations( + databaseId: "", + status: "pending", // optional + type: "backup", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/postgresql/list-specifications.md b/docs/examples/postgresql/list-specifications.md new file mode 100644 index 00000000..da1539be --- /dev/null +++ b/docs/examples/postgresql/list-specifications.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseSpecificationList result = await postgresql.ListSpecifications(); + + +``` diff --git a/docs/examples/postgresql/list.md b/docs/examples/postgresql/list.md new file mode 100644 index 00000000..eb2e0e06 --- /dev/null +++ b/docs/examples/postgresql/list.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseList result = await postgresql.List( + queries: new List() // optional +); + +``` diff --git a/docs/examples/postgresql/update-backup-policy.md b/docs/examples/postgresql/update-backup-policy.md new file mode 100644 index 00000000..c1faaa09 --- /dev/null +++ b/docs/examples/postgresql/update-backup-policy.md @@ -0,0 +1,22 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +BackupPolicy result = await postgresql.UpdateBackupPolicy( + databaseId: "", + policyId: "", + name: "", // optional + schedule: "", // optional + retention: 1, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/postgresql/update-backup-storage.md b/docs/examples/postgresql/update-backup-storage.md new file mode 100644 index 00000000..88d946e1 --- /dev/null +++ b/docs/examples/postgresql/update-backup-storage.md @@ -0,0 +1,24 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabaseBackupStorage result = await postgresql.UpdateBackupStorage( + databaseId: "", + provider: "s3", + bucket: "", + accessKey: "", + secretKey: "", + region: "", // optional + prefix: "", // optional + endpoint: "" // optional +); + +``` diff --git a/docs/examples/postgresql/update-credentials.md b/docs/examples/postgresql/update-credentials.md new file mode 100644 index 00000000..c02fcd67 --- /dev/null +++ b/docs/examples/postgresql/update-credentials.md @@ -0,0 +1,17 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.UpdateCredentials( + databaseId: "" +); + +``` diff --git a/docs/examples/postgresql/update-maintenance.md b/docs/examples/postgresql/update-maintenance.md new file mode 100644 index 00000000..ed6fa91a --- /dev/null +++ b/docs/examples/postgresql/update-maintenance.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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.UpdateMaintenance( + databaseId: "", + day: "sun", + hourUtc: 0 +); + +``` diff --git a/docs/examples/postgresql/update-pooler.md b/docs/examples/postgresql/update-pooler.md new file mode 100644 index 00000000..bc77771f --- /dev/null +++ b/docs/examples/postgresql/update-pooler.md @@ -0,0 +1,25 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabasePooler result = await postgresql.UpdatePooler( + databaseId: "", + mode: "transaction", // optional + maxConnections: 10, // optional + defaultPoolSize: 1, // optional + readWriteSplitting: false, // optional + poolerCpuRequest: "", // optional + poolerCpuLimit: "", // optional + poolerMemoryRequest: "", // optional + poolerMemoryLimit: "" // optional +); + +``` diff --git a/docs/examples/postgresql/update.md b/docs/examples/postgresql/update.md new file mode 100644 index 00000000..c6e5d48a --- /dev/null +++ b/docs/examples/postgresql/update.md @@ -0,0 +1,37 @@ +```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 + +Postgresql postgresql = new Postgresql(client); + +DedicatedDatabase result = await postgresql.Update( + databaseId: "", + name: "", // optional + status: "ready", // optional + specification: "", // optional + replicas: 0, // optional + syncMode: "async", // optional + networkIdleTimeoutSeconds: 60, // optional + networkIPAllowlist: new List(), // optional + idleTimeoutMinutes: 5, // optional + pitr: false, // optional + pitrRetentionDays: 1, // optional + storageAutoscaling: false, // optional + storageAutoscalingThresholdPercent: 50, // optional + storageAutoscalingMaxGb: 0, // optional + metricsTraceSampleRate: 0, // optional + metricsSlowQueryLogThresholdMs: 0, // optional + sqlApiEnabled: false, // optional + sqlApiAllowedStatements: new List(), // optional + sqlApiMaxRows: 1, // optional + sqlApiMaxBytes: 1024, // optional + sqlApiTimeoutSeconds: 1 // optional +); + +``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 0431d249..e3540674 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -12,4 +12,6 @@ Presences presences = new Presences(client); await presences.Delete( presenceId: "" -);``` +); + +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index acf317de..85e7287e 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -12,4 +12,6 @@ Presences presences = new Presences(client); Presence result = await presences.Get( presenceId: "" -);``` +); + +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index e1bd9653..8285644e 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -14,4 +14,6 @@ PresenceList result = await presences.List( queries: new List(), // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 723d681c..ed55483b 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -18,4 +18,6 @@ Presence result = await presences.Update( metadata: [object], // optional permissions: new List { Permission.Read(Role.Any()) }, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index 4c73ddc4..b7868248 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -17,4 +17,6 @@ Presence result = await presences.Upsert( permissions: new List { Permission.Read(Role.Any()) }, // optional expiresAt: "2020-10-15T06:38:00.000+00:00", // optional metadata: [object] // optional -);``` +); + +``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index 34280b50..df8dd6e0 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -14,4 +14,6 @@ PlatformAndroid result = await project.CreateAndroidPlatform( platformId: "", name: "", applicationId: "" -);``` +); + +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 0326c775..10dc58da 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -14,4 +14,6 @@ PlatformApple result = await project.CreateApplePlatform( platformId: "", name: "", bundleIdentifier: "" -);``` +); + +``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index afc4fc28..5b6226bb 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -14,4 +14,6 @@ Project project = new Project(client); EphemeralKey result = await project.CreateEphemeralKey( scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, duration: 600 -);``` +); + +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index 5fa6c77d..7037a09c 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -14,4 +14,6 @@ PlatformLinux result = await project.CreateLinuxPlatform( platformId: "", name: "", packageName: "" -);``` +); + +``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index f3d846ab..f8bb1bf5 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumber result = await project.CreateMockPhone( number: "+12065550100", otp: "" -);``` +); + +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index 3ee832cb..d461c0cd 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -12,4 +12,6 @@ Project project = new Project(client); result = await project.CreateSMTPTest( emails: new List() -);``` +); + +``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index a49aa454..1e361c54 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -15,4 +15,6 @@ Variable result = await project.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 1a2bd50a..83f148a0 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -14,4 +14,6 @@ PlatformWeb result = await project.CreateWebPlatform( platformId: "", name: "", hostname: "app.example.com" -);``` +); + +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index ab48dc3d..01eb5b90 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -14,4 +14,6 @@ PlatformWindows result = await project.CreateWindowsPlatform( platformId: "", name: "", packageIdentifierName: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md index 96654a14..258def64 100644 --- a/docs/examples/project/delete-key.md +++ b/docs/examples/project/delete-key.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md index 3ba22dcc..c716be59 100644 --- a/docs/examples/project/delete-mock-phone.md +++ b/docs/examples/project/delete-mock-phone.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteMockPhone( number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md index 6eb9777a..77ddecda 100644 --- a/docs/examples/project/delete-platform.md +++ b/docs/examples/project/delete-platform.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeletePlatform( platformId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index 83762d9b..5ef1405e 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -12,4 +12,6 @@ Project project = new Project(client); await project.DeleteVariable( variableId: "" -);``` +); + +``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md index 42f63b32..17f70c47 100644 --- a/docs/examples/project/delete.md +++ b/docs/examples/project/delete.md @@ -11,4 +11,6 @@ Client client = new Client() Project project = new Project(client); await project.Delete(); + + ``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index 64c4435a..11a331a2 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -14,4 +14,6 @@ Project project = new Project(client); EmailTemplate result = await project.GetEmailTemplate( templateId: ProjectEmailTemplateId.Verification, locale: ProjectEmailTemplateLocale.Af // optional -);``` +); + +``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md index 6b0e8192..a84c4602 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -12,4 +12,6 @@ Project project = new Project(client); Key result = await project.GetKey( keyId: "" -);``` +); + +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index 70a48e59..43fea545 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -12,4 +12,6 @@ Project project = new Project(client); MockNumber result = await project.GetMockPhone( number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index c7128c37..ea55cb1e 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -13,4 +13,6 @@ Project project = new Project(client); object result = await project.GetOAuth2Provider( providerId: ProjectOAuthProviderId.Amazon -);``` +); + +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md index 6dc39ce0..236eeb77 100644 --- a/docs/examples/project/get-platform.md +++ b/docs/examples/project/get-platform.md @@ -12,4 +12,6 @@ Project project = new Project(client); object result = await project.GetPlatform( platformId: "" -);``` +); + +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index 21a1bc23..ed4e8a5f 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -13,4 +13,6 @@ Project project = new Project(client); object result = await project.GetPolicy( policyId: ProjectPolicyId.PasswordDictionary -);``` +); + +``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index d1283ed3..bda49739 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -12,4 +12,6 @@ Project project = new Project(client); Variable result = await project.GetVariable( variableId: "" -);``` +); + +``` diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md index bba3b088..8dbf5a58 100644 --- a/docs/examples/project/get.md +++ b/docs/examples/project/get.md @@ -11,4 +11,6 @@ Client client = new Client() Project project = new Project(client); Project result = await project.Get(); + + ``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 828692bf..0cd3cad1 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -13,4 +13,6 @@ Project project = new Project(client); EmailTemplateList result = await project.ListEmailTemplates( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index ac4c2cf4..f006dd19 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -13,4 +13,6 @@ Project project = new Project(client); KeyList result = await project.ListKeys( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 9e276369..3fa07bdc 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumberList result = await project.ListMockPhones( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index 58413a81..9d0e7eae 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -13,4 +13,6 @@ Project project = new Project(client); OAuth2ProviderList result = await project.ListOAuth2Providers( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 066d6e0d..2a507c27 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -13,4 +13,6 @@ Project project = new Project(client); PlatformList result = await project.ListPlatforms( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index e1045511..bbd49b4c 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -13,4 +13,6 @@ Project project = new Project(client); PolicyList result = await project.ListPolicies( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index 5f6f00cc..e8107ab6 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -13,4 +13,6 @@ Project project = new Project(client); VariableList result = await project.ListVariables( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 6106dcfb..77b78b57 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -14,4 +14,6 @@ PlatformAndroid result = await project.UpdateAndroidPlatform( platformId: "", name: "", applicationId: "" -);``` +); + +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index ebe02343..fa9ec462 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -14,4 +14,6 @@ PlatformApple result = await project.UpdateApplePlatform( platformId: "", name: "", bundleIdentifier: "" -);``` +); + +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 8e5b4199..0b180be2 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -14,4 +14,6 @@ Project project = new Project(client); Project result = await project.UpdateAuthMethod( methodId: ProjectAuthMethodId.EmailPassword, enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-aliased-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md index b902b574..50d622ea 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateDenyAliasedEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-corporate-email-policy.md b/docs/examples/project/update-deny-corporate-email-policy.md index 99a41b18..13e204eb 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateDenyCorporateEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md index 3bee9a1a..7e22b31a 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateDenyDisposableEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md index 88da981f..49ba6767 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateDenyFreeEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md index 97277a96..2c4c747d 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -20,4 +20,6 @@ EmailTemplate result = await project.UpdateEmailTemplate( senderEmail: "email@example.com", // optional replyToEmail: "email@example.com", // optional replyToName: "" // optional -);``` +); + +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 23da35d9..619fca4b 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -16,4 +16,6 @@ Key result = await project.UpdateKey( name: "", scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md index 22079e52..2dfe3ea8 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateLabels( labels: new List() -);``` +); + +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index fe94ccba..0e0be47d 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -14,4 +14,6 @@ PlatformLinux result = await project.UpdateLinuxPlatform( platformId: "", name: "", packageName: "" -);``` +); + +``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index bd452cf8..3e6102f6 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -17,4 +17,6 @@ Project result = await project.UpdateMembershipPrivacyPolicy( userName: false, // optional userMFA: false, // optional userAccessedAt: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index b1d4ccf9..aa9ed2a5 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -15,4 +15,6 @@ Project result = await project.UpdateMFAFactorsPolicy( email: false, // optional phone: false, // optional custom: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index c5a18e2b..e2c699e2 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -13,4 +13,6 @@ Project project = new Project(client); MockNumber result = await project.UpdateMockPhone( number: "+12065550100", otp: "" -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index 8680703d..b104edf0 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -14,4 +14,6 @@ OAuth2Amazon result = await project.UpdateOAuth2Amazon( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index 942cebc6..d36a2b98 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -16,4 +16,6 @@ OAuth2Apple result = await project.UpdateOAuth2Apple( teamId: "", // optional p8File: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-appwrite.md b/docs/examples/project/update-o-auth-2-appwrite.md index 45aec1c8..cb38c52d 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -14,4 +14,6 @@ OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index 2c212601..081f8323 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -15,4 +15,6 @@ OAuth2Auth0 result = await project.UpdateOAuth2Auth0( clientSecret: "", // optional endpoint: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md index 293b98e9..75107594 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -15,4 +15,6 @@ OAuth2Authentik result = await project.UpdateOAuth2Authentik( clientSecret: "", // optional endpoint: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index 40edd2b1..836fcc55 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -14,4 +14,6 @@ OAuth2Autodesk result = await project.UpdateOAuth2Autodesk( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md index 53f7411e..6a72900d 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -14,4 +14,6 @@ OAuth2Bitbucket result = await project.UpdateOAuth2Bitbucket( key: "", // optional secret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md index eec326fd..f46dd35a 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -14,4 +14,6 @@ OAuth2Bitly result = await project.UpdateOAuth2Bitly( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md index c1f1915b..1f331e2c 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -14,4 +14,6 @@ OAuth2Box result = await project.UpdateOAuth2Box( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md index b99bc357..87c2c478 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -14,4 +14,6 @@ OAuth2Dailymotion result = await project.UpdateOAuth2Dailymotion( apiKey: "", // optional apiSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index 7d6dc9d5..b6a92dbe 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -14,4 +14,6 @@ OAuth2Discord result = await project.UpdateOAuth2Discord( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md index 6c7d9c7e..a7235621 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -14,4 +14,6 @@ OAuth2Disqus result = await project.UpdateOAuth2Disqus( publicKey: "", // optional secretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md index 0106e913..16dd0f99 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -14,4 +14,6 @@ OAuth2Dropbox result = await project.UpdateOAuth2Dropbox( appKey: "", // optional appSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md index 4143db45..7ffcb53f 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -14,4 +14,6 @@ OAuth2Etsy result = await project.UpdateOAuth2Etsy( keyString: "", // optional sharedSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md index ac5ebcb8..a1549973 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -14,4 +14,6 @@ OAuth2Facebook result = await project.UpdateOAuth2Facebook( appId: "", // optional appSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md index b99a6b25..4c2e8bcd 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -14,4 +14,6 @@ OAuth2Figma result = await project.UpdateOAuth2Figma( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md index 8fa9fe55..d8515eea 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -15,4 +15,6 @@ OAuth2FusionAuth result = await project.UpdateOAuth2FusionAuth( clientSecret: "", // optional endpoint: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index 5c2cf3b5..f57712e3 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -14,4 +14,6 @@ OAuth2Github result = await project.UpdateOAuth2GitHub( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md index b3530fb2..169b2ec8 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -15,4 +15,6 @@ OAuth2Gitlab result = await project.UpdateOAuth2Gitlab( secret: "", // optional endpoint: "https://example.com", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index d9e7308a..ca498940 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -16,4 +16,6 @@ OAuth2Google result = await project.UpdateOAuth2Google( clientSecret: "", // optional prompt: new List<ProjectOAuth2GooglePrompt> { ProjectOAuth2GooglePrompt.None }, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-hugging-face.md b/docs/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 00000000..350640d4 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-hugging-face.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 + +Project project = new Project(client); + +OAuth2HuggingFace result = await project.UpdateOAuth2HuggingFace( + clientId: "", // optional + clientSecret: "", // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md index 3027251e..67b03697 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -16,4 +16,6 @@ OAuth2Keycloak result = await project.UpdateOAuth2Keycloak( endpoint: "", // optional realmName: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 8b9661bf..56cbef85 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -14,4 +14,6 @@ OAuth2Kick result = await project.UpdateOAuth2Kick( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md index e360cc7a..72c13842 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -14,4 +14,6 @@ OAuth2Linkedin result = await project.UpdateOAuth2Linkedin( clientId: "", // optional primaryClientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index eb8780b1..8e5afa31 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -15,4 +15,6 @@ OAuth2Microsoft result = await project.UpdateOAuth2Microsoft( applicationSecret: "", // optional tenant: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md index 06199ccf..a3cb7763 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -14,4 +14,6 @@ OAuth2Notion result = await project.UpdateOAuth2Notion( oauthClientId: "", // optional oauthClientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index fee55e75..5abb4932 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -21,4 +21,6 @@ OAuth2Oidc result = await project.UpdateOAuth2Oidc( prompt: new List<ProjectOAuth2OidcPrompt> { ProjectOAuth2OidcPrompt.None }, // optional maxAge: 0, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index 87e3c4b4..fa2a1151 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -13,7 +13,9 @@ Project project = new Project(client); OAuth2Okta result = await project.UpdateOAuth2Okta( clientId: "", // optional clientSecret: "", // optional - domain: "", // optional + domain: "example.com", // optional authorizationServerId: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md index f98cf68e..1cbc8c57 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -14,4 +14,6 @@ OAuth2Paypal result = await project.UpdateOAuth2PaypalSandbox( clientId: "", // optional secretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md index cb2a010f..03fc6659 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -14,4 +14,6 @@ OAuth2Paypal result = await project.UpdateOAuth2Paypal( clientId: "", // optional secretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md index 1233e25b..9e8b31f6 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -14,4 +14,6 @@ OAuth2Podio result = await project.UpdateOAuth2Podio( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index f87bb018..e4b6629c 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -14,4 +14,6 @@ OAuth2Salesforce result = await project.UpdateOAuth2Salesforce( customerKey: "", // optional customerSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 615e1621..c43efa26 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -27,4 +27,6 @@ Project result = await project.UpdateOAuth2Server( deviceCodeDuration: 60, // optional defaultScopes: new List(), // optional installationScopes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index b3ac0084..1d7cc149 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -14,4 +14,6 @@ OAuth2Slack result = await project.UpdateOAuth2Slack( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md index 22d7b4c1..481634e4 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -14,4 +14,6 @@ OAuth2Spotify result = await project.UpdateOAuth2Spotify( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md index fbe842ff..97ce54a1 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -14,4 +14,6 @@ OAuth2Stripe result = await project.UpdateOAuth2Stripe( clientId: "", // optional apiSecretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md index 18d5644c..72ab7c5a 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -14,4 +14,6 @@ OAuth2Tradeshift result = await project.UpdateOAuth2TradeshiftSandbox( oauth2ClientId: "", // optional oauth2ClientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md index 649f5590..01edc689 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -14,4 +14,6 @@ OAuth2Tradeshift result = await project.UpdateOAuth2Tradeshift( oauth2ClientId: "", // optional oauth2ClientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md index 30acec4a..405b7dc7 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -14,4 +14,6 @@ OAuth2Twitch result = await project.UpdateOAuth2Twitch( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md index 40e387e8..60bbdfcf 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -14,4 +14,6 @@ OAuth2WordPress result = await project.UpdateOAuth2WordPress( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md index 3fbc0b55..127f9786 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -14,4 +14,6 @@ OAuth2Yahoo result = await project.UpdateOAuth2Yahoo( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md index 186d3a0c..0fcc0dc7 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -14,4 +14,6 @@ OAuth2Yandex result = await project.UpdateOAuth2Yandex( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index 3ae358d7..6347cb2b 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -14,4 +14,6 @@ OAuth2Zoho result = await project.UpdateOAuth2Zoho( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md index 3398abe7..2b9d60dd 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -14,4 +14,6 @@ OAuth2Zoom result = await project.UpdateOAuth2Zoom( clientId: "", // optional clientSecret: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md index e346ab5c..01bab140 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -14,4 +14,6 @@ OAuth2X result = await project.UpdateOAuth2X( customerKey: "", // optional secretKey: "", // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index d332a214..bfcf1c3d 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdatePasswordDictionaryPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md index 9f74fa8b..83876154 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdatePasswordHistoryPolicy( total: 1 -);``` +); + +``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index f6543483..e79919f2 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdatePasswordPersonalDataPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index 6394609b..7edf3050 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -16,4 +16,6 @@ PolicyPasswordStrength result = await project.UpdatePasswordStrengthPolicy( lowercase: false, // optional number: false, // optional symbols: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index 0440e0b9..9a53240a 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -14,4 +14,6 @@ Project project = new Project(client); Project result = await project.UpdateProtocol( protocolId: ProjectProtocolId.Rest, enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md index fd9c1eff..8463028b 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -14,4 +14,6 @@ Project project = new Project(client); Project result = await project.UpdateService( serviceId: ProjectServiceId.Account, enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md index 14bc61a2..247fe3ce 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateSessionAlertPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index bfe9a07e..1c66cc20 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateSessionDurationPolicy( duration: 60 -);``` +); + +``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md index ba3ccc21..e354b471 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateSessionInvalidationPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md index 6b4b8017..11434253 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateSessionLimitPolicy( total: 1 -);``` +); + +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index 91c2fda2..4af1ceee 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -12,8 +12,8 @@ Client client = new Client() Project project = new Project(client); Project result = await project.UpdateSMTP( - host: "", // optional - port: 0, // optional + host: "example.com", // optional + port: 587, // optional username: "", // optional password: "password", // optional senderEmail: "email@example.com", // optional @@ -22,4 +22,6 @@ Project result = await project.UpdateSMTP( replyToName: "", // optional secure: ProjectSMTPSecure.Tls, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index aea79aaf..d24957e0 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -12,4 +12,6 @@ Project project = new Project(client); Project result = await project.UpdateUserLimitPolicy( total: 0 -);``` +); + +``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index cfdf56bd..b612ed86 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -15,4 +15,6 @@ Variable result = await project.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index 11454ea4..3d03f26d 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -14,4 +14,6 @@ PlatformWeb result = await project.UpdateWebPlatform( platformId: "", name: "", hostname: "app.example.com" -);``` +); + +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index 42a3073d..64e21998 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -14,4 +14,6 @@ PlatformWindows result = await project.UpdateWindowsPlatform( platformId: "", name: "", packageIdentifierName: "" -);``` +); + +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index 548dcd82..a5511bd3 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -11,5 +11,7 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateAPIRule( - domain: "" -);``` + domain: "example.com" +); + +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index c2052d56..fe1fd906 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -11,7 +11,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateFunctionRule( - domain: "", + domain: "example.com", functionId: "", branch: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 8fe43e67..0b51ed48 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -12,7 +12,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyInvalidation result = await proxy.CreateInvalidation( - domain: "", + domain: "example.com", type: InvalidationType.Tag, reference: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 494a41c2..71ffbefe 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -12,9 +12,11 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateRedirectRule( - domain: "", + domain: "example.com", url: "https://example.com", statusCode: StatusCode.MovedPermanently, resourceId: "", resourceType: ProxyResourceType.Site -);``` +); + +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index 6e29ede9..52b6b60e 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -11,7 +11,9 @@ Client client = new Client() Proxy proxy = new Proxy(client); ProxyRule result = await proxy.CreateSiteRule( - domain: "", + domain: "example.com", siteId: "", branch: "" // optional -);``` +); + +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index c198c832..d9e9b160 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); await proxy.DeleteRule( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index edaca90d..6834db74 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); ProxyRule result = await proxy.GetRule( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index e38680a4..4a962d30 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -13,4 +13,6 @@ Proxy proxy = new Proxy(client); ProxyRuleList result = await proxy.ListRules( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index 30f7f9e7..da3efe37 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -12,4 +12,6 @@ Proxy proxy = new Proxy(client); ProxyRule result = await proxy.UpdateRuleStatus( ruleId: "" -);``` +); + +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 692d7743..61b56268 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -17,4 +17,6 @@ Deployment result = await sites.CreateDeployment( buildCommand: "", // optional outputDirectory: "", // optional activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index acca4c7c..22c70c1d 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.CreateDuplicateDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 306a9653..769fcc1c 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -19,4 +19,6 @@ Deployment result = await sites.CreateTemplateDeployment( type: TemplateReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 551e381a..9e9d1ef7 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -16,4 +16,6 @@ Variable result = await sites.CreateVariable( key: "", value: "", secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 8a4a618d..42ec3756 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -16,4 +16,6 @@ Deployment result = await sites.CreateVcsDeployment( type: VCSReferenceType.Branch, reference: "", activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 65fd4f07..9b2d5b52 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -32,7 +32,10 @@ Site result = await sites.Create( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional - deploymentRetention: 0 // optional -);``` + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index fb457b05..be144088 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index a5aebb19..576be3fb 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteLog( siteId: "", logId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 2b79ffeb..0d7d68be 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); await sites.DeleteVariable( siteId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index 2e1470f6..80510f15 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); await sites.Delete( siteId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 457f1532..e4f0985b 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -16,4 +16,6 @@ byte[] result = await sites.GetDeploymentDownload( deploymentId: "", type: DeploymentDownloadType.Source, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index f92ffb42..dfd86dfc 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.GetDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 822bcdbd..caa38be7 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Execution result = await sites.GetLog( siteId: "", logId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 75c28abd..9a68b661 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Variable result = await sites.GetVariable( siteId: "", variableId: "" -);``` +); + +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 6863555c..7c1885cb 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); Site result = await sites.Get( siteId: "" -);``` +); + +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 39acb57c..b25172e2 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -15,4 +15,6 @@ DeploymentList result = await sites.ListDeployments( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 8d802f7f..7a3165f9 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -11,4 +11,6 @@ Client client = new Client() Sites sites = new Sites(client); FrameworkList result = await sites.ListFrameworks(); + + ``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 36463eeb..baee6c91 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -14,4 +14,6 @@ ExecutionList result = await sites.ListLogs( siteId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index af963654..12d18408 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -12,4 +12,6 @@ Sites sites = new Sites(client); SpecificationList result = await sites.ListSpecifications( type: "runtimes" // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 0f3d254f..8f546817 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -14,4 +14,6 @@ VariableList result = await sites.ListVariables( siteId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index fe543e7c..27c4f659 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -14,4 +14,6 @@ SiteList result = await sites.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 322c8cc1..0a6bf240 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Deployment result = await sites.UpdateDeploymentStatus( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index 4f75e1f3..8633ab7e 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -13,4 +13,6 @@ Sites sites = new Sites(client); Site result = await sites.UpdateSiteDeployment( siteId: "", deploymentId: "" -);``` +); + +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 2b1e1662..e7236cef 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -16,4 +16,6 @@ Variable result = await sites.UpdateVariable( key: "", // optional value: "", // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 5a7fd0ca..8c812841 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -32,7 +32,10 @@ Site result = await sites.Update( providerRootDirectory: "", // optional providerBranches: new List(), // optional providerPaths: new List(), // optional - buildSpecification: "", // optional - runtimeSpecification: "", // optional - deploymentRetention: 0 // optional -);``` + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 6ccdb33e..bdbd46a9 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -23,4 +23,6 @@ Bucket result = await storage.CreateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index c471f283..32cbd1d3 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -15,5 +15,7 @@ File result = await storage.CreateFile( fileId: "", file: InputFile.FromPath("./path-to-files/image.jpg"), permissions: new List { Permission.Read(Role.Any()) }, // optional - folder: "" // optional -);``` + folder: "photos/2026" // optional +); + +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index dfee759b..7203b3fb 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -12,4 +12,6 @@ Storage storage = new Storage(client); await storage.DeleteBucket( bucketId: "" -);``` +); + +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index a637341b..cc540d6d 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -13,4 +13,6 @@ Storage storage = new Storage(client); await storage.DeleteFile( bucketId: "", fileId: "" -);``` +); + +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 27d9e405..8c1edda2 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -12,4 +12,6 @@ Storage storage = new Storage(client); Bucket result = await storage.GetBucket( bucketId: "" -);``` +); + +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 02ad30d5..0cb45475 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -14,4 +14,6 @@ byte[] result = await storage.GetFileDownload( bucketId: "", fileId: "", token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index cc3d88a8..0f8ae58d 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -19,11 +19,13 @@ byte[] result = await storage.GetFilePreview( gravity: ImageGravity.Center, // optional quality: -1, // optional borderWidth: 0, // optional - borderColor: "", // optional + borderColor: "FFFFFF", // optional borderRadius: 0, // optional opacity: 0, // optional rotation: -360, // optional - background: "", // optional + background: "FFFFFF", // optional output: ImageFormat.Jpg, // optional token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index b9088d00..5639caef 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -14,4 +14,6 @@ byte[] result = await storage.GetFileView( bucketId: "", fileId: "", token: "" // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 769386ed..925a7b5d 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -13,4 +13,6 @@ Storage storage = new Storage(client); File result = await storage.GetFile( bucketId: "", fileId: "" -);``` +); + +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 5580b727..df214567 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -14,4 +14,6 @@ BucketList result = await storage.ListBuckets( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 93943019..756aeb9f 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -15,4 +15,6 @@ FileList result = await storage.ListFiles( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index c68d001c..6e31cb35 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -23,4 +23,6 @@ Bucket result = await storage.UpdateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index df3e7373..a2b7013c 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -15,4 +15,6 @@ File result = await storage.UpdateFile( fileId: "", name: "", // optional permissions: new List { Permission.Read(Role.Any()) } // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 58137859..9849dc44 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnBigint result = await tablesDB.CreateBigIntColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional + max: 1000000, // optional default: 0, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 67cefc22..d4d17767 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnBoolean result = await tablesDB.CreateBooleanColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 23f02dff..0739c6cf 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnDatetime result = await tablesDB.CreateDatetimeColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 4c07c436..b5879ca4 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnEmail result = await tablesDB.CreateEmailColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "email@example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index ebe5d6b7..7a855e5d 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnEnum result = await tablesDB.CreateEnumColumn( databaseId: "", tableId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", // optional + default: "active", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index 897e9df9..8eee23f4 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabase result = await tablesDB.CreateFailover( databaseId: "", targetReplicaId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 2a0c5023..8d7293a5 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnFloat result = await tablesDB.CreateFloatColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10.5, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 46bfcd27..df5d61e3 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -14,9 +14,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnIndex result = await tablesDB.CreateIndex( databaseId: "", tableId: "", - key: "", + key: "", type: TablesDBIndexType.Key, columns: new List(), orders: new List<OrderBy> { OrderBy.Asc }, // optional lengths: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index 4f822041..60ecc4c1 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnInteger result = await tablesDB.CreateIntegerColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, min: 0, // optional - max: 0, // optional - default: 0, // optional + max: 100, // optional + default: 10, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index bf996e72..dea6f8a0 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnIp result = await tablesDB.CreateIpColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "192.0.2.0", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index e3d438a2..3f7ae338 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnLine result = await tablesDB.CreateLineColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 9846702d..7f63f462 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnLongtext result = await tablesDB.CreateLongtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 8d69db7d..f834cf24 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnMediumtext result = await tablesDB.CreateMediumtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 8318f4f6..863f223c 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -14,4 +14,6 @@ DatabaseMigration result = await tablesDB.CreateMigration( databaseId: "", specification: "s-1vcpu-1gb", autoCutover: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 1d5b385a..e7e92df1 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -23,4 +23,6 @@ Transaction result = await tablesDB.CreateOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 318e8eb7..aa787a48 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnPoint result = await tablesDB.CreatePointColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index f39ceeb5..c667492f 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -13,7 +13,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnPolygon result = await tablesDB.CreatePolygonColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 003d9b8c..2ad3e365 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -17,7 +17,9 @@ ColumnRelationship result = await tablesDB.CreateRelationshipColumn( relatedTableId: "", type: RelationshipType.OneToOne, twoWay: false, // optional - key: "", // optional - twoWayKey: "", // optional + key: "", // optional + twoWayKey: "", // optional onDelete: RelationMutate.Cascade // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 4f6112b8..05cbe3ce 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.CreateRow( }, permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 2a8a07b7..868c515a 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -15,4 +15,6 @@ RowList result = await tablesDB.CreateRows( tableId: "", rows: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index 28f5e4c3..70d55283 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnString result = await tablesDB.CreateStringColumn( databaseId: "", tableId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 242456de..f7781fc7 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -19,4 +19,6 @@ Table result = await tablesDB.CreateTable( enabled: false, // optional columns: new List(), // optional indexes: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index efde4ad8..ae046a6a 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnText result = await tablesDB.CreateTextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 9fea42b8..cc3845f0 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); Transaction result = await tablesDB.CreateTransaction( ttl: 60 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 1df7b2e9..de79303f 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnUrl result = await tablesDB.CreateUrlColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "https://example.com", // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 5656c9c2..507c8dd4 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnVarchar result = await tablesDB.CreateVarcharColumn( databaseId: "", tableId: "", - key: "", + key: "", size: 1, required: false, - default: "", // optional + default: "Hello World", // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 717cca18..8175c0eb 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -17,4 +17,6 @@ Database result = await tablesDB.Create( specification: "serverless", // optional replicas: 0, // optional syncMode: "async" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md index e82c3a25..1fd78e64 100644 --- a/docs/examples/tablesdb/cutover-migration.md +++ b/docs/examples/tablesdb/cutover-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigration result = await tablesDB.CutoverMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index b91aed74..c7a97020 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -14,8 +14,10 @@ Row result = await tablesDB.DecrementRowColumn( databaseId: "", tableId: "", rowId: "", - column: "", - value: 0, // optional + column: "", + value: 1, // optional min: 0, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index edd94325..fbb62253 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteColumn( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index e52f9655..ccf44a5f 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteIndex( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md index 4be3a7cc..84541e14 100644 --- a/docs/examples/tablesdb/delete-migration.md +++ b/docs/examples/tablesdb/delete-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 9186473c..51c0168e 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -15,4 +15,6 @@ await tablesDB.DeleteRow( tableId: "", rowId: "", transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 57762ab4..1cfdfe72 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -15,4 +15,6 @@ await tablesDB.DeleteRows( tableId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 89af4df8..486d1cfd 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteTable( databaseId: "", tableId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 42fdcc14..1fc1ced4 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.DeleteTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 051de970..8af9ed67 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); await tablesDB.Delete( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 70242d92..c0d9c042 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); object result = await tablesDB.GetColumn( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 66cdd1ca..45cb4826 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -13,5 +13,7 @@ TablesDB tablesDB = new TablesDB(client); ColumnIndex result = await tablesDB.GetIndex( databaseId: "", tableId: "", - key: "" -);``` + key: "" +); + +``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index 9e5e1525..de4d85e3 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigration result = await tablesDB.GetMigration( databaseId: "", migrationId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index 1001b30e..1053522f 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseReplicas result = await tablesDB.GetReplicas( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 21af7c4d..83c1f61e 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -16,4 +16,6 @@ Row result = await tablesDB.GetRow( rowId: "", queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index 73917886..5cc588fb 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseStatus result = await tablesDB.GetStatus( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 9932f84c..e5f5c4e4 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -13,4 +13,6 @@ TablesDB tablesDB = new TablesDB(client); Table result = await tablesDB.GetTable( databaseId: "", tableId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index a3d72b1a..9bfeeb63 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); Transaction result = await tablesDB.GetTransaction( transactionId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 85e7223f..daa759ab 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); Database result = await tablesDB.Get( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index fc594b90..16d13fbc 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -14,8 +14,10 @@ Row result = await tablesDB.IncrementRowColumn( databaseId: "", tableId: "", rowId: "", - column: "", - value: 0, // optional - max: 0, // optional + column: "", + value: 1, // optional + max: 100, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 5d459077..fdb00a25 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -15,4 +15,6 @@ ColumnList result = await tablesDB.ListColumns( tableId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 3942b400..f2b039a4 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -15,4 +15,6 @@ ColumnIndexList result = await tablesDB.ListIndexes( tableId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index 4fce8998..a7b88cb9 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); DatabaseMigrationList result = await tablesDB.ListMigrations( databaseId: "" -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index a4599ac5..daaa2868 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -12,7 +12,9 @@ TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseOperationList result = await tablesDB.ListOperations( databaseId: "", - status: "running", // optional + status: "queued", // optional limit: 1, // optional offset: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index e9186378..66e085fd 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -17,4 +17,6 @@ RowList result = await tablesDB.ListRows( transactionId: "", // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md index 4672e263..262b9fd3 100644 --- a/docs/examples/tablesdb/list-specifications.md +++ b/docs/examples/tablesdb/list-specifications.md @@ -11,4 +11,6 @@ Client client = new Client() TablesDB tablesDB = new TablesDB(client); DedicatedDatabaseSpecificationList result = await tablesDB.ListSpecifications(); + + ``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 1d8c95c2..89c2e7b5 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -15,4 +15,6 @@ TableList result = await tablesDB.ListTables( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index fe7b4a43..6d7db9ab 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -12,4 +12,6 @@ TablesDB tablesDB = new TablesDB(client); TransactionList result = await tablesDB.ListTransactions( queries: new List() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index f3d19ac7..6f082930 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -14,4 +14,6 @@ DatabaseList result = await tablesDB.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 1ac27c47..381d02b2 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnBigint result = await tablesDB.UpdateBigIntColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: 0, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 1000000, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 4c7763fd..5f7685ec 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnBoolean result = await tablesDB.UpdateBooleanColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: false, - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index efd202c5..f659279c 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "2020-10-15T06:38:00.000+00:00", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 6661c900..c8f5d912 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnEmail result = await tablesDB.UpdateEmailColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "email@example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 30024727..404fc413 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnEnum result = await tablesDB.UpdateEnumColumn( databaseId: "", tableId: "", - key: "", - elements: new List(), + key: "", + elements: ["active", "inactive"], required: false, - default: "", - newKey: "" // optional -);``` + default: "active", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 24f28a92..7983743e 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnFloat result = await tablesDB.UpdateFloatColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: 0, + default: 10.5, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 0390d353..22b8ab20 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -13,10 +13,12 @@ TablesDB tablesDB = new TablesDB(client); ColumnInteger result = await tablesDB.UpdateIntegerColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: 0, + default: 10, min: 0, // optional - max: 0, // optional - newKey: "" // optional -);``` + max: 100, // optional + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 218342f5..30a9c595 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnIp result = await tablesDB.UpdateIpColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "192.0.2.0", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 8aac5599..91291e3f 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnLine result = await tablesDB.UpdateLineColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[1, 2], [3, 4], [5, 6]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index d7abb4f4..c240a496 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnLongtext result = await tablesDB.UpdateLongtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 3a8a490f..592d8afa 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnMediumtext result = await tablesDB.UpdateMediumtextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index a976260a..4e2dcc07 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnPoint result = await tablesDB.UpdatePointColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [1, 2], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index f19a0717..5ecd1b80 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnPolygon result = await tablesDB.UpdatePolygonColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 36cc97d2..8d75dd0a 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -14,7 +14,9 @@ TablesDB tablesDB = new TablesDB(client); ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( databaseId: "", tableId: "", - key: "", + key: "", onDelete: RelationMutate.Cascade, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 54e6ca16..03f71f61 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.UpdateRow( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 0fe6b38b..9e4c497b 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -22,4 +22,6 @@ RowList result = await tablesDB.UpdateRows( }, // optional queries: new List(), // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index c0b860db..bf0849e2 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnString result = await tablesDB.UpdateStringColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index fd23907e..e7a22821 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -18,4 +18,6 @@ Table result = await tablesDB.UpdateTable( rowSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index da4fefaa..0ee26e04 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnText result = await tablesDB.UpdateTextColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", - newKey: "" // optional -);``` + default: "Hello World", + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 99e6a017..2010f673 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -14,4 +14,6 @@ Transaction result = await tablesDB.UpdateTransaction( transactionId: "", commit: false, // optional rollback: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 10761c90..f32ce01a 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -13,8 +13,10 @@ TablesDB tablesDB = new TablesDB(client); ColumnUrl result = await tablesDB.UpdateUrlColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, default: "https://example.com", - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 948be687..3cd1f9c0 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -13,9 +13,11 @@ TablesDB tablesDB = new TablesDB(client); ColumnVarchar result = await tablesDB.UpdateVarcharColumn( databaseId: "", tableId: "", - key: "", + key: "", required: false, - default: "", + default: "Hello World", size: 1, // optional - newKey: "" // optional -);``` + newKey: "" // optional +); + +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 132a1681..8b28a996 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -17,4 +17,6 @@ Database result = await tablesDB.Update( specification: "serverless", // optional replicas: 0, // optional syncMode: "async" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 5f3c4d28..ef38e305 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -23,4 +23,6 @@ Row result = await tablesDB.UpsertRow( }, // optional permissions: new List { Permission.Read(Role.Any()) }, // optional transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index b1fbe191..41d3bcd8 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -15,4 +15,6 @@ RowList result = await tablesDB.UpsertRows( tableId: "", rows: new List(), transactionId: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index 8cc34ef6..217d0a23 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -14,4 +14,6 @@ AppInstallation result = await teams.CreateInstallation( teamId: "", appId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index f107bbc5..1092050b 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -18,4 +18,6 @@ Membership result = await teams.CreateMembership( phone: "+12065550100", // optional url: "https://example.com", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index ead315a9..fdc1e09c 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -14,4 +14,6 @@ Team result = await teams.Create( teamId: "", name: "", roles: new List() // optional -);``` +); + +``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md index b2a63291..d9d4263a 100644 --- a/docs/examples/teams/delete-installation.md +++ b/docs/examples/teams/delete-installation.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); await teams.DeleteInstallation( teamId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index ac7ff432..e7b8bb31 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); await teams.DeleteMembership( teamId: "", membershipId: "" -);``` +); + +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 67f20dee..b1054418 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); await teams.Delete( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index 48546fe8..e23c4781 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); AppInstallation result = await teams.GetInstallation( teamId: "", installationId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index f8c0cd0b..f359df1a 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Membership result = await teams.GetMembership( teamId: "", membershipId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index b8a790a1..95a8c288 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); Preferences result = await teams.GetPrefs( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 0ad3fd3c..900d932d 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -12,4 +12,6 @@ Teams teams = new Teams(client); Team result = await teams.Get( teamId: "" -);``` +); + +``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index 7f29bdca..133f4278 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -14,4 +14,6 @@ AppInstallationList result = await teams.ListInstallations( teamId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 85fe50cd..64c25747 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -15,4 +15,6 @@ MembershipList result = await teams.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index d345222a..571c8663 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -14,4 +14,6 @@ TeamList result = await teams.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index d64faf09..7fa98101 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -14,4 +14,6 @@ AppInstallation result = await teams.UpdateInstallation( teamId: "", installationId: "", authorizationDetails: "" // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 05d763d3..1f172dab 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -15,4 +15,6 @@ Membership result = await teams.UpdateMembershipStatus( membershipId: "", userId: "", secret: "" -);``` +); + +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 6aef545f..ff4ad455 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -14,4 +14,6 @@ Membership result = await teams.UpdateMembership( teamId: "", membershipId: "", roles: new List() -);``` +); + +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index e3161e1b..6f42ce5c 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Team result = await teams.UpdateName( teamId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index fdfa9e0d..b2dbac7a 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -13,4 +13,6 @@ Teams teams = new Teams(client); Preferences result = await teams.UpdatePrefs( teamId: "", prefs: [object] -);``` +); + +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 4960c042..baf4c376 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -14,4 +14,6 @@ ResourceToken result = await tokens.CreateFileToken( bucketId: "", fileId: "", expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index 22004e28..9b186358 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -12,4 +12,6 @@ Tokens tokens = new Tokens(client); await tokens.Delete( tokenId: "" -);``` +); + +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 274b3432..5466ae87 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -12,4 +12,6 @@ Tokens tokens = new Tokens(client); ResourceToken result = await tokens.Get( tokenId: "" -);``` +); + +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 0cc4dc4b..45e027d4 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -15,4 +15,6 @@ ResourceTokenList result = await tokens.List( fileId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 6cd7dee0..041dce97 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -13,4 +13,6 @@ Tokens tokens = new Tokens(client); ResourceToken result = await tokens.Update( tokenId: "", expire: "2020-10-15T06:38:00.000+00:00" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 0962eff6..6c4ba635 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -15,4 +15,6 @@ User result = await users.CreateArgon2User( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index bdcfd9a8..d4a70e5b 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -15,4 +15,6 @@ User result = await users.CreateBcryptUser( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 2c6d9770..0841f4ea 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -12,6 +12,8 @@ Users users = new Users(client); JWT result = await users.CreateJWT( userId: "", - sessionId: "", // optional + sessionId: "recent()", // optional duration: 0 // optional -);``` +); + +``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 5fc94ca7..26825711 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -15,4 +15,6 @@ User result = await users.CreateMD5User( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 453e66c2..02a34ab9 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 0d6b7fae..efcc9f27 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -15,4 +15,6 @@ User result = await users.CreatePHPassUser( email: "email@example.com", password: "password", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 640cdb8f..687282b2 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -18,4 +18,6 @@ User result = await users.CreateScryptModifiedUser( passwordSaltSeparator: "", passwordSignerKey: "", name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 47f4d8e1..ee7e61a1 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -15,9 +15,11 @@ User result = await users.CreateScryptUser( email: "email@example.com", password: "password", passwordSalt: "", - passwordCpu: 0, - passwordMemory: 0, - passwordParallel: 0, - passwordLength: 0, + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 78cd1d2b..5ca7121f 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -12,4 +12,6 @@ Users users = new Users(client); Session result = await users.CreateSession( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 9c8d13b7..8dd3a160 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -17,4 +17,6 @@ User result = await users.CreateSHAUser( password: "password", passwordVersion: PasswordHash.Sha1, // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 17129125..281996df 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -18,4 +18,6 @@ Target result = await users.CreateTarget( identifier: "", providerId: "", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 5e8fd9e3..3d929346 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -14,4 +14,6 @@ Token result = await users.CreateToken( userId: "", length: 4, // optional expire: 60 // optional -);``` +); + +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index dd8d684c..fb2a8095 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -16,4 +16,6 @@ User result = await users.Create( phone: "+12065550100", // optional password: "password", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 1237f3a4..bc55fed8 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.DeleteIdentity( identityId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 7b311319..82ddb00f 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -14,4 +14,6 @@ Users users = new Users(client); await users.DeleteMFAAuthenticator( userId: "", type: AuthenticatorType.Totp -);``` +); + +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 5d0282d5..c0cbbf02 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -13,4 +13,6 @@ Users users = new Users(client); await users.DeleteSession( userId: "", sessionId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 26b2cac1..6fcb9d0c 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.DeleteSessions( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 60bbc5a6..b496d645 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -13,4 +13,6 @@ Users users = new Users(client); await users.DeleteTarget( userId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index f1ee25ff..426c3007 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -12,4 +12,6 @@ Users users = new Users(client); await users.Delete( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 810ea136..98f2131b 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -13,4 +13,6 @@ Users users = new Users(client); MfaChallengeSecret result = await users.GetMFAChallenge( userId: "", challengeId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 34dca016..b2c1e98a 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.GetMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 183bf14a..70f55411 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -12,4 +12,6 @@ Users users = new Users(client); Preferences result = await users.GetPrefs( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 428e9248..3011e569 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -13,4 +13,6 @@ Users users = new Users(client); Target result = await users.GetTarget( userId: "", targetId: "" -);``` +); + +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index f1de9cd0..047ed83c 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -12,4 +12,6 @@ Users users = new Users(client); User result = await users.Get( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 3c8cdd62..08ee96bd 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -14,4 +14,6 @@ IdentityList result = await users.ListIdentities( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index b1faf3dc..ec0ff9ac 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -14,4 +14,6 @@ LogList result = await users.ListLogs( userId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index b72ebb37..ad3e77a2 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -15,4 +15,6 @@ MembershipList result = await users.ListMemberships( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 18f888f2..c1f7365e 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaFactors result = await users.ListMFAFactors( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 3c888dda..49593956 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -13,4 +13,6 @@ Users users = new Users(client); SessionList result = await users.ListSessions( userId: "", total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index d825f0b1..d867b06f 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -14,4 +14,6 @@ TargetList result = await users.ListTargets( userId: "", queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 24407b55..8f0ad9d5 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -14,4 +14,6 @@ UserList result = await users.List( queries: new List(), // optional search: "", // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 1a9bee68..0f6233c3 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateEmailVerification( userId: "", emailVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 971db635..be7bc521 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateEmail( userId: "", email: "email@example.com" -);``` +); + +``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index 908bad5f..91d94e78 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateImpersonator( userId: "", impersonator: false -);``` +); + +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 745fcde0..f6c0b554 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateLabels( userId: "", labels: new List() -);``` +); + +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index f2c59a7d..78018690 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -12,4 +12,6 @@ Users users = new Users(client); MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( userId: "" -);``` +); + +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index ea9ae97f..4e51f9f1 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateMFA( userId: "", mfa: false -);``` +); + +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 874476e9..4a58aa86 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateName( userId: "", name: "" -);``` +); + +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 17e3a35c..4306cd73 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePassword( userId: "", password: "password" -);``` +); + +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index fce805ce..81fedf8a 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePhoneVerification( userId: "", phoneVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index dce430d0..de2a0723 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdatePhone( userId: "", number: "+12065550100" -);``` +); + +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index e6ebf0d0..db20bfc8 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -13,4 +13,6 @@ Users users = new Users(client); Preferences result = await users.UpdatePrefs( userId: "", prefs: [object] -);``` +); + +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 04057430..bd9f4839 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -13,4 +13,6 @@ Users users = new Users(client); User result = await users.UpdateStatus( userId: "", status: false -);``` +); + +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 9104e974..a2c18419 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -16,4 +16,6 @@ Target result = await users.UpdateTarget( identifier: "", // optional providerId: "", // optional name: "" // optional -);``` +); + +``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md new file mode 100644 index 00000000..b0cebcd4 --- /dev/null +++ b/docs/examples/vectorsdb/create-collection.md @@ -0,0 +1,23 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.CreateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md new file mode 100644 index 00000000..3fce530d --- /dev/null +++ b/docs/examples/vectorsdb/create-document.md @@ -0,0 +1,24 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.CreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: new { + embeddings = new[] { 0.12, -0.55, 0.88, 1.02 }, + metadata = { key = "value" } + }, + permissions: new List { Permission.Read(Role.Any()) } // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md new file mode 100644 index 00000000..9f2c9b98 --- /dev/null +++ b/docs/examples/vectorsdb/create-documents.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +); + +``` diff --git a/docs/examples/vectorsdb/create-failover.md b/docs/examples/vectorsdb/create-failover.md new file mode 100644 index 00000000..dd50d8dc --- /dev/null +++ b/docs/examples/vectorsdb/create-failover.md @@ -0,0 +1,18 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabase result = await vectorsDB.CreateFailover( + databaseId: "", + targetReplicaId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md new file mode 100644 index 00000000..5adac04c --- /dev/null +++ b/docs/examples/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.CreateIndex( + databaseId: "", + collectionId: "", + key: "", + type: VectorsDBIndexType.HnswEuclidean, + attributes: new List(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List() // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md new file mode 100644 index 00000000..346c7d24 --- /dev/null +++ b/docs/examples/vectorsdb/create-operations.md @@ -0,0 +1,28 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-query.md b/docs/examples/vectorsdb/create-query.md new file mode 100644 index 00000000..bcc28eda --- /dev/null +++ b/docs/examples/vectorsdb/create-query.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateQuery( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md new file mode 100644 index 00000000..133e6bbd --- /dev/null +++ b/docs/examples/vectorsdb/create-transaction.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md new file mode 100644 index 00000000..5ef6db08 --- /dev/null +++ b/docs/examples/vectorsdb/create.md @@ -0,0 +1,22 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Create( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md new file mode 100644 index 00000000..563f025d --- /dev/null +++ b/docs/examples/vectorsdb/delete-collection.md @@ -0,0 +1,18 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md new file mode 100644 index 00000000..78ccb33c --- /dev/null +++ b/docs/examples/vectorsdb/delete-document.md @@ -0,0 +1,20 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md new file mode 100644 index 00000000..e7d21a4b --- /dev/null +++ b/docs/examples/vectorsdb/delete-documents.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md new file mode 100644 index 00000000..7764d3ce --- /dev/null +++ b/docs/examples/vectorsdb/delete-index.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 00000000..2d706dd2 --- /dev/null +++ b/docs/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md new file mode 100644 index 00000000..0f43900d --- /dev/null +++ b/docs/examples/vectorsdb/delete.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.Delete( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md new file mode 100644 index 00000000..9111b740 --- /dev/null +++ b/docs/examples/vectorsdb/get-collection.md @@ -0,0 +1,18 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.GetCollection( + databaseId: "", + collectionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md new file mode 100644 index 00000000..98762a93 --- /dev/null +++ b/docs/examples/vectorsdb/get-document.md @@ -0,0 +1,21 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.GetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md new file mode 100644 index 00000000..6c2d1dfb --- /dev/null +++ b/docs/examples/vectorsdb/get-index.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.GetIndex( + databaseId: "", + collectionId: "", + key: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-replicas.md b/docs/examples/vectorsdb/get-replicas.md new file mode 100644 index 00000000..b1a849f3 --- /dev/null +++ b/docs/examples/vectorsdb/get-replicas.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseReplicas result = await vectorsDB.GetReplicas( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-status.md b/docs/examples/vectorsdb/get-status.md new file mode 100644 index 00000000..e019656d --- /dev/null +++ b/docs/examples/vectorsdb/get-status.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DatabaseStatus result = await vectorsDB.GetStatus( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md new file mode 100644 index 00000000..4cd0b3fd --- /dev/null +++ b/docs/examples/vectorsdb/get-transaction.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.GetTransaction( + transactionId: "" +); + +``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md new file mode 100644 index 00000000..5b605e57 --- /dev/null +++ b/docs/examples/vectorsdb/get.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Get( + databaseId: "" +); + +``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md new file mode 100644 index 00000000..5e9f2737 --- /dev/null +++ b/docs/examples/vectorsdb/list-collections.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollectionList result = await vectorsDB.ListCollections( + databaseId: "", + queries: new List(), // optional + search: "", // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md new file mode 100644 index 00000000..93411673 --- /dev/null +++ b/docs/examples/vectorsdb/list-documents.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.ListDocuments( + databaseId: "", + collectionId: "", + queries: new List(), // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md new file mode 100644 index 00000000..acf0af7a --- /dev/null +++ b/docs/examples/vectorsdb/list-indexes.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +IndexList result = await vectorsDB.ListIndexes( + databaseId: "", + collectionId: "", + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-operations.md b/docs/examples/vectorsdb/list-operations.md new file mode 100644 index 00000000..90a4327f --- /dev/null +++ b/docs/examples/vectorsdb/list-operations.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseOperationList result = await vectorsDB.ListOperations( + databaseId: "", + status: "queued", // optional + limit: 1, // optional + offset: 0 // optional +); + +``` diff --git a/docs/examples/vectorsdb/list-specifications.md b/docs/examples/vectorsdb/list-specifications.md new file mode 100644 index 00000000..652d2324 --- /dev/null +++ b/docs/examples/vectorsdb/list-specifications.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DedicatedDatabaseSpecificationList result = await vectorsDB.ListSpecifications(); + + +``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md new file mode 100644 index 00000000..54ada0e6 --- /dev/null +++ b/docs/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +TransactionList result = await vectorsDB.ListTransactions( + queries: new List() // optional +); + +``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md new file mode 100644 index 00000000..f2c0e930 --- /dev/null +++ b/docs/examples/vectorsdb/list.md @@ -0,0 +1,18 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DatabaseList result = await vectorsDB.List( + queries: new List(), // optional + total: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md new file mode 100644 index 00000000..bcadbda2 --- /dev/null +++ b/docs/examples/vectorsdb/update-collection.md @@ -0,0 +1,23 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.UpdateCollection( + databaseId: "", + collectionId: "", + name: "", + dimension: 1, // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md new file mode 100644 index 00000000..d1d0d078 --- /dev/null +++ b/docs/examples/vectorsdb/update-document.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md new file mode 100644 index 00000000..5833aac1 --- /dev/null +++ b/docs/examples/vectorsdb/update-documents.md @@ -0,0 +1,21 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List(), // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md new file mode 100644 index 00000000..65320cc2 --- /dev/null +++ b/docs/examples/vectorsdb/update-transaction.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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.UpdateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md new file mode 100644 index 00000000..c8184ece --- /dev/null +++ b/docs/examples/vectorsdb/update.md @@ -0,0 +1,22 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Update( + databaseId: "", + name: "", + enabled: false, // optional + specification: "serverless", // optional + replicas: 0, // optional + syncMode: "async" // optional +); + +``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md new file mode 100644 index 00000000..edb18673 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-document.md @@ -0,0 +1,22 @@ +```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 + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], // optional + permissions: new List { Permission.Read(Role.Any()) }, // optional + transactionId: "" // optional +); + +``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md new file mode 100644 index 00000000..d9209fd9 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```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 + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List(), + transactionId: "" // optional +); + +``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index c3e9f558..28a5222f 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -12,7 +12,7 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Create( webhookId: "", - url: "", + url: "https://example.com/webhook", name: "", events: new List(), enabled: false, // optional @@ -20,4 +20,6 @@ Webhook result = await webhooks.Create( authUsername: "", // optional authPassword: "password", // optional secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md index a9aac880..8cb5a401 100644 --- a/docs/examples/webhooks/delete.md +++ b/docs/examples/webhooks/delete.md @@ -12,4 +12,6 @@ Webhooks webhooks = new Webhooks(client); await webhooks.Delete( webhookId: "" -);``` +); + +``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index f9c6835a..2b6ce7dd 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -12,4 +12,6 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Get( webhookId: "" -);``` +); + +``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index 94db7d62..c8c4b065 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -13,4 +13,6 @@ Webhooks webhooks = new Webhooks(client); WebhookList result = await webhooks.List( queries: new List(), // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index c6b4a167..c6d94551 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -13,4 +13,6 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.UpdateSecret( webhookId: "", secret: "" // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index d3485855..795cfafe 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -13,10 +13,12 @@ Webhooks webhooks = new Webhooks(client); Webhook result = await webhooks.Update( webhookId: "", name: "", - url: "", + url: "https://example.com/webhook", events: new List(), enabled: false, // optional tls: false, // optional authUsername: "", // optional authPassword: "password" // optional -);``` +); + +``` From a3b2d873acf4133fa2291c3639c29a659c84cae0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 27 Aug 2026 18:28:46 +0530 Subject: [PATCH 10/10] chore: update .NET SDK to 8.0.0-rc.1 --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 ++-- CHANGELOG.md | 6 +++++- README.md | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index a22c8679..02d557a9 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 7.1.0-rc.1 + 8.0.0-rc.1 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 6792fdac..35475d03 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -77,11 +77,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent", $"AppwriteDotNetSDK/7.1.0-rc.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent", $"AppwriteDotNetSDK/8.0.0-rc.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "7.1.0-rc.1"}, + { "x-sdk-version", "8.0.0-rc.1"}, { "X-Appwrite-Response-Format", "1.9.6" } }; diff --git a/CHANGELOG.md b/CHANGELOG.md index dfadaca9..3d754fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ # Change Log -## 7.1.0-rc.1 +## 8.0.0-rc.1 +* Breaking: `Execution.functionId` is replaced by `resourceId` and `resourceType`, now that executions cover both functions and sites +* Breaking: `AppInstallation.authorizationDetails` is now an array instead of an object +* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes` +* Breaking: `EmbeddingModel` no longer offers `embedding-gemma` or `bge-small` * Added: `documentsDB`, `vectorsDB`, `mysql`, `postgresql`, and `mongo` services, no longer hidden from server SDKs * Added: `DocumentsDBIndexType` and `VectorsDBIndexType` enums * Added: dedicated database models for branches, backups, restorations, poolers, PITR windows, extensions, and executions diff --git a/README.md b/README.md index e1c9ec98..bdb512b9 100644 --- a/README.md +++ b/README.md @@ -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 7.1.0-rc.1 +Install-Package Appwrite -Version 8.0.0-rc.1 # or .NET CLI -dotnet add package Appwrite --version 7.1.0-rc.1 +dotnet add package Appwrite --version 8.0.0-rc.1 ```