From f2deb046ae1444188615995a19ee4277e7f4043e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 10:48:13 +0530 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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(),