From 667034c84d428d2367da40f1c7089543659edbec Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 10:47:19 +0530 Subject: [PATCH 01/10] chore: update PHP SDK to 27.0.0 --- CHANGELOG.md | 21 + composer.json | 3 +- docs/account.md | 2 +- docs/backups.md | 6 +- docs/examples/backups/create-restoration.md | 3 +- .../functions/get-deployment-download.md | 3 +- .../examples/functions/list-specifications.md | 5 +- docs/examples/health/get-audits-db.md | 15 - docs/examples/health/get-cache.md | 15 - docs/examples/health/get-certificate.md | 16 - docs/examples/health/get-db.md | 15 - docs/examples/health/get-pub-sub.md | 15 - docs/examples/health/get-queue-databases.md | 17 - docs/examples/health/get-queue-deletes.md | 16 - docs/examples/health/get-queue-functions.md | 16 - docs/examples/health/get-queue-logs.md | 16 - docs/examples/health/get-queue-mails.md | 16 - docs/examples/health/get-queue-messaging.md | 16 - docs/examples/health/get-queue-migrations.md | 16 - .../health/get-queue-stats-resources.md | 16 - docs/examples/health/get-queue-usage.md | 16 - docs/examples/health/get-queue-webhooks.md | 16 - docs/examples/health/get-storage-local.md | 15 - docs/examples/health/get-storage.md | 15 - docs/examples/health/get-time.md | 15 - docs/examples/messaging/list-provider-logs.md | 18 - .../messaging/list-subscriber-logs.md | 18 - docs/examples/messaging/list-topic-logs.md | 18 - .../organization/create-membership.md | 21 + .../delete-membership.md} | 8 +- .../delete.md} | 6 +- .../get-membership.md} | 8 +- docs/examples/{health => organization}/get.md | 6 +- .../list-memberships.md} | 8 +- .../update-membership.md} | 10 +- .../update.md} | 8 +- .../update-o-auth-2-appwrite.md} | 12 +- docs/examples/project/update-o-auth-2-oidc.md | 3 + .../project/update-o-auth-2-server.md | 3 +- docs/examples/sites/list-specifications.md | 5 +- docs/examples/tablesdb/create.md | 2 +- docs/examples/usage/list-events.md | 26 - docs/examples/usage/list-gauges.md | 26 - docs/functions.md | 13 +- docs/health.md | 280 ----- docs/messaging.md | 60 - docs/organization.md | 106 +- docs/project.md | 24 +- docs/sites.md | 8 +- docs/tablesdb.md | 2 +- docs/usage.md | 60 - docs/users.md | 2 +- src/Appwrite/Client.php | 89 +- src/Appwrite/Enums/BillingPlanGroup.php | 61 + src/Appwrite/Enums/DatabaseStatus.php | 61 + src/Appwrite/Enums/HealthAntivirusStatus.php | 61 - src/Appwrite/Enums/HealthCheckStatus.php | 52 - src/Appwrite/Enums/HealthQueueName.php | 151 --- src/Appwrite/Enums/OAuth2OidcPrompt.php | 70 ++ src/Appwrite/Enums/OAuthProvider.php | 9 + src/Appwrite/Enums/OrganizationKeyScopes.php | 36 + src/Appwrite/Enums/ProjectKeyScopes.php | 60 +- .../Enums/ProjectOAuth2OidcPrompt.php | 70 ++ src/Appwrite/Enums/ProjectOAuthProviderId.php | 9 + src/Appwrite/Models/ActivityEvent.php | 20 +- src/Appwrite/Models/AdditionalResource.php | 82 ++ src/Appwrite/Models/BillingPlan.php | 506 +++++++++ src/Appwrite/Models/BillingPlanAddon.php | 54 + .../Models/BillingPlanAddonDetails.php | 96 ++ .../BillingPlanDedicatedDatabaseLimits.php | 116 ++ src/Appwrite/Models/BillingPlanLimits.php | 48 + .../Models/BillingPlanSupportedAddons.php | 61 + src/Appwrite/Models/Block.php | 7 + src/Appwrite/Models/Database.php | 9 +- src/Appwrite/Models/HealthAntivirus.php | 56 - src/Appwrite/Models/HealthCertificate.php | 82 -- src/Appwrite/Models/HealthQueue.php | 47 - src/Appwrite/Models/HealthStatus.php | 63 - src/Appwrite/Models/HealthStatusList.php | 59 - src/Appwrite/Models/HealthTime.php | 61 - src/Appwrite/Models/Locale.php | 50 +- src/Appwrite/Models/Log.php | 2 +- src/Appwrite/Models/OAuth2Appwrite.php | 68 ++ src/Appwrite/Models/OAuth2Oidc.php | 24 +- src/Appwrite/Models/Organization.php | 282 +++++ src/Appwrite/Models/Program.php | 103 ++ src/Appwrite/Models/Project.php | 11 + src/Appwrite/Models/UsageBillingPlan.php | 117 ++ src/Appwrite/Models/UsageEventList.php | 66 -- src/Appwrite/Models/UsageGaugeList.php | 66 -- src/Appwrite/Models/UsageGroup.php | 106 -- src/Appwrite/Query.php | 36 + src/Appwrite/Services/Backups.php | 17 +- src/Appwrite/Services/Databases.php | 42 + src/Appwrite/Services/Functions.php | 19 +- src/Appwrite/Services/Health.php | 1012 ----------------- src/Appwrite/Services/Messaging.php | 188 --- src/Appwrite/Services/Organization.php | 332 ++++++ src/Appwrite/Services/Project.php | 56 +- src/Appwrite/Services/Sites.php | 12 +- src/Appwrite/Services/TablesDB.php | 8 +- src/Appwrite/Services/Usage.php | 218 ---- tests/Appwrite/Services/ActivitiesTest.php | 8 +- tests/Appwrite/Services/BackupsTest.php | 6 +- tests/Appwrite/Services/HealthTest.php | 518 --------- tests/Appwrite/Services/MessagingTest.php | 184 --- tests/Appwrite/Services/OrganizationTest.php | 644 +++++++++++ tests/Appwrite/Services/ProjectTest.php | 65 +- tests/Appwrite/Services/UsageTest.php | 75 -- 109 files changed, 3540 insertions(+), 3977 deletions(-) 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-certificate.md delete mode 100644 docs/examples/health/get-db.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-certificates.md => organization/delete-membership.md} (62%) rename docs/examples/{health/get-antivirus.md => organization/delete.md} (69%) rename docs/examples/{health/get-queue-builds.md => organization/get-membership.md} (62%) rename docs/examples/{health => organization}/get.md (70%) rename docs/examples/{messaging/list-message-logs.md => organization/list-memberships.md} (67%) rename docs/examples/{health/get-console-pausing.md => organization/update-membership.md} (60%) rename docs/examples/{health/get-queue-audits.md => organization/update.md} (66%) rename docs/examples/{health/get-failed-jobs.md => project/update-o-auth-2-appwrite.md} (53%) delete mode 100644 docs/examples/usage/list-events.md delete mode 100644 docs/examples/usage/list-gauges.md delete mode 100644 docs/health.md delete mode 100644 docs/usage.md create mode 100644 src/Appwrite/Enums/BillingPlanGroup.php create mode 100644 src/Appwrite/Enums/DatabaseStatus.php delete mode 100644 src/Appwrite/Enums/HealthAntivirusStatus.php delete mode 100644 src/Appwrite/Enums/HealthCheckStatus.php delete mode 100644 src/Appwrite/Enums/HealthQueueName.php create mode 100644 src/Appwrite/Enums/OAuth2OidcPrompt.php create mode 100644 src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php create mode 100644 src/Appwrite/Models/AdditionalResource.php create mode 100644 src/Appwrite/Models/BillingPlan.php create mode 100644 src/Appwrite/Models/BillingPlanAddon.php create mode 100644 src/Appwrite/Models/BillingPlanAddonDetails.php create mode 100644 src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php create mode 100644 src/Appwrite/Models/BillingPlanLimits.php create mode 100644 src/Appwrite/Models/BillingPlanSupportedAddons.php delete mode 100644 src/Appwrite/Models/HealthAntivirus.php delete mode 100644 src/Appwrite/Models/HealthCertificate.php delete mode 100644 src/Appwrite/Models/HealthQueue.php delete mode 100644 src/Appwrite/Models/HealthStatus.php delete mode 100644 src/Appwrite/Models/HealthStatusList.php delete mode 100644 src/Appwrite/Models/HealthTime.php create mode 100644 src/Appwrite/Models/OAuth2Appwrite.php create mode 100644 src/Appwrite/Models/Organization.php create mode 100644 src/Appwrite/Models/Program.php create mode 100644 src/Appwrite/Models/UsageBillingPlan.php delete mode 100644 src/Appwrite/Models/UsageEventList.php delete mode 100644 src/Appwrite/Models/UsageGaugeList.php delete mode 100644 src/Appwrite/Models/UsageGroup.php delete mode 100644 src/Appwrite/Services/Health.php delete mode 100644 src/Appwrite/Services/Usage.php delete mode 100644 tests/Appwrite/Services/HealthTest.php delete mode 100644 tests/Appwrite/Services/UsageTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index adbaa019..0a41a9e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 27.0.0 + +* Breaking: Removed `Health` service with its models and enums +* Breaking: Removed `Usage` service and usage models +* Breaking: Removed `Messaging` methods `listMessageLogs`, `listProviderLogs`, `listSubscriberLogs`, `listTopicLogs` +* Breaking: Renamed `TablesDB::create` parameter `dedicatedDatabaseId` to `specification` +* Breaking: Removed `countryCode` and `countryName` from `ActivityEvent` model +* Added: `Organization` service `get`, `update`, `delete`, and membership CRUD methods +* Added: `Client::setSigningKey` and `Client::setBearer` for JWT and bearer authentication +* Added: vector query helpers `Query::vectorDot`, `Query::vectorCosine`, `Query::vectorEuclidean` +* Added: `appwrite` OAuth2 provider and `Project::updateOAuth2Appwrite` method +* Added: `prompt` and `maxAge` parameters to `updateOAuth2Oidc`, `defaultScopes` to `updateOAuth2Server` +* Added: `newSpecification` parameter to `Backups::createRestoration` +* Added: `type` parameter to `Functions` and `Sites` `listSpecifications` +* Added: `token` parameter to `Functions::getDeploymentDownload` +* Added: `mode` to `Block`, `status` to `Database`, geolocation/ISP fields to `Locale` models +* Added: `onboarding` and `oAuth2ServerDefaultScopes` to `Project` model +* Added: organization membership, organization, and `project.oauth2`/`stages` key scopes +* Added: billing plan models, `BillingPlanGroup`, `DatabaseStatus`, OIDC prompt enums +* Updated: deprecated `Databases` transaction and text attribute methods in favor of `TablesDB` + ## 26.1.0 * Updated: Reworked `usage.listEvents` into an aggregation query with `metric`, `interval`, `dimensions`, and `orderBy` diff --git a/composer.json b/composer.json index a5eb1aa5..54fa8a06 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "require": { "php": ">=8.2.0", "ext-curl": "*", - "ext-json": "*" + "ext-json": "*", + "adhocore/jwt": "^1.1" }, "require-dev": { "phpunit/phpunit": "^12", diff --git a/docs/account.md b/docs/account.md index 9368ea08..31ac8d2e 100644 --- a/docs/account.md +++ b/docs/account.md @@ -565,7 +565,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | +| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | | success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] | diff --git a/docs/backups.md b/docs/backups.md index 36a4ee91..3ad1f4eb 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -133,7 +133,10 @@ DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId} POST https://cloud.appwrite.io/v1/backups/restoration ``` -** Create and trigger a new restoration for a backup on a project. ** +** 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. + ** ### Parameters @@ -143,6 +146,7 @@ POST https://cloud.appwrite.io/v1/backups/restoration | services | array | Array of services to restore | | | newResourceId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | newResourceName | string | Database name. Max length: 128 chars. | | +| newSpecification | string | Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. | | ```http request diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 61d9e0b2..e572dd47 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -16,5 +16,6 @@ $result = $backups->createRestoration( archiveId: '', services: [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 73842f54..e267d325 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -15,5 +15,6 @@ $functions = new Functions($client); $result = $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 f5afe80b..7211ce69 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -11,5 +11,6 @@ $client = (new Client()) $functions = new Functions($client); -$result = $functions->listSpecifications(); -``` +$result = $functions->listSpecifications( + type: 'runtimes' // optional +);``` diff --git a/docs/examples/health/get-audits-db.md b/docs/examples/health/get-audits-db.md deleted file mode 100644 index 045c32fd..00000000 --- a/docs/examples/health/get-audits-db.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getAuditsDB(); -``` diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md deleted file mode 100644 index 8443c64f..00000000 --- a/docs/examples/health/get-cache.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getCache(); -``` diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md deleted file mode 100644 index d1d1fd1e..00000000 --- a/docs/examples/health/get-certificate.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getCertificate( - domain: '' // optional -);``` diff --git a/docs/examples/health/get-db.md b/docs/examples/health/get-db.md deleted file mode 100644 index 1682bcf3..00000000 --- a/docs/examples/health/get-db.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getDB(); -``` diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md deleted file mode 100644 index 97dc4b6f..00000000 --- a/docs/examples/health/get-pub-sub.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $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 96bfb6fd..00000000 --- a/docs/examples/health/get-queue-databases.md +++ /dev/null @@ -1,17 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueDatabases( - name: '', // optional - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md deleted file mode 100644 index 2b147f42..00000000 --- a/docs/examples/health/get-queue-deletes.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueDeletes( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md deleted file mode 100644 index d5b58442..00000000 --- a/docs/examples/health/get-queue-functions.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueFunctions( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md deleted file mode 100644 index cb0125cb..00000000 --- a/docs/examples/health/get-queue-logs.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueLogs( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md deleted file mode 100644 index 56babd6c..00000000 --- a/docs/examples/health/get-queue-mails.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueMails( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md deleted file mode 100644 index 4539c5d9..00000000 --- a/docs/examples/health/get-queue-messaging.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueMessaging( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md deleted file mode 100644 index 36b8d4b4..00000000 --- a/docs/examples/health/get-queue-migrations.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueMigrations( - threshold: null // 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 da4cee7a..00000000 --- a/docs/examples/health/get-queue-stats-resources.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueStatsResources( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md deleted file mode 100644 index dd35802b..00000000 --- a/docs/examples/health/get-queue-usage.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueUsage( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md deleted file mode 100644 index d2877ce6..00000000 --- a/docs/examples/health/get-queue-webhooks.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueWebhooks( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md deleted file mode 100644 index d7524bad..00000000 --- a/docs/examples/health/get-storage-local.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getStorageLocal(); -``` diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md deleted file mode 100644 index 2a109dec..00000000 --- a/docs/examples/health/get-storage.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getStorage(); -``` diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md deleted file mode 100644 index 559b1797..00000000 --- a/docs/examples/health/get-time.md +++ /dev/null @@ -1,15 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getTime(); -``` diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md deleted file mode 100644 index afc3df91..00000000 --- a/docs/examples/messaging/list-provider-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$messaging = new Messaging($client); - -$result = $messaging->listProviderLogs( - providerId: '', - queries: [], // 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 7a0e5ad7..00000000 --- a/docs/examples/messaging/list-subscriber-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$messaging = new Messaging($client); - -$result = $messaging->listSubscriberLogs( - subscriberId: '', - queries: [], // 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 d32d27ae..00000000 --- a/docs/examples/messaging/list-topic-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$messaging = new Messaging($client); - -$result = $messaging->listTopicLogs( - topicId: '', - queries: [], // optional - total: false // optional -);``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md new file mode 100644 index 00000000..372c09cc --- /dev/null +++ b/docs/examples/organization/create-membership.md @@ -0,0 +1,21 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->createMembership( + roles: [], + 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-certificates.md b/docs/examples/organization/delete-membership.md similarity index 62% rename from docs/examples/health/get-queue-certificates.md rename to docs/examples/organization/delete-membership.md index d70b6574..9da3b64f 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/organization/delete-membership.md @@ -2,15 +2,15 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->getQueueCertificates( - threshold: null // optional +$result = $organization->deleteMembership( + membershipId: '' );``` diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/organization/delete.md similarity index 69% rename from docs/examples/health/get-antivirus.md rename to docs/examples/organization/delete.md index 7f57d8aa..1160857a 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/organization/delete.md @@ -2,14 +2,14 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->getAntivirus(); +$result = $organization->delete(); ``` diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/organization/get-membership.md similarity index 62% rename from docs/examples/health/get-queue-builds.md rename to docs/examples/organization/get-membership.md index 607acb20..52e2d17d 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/organization/get-membership.md @@ -2,15 +2,15 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->getQueueBuilds( - threshold: null // optional +$result = $organization->getMembership( + membershipId: '' );``` diff --git a/docs/examples/health/get.md b/docs/examples/organization/get.md similarity index 70% rename from docs/examples/health/get.md rename to docs/examples/organization/get.md index 4b46ac2c..6fb38198 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/organization/get.md @@ -2,14 +2,14 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->get(); +$result = $organization->get(); ``` diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/organization/list-memberships.md similarity index 67% rename from docs/examples/messaging/list-message-logs.md rename to docs/examples/organization/list-memberships.md index 8bc5631c..17858996 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/organization/list-memberships.md @@ -2,17 +2,17 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$messaging = new Messaging($client); +$organization = new Organization($client); -$result = $messaging->listMessageLogs( - messageId: '', +$result = $organization->listMemberships( queries: [], // 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 60% rename from docs/examples/health/get-console-pausing.md rename to docs/examples/organization/update-membership.md index 06a434d8..7097729e 100644 --- a/docs/examples/health/get-console-pausing.md +++ b/docs/examples/organization/update-membership.md @@ -2,16 +2,16 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->getConsolePausing( - threshold: null, // optional - inactivityDays: null // optional +$result = $organization->updateMembership( + membershipId: '', + roles: [] );``` diff --git a/docs/examples/health/get-queue-audits.md b/docs/examples/organization/update.md similarity index 66% rename from docs/examples/health/get-queue-audits.md rename to docs/examples/organization/update.md index 2bfc32e8..45e7f0ff 100644 --- a/docs/examples/health/get-queue-audits.md +++ b/docs/examples/organization/update.md @@ -2,15 +2,15 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$organization = new Organization($client); -$result = $health->getQueueAudits( - threshold: null // optional +$result = $organization->update( + name: '' );``` diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/project/update-o-auth-2-appwrite.md similarity index 53% rename from docs/examples/health/get-failed-jobs.md rename to docs/examples/project/update-o-auth-2-appwrite.md index de204109..be24abdb 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -2,17 +2,17 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$project = new Project($client); -$result = $health->getFailedJobs( - name: HealthQueueName::V1DATABASE(), - threshold: null // optional +$result = $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 1b9d9b86..2c06fe89 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -3,6 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Project; +use Appwrite\Enums\ProjectOAuth2OidcPrompt; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -18,5 +19,7 @@ $result = $project->updateOAuth2Oidc( authorizationURL: 'https://example.com', // optional tokenURL: 'https://example.com', // optional userInfoURL: 'https://example.com', // optional + prompt: [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 d8974303..9c3eb9a8 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -24,5 +24,6 @@ $result = $project->updateOAuth2Server( verificationUrl: 'https://example.com', // optional userCodeLength: 6, // optional userCodeFormat: 'numeric', // optional - deviceCodeDuration: 60 // optional + deviceCodeDuration: 60, // optional + defaultScopes: [] // optional );``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 1a732b6a..33bc0c59 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -11,5 +11,6 @@ $client = (new Client()) $sites = new Sites($client); -$result = $sites->listSpecifications(); -``` +$result = $sites->listSpecifications( + type: 'runtimes' // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 34d30569..9cbbf307 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -15,5 +15,5 @@ $result = $tablesDB->create( databaseId: '', name: '', enabled: false, // optional - dedicatedDatabaseId: '' // 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 e7cfe438..00000000 --- a/docs/examples/usage/list-events.md +++ /dev/null @@ -1,26 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$usage = new Usage($client); - -$result = $usage->listEvents( - metric: '', - resource: '', // optional - resourceId: '', // optional - interval: '1m', // optional - dimensions: [], // optional - startAt: '2020-10-15T06:38:00.000+00:00', // optional - endAt: '2020-10-15T06:38:00.000+00:00', // optional - orderBy: 'time', // optional - orderDir: 'asc', // optional - limit: 1, // optional - offset: 0 // optional -);``` diff --git a/docs/examples/usage/list-gauges.md b/docs/examples/usage/list-gauges.md deleted file mode 100644 index 899c052b..00000000 --- a/docs/examples/usage/list-gauges.md +++ /dev/null @@ -1,26 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$usage = new Usage($client); - -$result = $usage->listGauges( - metric: '', - resourceId: '', // optional - teamId: '', // optional - interval: '1m', // optional - dimensions: [], // optional - startAt: '2020-10-15T06:38:00.000+00:00', // optional - endAt: '2020-10-15T06:38:00.000+00:00', // optional - orderBy: 'time', // optional - orderDir: 'asc', // optional - limit: 1, // optional - offset: 0 // optional -);``` diff --git a/docs/functions.md b/docs/functions.md index 04fed225..86be1ee9 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -37,7 +37,7 @@ POST https://cloud.appwrite.io/v1/functions | logging | boolean | When disabled, executions will exclude logs and errors, and will be slightly faster. | 1 | | entrypoint | string | Entrypoint File. This path is relative to the "providerRootDirectory". | | | commands | string | Build Commands. | | -| scopes | array | List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. | [] | +| scopes | array | List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed. | [] | | installationId | string | Appwrite Installation ID for VCS (Version Control System) deployment. | | | providerRepositoryId | string | Repository ID of the repo linked to the function. | | | providerBranch | string | Production branch for the repo linked to the function. | | @@ -63,6 +63,12 @@ GET https://cloud.appwrite.io/v1/functions/specifications ** List allowed function specifications for this instance. ** +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| type | string | Specification type to list. Can be one of: runtimes, builds. | runtimes | + ```http request GET https://cloud.appwrite.io/v1/functions/{functionId} @@ -98,7 +104,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | logging | boolean | When disabled, executions will exclude logs and errors, and will be slightly faster. | 1 | | entrypoint | string | Entrypoint File. This path is relative to the "providerRootDirectory". | | | commands | string | Build Commands. | | -| scopes | array | List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. | [] | +| scopes | array | List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. | [] | | installationId | string | Appwrite Installation ID for VCS (Version Controle System) deployment. | | | providerRepositoryId | string | Repository ID of the repo linked to the function | | | providerBranch | string | Production branch for the repo linked to the function | | @@ -106,7 +112,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | providerRootDirectory | string | Path to function code in the linked repo. | | | providerBranches | array | List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. | | | providerPaths | array | List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. | | -| buildSpecification | string | Build specification for the function deployments. | [] | +| buildSpecification | string | Build specification for the function deployments. | | | runtimeSpecification | string | Runtime specification for the function executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | @@ -270,6 +276,7 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentI | functionId | string | **Required** Function ID. | | | deploymentId | string | **Required** Deployment ID. | | | type | string | Deployment file to download. Can be: "source", "output". | source | +| token | string | Presigned source-download token for accessing this deployment without a session (jobs-service). | | ```http request diff --git a/docs/health.md b/docs/health.md deleted file mode 100644 index 2dc98889..00000000 --- a/docs/health.md +++ /dev/null @@ -1,280 +0,0 @@ -# Health Service - - -```http request -GET https://cloud.appwrite.io/v1/health -``` - -** Check the Appwrite HTTP server is up and responsive. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/anti-virus -``` - -** Check the Appwrite Antivirus server is up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/audits-db -``` - -** 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. - ** - - -```http request -GET https://cloud.appwrite.io/v1/health/cache -``` - -** Check the Appwrite in-memory cache servers are up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/certificate -``` - -** Get the SSL certificate for a domain ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| domain | string | string | | - - -```http request -GET https://cloud.appwrite.io/v1/health/console-pausing -``` - -** Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking. - ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10. | 10 | -| inactivityDays | integer | Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7. | 7 | - - -```http request -GET https://cloud.appwrite.io/v1/health/db -``` - -** Check the Appwrite database servers are up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/pubsub -``` - -** Check the Appwrite pub-sub servers are up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/audits -``` - -** Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. - ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/builds -``` - -** Get the number of builds that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/certificates -``` - -** Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/databases -``` - -** Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Queue name for which to check the queue size | database_db_main | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/deletes -``` - -** Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/failed/{name} -``` - -** Returns the amount of failed jobs in a given queue. - ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | **Required** The name of the queue | | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/functions -``` - -** Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/logs -``` - -** Get the number of logs that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/mails -``` - -** Get the number of mails that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/messaging -``` - -** Get the number of messages that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/migrations -``` - -** Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/stats-resources -``` - -** Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/stats-usage -``` - -** Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/queue/webhooks -``` - -** Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| threshold | integer | Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. | 5000 | - - -```http request -GET https://cloud.appwrite.io/v1/health/storage -``` - -** Check the Appwrite storage device is up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/storage/local -``` - -** Check the Appwrite local storage device is up and connection is successful. ** - - -```http request -GET https://cloud.appwrite.io/v1/health/time -``` - -** 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. ** - diff --git a/docs/messaging.md b/docs/messaging.md index 15f8056c..e2585239 100644 --- a/docs/messaging.md +++ b/docs/messaging.md @@ -233,21 +233,6 @@ DELETE https://cloud.appwrite.io/v1/messaging/messages/{messageId} | messageId | string | **Required** Message ID. | | -```http request -GET https://cloud.appwrite.io/v1/messaging/messages/{messageId}/logs -``` - -** Get the message activity logs listed by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| messageId | string | **Required** Message ID. | | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] | -| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | - - ```http request GET https://cloud.appwrite.io/v1/messaging/messages/{messageId}/targets ``` @@ -901,36 +886,6 @@ DELETE https://cloud.appwrite.io/v1/messaging/providers/{providerId} | providerId | string | **Required** Provider ID. | | -```http request -GET https://cloud.appwrite.io/v1/messaging/providers/{providerId}/logs -``` - -** Get the provider activity logs listed by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| providerId | string | **Required** Provider ID. | | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] | -| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | - - -```http request -GET https://cloud.appwrite.io/v1/messaging/subscribers/{subscriberId}/logs -``` - -** Get the subscriber activity logs listed by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| subscriberId | string | **Required** Subscriber ID. | | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] | -| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | - - ```http request GET https://cloud.appwrite.io/v1/messaging/topics ``` @@ -1004,21 +959,6 @@ DELETE https://cloud.appwrite.io/v1/messaging/topics/{topicId} | topicId | string | **Required** Topic ID. | | -```http request -GET https://cloud.appwrite.io/v1/messaging/topics/{topicId}/logs -``` - -** Get the topic activity logs listed by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| topicId | string | **Required** Topic ID. | | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] | -| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | - - ```http request GET https://cloud.appwrite.io/v1/messaging/topics/{topicId}/subscribers ``` diff --git a/docs/organization.md b/docs/organization.md index 6bd35ae8..65a24932 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -1,6 +1,33 @@ # Organization Service +```http request +GET https://cloud.appwrite.io/v1/organization +``` + +** Get the current organization. ** + + +```http request +PUT https://cloud.appwrite.io/v1/organization +``` + +** Update the current organization's name. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| name | string | New organization name. Max length: 128 chars. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/organization +``` + +** Delete the current organization. All projects that belong to the organization are deleted as well. ** + + ```http request GET https://cloud.appwrite.io/v1/organization/keys ``` @@ -27,7 +54,7 @@ POST https://cloud.appwrite.io/v1/organization/keys | --- | --- | --- | --- | | keyId | string | Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | name | string | Key name. Max length: 128 chars. | | -| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | | +| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | | expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | | @@ -56,7 +83,7 @@ PUT https://cloud.appwrite.io/v1/organization/keys/{keyId} | --- | --- | --- | --- | | keyId | string | **Required** Key unique ID. | | | name | string | Key name. Max length: 128 chars. | | -| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | | +| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | | expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | | @@ -73,6 +100,79 @@ DELETE https://cloud.appwrite.io/v1/organization/keys/{keyId} | keyId | string | **Required** Key unique ID. | | +```http request +GET https://cloud.appwrite.io/v1/organization/memberships +``` + +** Get a list of all memberships from the current organization. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles | [] | +| search | string | Search term to filter your list results. Max length: 256 chars. | | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/organization/memberships +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| email | string | Email of the new organization member. | | +| userId | string | ID of the user to be added to the organization. | | +| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. | | +| roles | array | Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. | | +| url | string | URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. | | +| name | string | Name of the new organization member. Max length: 128 chars. | | + + +```http request +GET https://cloud.appwrite.io/v1/organization/memberships/{membershipId} +``` + +** Get a membership from the current organization by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| membershipId | string | **Required** Membership ID. | | + + +```http request +PATCH https://cloud.appwrite.io/v1/organization/memberships/{membershipId} +``` + +** Modify the roles of a member in the current organization. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| membershipId | string | **Required** Membership ID. | | +| roles | array | An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/organization/memberships/{membershipId} +``` + +** Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| membershipId | string | **Required** Membership ID. | | + + ```http request GET https://cloud.appwrite.io/v1/organization/projects ``` @@ -83,7 +183,7 @@ GET https://cloud.appwrite.io/v1/organization/projects | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search | [] | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | | total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | diff --git a/docs/project.md b/docs/project.md index 6cb25b4a..ca8f7cb6 100644 --- a/docs/project.md +++ b/docs/project.md @@ -57,7 +57,7 @@ You can also create an ephemeral API key if you need a short-lived key instead. | --- | --- | --- | --- | | keyId | string | Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | name | string | Key name. Max length: 128 chars. | | -| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | | +| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | | expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | | @@ -73,7 +73,7 @@ You can also create a standard API key if you need a longer-lived key instead. * | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | | +| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | | duration | integer | Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. | | @@ -102,7 +102,7 @@ PUT https://cloud.appwrite.io/v1/project/keys/{keyId} | --- | --- | --- | --- | | keyId | string | **Required** Key ID. | | | name | string | Key name. Max length: 128 chars. | | -| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | | +| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | | expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | | @@ -237,6 +237,7 @@ PUT https://cloud.appwrite.io/v1/project/oauth2-server | userCodeLength | integer | Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. | | | userCodeFormat | string | Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. | alphanumeric | | deviceCodeDuration | integer | Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. | | +| defaultScopes | array | List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. | [] | ```http request @@ -271,6 +272,21 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/apple | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | +```http request +PATCH https://cloud.appwrite.io/v1/project/oauth2/appwrite +``` + +** Update the project OAuth2 Appwrite configuration. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| clientId | string | 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 | | +| clientSecret | string | 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 | | +| enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | + + ```http request PATCH https://cloud.appwrite.io/v1/project/oauth2/auth0 ``` @@ -625,6 +641,8 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/oidc | authorizationURL | string | OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize | | | tokenURL | string | OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token | | | userInfoURL | string | OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo | | +| prompt | array | Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | +| maxAge | integer | Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. | | | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | diff --git a/docs/sites.md b/docs/sites.md index 80247d5a..74c000aa 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -64,6 +64,12 @@ GET https://cloud.appwrite.io/v1/sites/specifications ** List allowed site specifications for this instance. ** +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| type | string | Specification type to list. Can be one of: runtimes, builds. | runtimes | + ```http request GET https://cloud.appwrite.io/v1/sites/{siteId} @@ -108,7 +114,7 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId} | providerRootDirectory | string | Path to site code in the linked repo. | | | providerBranches | array | List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. | | | providerPaths | array | List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. | | -| buildSpecification | string | Build specification for the site deployments. | [] | +| buildSpecification | string | Build specification for the site deployments. | | | runtimeSpecification | string | Runtime specification for the SSR executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 7580ce10..1df71a2b 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -30,7 +30,7 @@ POST https://cloud.appwrite.io/v1/tablesdb | databaseId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | name | string | Database name. Max length: 128 chars. | | | enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 | -| dedicatedDatabaseId | string | Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. | | +| specification | string | Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. | serverless | ```http request diff --git a/docs/usage.md b/docs/usage.md deleted file mode 100644 index c8466fc9..00000000 --- a/docs/usage.md +++ /dev/null @@ -1,60 +0,0 @@ -# Usage Service - - -```http request -GET https://cloud.appwrite.io/v1/usage/events -``` - -** Aggregate usage event metrics. `metric` is required. - -**Two response shapes**: -- Omit `interval` for a flat top-N table — one row per dimension combination, no time axis. Useful for "top 10 paths by bandwidth in the last 7 days". -- Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one row per (time bucket × dimension combination). - -`dimensions[]` breaks each row down by one or more attributes (service, path, status, country, …). `resource` and `resourceId` filter the underlying events. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N by aggregated value. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| metric | string | **Required** Metric name (required). Example: executions, network.requests. | | -| resource | string | Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project. | | -| resourceId | string | Resource id filter. | | -| interval | string | Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d. | | -| dimensions | array | Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId. | [] | -| startAt | string | Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate). | | -| endAt | string | Range end in ISO 8601. Defaults to the current time. | | -| orderBy | string | Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value. | time | -| orderDir | string | Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first. | desc | -| limit | integer | Maximum rows to return (1-5000). | 500 | -| offset | integer | Pagination offset (0-100000). | 0 | - - -```http request -GET https://cloud.appwrite.io/v1/usage/gauges -``` - -** Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each group carries the latest snapshot in its interval via `argMax(value, time)`. `metric` is required. - -**Two response shapes**: -- Omit `interval` for a flat top-N table — `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for "top 10 resources by current storage". -- Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination). - -`dimensions[]` breaks each row down further — only `resourceId` and `teamId` are supported on gauges. `resourceId` and `teamId` parameters filter the underlying rows. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| metric | string | **Required** Metric name (required). Example: files.storage, deployments.storage. | | -| resourceId | string | Resource id filter. | | -| teamId | string | Team id filter. | | -| interval | string | Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d. | | -| dimensions | array | Break-down dimensions. Allowed: resourceId, teamId. | [] | -| startAt | string | Range start in ISO 8601. Defaults to endAt - 7d. | | -| endAt | string | Range end in ISO 8601. Defaults to the current time. | | -| orderBy | string | Column to order by. Allowed: time, value. Default time. | time | -| orderDir | string | Sort direction: asc or desc. Default desc — paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting. | desc | -| limit | integer | Maximum rows to return (1-5000). | 500 | -| offset | integer | Pagination offset (0-100000). | 0 | - diff --git a/docs/users.md b/docs/users.md index 5c246265..02d1d014 100644 --- a/docs/users.md +++ b/docs/users.md @@ -11,7 +11,7 @@ GET https://cloud.appwrite.io/v1/users | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator | [] | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | | total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 0242bc6b..2787f561 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -2,6 +2,8 @@ namespace Appwrite; +use Ahc\Jwt\JWT; + class Client { const METHOD_GET = 'GET'; @@ -15,6 +17,7 @@ class Client const METHOD_TRACE = 'TRACE'; const CHUNK_SIZE = 5 * 1024 * 1024; + const JWT_MAX_AGE_SECONDS = 3600; /** * Is Self Signed Certificates Allowed? @@ -37,11 +40,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/26.1.0 ()', + 'user-agent' => 'AppwritePHPSDK/27.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '26.1.0', + 'x-sdk-version'=> '27.0.0', ]; /** @@ -51,6 +54,27 @@ class Client */ protected array $config = []; + /** + * API key for JWT generation + * + * @var string|null + */ + protected ?string $key = null; + + /** + * Cached authorization header value + * + * @var string|null + */ + protected ?string $authorization = null; + + /** + * Authorization header expiry time + * + * @var \DateTime|null + */ + protected ?\DateTime $authorizationExpiresAt = null; + /** * Timeout in seconds * @@ -124,6 +148,26 @@ public function setJWT(string $value): Client return $this; } + /** + * Set Bearer + * + * The OAuth access token to authenticate with + * + * @param string $value + * + * @return Client + */ + public function setBearer(string $value): Client + { + $this->addHeader('Authorization', $value); + $this->config['bearer'] = $value; + $this->key = null; + $this->authorization = null; + $this->authorizationExpiresAt = null; + + return $this; + } + /** * Set Locale * @@ -258,6 +302,25 @@ public function setImpersonateUserPhone(string $value): Client return $this; } + /** + * Set Signing Key + * + * Set a secret key used to self-sign short-lived JWTs for the Authorization header + * + * @param string $key + * + * @return Client + */ + public function setSigningKey(string $key): Client + { + $this->key = $key; + $this->authorization = null; + $this->authorizationExpiresAt = null; + unset($this->headers['authorization'], $this->config['bearer']); + + return $this; + } + public function getConfig(string $key): string { @@ -334,6 +397,25 @@ public function getHeaders(): array return $this->headers; } + /** + * Get authorization header, generating a new JWT if needed + * + * @return string + */ + private function getAuthorization(): string + { + if (\is_string($this->authorization) && $this->authorizationExpiresAt > new \DateTime()) { + return $this->authorization; + } + + $jwt = new JWT($this->key, maxAge: self::JWT_MAX_AGE_SECONDS); + $this->authorization = "Bearer {$jwt->encode([])}"; + + $this->authorizationExpiresAt = (new \DateTime())->modify('+' . (self::JWT_MAX_AGE_SECONDS - 5) . ' seconds'); + + return $this->authorization; + } + /** * Call * @@ -354,6 +436,9 @@ public function call( ?string $responseType = null ) { + if ($this->key !== null) { + $this->headers['authorization'] = $this->getAuthorization(); + } $headers = array_merge($this->headers, $headers); $querySeparator = str_contains($path, '?') ? '&' : '?'; $ch = curl_init($this->endpoint . $path . (($method == self::METHOD_GET && !empty($params)) ? $querySeparator . http_build_query($params) : '')); diff --git a/src/Appwrite/Enums/BillingPlanGroup.php b/src/Appwrite/Enums/BillingPlanGroup.php new file mode 100644 index 00000000..a58d7e91 --- /dev/null +++ b/src/Appwrite/Enums/BillingPlanGroup.php @@ -0,0 +1,61 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function STARTER(): BillingPlanGroup + { + if (!isset(self::$STARTER)) { + self::$STARTER = new BillingPlanGroup('starter'); + } + return self::$STARTER; + } + public static function PRO(): BillingPlanGroup + { + if (!isset(self::$PRO)) { + self::$PRO = new BillingPlanGroup('pro'); + } + return self::$PRO; + } + public static function SCALE(): BillingPlanGroup + { + if (!isset(self::$SCALE)) { + self::$SCALE = new BillingPlanGroup('scale'); + } + return self::$SCALE; + } + + public static function from(string $value): self + { + return match ($value) { + 'starter' => self::STARTER(), + 'pro' => self::PRO(), + 'scale' => self::SCALE(), + default => throw new \InvalidArgumentException('Unknown BillingPlanGroup value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/DatabaseStatus.php b/src/Appwrite/Enums/DatabaseStatus.php new file mode 100644 index 00000000..0555a062 --- /dev/null +++ b/src/Appwrite/Enums/DatabaseStatus.php @@ -0,0 +1,61 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function PROVISIONING(): DatabaseStatus + { + if (!isset(self::$PROVISIONING)) { + self::$PROVISIONING = new DatabaseStatus('provisioning'); + } + return self::$PROVISIONING; + } + public static function READY(): DatabaseStatus + { + if (!isset(self::$READY)) { + self::$READY = new DatabaseStatus('ready'); + } + return self::$READY; + } + public static function FAILED(): DatabaseStatus + { + if (!isset(self::$FAILED)) { + self::$FAILED = new DatabaseStatus('failed'); + } + return self::$FAILED; + } + + public static function from(string $value): self + { + return match ($value) { + 'provisioning' => self::PROVISIONING(), + 'ready' => self::READY(), + 'failed' => self::FAILED(), + default => throw new \InvalidArgumentException('Unknown DatabaseStatus value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/HealthAntivirusStatus.php b/src/Appwrite/Enums/HealthAntivirusStatus.php deleted file mode 100644 index edee6045..00000000 --- a/src/Appwrite/Enums/HealthAntivirusStatus.php +++ /dev/null @@ -1,61 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function DISABLED(): HealthAntivirusStatus - { - if (!isset(self::$DISABLED)) { - self::$DISABLED = new HealthAntivirusStatus('disabled'); - } - return self::$DISABLED; - } - public static function OFFLINE(): HealthAntivirusStatus - { - if (!isset(self::$OFFLINE)) { - self::$OFFLINE = new HealthAntivirusStatus('offline'); - } - return self::$OFFLINE; - } - public static function ONLINE(): HealthAntivirusStatus - { - if (!isset(self::$ONLINE)) { - self::$ONLINE = new HealthAntivirusStatus('online'); - } - return self::$ONLINE; - } - - public static function from(string $value): self - { - return match ($value) { - 'disabled' => self::DISABLED(), - 'offline' => self::OFFLINE(), - 'online' => self::ONLINE(), - default => throw new \InvalidArgumentException('Unknown HealthAntivirusStatus value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/HealthCheckStatus.php b/src/Appwrite/Enums/HealthCheckStatus.php deleted file mode 100644 index 8d36ec4e..00000000 --- a/src/Appwrite/Enums/HealthCheckStatus.php +++ /dev/null @@ -1,52 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function PASS(): HealthCheckStatus - { - if (!isset(self::$PASS)) { - self::$PASS = new HealthCheckStatus('pass'); - } - return self::$PASS; - } - public static function FAIL(): HealthCheckStatus - { - if (!isset(self::$FAIL)) { - self::$FAIL = new HealthCheckStatus('fail'); - } - return self::$FAIL; - } - - public static function from(string $value): self - { - return match ($value) { - 'pass' => self::PASS(), - 'fail' => self::FAIL(), - default => throw new \InvalidArgumentException('Unknown HealthCheckStatus value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/HealthQueueName.php b/src/Appwrite/Enums/HealthQueueName.php deleted file mode 100644 index e03d7c81..00000000 --- a/src/Appwrite/Enums/HealthQueueName.php +++ /dev/null @@ -1,151 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function V1DATABASE(): HealthQueueName - { - if (!isset(self::$V1DATABASE)) { - self::$V1DATABASE = new HealthQueueName('v1-database'); - } - return self::$V1DATABASE; - } - public static function V1DELETES(): HealthQueueName - { - if (!isset(self::$V1DELETES)) { - self::$V1DELETES = new HealthQueueName('v1-deletes'); - } - return self::$V1DELETES; - } - public static function V1AUDITS(): HealthQueueName - { - if (!isset(self::$V1AUDITS)) { - self::$V1AUDITS = new HealthQueueName('v1-audits'); - } - return self::$V1AUDITS; - } - public static function V1MAILS(): HealthQueueName - { - if (!isset(self::$V1MAILS)) { - self::$V1MAILS = new HealthQueueName('v1-mails'); - } - return self::$V1MAILS; - } - public static function V1FUNCTIONS(): HealthQueueName - { - if (!isset(self::$V1FUNCTIONS)) { - self::$V1FUNCTIONS = new HealthQueueName('v1-functions'); - } - return self::$V1FUNCTIONS; - } - public static function V1STATSRESOURCES(): HealthQueueName - { - if (!isset(self::$V1STATSRESOURCES)) { - self::$V1STATSRESOURCES = new HealthQueueName('v1-stats-resources'); - } - return self::$V1STATSRESOURCES; - } - public static function V1STATSUSAGE(): HealthQueueName - { - if (!isset(self::$V1STATSUSAGE)) { - self::$V1STATSUSAGE = new HealthQueueName('v1-stats-usage'); - } - return self::$V1STATSUSAGE; - } - public static function V1WEBHOOKS(): HealthQueueName - { - if (!isset(self::$V1WEBHOOKS)) { - self::$V1WEBHOOKS = new HealthQueueName('v1-webhooks'); - } - return self::$V1WEBHOOKS; - } - public static function V1CERTIFICATES(): HealthQueueName - { - if (!isset(self::$V1CERTIFICATES)) { - self::$V1CERTIFICATES = new HealthQueueName('v1-certificates'); - } - return self::$V1CERTIFICATES; - } - public static function V1BUILDS(): HealthQueueName - { - if (!isset(self::$V1BUILDS)) { - self::$V1BUILDS = new HealthQueueName('v1-builds'); - } - return self::$V1BUILDS; - } - public static function V1SCREENSHOTS(): HealthQueueName - { - if (!isset(self::$V1SCREENSHOTS)) { - self::$V1SCREENSHOTS = new HealthQueueName('v1-screenshots'); - } - return self::$V1SCREENSHOTS; - } - public static function V1MESSAGING(): HealthQueueName - { - if (!isset(self::$V1MESSAGING)) { - self::$V1MESSAGING = new HealthQueueName('v1-messaging'); - } - return self::$V1MESSAGING; - } - public static function V1MIGRATIONS(): HealthQueueName - { - if (!isset(self::$V1MIGRATIONS)) { - self::$V1MIGRATIONS = new HealthQueueName('v1-migrations'); - } - return self::$V1MIGRATIONS; - } - - public static function from(string $value): self - { - return match ($value) { - 'v1-database' => self::V1DATABASE(), - 'v1-deletes' => self::V1DELETES(), - 'v1-audits' => self::V1AUDITS(), - 'v1-mails' => self::V1MAILS(), - 'v1-functions' => self::V1FUNCTIONS(), - 'v1-stats-resources' => self::V1STATSRESOURCES(), - 'v1-stats-usage' => self::V1STATSUSAGE(), - 'v1-webhooks' => self::V1WEBHOOKS(), - 'v1-certificates' => self::V1CERTIFICATES(), - 'v1-builds' => self::V1BUILDS(), - 'v1-screenshots' => self::V1SCREENSHOTS(), - 'v1-messaging' => self::V1MESSAGING(), - 'v1-migrations' => self::V1MIGRATIONS(), - default => throw new \InvalidArgumentException('Unknown HealthQueueName value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/OAuth2OidcPrompt.php b/src/Appwrite/Enums/OAuth2OidcPrompt.php new file mode 100644 index 00000000..bbdad5ad --- /dev/null +++ b/src/Appwrite/Enums/OAuth2OidcPrompt.php @@ -0,0 +1,70 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NONE(): OAuth2OidcPrompt + { + if (!isset(self::$NONE)) { + self::$NONE = new OAuth2OidcPrompt('none'); + } + return self::$NONE; + } + public static function LOGIN(): OAuth2OidcPrompt + { + if (!isset(self::$LOGIN)) { + self::$LOGIN = new OAuth2OidcPrompt('login'); + } + return self::$LOGIN; + } + public static function CONSENT(): OAuth2OidcPrompt + { + if (!isset(self::$CONSENT)) { + self::$CONSENT = new OAuth2OidcPrompt('consent'); + } + return self::$CONSENT; + } + public static function SELECTACCOUNT(): OAuth2OidcPrompt + { + if (!isset(self::$SELECTACCOUNT)) { + self::$SELECTACCOUNT = new OAuth2OidcPrompt('select_account'); + } + return self::$SELECTACCOUNT; + } + + public static function from(string $value): self + { + return match ($value) { + 'none' => self::NONE(), + 'login' => self::LOGIN(), + 'consent' => self::CONSENT(), + 'select_account' => self::SELECTACCOUNT(), + default => throw new \InvalidArgumentException('Unknown OAuth2OidcPrompt value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/OAuthProvider.php b/src/Appwrite/Enums/OAuthProvider.php index 4763c082..decb1d46 100644 --- a/src/Appwrite/Enums/OAuthProvider.php +++ b/src/Appwrite/Enums/OAuthProvider.php @@ -8,6 +8,7 @@ class OAuthProvider implements JsonSerializable { private static OAuthProvider $AMAZON; private static OAuthProvider $APPLE; + private static OAuthProvider $APPWRITE; private static OAuthProvider $AUTH0; private static OAuthProvider $AUTHENTIK; private static OAuthProvider $AUTODESK; @@ -81,6 +82,13 @@ public static function APPLE(): OAuthProvider } return self::$APPLE; } + public static function APPWRITE(): OAuthProvider + { + if (!isset(self::$APPWRITE)) { + self::$APPWRITE = new OAuthProvider('appwrite'); + } + return self::$APPWRITE; + } public static function AUTH0(): OAuthProvider { if (!isset(self::$AUTH0)) { @@ -374,6 +382,7 @@ public static function from(string $value): self return match ($value) { 'amazon' => self::AMAZON(), 'apple' => self::APPLE(), + 'appwrite' => self::APPWRITE(), 'auth0' => self::AUTH0(), 'authentik' => self::AUTHENTIK(), 'autodesk' => self::AUTODESK(), diff --git a/src/Appwrite/Enums/OrganizationKeyScopes.php b/src/Appwrite/Enums/OrganizationKeyScopes.php index b013d0f2..7bf3987f 100644 --- a/src/Appwrite/Enums/OrganizationKeyScopes.php +++ b/src/Appwrite/Enums/OrganizationKeyScopes.php @@ -12,6 +12,10 @@ class OrganizationKeyScopes implements JsonSerializable private static OrganizationKeyScopes $DEVKEYSWRITE; private static OrganizationKeyScopes $ORGANIZATIONKEYSREAD; private static OrganizationKeyScopes $ORGANIZATIONKEYSWRITE; + private static OrganizationKeyScopes $ORGANIZATIONMEMBERSHIPSREAD; + private static OrganizationKeyScopes $ORGANIZATIONMEMBERSHIPSWRITE; + private static OrganizationKeyScopes $ORGANIZATIONREAD; + private static OrganizationKeyScopes $ORGANIZATIONWRITE; private static OrganizationKeyScopes $DOMAINSREAD; private static OrganizationKeyScopes $DOMAINSWRITE; private static OrganizationKeyScopes $KEYSREAD; @@ -76,6 +80,34 @@ public static function ORGANIZATIONKEYSWRITE(): OrganizationKeyScopes } return self::$ORGANIZATIONKEYSWRITE; } + public static function ORGANIZATIONMEMBERSHIPSREAD(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONMEMBERSHIPSREAD)) { + self::$ORGANIZATIONMEMBERSHIPSREAD = new OrganizationKeyScopes('organization.memberships.read'); + } + return self::$ORGANIZATIONMEMBERSHIPSREAD; + } + public static function ORGANIZATIONMEMBERSHIPSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONMEMBERSHIPSWRITE)) { + self::$ORGANIZATIONMEMBERSHIPSWRITE = new OrganizationKeyScopes('organization.memberships.write'); + } + return self::$ORGANIZATIONMEMBERSHIPSWRITE; + } + public static function ORGANIZATIONREAD(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONREAD)) { + self::$ORGANIZATIONREAD = new OrganizationKeyScopes('organization.read'); + } + return self::$ORGANIZATIONREAD; + } + public static function ORGANIZATIONWRITE(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONWRITE)) { + self::$ORGANIZATIONWRITE = new OrganizationKeyScopes('organization.write'); + } + return self::$ORGANIZATIONWRITE; + } public static function DOMAINSREAD(): OrganizationKeyScopes { if (!isset(self::$DOMAINSREAD)) { @@ -114,6 +146,10 @@ public static function from(string $value): self 'devKeys.write' => self::DEVKEYSWRITE(), 'organization.keys.read' => self::ORGANIZATIONKEYSREAD(), 'organization.keys.write' => self::ORGANIZATIONKEYSWRITE(), + 'organization.memberships.read' => self::ORGANIZATIONMEMBERSHIPSREAD(), + 'organization.memberships.write' => self::ORGANIZATIONMEMBERSHIPSWRITE(), + 'organization.read' => self::ORGANIZATIONREAD(), + 'organization.write' => self::ORGANIZATIONWRITE(), 'domains.read' => self::DOMAINSREAD(), 'domains.write' => self::DOMAINSWRITE(), 'keys.read' => self::KEYSREAD(), diff --git a/src/Appwrite/Enums/ProjectKeyScopes.php b/src/Appwrite/Enums/ProjectKeyScopes.php index 2c78383f..c087a037 100644 --- a/src/Appwrite/Enums/ProjectKeyScopes.php +++ b/src/Appwrite/Enums/ProjectKeyScopes.php @@ -18,10 +18,12 @@ class ProjectKeyScopes implements JsonSerializable private static ProjectKeyScopes $POLICIESWRITE; private static ProjectKeyScopes $PROJECTPOLICIESREAD; private static ProjectKeyScopes $PROJECTPOLICIESWRITE; + private static ProjectKeyScopes $PROJECTOAUTH2READ; + private static ProjectKeyScopes $PROJECTOAUTH2WRITE; private static ProjectKeyScopes $TEMPLATESREAD; private static ProjectKeyScopes $TEMPLATESWRITE; - private static ProjectKeyScopes $OAUTH2READ; - private static ProjectKeyScopes $OAUTH2WRITE; + private static ProjectKeyScopes $STAGESREAD; + private static ProjectKeyScopes $STAGESWRITE; private static ProjectKeyScopes $USERSREAD; private static ProjectKeyScopes $USERSWRITE; private static ProjectKeyScopes $SESSIONSREAD; @@ -102,6 +104,8 @@ class ProjectKeyScopes implements JsonSerializable private static ProjectKeyScopes $EVENTSREAD; private static ProjectKeyScopes $APPSREAD; private static ProjectKeyScopes $APPSWRITE; + private static ProjectKeyScopes $OAUTH2READ; + private static ProjectKeyScopes $OAUTH2WRITE; private static ProjectKeyScopes $USAGEREAD; private string $value; @@ -205,6 +209,20 @@ public static function PROJECTPOLICIESWRITE(): ProjectKeyScopes } return self::$PROJECTPOLICIESWRITE; } + public static function PROJECTOAUTH2READ(): ProjectKeyScopes + { + if (!isset(self::$PROJECTOAUTH2READ)) { + self::$PROJECTOAUTH2READ = new ProjectKeyScopes('project.oauth2.read'); + } + return self::$PROJECTOAUTH2READ; + } + public static function PROJECTOAUTH2WRITE(): ProjectKeyScopes + { + if (!isset(self::$PROJECTOAUTH2WRITE)) { + self::$PROJECTOAUTH2WRITE = new ProjectKeyScopes('project.oauth2.write'); + } + return self::$PROJECTOAUTH2WRITE; + } public static function TEMPLATESREAD(): ProjectKeyScopes { if (!isset(self::$TEMPLATESREAD)) { @@ -219,19 +237,19 @@ public static function TEMPLATESWRITE(): ProjectKeyScopes } return self::$TEMPLATESWRITE; } - public static function OAUTH2READ(): ProjectKeyScopes + public static function STAGESREAD(): ProjectKeyScopes { - if (!isset(self::$OAUTH2READ)) { - self::$OAUTH2READ = new ProjectKeyScopes('oauth2.read'); + if (!isset(self::$STAGESREAD)) { + self::$STAGESREAD = new ProjectKeyScopes('stages.read'); } - return self::$OAUTH2READ; + return self::$STAGESREAD; } - public static function OAUTH2WRITE(): ProjectKeyScopes + public static function STAGESWRITE(): ProjectKeyScopes { - if (!isset(self::$OAUTH2WRITE)) { - self::$OAUTH2WRITE = new ProjectKeyScopes('oauth2.write'); + if (!isset(self::$STAGESWRITE)) { + self::$STAGESWRITE = new ProjectKeyScopes('stages.write'); } - return self::$OAUTH2WRITE; + return self::$STAGESWRITE; } public static function USERSREAD(): ProjectKeyScopes { @@ -793,6 +811,20 @@ public static function APPSWRITE(): ProjectKeyScopes } return self::$APPSWRITE; } + public static function OAUTH2READ(): ProjectKeyScopes + { + if (!isset(self::$OAUTH2READ)) { + self::$OAUTH2READ = new ProjectKeyScopes('oauth2.read'); + } + return self::$OAUTH2READ; + } + public static function OAUTH2WRITE(): ProjectKeyScopes + { + if (!isset(self::$OAUTH2WRITE)) { + self::$OAUTH2WRITE = new ProjectKeyScopes('oauth2.write'); + } + return self::$OAUTH2WRITE; + } public static function USAGEREAD(): ProjectKeyScopes { if (!isset(self::$USAGEREAD)) { @@ -816,10 +848,12 @@ public static function from(string $value): self 'policies.write' => self::POLICIESWRITE(), 'project.policies.read' => self::PROJECTPOLICIESREAD(), 'project.policies.write' => self::PROJECTPOLICIESWRITE(), + 'project.oauth2.read' => self::PROJECTOAUTH2READ(), + 'project.oauth2.write' => self::PROJECTOAUTH2WRITE(), 'templates.read' => self::TEMPLATESREAD(), 'templates.write' => self::TEMPLATESWRITE(), - 'oauth2.read' => self::OAUTH2READ(), - 'oauth2.write' => self::OAUTH2WRITE(), + 'stages.read' => self::STAGESREAD(), + 'stages.write' => self::STAGESWRITE(), 'users.read' => self::USERSREAD(), 'users.write' => self::USERSWRITE(), 'sessions.read' => self::SESSIONSREAD(), @@ -900,6 +934,8 @@ public static function from(string $value): self 'events.read' => self::EVENTSREAD(), 'apps.read' => self::APPSREAD(), 'apps.write' => self::APPSWRITE(), + 'oauth2.read' => self::OAUTH2READ(), + 'oauth2.write' => self::OAUTH2WRITE(), 'usage.read' => self::USAGEREAD(), default => throw new \InvalidArgumentException('Unknown ProjectKeyScopes value: ' . $value), }; diff --git a/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php new file mode 100644 index 00000000..867ee098 --- /dev/null +++ b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php @@ -0,0 +1,70 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NONE(): ProjectOAuth2OidcPrompt + { + if (!isset(self::$NONE)) { + self::$NONE = new ProjectOAuth2OidcPrompt('none'); + } + return self::$NONE; + } + public static function LOGIN(): ProjectOAuth2OidcPrompt + { + if (!isset(self::$LOGIN)) { + self::$LOGIN = new ProjectOAuth2OidcPrompt('login'); + } + return self::$LOGIN; + } + public static function CONSENT(): ProjectOAuth2OidcPrompt + { + if (!isset(self::$CONSENT)) { + self::$CONSENT = new ProjectOAuth2OidcPrompt('consent'); + } + return self::$CONSENT; + } + public static function SELECTACCOUNT(): ProjectOAuth2OidcPrompt + { + if (!isset(self::$SELECTACCOUNT)) { + self::$SELECTACCOUNT = new ProjectOAuth2OidcPrompt('select_account'); + } + return self::$SELECTACCOUNT; + } + + public static function from(string $value): self + { + return match ($value) { + 'none' => self::NONE(), + 'login' => self::LOGIN(), + 'consent' => self::CONSENT(), + 'select_account' => self::SELECTACCOUNT(), + default => throw new \InvalidArgumentException('Unknown ProjectOAuth2OidcPrompt value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/ProjectOAuthProviderId.php b/src/Appwrite/Enums/ProjectOAuthProviderId.php index a9325a75..7f697114 100644 --- a/src/Appwrite/Enums/ProjectOAuthProviderId.php +++ b/src/Appwrite/Enums/ProjectOAuthProviderId.php @@ -8,6 +8,7 @@ class ProjectOAuthProviderId implements JsonSerializable { private static ProjectOAuthProviderId $AMAZON; private static ProjectOAuthProviderId $APPLE; + private static ProjectOAuthProviderId $APPWRITE; private static ProjectOAuthProviderId $AUTH0; private static ProjectOAuthProviderId $AUTHENTIK; private static ProjectOAuthProviderId $AUTODESK; @@ -81,6 +82,13 @@ public static function APPLE(): ProjectOAuthProviderId } return self::$APPLE; } + public static function APPWRITE(): ProjectOAuthProviderId + { + if (!isset(self::$APPWRITE)) { + self::$APPWRITE = new ProjectOAuthProviderId('appwrite'); + } + return self::$APPWRITE; + } public static function AUTH0(): ProjectOAuthProviderId { if (!isset(self::$AUTH0)) { @@ -374,6 +382,7 @@ public static function from(string $value): self return match ($value) { 'amazon' => self::AMAZON(), 'apple' => self::APPLE(), + 'appwrite' => self::APPWRITE(), 'auth0' => self::AUTH0(), 'authentik' => self::AUTHENTIK(), 'autodesk' => self::AUTODESK(), diff --git a/src/Appwrite/Models/ActivityEvent.php b/src/Appwrite/Models/ActivityEvent.php index 287011dd..5c6429ab 100644 --- a/src/Appwrite/Models/ActivityEvent.php +++ b/src/Appwrite/Models/ActivityEvent.php @@ -30,8 +30,6 @@ * @param string $projectId project id. * @param string $teamId team id. * @param string $hostname hostname. - * @param string $countryCode country two-character iso 3166-1 alpha code. - * @param string $countryName country name. */ public function __construct( public string $id, @@ -51,9 +49,7 @@ public function __construct( public string $time, public string $projectId, public string $teamId, - public string $hostname, - public string $countryCode, - public string $countryName + public string $hostname ) { } @@ -116,12 +112,6 @@ public static function from(array $data): static if (!array_key_exists('hostname', $data)) { throw new \InvalidArgumentException('Missing required field "hostname" for ' . static::class . '.'); } - if (!array_key_exists('countryCode', $data)) { - throw new \InvalidArgumentException('Missing required field "countryCode" for ' . static::class . '.'); - } - if (!array_key_exists('countryName', $data)) { - throw new \InvalidArgumentException('Missing required field "countryName" for ' . static::class . '.'); - } return new static( id: $data['$id'], @@ -141,9 +131,7 @@ public static function from(array $data): static time: $data['time'], projectId: $data['projectId'], teamId: $data['teamId'], - hostname: $data['hostname'], - countryCode: $data['countryCode'], - countryName: $data['countryName'] + hostname: $data['hostname'] ); } @@ -170,9 +158,7 @@ public function toArray(): array 'time' => static::serializeValue($this->time), 'projectId' => static::serializeValue($this->projectId), 'teamId' => static::serializeValue($this->teamId), - 'hostname' => static::serializeValue($this->hostname), - 'countryCode' => static::serializeValue($this->countryCode), - 'countryName' => static::serializeValue($this->countryName) + 'hostname' => static::serializeValue($this->hostname) ]; return $result; diff --git a/src/Appwrite/Models/AdditionalResource.php b/src/Appwrite/Models/AdditionalResource.php new file mode 100644 index 00000000..22ccf01a --- /dev/null +++ b/src/Appwrite/Models/AdditionalResource.php @@ -0,0 +1,82 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('unit', $data)) { + throw new \InvalidArgumentException('Missing required field "unit" for ' . static::class . '.'); + } + if (!array_key_exists('currency', $data)) { + throw new \InvalidArgumentException('Missing required field "currency" for ' . static::class . '.'); + } + if (!array_key_exists('price', $data)) { + throw new \InvalidArgumentException('Missing required field "price" for ' . static::class . '.'); + } + if (!array_key_exists('value', $data)) { + throw new \InvalidArgumentException('Missing required field "value" for ' . static::class . '.'); + } + if (!array_key_exists('invoiceDesc', $data)) { + throw new \InvalidArgumentException('Missing required field "invoiceDesc" for ' . static::class . '.'); + } + + return new static( + name: $data['name'], + unit: $data['unit'], + currency: $data['currency'], + price: $data['price'], + value: $data['value'], + invoiceDesc: $data['invoiceDesc'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'name' => static::serializeValue($this->name), + 'unit' => static::serializeValue($this->unit), + 'currency' => static::serializeValue($this->currency), + 'price' => static::serializeValue($this->price), + 'value' => static::serializeValue($this->value), + 'invoiceDesc' => static::serializeValue($this->invoiceDesc) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlan.php b/src/Appwrite/Models/BillingPlan.php new file mode 100644 index 00000000..dcfd652e --- /dev/null +++ b/src/Appwrite/Models/BillingPlan.php @@ -0,0 +1,506 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('desc', $data)) { + throw new \InvalidArgumentException('Missing required field "desc" for ' . static::class . '.'); + } + if (!array_key_exists('order', $data)) { + throw new \InvalidArgumentException('Missing required field "order" for ' . static::class . '.'); + } + if (!array_key_exists('price', $data)) { + throw new \InvalidArgumentException('Missing required field "price" for ' . static::class . '.'); + } + if (!array_key_exists('trial', $data)) { + throw new \InvalidArgumentException('Missing required field "trial" for ' . static::class . '.'); + } + if (!array_key_exists('bandwidth', $data)) { + throw new \InvalidArgumentException('Missing required field "bandwidth" for ' . static::class . '.'); + } + if (!array_key_exists('storage', $data)) { + throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.'); + } + if (!array_key_exists('imageTransformations', $data)) { + throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.'); + } + if (!array_key_exists('screenshotsGenerated', $data)) { + throw new \InvalidArgumentException('Missing required field "screenshotsGenerated" for ' . static::class . '.'); + } + if (!array_key_exists('members', $data)) { + throw new \InvalidArgumentException('Missing required field "members" for ' . static::class . '.'); + } + if (!array_key_exists('webhooks', $data)) { + throw new \InvalidArgumentException('Missing required field "webhooks" for ' . static::class . '.'); + } + if (!array_key_exists('projects', $data)) { + throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); + } + if (!array_key_exists('platforms', $data)) { + throw new \InvalidArgumentException('Missing required field "platforms" for ' . static::class . '.'); + } + if (!array_key_exists('users', $data)) { + throw new \InvalidArgumentException('Missing required field "users" for ' . static::class . '.'); + } + if (!array_key_exists('teams', $data)) { + throw new \InvalidArgumentException('Missing required field "teams" for ' . static::class . '.'); + } + if (!array_key_exists('databases', $data)) { + throw new \InvalidArgumentException('Missing required field "databases" for ' . static::class . '.'); + } + if (!array_key_exists('databasesReads', $data)) { + throw new \InvalidArgumentException('Missing required field "databasesReads" for ' . static::class . '.'); + } + if (!array_key_exists('databasesWrites', $data)) { + throw new \InvalidArgumentException('Missing required field "databasesWrites" for ' . static::class . '.'); + } + if (!array_key_exists('databasesBatchSize', $data)) { + throw new \InvalidArgumentException('Missing required field "databasesBatchSize" for ' . static::class . '.'); + } + if (!array_key_exists('buckets', $data)) { + throw new \InvalidArgumentException('Missing required field "buckets" for ' . static::class . '.'); + } + if (!array_key_exists('fileSize', $data)) { + throw new \InvalidArgumentException('Missing required field "fileSize" for ' . static::class . '.'); + } + if (!array_key_exists('functions', $data)) { + throw new \InvalidArgumentException('Missing required field "functions" for ' . static::class . '.'); + } + if (!array_key_exists('sites', $data)) { + throw new \InvalidArgumentException('Missing required field "sites" for ' . static::class . '.'); + } + if (!array_key_exists('executions', $data)) { + throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.'); + } + if (!array_key_exists('executionsRetentionCount', $data)) { + throw new \InvalidArgumentException('Missing required field "executionsRetentionCount" for ' . static::class . '.'); + } + if (!array_key_exists('GBHours', $data)) { + throw new \InvalidArgumentException('Missing required field "GBHours" for ' . static::class . '.'); + } + if (!array_key_exists('realtime', $data)) { + throw new \InvalidArgumentException('Missing required field "realtime" for ' . static::class . '.'); + } + if (!array_key_exists('realtimeMessages', $data)) { + throw new \InvalidArgumentException('Missing required field "realtimeMessages" for ' . static::class . '.'); + } + if (!array_key_exists('messages', $data)) { + throw new \InvalidArgumentException('Missing required field "messages" for ' . static::class . '.'); + } + if (!array_key_exists('topics', $data)) { + throw new \InvalidArgumentException('Missing required field "topics" for ' . static::class . '.'); + } + if (!array_key_exists('authPhone', $data)) { + throw new \InvalidArgumentException('Missing required field "authPhone" for ' . static::class . '.'); + } + if (!array_key_exists('domains', $data)) { + throw new \InvalidArgumentException('Missing required field "domains" for ' . static::class . '.'); + } + if (!array_key_exists('activityLogs', $data)) { + throw new \InvalidArgumentException('Missing required field "activityLogs" for ' . static::class . '.'); + } + if (!array_key_exists('usageLogs', $data)) { + throw new \InvalidArgumentException('Missing required field "usageLogs" for ' . static::class . '.'); + } + if (!array_key_exists('projectInactivityDays', $data)) { + throw new \InvalidArgumentException('Missing required field "projectInactivityDays" for ' . static::class . '.'); + } + if (!array_key_exists('alertLimit', $data)) { + throw new \InvalidArgumentException('Missing required field "alertLimit" for ' . static::class . '.'); + } + if (!array_key_exists('usage', $data)) { + throw new \InvalidArgumentException('Missing required field "usage" for ' . static::class . '.'); + } + if (!array_key_exists('addons', $data)) { + throw new \InvalidArgumentException('Missing required field "addons" for ' . static::class . '.'); + } + if (!array_key_exists('budgetCapEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "budgetCapEnabled" for ' . static::class . '.'); + } + if (!array_key_exists('customSmtp', $data)) { + throw new \InvalidArgumentException('Missing required field "customSmtp" for ' . static::class . '.'); + } + if (!array_key_exists('emailBranding', $data)) { + throw new \InvalidArgumentException('Missing required field "emailBranding" for ' . static::class . '.'); + } + if (!array_key_exists('requiresPaymentMethod', $data)) { + throw new \InvalidArgumentException('Missing required field "requiresPaymentMethod" for ' . static::class . '.'); + } + if (!array_key_exists('requiresBillingAddress', $data)) { + throw new \InvalidArgumentException('Missing required field "requiresBillingAddress" for ' . static::class . '.'); + } + if (!array_key_exists('isAvailable', $data)) { + throw new \InvalidArgumentException('Missing required field "isAvailable" for ' . static::class . '.'); + } + if (!array_key_exists('selfService', $data)) { + throw new \InvalidArgumentException('Missing required field "selfService" for ' . static::class . '.'); + } + if (!array_key_exists('premiumSupport', $data)) { + throw new \InvalidArgumentException('Missing required field "premiumSupport" for ' . static::class . '.'); + } + if (!array_key_exists('budgeting', $data)) { + throw new \InvalidArgumentException('Missing required field "budgeting" for ' . static::class . '.'); + } + if (!array_key_exists('supportsMockNumbers', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsMockNumbers" for ' . static::class . '.'); + } + if (!array_key_exists('supportsOrganizationRoles', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsOrganizationRoles" for ' . static::class . '.'); + } + if (!array_key_exists('supportsCredits', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsCredits" for ' . static::class . '.'); + } + if (!array_key_exists('supportsDisposableEmailValidation', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsDisposableEmailValidation" for ' . static::class . '.'); + } + if (!array_key_exists('supportsCanonicalEmailValidation', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsCanonicalEmailValidation" for ' . static::class . '.'); + } + if (!array_key_exists('supportsFreeEmailValidation', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsFreeEmailValidation" for ' . static::class . '.'); + } + if (!array_key_exists('supportsCorporateEmailValidation', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsCorporateEmailValidation" for ' . static::class . '.'); + } + if (!array_key_exists('supportsProjectSpecificRoles', $data)) { + throw new \InvalidArgumentException('Missing required field "supportsProjectSpecificRoles" for ' . static::class . '.'); + } + if (!array_key_exists('backupsEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "backupsEnabled" for ' . static::class . '.'); + } + if (!array_key_exists('usagePerProject', $data)) { + throw new \InvalidArgumentException('Missing required field "usagePerProject" for ' . static::class . '.'); + } + if (!array_key_exists('supportedAddons', $data)) { + throw new \InvalidArgumentException('Missing required field "supportedAddons" for ' . static::class . '.'); + } + if (!array_key_exists('backupPolicies', $data)) { + throw new \InvalidArgumentException('Missing required field "backupPolicies" for ' . static::class . '.'); + } + if (!array_key_exists('deploymentSize', $data)) { + throw new \InvalidArgumentException('Missing required field "deploymentSize" for ' . static::class . '.'); + } + if (!array_key_exists('buildSize', $data)) { + throw new \InvalidArgumentException('Missing required field "buildSize" for ' . static::class . '.'); + } + if (!array_key_exists('databasesAllowEncrypt', $data)) { + throw new \InvalidArgumentException('Missing required field "databasesAllowEncrypt" for ' . static::class . '.'); + } + if (!array_key_exists('group', $data)) { + throw new \InvalidArgumentException('Missing required field "group" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + name: $data['name'], + desc: $data['desc'], + order: $data['order'], + price: $data['price'], + trial: $data['trial'], + bandwidth: $data['bandwidth'], + storage: $data['storage'], + imageTransformations: $data['imageTransformations'], + screenshotsGenerated: $data['screenshotsGenerated'], + members: $data['members'], + webhooks: $data['webhooks'], + projects: $data['projects'], + platforms: $data['platforms'], + users: $data['users'], + teams: $data['teams'], + databases: $data['databases'], + databasesReads: $data['databasesReads'], + databasesWrites: $data['databasesWrites'], + databasesBatchSize: $data['databasesBatchSize'], + buckets: $data['buckets'], + fileSize: $data['fileSize'], + functions: $data['functions'], + sites: $data['sites'], + executions: $data['executions'], + executionsRetentionCount: $data['executionsRetentionCount'], + gBHours: $data['GBHours'], + realtime: $data['realtime'], + realtimeMessages: $data['realtimeMessages'], + messages: $data['messages'], + topics: $data['topics'], + authPhone: $data['authPhone'], + domains: $data['domains'], + activityLogs: $data['activityLogs'], + usageLogs: $data['usageLogs'], + projectInactivityDays: $data['projectInactivityDays'], + alertLimit: $data['alertLimit'], + usage: static::hydrateTypedValue(UsageBillingPlan::class, $data['usage']), + addons: static::hydrateTypedValue(BillingPlanAddon::class, $data['addons']), + budgetCapEnabled: $data['budgetCapEnabled'], + customSmtp: $data['customSmtp'], + emailBranding: $data['emailBranding'], + requiresPaymentMethod: $data['requiresPaymentMethod'], + requiresBillingAddress: $data['requiresBillingAddress'], + isAvailable: $data['isAvailable'], + selfService: $data['selfService'], + premiumSupport: $data['premiumSupport'], + budgeting: $data['budgeting'], + supportsMockNumbers: $data['supportsMockNumbers'], + supportsOrganizationRoles: $data['supportsOrganizationRoles'], + supportsCredits: $data['supportsCredits'], + supportsDisposableEmailValidation: $data['supportsDisposableEmailValidation'], + supportsCanonicalEmailValidation: $data['supportsCanonicalEmailValidation'], + supportsFreeEmailValidation: $data['supportsFreeEmailValidation'], + supportsCorporateEmailValidation: $data['supportsCorporateEmailValidation'], + supportsProjectSpecificRoles: $data['supportsProjectSpecificRoles'], + backupsEnabled: $data['backupsEnabled'], + usagePerProject: $data['usagePerProject'], + supportedAddons: static::hydrateTypedValue(BillingPlanSupportedAddons::class, $data['supportedAddons']), + backupPolicies: $data['backupPolicies'], + deploymentSize: $data['deploymentSize'], + buildSize: $data['buildSize'], + databasesAllowEncrypt: $data['databasesAllowEncrypt'], + group: static::hydrateTypedValue(BillingPlanGroup::class, $data['group']), + usageLogsIntervals: array_key_exists('usageLogsIntervals', $data) ? $data['usageLogsIntervals'] : null, + limits: array_key_exists('limits', $data) ? static::hydrateTypedValue(BillingPlanLimits::class, $data['limits'], true) : null, + program: array_key_exists('program', $data) ? static::hydrateTypedValue(Program::class, $data['program'], true) : null, + dedicatedDatabases: array_key_exists('dedicatedDatabases', $data) ? static::hydrateTypedValue(BillingPlanDedicatedDatabaseLimits::class, $data['dedicatedDatabases'], true) : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'name' => static::serializeValue($this->name), + 'desc' => static::serializeValue($this->desc), + 'order' => static::serializeValue($this->order), + 'price' => static::serializeValue($this->price), + 'trial' => static::serializeValue($this->trial), + 'bandwidth' => static::serializeValue($this->bandwidth), + 'storage' => static::serializeValue($this->storage), + 'imageTransformations' => static::serializeValue($this->imageTransformations), + 'screenshotsGenerated' => static::serializeValue($this->screenshotsGenerated), + 'members' => static::serializeValue($this->members), + 'webhooks' => static::serializeValue($this->webhooks), + 'projects' => static::serializeValue($this->projects), + 'platforms' => static::serializeValue($this->platforms), + 'users' => static::serializeValue($this->users), + 'teams' => static::serializeValue($this->teams), + 'databases' => static::serializeValue($this->databases), + 'databasesReads' => static::serializeValue($this->databasesReads), + 'databasesWrites' => static::serializeValue($this->databasesWrites), + 'databasesBatchSize' => static::serializeValue($this->databasesBatchSize), + 'buckets' => static::serializeValue($this->buckets), + 'fileSize' => static::serializeValue($this->fileSize), + 'functions' => static::serializeValue($this->functions), + 'sites' => static::serializeValue($this->sites), + 'executions' => static::serializeValue($this->executions), + 'executionsRetentionCount' => static::serializeValue($this->executionsRetentionCount), + 'GBHours' => static::serializeValue($this->gBHours), + 'realtime' => static::serializeValue($this->realtime), + 'realtimeMessages' => static::serializeValue($this->realtimeMessages), + 'messages' => static::serializeValue($this->messages), + 'topics' => static::serializeValue($this->topics), + 'authPhone' => static::serializeValue($this->authPhone), + 'domains' => static::serializeValue($this->domains), + 'activityLogs' => static::serializeValue($this->activityLogs), + 'usageLogs' => static::serializeValue($this->usageLogs), + 'usageLogsIntervals' => static::serializeValue($this->usageLogsIntervals), + 'projectInactivityDays' => static::serializeValue($this->projectInactivityDays), + 'alertLimit' => static::serializeValue($this->alertLimit), + 'usage' => static::serializeValue($this->usage), + 'addons' => static::serializeValue($this->addons), + 'budgetCapEnabled' => static::serializeValue($this->budgetCapEnabled), + 'customSmtp' => static::serializeValue($this->customSmtp), + 'emailBranding' => static::serializeValue($this->emailBranding), + 'requiresPaymentMethod' => static::serializeValue($this->requiresPaymentMethod), + 'requiresBillingAddress' => static::serializeValue($this->requiresBillingAddress), + 'isAvailable' => static::serializeValue($this->isAvailable), + 'selfService' => static::serializeValue($this->selfService), + 'premiumSupport' => static::serializeValue($this->premiumSupport), + 'budgeting' => static::serializeValue($this->budgeting), + 'supportsMockNumbers' => static::serializeValue($this->supportsMockNumbers), + 'supportsOrganizationRoles' => static::serializeValue($this->supportsOrganizationRoles), + 'supportsCredits' => static::serializeValue($this->supportsCredits), + 'supportsDisposableEmailValidation' => static::serializeValue($this->supportsDisposableEmailValidation), + 'supportsCanonicalEmailValidation' => static::serializeValue($this->supportsCanonicalEmailValidation), + 'supportsFreeEmailValidation' => static::serializeValue($this->supportsFreeEmailValidation), + 'supportsCorporateEmailValidation' => static::serializeValue($this->supportsCorporateEmailValidation), + 'supportsProjectSpecificRoles' => static::serializeValue($this->supportsProjectSpecificRoles), + 'backupsEnabled' => static::serializeValue($this->backupsEnabled), + 'usagePerProject' => static::serializeValue($this->usagePerProject), + 'supportedAddons' => static::serializeValue($this->supportedAddons), + 'backupPolicies' => static::serializeValue($this->backupPolicies), + 'deploymentSize' => static::serializeValue($this->deploymentSize), + 'buildSize' => static::serializeValue($this->buildSize), + 'databasesAllowEncrypt' => static::serializeValue($this->databasesAllowEncrypt), + 'limits' => static::serializeValue($this->limits), + 'group' => static::serializeValue($this->group), + 'program' => static::serializeValue($this->program), + 'dedicatedDatabases' => static::serializeValue($this->dedicatedDatabases) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlanAddon.php b/src/Appwrite/Models/BillingPlanAddon.php new file mode 100644 index 00000000..7e79ea14 --- /dev/null +++ b/src/Appwrite/Models/BillingPlanAddon.php @@ -0,0 +1,54 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('seats', $data)) { + throw new \InvalidArgumentException('Missing required field "seats" for ' . static::class . '.'); + } + if (!array_key_exists('projects', $data)) { + throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); + } + + return new static( + seats: static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['seats']), + projects: static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['projects']) + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'seats' => static::serializeValue($this->seats), + 'projects' => static::serializeValue($this->projects) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlanAddonDetails.php b/src/Appwrite/Models/BillingPlanAddonDetails.php new file mode 100644 index 00000000..60f94449 --- /dev/null +++ b/src/Appwrite/Models/BillingPlanAddonDetails.php @@ -0,0 +1,96 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('supported', $data)) { + throw new \InvalidArgumentException('Missing required field "supported" for ' . static::class . '.'); + } + if (!array_key_exists('planIncluded', $data)) { + throw new \InvalidArgumentException('Missing required field "planIncluded" for ' . static::class . '.'); + } + if (!array_key_exists('limit', $data)) { + throw new \InvalidArgumentException('Missing required field "limit" for ' . static::class . '.'); + } + if (!array_key_exists('type', $data)) { + throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); + } + if (!array_key_exists('currency', $data)) { + throw new \InvalidArgumentException('Missing required field "currency" for ' . static::class . '.'); + } + if (!array_key_exists('price', $data)) { + throw new \InvalidArgumentException('Missing required field "price" for ' . static::class . '.'); + } + if (!array_key_exists('value', $data)) { + throw new \InvalidArgumentException('Missing required field "value" for ' . static::class . '.'); + } + if (!array_key_exists('invoiceDesc', $data)) { + throw new \InvalidArgumentException('Missing required field "invoiceDesc" for ' . static::class . '.'); + } + + return new static( + supported: $data['supported'], + planIncluded: $data['planIncluded'], + limit: $data['limit'], + type: $data['type'], + currency: $data['currency'], + price: $data['price'], + value: $data['value'], + invoiceDesc: $data['invoiceDesc'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'supported' => static::serializeValue($this->supported), + 'planIncluded' => static::serializeValue($this->planIncluded), + 'limit' => static::serializeValue($this->limit), + 'type' => static::serializeValue($this->type), + 'currency' => static::serializeValue($this->currency), + 'price' => static::serializeValue($this->price), + 'value' => static::serializeValue($this->value), + 'invoiceDesc' => static::serializeValue($this->invoiceDesc) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php new file mode 100644 index 00000000..97a088b1 --- /dev/null +++ b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php @@ -0,0 +1,116 @@ + $data + */ + public static function from(array $data): static + { + + return new static( + minCpu: array_key_exists('minCpu', $data) ? $data['minCpu'] : null, + maxCpu: array_key_exists('maxCpu', $data) ? $data['maxCpu'] : null, + minMemoryMb: array_key_exists('minMemoryMb', $data) ? $data['minMemoryMb'] : null, + maxMemoryMb: array_key_exists('maxMemoryMb', $data) ? $data['maxMemoryMb'] : null, + minStorageGb: array_key_exists('minStorageGb', $data) ? $data['minStorageGb'] : null, + maxStorageGb: array_key_exists('maxStorageGb', $data) ? $data['maxStorageGb'] : null, + maxReplicas: array_key_exists('maxReplicas', $data) ? $data['maxReplicas'] : null, + maxConnections: array_key_exists('maxConnections', $data) ? $data['maxConnections'] : null, + maxIpAllowlistSize: array_key_exists('maxIpAllowlistSize', $data) ? $data['maxIpAllowlistSize'] : null, + maxExtensions: array_key_exists('maxExtensions', $data) ? $data['maxExtensions'] : null, + maxBackupRetentionDays: array_key_exists('maxBackupRetentionDays', $data) ? $data['maxBackupRetentionDays'] : null, + maxPitrRetentionDays: array_key_exists('maxPitrRetentionDays', $data) ? $data['maxPitrRetentionDays'] : null, + maxSqlApiMaxRows: array_key_exists('maxSqlApiMaxRows', $data) ? $data['maxSqlApiMaxRows'] : null, + maxSqlApiMaxBytes: array_key_exists('maxSqlApiMaxBytes', $data) ? $data['maxSqlApiMaxBytes'] : null, + maxSqlApiTimeoutSeconds: array_key_exists('maxSqlApiTimeoutSeconds', $data) ? $data['maxSqlApiTimeoutSeconds'] : null, + maxSqlApiAllowedStatements: array_key_exists('maxSqlApiAllowedStatements', $data) ? $data['maxSqlApiAllowedStatements'] : null, + allowedSqlStatements: array_key_exists('allowedSqlStatements', $data) ? $data['allowedSqlStatements'] : null, + allowedStorageClasses: array_key_exists('allowedStorageClasses', $data) ? $data['allowedStorageClasses'] : null, + allowedSyncModes: array_key_exists('allowedSyncModes', $data) ? $data['allowedSyncModes'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'minCpu' => static::serializeValue($this->minCpu), + 'maxCpu' => static::serializeValue($this->maxCpu), + 'minMemoryMb' => static::serializeValue($this->minMemoryMb), + 'maxMemoryMb' => static::serializeValue($this->maxMemoryMb), + 'minStorageGb' => static::serializeValue($this->minStorageGb), + 'maxStorageGb' => static::serializeValue($this->maxStorageGb), + 'maxReplicas' => static::serializeValue($this->maxReplicas), + 'maxConnections' => static::serializeValue($this->maxConnections), + 'maxIpAllowlistSize' => static::serializeValue($this->maxIpAllowlistSize), + 'maxExtensions' => static::serializeValue($this->maxExtensions), + 'maxBackupRetentionDays' => static::serializeValue($this->maxBackupRetentionDays), + 'maxPitrRetentionDays' => static::serializeValue($this->maxPitrRetentionDays), + 'maxSqlApiMaxRows' => static::serializeValue($this->maxSqlApiMaxRows), + 'maxSqlApiMaxBytes' => static::serializeValue($this->maxSqlApiMaxBytes), + 'maxSqlApiTimeoutSeconds' => static::serializeValue($this->maxSqlApiTimeoutSeconds), + 'maxSqlApiAllowedStatements' => static::serializeValue($this->maxSqlApiAllowedStatements), + 'allowedSqlStatements' => static::serializeValue($this->allowedSqlStatements), + 'allowedStorageClasses' => static::serializeValue($this->allowedStorageClasses), + 'allowedSyncModes' => static::serializeValue($this->allowedSyncModes) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlanLimits.php b/src/Appwrite/Models/BillingPlanLimits.php new file mode 100644 index 00000000..2f8d9d86 --- /dev/null +++ b/src/Appwrite/Models/BillingPlanLimits.php @@ -0,0 +1,48 @@ + $data + */ + public static function from(array $data): static + { + + return new static( + credits: array_key_exists('credits', $data) ? $data['credits'] : null, + dailyCredits: array_key_exists('dailyCredits', $data) ? $data['dailyCredits'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'credits' => static::serializeValue($this->credits), + 'dailyCredits' => static::serializeValue($this->dailyCredits) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlanSupportedAddons.php b/src/Appwrite/Models/BillingPlanSupportedAddons.php new file mode 100644 index 00000000..344ce998 --- /dev/null +++ b/src/Appwrite/Models/BillingPlanSupportedAddons.php @@ -0,0 +1,61 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('baa', $data)) { + throw new \InvalidArgumentException('Missing required field "baa" for ' . static::class . '.'); + } + if (!array_key_exists('premiumGeoDB', $data)) { + throw new \InvalidArgumentException('Missing required field "premiumGeoDB" for ' . static::class . '.'); + } + if (!array_key_exists('premiumGeoDBOrg', $data)) { + throw new \InvalidArgumentException('Missing required field "premiumGeoDBOrg" for ' . static::class . '.'); + } + + return new static( + baa: $data['baa'], + premiumGeoDB: $data['premiumGeoDB'], + premiumGeoDBOrg: $data['premiumGeoDBOrg'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'baa' => static::serializeValue($this->baa), + 'premiumGeoDB' => static::serializeValue($this->premiumGeoDB), + 'premiumGeoDBOrg' => static::serializeValue($this->premiumGeoDBOrg) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Block.php b/src/Appwrite/Models/Block.php index 350d0c12..4079f849 100644 --- a/src/Appwrite/Models/Block.php +++ b/src/Appwrite/Models/Block.php @@ -15,6 +15,7 @@ * @param string $createdAt block creation date in iso 8601 format. * @param string $resourceType resource type that is blocked * @param string $resourceId resource identifier that is blocked + * @param string $mode block mode. full blocks reads and writes; readonly blocks writes only. * @param string $projectName name of the project this block applies to. * @param string $region region of the project this block applies to. * @param string $organizationName name of the organization that owns the project. @@ -27,6 +28,7 @@ public function __construct( public string $createdAt, public string $resourceType, public string $resourceId, + public string $mode, public string $projectName, public string $region, public string $organizationName, @@ -51,6 +53,9 @@ public static function from(array $data): static if (!array_key_exists('resourceId', $data)) { throw new \InvalidArgumentException('Missing required field "resourceId" for ' . static::class . '.'); } + if (!array_key_exists('mode', $data)) { + throw new \InvalidArgumentException('Missing required field "mode" for ' . static::class . '.'); + } if (!array_key_exists('projectName', $data)) { throw new \InvalidArgumentException('Missing required field "projectName" for ' . static::class . '.'); } @@ -71,6 +76,7 @@ public static function from(array $data): static createdAt: $data['$createdAt'], resourceType: $data['resourceType'], resourceId: $data['resourceId'], + mode: $data['mode'], projectName: $data['projectName'], region: $data['region'], organizationName: $data['organizationName'], @@ -90,6 +96,7 @@ public function toArray(): array '$createdAt' => static::serializeValue($this->createdAt), 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId), + 'mode' => static::serializeValue($this->mode), 'reason' => static::serializeValue($this->reason), 'expiredAt' => static::serializeValue($this->expiredAt), 'projectName' => static::serializeValue($this->projectName), diff --git a/src/Appwrite/Models/Database.php b/src/Appwrite/Models/Database.php index fc06cde2..6a226440 100644 --- a/src/Appwrite/Models/Database.php +++ b/src/Appwrite/Models/Database.php @@ -3,6 +3,7 @@ namespace Appwrite\Models; use Appwrite\Enums\DatabaseType; +use Appwrite\Enums\DatabaseStatus; /** * Database @@ -22,6 +23,7 @@ * @param DatabaseType $type database type. * @param list $policies database backup policies. * @param list $archives database backup archives. + * @param DatabaseStatus|null $status database status. possible values: `provisioning`, `ready` or `failed` */ public function __construct( public string $id, @@ -31,7 +33,8 @@ public function __construct( public bool $enabled, public DatabaseType $type, public array $policies, - public array $archives + public array $archives, + public ?DatabaseStatus $status = null ) { } @@ -83,7 +86,8 @@ public static function from(array $data): static static fn (mixed $item): mixed => static::hydrateTypedValue(BackupArchive::class, $item), $data['archives'] ) - : $data['archives'] + : $data['archives'], + status: array_key_exists('status', $data) ? static::hydrateTypedValue(DatabaseStatus::class, $data['status'], true) : null ); } @@ -99,6 +103,7 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'enabled' => static::serializeValue($this->enabled), 'type' => static::serializeValue($this->type), + 'status' => static::serializeValue($this->status), 'policies' => static::serializeValue($this->policies), 'archives' => static::serializeValue($this->archives) ]; diff --git a/src/Appwrite/Models/HealthAntivirus.php b/src/Appwrite/Models/HealthAntivirus.php deleted file mode 100644 index 31a47bbd..00000000 --- a/src/Appwrite/Models/HealthAntivirus.php +++ /dev/null @@ -1,56 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('version', $data)) { - throw new \InvalidArgumentException('Missing required field "version" for ' . static::class . '.'); - } - if (!array_key_exists('status', $data)) { - throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); - } - - return new static( - version: $data['version'], - status: static::hydrateTypedValue(HealthAntivirusStatus::class, $data['status']) - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'version' => static::serializeValue($this->version), - 'status' => static::serializeValue($this->status) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/HealthCertificate.php b/src/Appwrite/Models/HealthCertificate.php deleted file mode 100644 index bad516ff..00000000 --- a/src/Appwrite/Models/HealthCertificate.php +++ /dev/null @@ -1,82 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('name', $data)) { - throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); - } - if (!array_key_exists('subjectSN', $data)) { - throw new \InvalidArgumentException('Missing required field "subjectSN" for ' . static::class . '.'); - } - if (!array_key_exists('issuerOrganisation', $data)) { - throw new \InvalidArgumentException('Missing required field "issuerOrganisation" for ' . static::class . '.'); - } - if (!array_key_exists('validFrom', $data)) { - throw new \InvalidArgumentException('Missing required field "validFrom" for ' . static::class . '.'); - } - if (!array_key_exists('validTo', $data)) { - throw new \InvalidArgumentException('Missing required field "validTo" for ' . static::class . '.'); - } - if (!array_key_exists('signatureTypeSN', $data)) { - throw new \InvalidArgumentException('Missing required field "signatureTypeSN" for ' . static::class . '.'); - } - - return new static( - name: $data['name'], - subjectSN: $data['subjectSN'], - issuerOrganisation: $data['issuerOrganisation'], - validFrom: $data['validFrom'], - validTo: $data['validTo'], - signatureTypeSN: $data['signatureTypeSN'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'name' => static::serializeValue($this->name), - 'subjectSN' => static::serializeValue($this->subjectSN), - 'issuerOrganisation' => static::serializeValue($this->issuerOrganisation), - 'validFrom' => static::serializeValue($this->validFrom), - 'validTo' => static::serializeValue($this->validTo), - 'signatureTypeSN' => static::serializeValue($this->signatureTypeSN) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/HealthQueue.php b/src/Appwrite/Models/HealthQueue.php deleted file mode 100644 index f709a229..00000000 --- a/src/Appwrite/Models/HealthQueue.php +++ /dev/null @@ -1,47 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('size', $data)) { - throw new \InvalidArgumentException('Missing required field "size" for ' . static::class . '.'); - } - - return new static( - size: $data['size'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'size' => static::serializeValue($this->size) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/HealthStatus.php b/src/Appwrite/Models/HealthStatus.php deleted file mode 100644 index 6238a2eb..00000000 --- a/src/Appwrite/Models/HealthStatus.php +++ /dev/null @@ -1,63 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('name', $data)) { - throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); - } - if (!array_key_exists('ping', $data)) { - throw new \InvalidArgumentException('Missing required field "ping" for ' . static::class . '.'); - } - if (!array_key_exists('status', $data)) { - throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); - } - - return new static( - name: $data['name'], - ping: $data['ping'], - status: static::hydrateTypedValue(HealthCheckStatus::class, $data['status']) - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'name' => static::serializeValue($this->name), - 'ping' => static::serializeValue($this->ping), - 'status' => static::serializeValue($this->status) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/HealthStatusList.php b/src/Appwrite/Models/HealthStatusList.php deleted file mode 100644 index 4b13218d..00000000 --- a/src/Appwrite/Models/HealthStatusList.php +++ /dev/null @@ -1,59 +0,0 @@ - $statuses list of statuses. - */ - public function __construct( - public int $total, - public array $statuses - ) { - } - - /** - * @param array $data - */ - public static function from(array $data): static - { - if (!array_key_exists('total', $data)) { - throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); - } - if (!array_key_exists('statuses', $data)) { - throw new \InvalidArgumentException('Missing required field "statuses" for ' . static::class . '.'); - } - - return new static( - total: $data['total'], - statuses: is_array($data['statuses']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(HealthStatus::class, $item), - $data['statuses'] - ) - : $data['statuses'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'total' => static::serializeValue($this->total), - 'statuses' => static::serializeValue($this->statuses) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/HealthTime.php b/src/Appwrite/Models/HealthTime.php deleted file mode 100644 index c3036d1e..00000000 --- a/src/Appwrite/Models/HealthTime.php +++ /dev/null @@ -1,61 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('remoteTime', $data)) { - throw new \InvalidArgumentException('Missing required field "remoteTime" for ' . static::class . '.'); - } - if (!array_key_exists('localTime', $data)) { - throw new \InvalidArgumentException('Missing required field "localTime" for ' . static::class . '.'); - } - if (!array_key_exists('diff', $data)) { - throw new \InvalidArgumentException('Missing required field "diff" for ' . static::class . '.'); - } - - return new static( - remoteTime: $data['remoteTime'], - localTime: $data['localTime'], - diff: $data['diff'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'remoteTime' => static::serializeValue($this->remoteTime), - 'localTime' => static::serializeValue($this->localTime), - 'diff' => static::serializeValue($this->diff) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/Locale.php b/src/Appwrite/Models/Locale.php index 183919af..e7ab2726 100644 --- a/src/Appwrite/Models/Locale.php +++ b/src/Appwrite/Models/Locale.php @@ -19,6 +19,17 @@ * @param string $continent continent name. this field support localization. * @param bool $eu true if country is part of the european union. * @param string $currency currency code in [iso 4217-1](http://en.wikipedia.org/wiki/iso_4217) three-character format + * @param string|null $city city + * @param string|null $timeZone name of timezone + * @param string|null $postalCode postal code + * @param float|null $latitude latitude + * @param float|null $longitude longitude + * @param string|null $autonomousSystemNumber autonomous system number (asn) of the ip + * @param string|null $autonomousSystemOrganization organization that owns the asn + * @param string|null $isp internet service provider of the ip + * @param string|null $connectionType connection type of the ip (e.g. cable, cellular, corporate) + * @param string|null $connectionUsageType user type classification of the ip (e.g. residential, business, hosting) + * @param string|null $connectionOrganization registered organization of the ip */ public function __construct( public string $ip, @@ -27,7 +38,18 @@ public function __construct( public string $continentCode, public string $continent, public bool $eu, - public string $currency + public string $currency, + public ?string $city = null, + public ?string $timeZone = null, + public ?string $postalCode = null, + public ?float $latitude = null, + public ?float $longitude = null, + public ?string $autonomousSystemNumber = null, + public ?string $autonomousSystemOrganization = null, + public ?string $isp = null, + public ?string $connectionType = null, + public ?string $connectionUsageType = null, + public ?string $connectionOrganization = null ) { } @@ -65,7 +87,18 @@ public static function from(array $data): static continentCode: $data['continentCode'], continent: $data['continent'], eu: $data['eu'], - currency: $data['currency'] + currency: $data['currency'], + city: array_key_exists('city', $data) ? $data['city'] : null, + timeZone: array_key_exists('timeZone', $data) ? $data['timeZone'] : null, + postalCode: array_key_exists('postalCode', $data) ? $data['postalCode'] : null, + latitude: array_key_exists('latitude', $data) ? $data['latitude'] : null, + longitude: array_key_exists('longitude', $data) ? $data['longitude'] : null, + autonomousSystemNumber: array_key_exists('autonomousSystemNumber', $data) ? $data['autonomousSystemNumber'] : null, + autonomousSystemOrganization: array_key_exists('autonomousSystemOrganization', $data) ? $data['autonomousSystemOrganization'] : null, + isp: array_key_exists('isp', $data) ? $data['isp'] : null, + connectionType: array_key_exists('connectionType', $data) ? $data['connectionType'] : null, + connectionUsageType: array_key_exists('connectionUsageType', $data) ? $data['connectionUsageType'] : null, + connectionOrganization: array_key_exists('connectionOrganization', $data) ? $data['connectionOrganization'] : null ); } @@ -81,7 +114,18 @@ public function toArray(): array 'continentCode' => static::serializeValue($this->continentCode), 'continent' => static::serializeValue($this->continent), 'eu' => static::serializeValue($this->eu), - 'currency' => static::serializeValue($this->currency) + 'currency' => static::serializeValue($this->currency), + 'city' => static::serializeValue($this->city), + 'timeZone' => static::serializeValue($this->timeZone), + 'postalCode' => static::serializeValue($this->postalCode), + 'latitude' => static::serializeValue($this->latitude), + 'longitude' => static::serializeValue($this->longitude), + 'autonomousSystemNumber' => static::serializeValue($this->autonomousSystemNumber), + 'autonomousSystemOrganization' => static::serializeValue($this->autonomousSystemOrganization), + 'isp' => static::serializeValue($this->isp), + 'connectionType' => static::serializeValue($this->connectionType), + 'connectionUsageType' => static::serializeValue($this->connectionUsageType), + 'connectionOrganization' => static::serializeValue($this->connectionOrganization) ]; return $result; diff --git a/src/Appwrite/Models/Log.php b/src/Appwrite/Models/Log.php index f3f74cee..8cb811db 100644 --- a/src/Appwrite/Models/Log.php +++ b/src/Appwrite/Models/Log.php @@ -17,7 +17,7 @@ * @param string $userEmail user email of the actor recorded for this log. during impersonation, this is the original impersonator. * @param string $userName user name of the actor recorded for this log. during impersonation, this is the original impersonator. * @param string $mode api mode when event triggered. - * @param string $userType user type who triggered the audit log. possible values: user, admin, guest, keyproject, keyaccount, keyorganization. + * @param string $userType user type who triggered the audit log. possible values: user, admin, guest, hidden, keyproject, keyaccount, keyorganization. * @param string $ip ip session in use when the session was created. * @param string $time log creation date in iso 8601 format. * @param string $osCode operating system code name. view list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). diff --git a/src/Appwrite/Models/OAuth2Appwrite.php b/src/Appwrite/Models/OAuth2Appwrite.php new file mode 100644 index 00000000..1ae1b35a --- /dev/null +++ b/src/Appwrite/Models/OAuth2Appwrite.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('enabled', $data)) { + throw new \InvalidArgumentException('Missing required field "enabled" for ' . static::class . '.'); + } + if (!array_key_exists('clientId', $data)) { + throw new \InvalidArgumentException('Missing required field "clientId" for ' . static::class . '.'); + } + if (!array_key_exists('clientSecret', $data)) { + throw new \InvalidArgumentException('Missing required field "clientSecret" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'], + clientId: $data['clientId'], + clientSecret: $data['clientSecret'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'enabled' => static::serializeValue($this->enabled), + 'clientId' => static::serializeValue($this->clientId), + 'clientSecret' => static::serializeValue($this->clientSecret) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/OAuth2Oidc.php b/src/Appwrite/Models/OAuth2Oidc.php index 7fd780e9..26a21ce1 100644 --- a/src/Appwrite/Models/OAuth2Oidc.php +++ b/src/Appwrite/Models/OAuth2Oidc.php @@ -2,6 +2,8 @@ namespace Appwrite\Models; +use Appwrite\Enums\OAuth2OidcPrompt; + /** * OAuth2Oidc */ @@ -20,6 +22,8 @@ * @param string $authorizationURL openid connect authorization endpoint url. * @param string $tokenURL openid connect token endpoint url. * @param string $userInfoURL openid connect user info endpoint url. + * @param list $prompt openid connect prompt values controlling the authentication and consent screens. + * @param int|null $maxAge maximum authentication age in seconds. when set, the user must have authenticated within this many seconds. */ public function __construct( public string $id, @@ -29,7 +33,9 @@ public function __construct( public string $wellKnownURL, public string $authorizationURL, public string $tokenURL, - public string $userInfoURL + public string $userInfoURL, + public array $prompt, + public ?int $maxAge = null ) { } @@ -62,6 +68,9 @@ public static function from(array $data): static if (!array_key_exists('userInfoURL', $data)) { throw new \InvalidArgumentException('Missing required field "userInfoURL" for ' . static::class . '.'); } + if (!array_key_exists('prompt', $data)) { + throw new \InvalidArgumentException('Missing required field "prompt" for ' . static::class . '.'); + } return new static( id: $data['$id'], @@ -71,7 +80,14 @@ public static function from(array $data): static wellKnownURL: $data['wellKnownURL'], authorizationURL: $data['authorizationURL'], tokenURL: $data['tokenURL'], - userInfoURL: $data['userInfoURL'] + userInfoURL: $data['userInfoURL'], + prompt: is_array($data['prompt']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(OAuth2OidcPrompt::class, $item), + $data['prompt'] + ) + : $data['prompt'], + maxAge: array_key_exists('maxAge', $data) ? $data['maxAge'] : null ); } @@ -88,7 +104,9 @@ public function toArray(): array 'wellKnownURL' => static::serializeValue($this->wellKnownURL), 'authorizationURL' => static::serializeValue($this->authorizationURL), 'tokenURL' => static::serializeValue($this->tokenURL), - 'userInfoURL' => static::serializeValue($this->userInfoURL) + 'userInfoURL' => static::serializeValue($this->userInfoURL), + 'prompt' => static::serializeValue($this->prompt), + 'maxAge' => static::serializeValue($this->maxAge) ]; return $result; diff --git a/src/Appwrite/Models/Organization.php b/src/Appwrite/Models/Organization.php new file mode 100644 index 00000000..8842b34f --- /dev/null +++ b/src/Appwrite/Models/Organization.php @@ -0,0 +1,282 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('prefs', $data)) { + throw new \InvalidArgumentException('Missing required field "prefs" for ' . static::class . '.'); + } + if (!array_key_exists('billingBudget', $data)) { + throw new \InvalidArgumentException('Missing required field "billingBudget" for ' . static::class . '.'); + } + if (!array_key_exists('budgetAlerts', $data)) { + throw new \InvalidArgumentException('Missing required field "budgetAlerts" for ' . static::class . '.'); + } + if (!array_key_exists('billingPlan', $data)) { + throw new \InvalidArgumentException('Missing required field "billingPlan" for ' . static::class . '.'); + } + if (!array_key_exists('billingPlanId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingPlanId" for ' . static::class . '.'); + } + if (!array_key_exists('billingPlanDetails', $data)) { + throw new \InvalidArgumentException('Missing required field "billingPlanDetails" for ' . static::class . '.'); + } + if (!array_key_exists('billingEmail', $data)) { + throw new \InvalidArgumentException('Missing required field "billingEmail" for ' . static::class . '.'); + } + if (!array_key_exists('billingStartDate', $data)) { + throw new \InvalidArgumentException('Missing required field "billingStartDate" for ' . static::class . '.'); + } + if (!array_key_exists('billingCurrentInvoiceDate', $data)) { + throw new \InvalidArgumentException('Missing required field "billingCurrentInvoiceDate" for ' . static::class . '.'); + } + if (!array_key_exists('billingNextInvoiceDate', $data)) { + throw new \InvalidArgumentException('Missing required field "billingNextInvoiceDate" for ' . static::class . '.'); + } + if (!array_key_exists('billingTrialStartDate', $data)) { + throw new \InvalidArgumentException('Missing required field "billingTrialStartDate" for ' . static::class . '.'); + } + if (!array_key_exists('billingTrialDays', $data)) { + throw new \InvalidArgumentException('Missing required field "billingTrialDays" for ' . static::class . '.'); + } + if (!array_key_exists('billingAggregationId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingAggregationId" for ' . static::class . '.'); + } + if (!array_key_exists('billingInvoiceId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingInvoiceId" for ' . static::class . '.'); + } + if (!array_key_exists('paymentMethodId', $data)) { + throw new \InvalidArgumentException('Missing required field "paymentMethodId" for ' . static::class . '.'); + } + if (!array_key_exists('billingAddressId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingAddressId" for ' . static::class . '.'); + } + if (!array_key_exists('backupPaymentMethodId', $data)) { + throw new \InvalidArgumentException('Missing required field "backupPaymentMethodId" for ' . static::class . '.'); + } + if (!array_key_exists('status', $data)) { + throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); + } + if (!array_key_exists('remarks', $data)) { + throw new \InvalidArgumentException('Missing required field "remarks" for ' . static::class . '.'); + } + if (!array_key_exists('agreementBAA', $data)) { + throw new \InvalidArgumentException('Missing required field "agreementBAA" for ' . static::class . '.'); + } + if (!array_key_exists('programManagerName', $data)) { + throw new \InvalidArgumentException('Missing required field "programManagerName" for ' . static::class . '.'); + } + if (!array_key_exists('programManagerCalendar', $data)) { + throw new \InvalidArgumentException('Missing required field "programManagerCalendar" for ' . static::class . '.'); + } + if (!array_key_exists('programDiscordChannelName', $data)) { + throw new \InvalidArgumentException('Missing required field "programDiscordChannelName" for ' . static::class . '.'); + } + if (!array_key_exists('programDiscordChannelUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "programDiscordChannelUrl" for ' . static::class . '.'); + } + if (!array_key_exists('billingPlanDowngrade', $data)) { + throw new \InvalidArgumentException('Missing required field "billingPlanDowngrade" for ' . static::class . '.'); + } + if (!array_key_exists('billingTaxId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingTaxId" for ' . static::class . '.'); + } + if (!array_key_exists('markedForDeletion', $data)) { + throw new \InvalidArgumentException('Missing required field "markedForDeletion" for ' . static::class . '.'); + } + if (!array_key_exists('platform', $data)) { + throw new \InvalidArgumentException('Missing required field "platform" for ' . static::class . '.'); + } + if (!array_key_exists('projects', $data)) { + throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + name: $data['name'], + total: $data['total'], + prefs: static::hydrateTypedValue(Preferences::class, $data['prefs']), + billingBudget: $data['billingBudget'], + budgetAlerts: $data['budgetAlerts'], + billingPlan: $data['billingPlan'], + billingPlanId: $data['billingPlanId'], + billingPlanDetails: static::hydrateTypedValue(BillingPlan::class, $data['billingPlanDetails']), + billingEmail: $data['billingEmail'], + billingStartDate: $data['billingStartDate'], + billingCurrentInvoiceDate: $data['billingCurrentInvoiceDate'], + billingNextInvoiceDate: $data['billingNextInvoiceDate'], + billingTrialStartDate: $data['billingTrialStartDate'], + billingTrialDays: $data['billingTrialDays'], + billingAggregationId: $data['billingAggregationId'], + billingInvoiceId: $data['billingInvoiceId'], + paymentMethodId: $data['paymentMethodId'], + billingAddressId: $data['billingAddressId'], + backupPaymentMethodId: $data['backupPaymentMethodId'], + status: $data['status'], + remarks: $data['remarks'], + agreementBAA: $data['agreementBAA'], + programManagerName: $data['programManagerName'], + programManagerCalendar: $data['programManagerCalendar'], + programDiscordChannelName: $data['programDiscordChannelName'], + programDiscordChannelUrl: $data['programDiscordChannelUrl'], + billingPlanDowngrade: $data['billingPlanDowngrade'], + billingTaxId: $data['billingTaxId'], + markedForDeletion: $data['markedForDeletion'], + platform: $data['platform'], + projects: $data['projects'], + billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'name' => static::serializeValue($this->name), + 'total' => static::serializeValue($this->total), + 'prefs' => static::serializeValue($this->prefs), + 'billingBudget' => static::serializeValue($this->billingBudget), + 'budgetAlerts' => static::serializeValue($this->budgetAlerts), + 'billingPlan' => static::serializeValue($this->billingPlan), + 'billingPlanId' => static::serializeValue($this->billingPlanId), + 'billingPlanDetails' => static::serializeValue($this->billingPlanDetails), + 'billingEmail' => static::serializeValue($this->billingEmail), + 'billingStartDate' => static::serializeValue($this->billingStartDate), + 'billingCurrentInvoiceDate' => static::serializeValue($this->billingCurrentInvoiceDate), + 'billingNextInvoiceDate' => static::serializeValue($this->billingNextInvoiceDate), + 'billingTrialStartDate' => static::serializeValue($this->billingTrialStartDate), + 'billingTrialDays' => static::serializeValue($this->billingTrialDays), + 'billingAggregationId' => static::serializeValue($this->billingAggregationId), + 'billingInvoiceId' => static::serializeValue($this->billingInvoiceId), + 'paymentMethodId' => static::serializeValue($this->paymentMethodId), + 'billingAddressId' => static::serializeValue($this->billingAddressId), + 'backupPaymentMethodId' => static::serializeValue($this->backupPaymentMethodId), + 'status' => static::serializeValue($this->status), + 'remarks' => static::serializeValue($this->remarks), + 'agreementBAA' => static::serializeValue($this->agreementBAA), + 'programManagerName' => static::serializeValue($this->programManagerName), + 'programManagerCalendar' => static::serializeValue($this->programManagerCalendar), + 'programDiscordChannelName' => static::serializeValue($this->programDiscordChannelName), + 'programDiscordChannelUrl' => static::serializeValue($this->programDiscordChannelUrl), + 'billingLimits' => static::serializeValue($this->billingLimits), + 'billingPlanDowngrade' => static::serializeValue($this->billingPlanDowngrade), + 'billingTaxId' => static::serializeValue($this->billingTaxId), + 'markedForDeletion' => static::serializeValue($this->markedForDeletion), + 'platform' => static::serializeValue($this->platform), + 'projects' => static::serializeValue($this->projects) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Program.php b/src/Appwrite/Models/Program.php new file mode 100644 index 00000000..a6bdcd53 --- /dev/null +++ b/src/Appwrite/Models/Program.php @@ -0,0 +1,103 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('title', $data)) { + throw new \InvalidArgumentException('Missing required field "title" for ' . static::class . '.'); + } + if (!array_key_exists('description', $data)) { + throw new \InvalidArgumentException('Missing required field "description" for ' . static::class . '.'); + } + if (!array_key_exists('tag', $data)) { + throw new \InvalidArgumentException('Missing required field "tag" for ' . static::class . '.'); + } + if (!array_key_exists('icon', $data)) { + throw new \InvalidArgumentException('Missing required field "icon" for ' . static::class . '.'); + } + if (!array_key_exists('url', $data)) { + throw new \InvalidArgumentException('Missing required field "url" for ' . static::class . '.'); + } + if (!array_key_exists('active', $data)) { + throw new \InvalidArgumentException('Missing required field "active" for ' . static::class . '.'); + } + if (!array_key_exists('external', $data)) { + throw new \InvalidArgumentException('Missing required field "external" for ' . static::class . '.'); + } + if (!array_key_exists('billingPlanId', $data)) { + throw new \InvalidArgumentException('Missing required field "billingPlanId" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + title: $data['title'], + description: $data['description'], + tag: $data['tag'], + icon: $data['icon'], + url: $data['url'], + active: $data['active'], + external: $data['external'], + billingPlanId: $data['billingPlanId'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'title' => static::serializeValue($this->title), + 'description' => static::serializeValue($this->description), + 'tag' => static::serializeValue($this->tag), + 'icon' => static::serializeValue($this->icon), + 'url' => static::serializeValue($this->url), + 'active' => static::serializeValue($this->active), + 'external' => static::serializeValue($this->external), + 'billingPlanId' => static::serializeValue($this->billingPlanId) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index 700b7f6e..f2af24d4 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -33,6 +33,7 @@ * @param string $pingedAt last ping datetime in iso 8601 format. * @param array $labels labels for the project. * @param string $status project status + * @param array $onboarding stage progress (completed or skipped) with timestamps and actor types, keyed by stage id. * @param list $authMethods list of auth methods. * @param list $services list of services. * @param list $protocols list of protocols. @@ -42,6 +43,7 @@ * @param bool|null $oAuth2ServerEnabled oauth2 server status * @param string|null $oAuth2ServerAuthorizationUrl oauth2 server authorization url * @param array|null $oAuth2ServerScopes oauth2 server allowed scopes + * @param array|null $oAuth2ServerDefaultScopes oauth2 server scopes used when an authorization request omits the scope parameter * @param array|null $oAuth2ServerAuthorizationDetailsTypes oauth2 server accepted rfc 9396 authorization_details types * @param int|null $oAuth2ServerAccessTokenDuration oauth2 server access token duration in seconds for confidential clients * @param int|null $oAuth2ServerRefreshTokenDuration oauth2 server refresh token duration in seconds for confidential clients @@ -76,6 +78,7 @@ public function __construct( public string $pingedAt, public array $labels, public string $status, + public array $onboarding, public array $authMethods, public array $services, public array $protocols, @@ -85,6 +88,7 @@ public function __construct( public ?bool $oAuth2ServerEnabled = null, public ?string $oAuth2ServerAuthorizationUrl = null, public ?array $oAuth2ServerScopes = null, + public ?array $oAuth2ServerDefaultScopes = null, public ?array $oAuth2ServerAuthorizationDetailsTypes = null, public ?int $oAuth2ServerAccessTokenDuration = null, public ?int $oAuth2ServerRefreshTokenDuration = null, @@ -167,6 +171,9 @@ public static function from(array $data): static if (!array_key_exists('status', $data)) { throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); } + if (!array_key_exists('onboarding', $data)) { + throw new \InvalidArgumentException('Missing required field "onboarding" for ' . static::class . '.'); + } if (!array_key_exists('authMethods', $data)) { throw new \InvalidArgumentException('Missing required field "authMethods" for ' . static::class . '.'); } @@ -210,6 +217,7 @@ public static function from(array $data): static pingedAt: $data['pingedAt'], labels: $data['labels'], status: $data['status'], + onboarding: $data['onboarding'], authMethods: is_array($data['authMethods']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(ProjectAuthMethod::class, $item), @@ -239,6 +247,7 @@ public static function from(array $data): static oAuth2ServerEnabled: array_key_exists('oAuth2ServerEnabled', $data) ? $data['oAuth2ServerEnabled'] : null, oAuth2ServerAuthorizationUrl: array_key_exists('oAuth2ServerAuthorizationUrl', $data) ? $data['oAuth2ServerAuthorizationUrl'] : null, oAuth2ServerScopes: array_key_exists('oAuth2ServerScopes', $data) ? $data['oAuth2ServerScopes'] : null, + oAuth2ServerDefaultScopes: array_key_exists('oAuth2ServerDefaultScopes', $data) ? $data['oAuth2ServerDefaultScopes'] : null, oAuth2ServerAuthorizationDetailsTypes: array_key_exists('oAuth2ServerAuthorizationDetailsTypes', $data) ? $data['oAuth2ServerAuthorizationDetailsTypes'] : null, oAuth2ServerAccessTokenDuration: array_key_exists('oAuth2ServerAccessTokenDuration', $data) ? $data['oAuth2ServerAccessTokenDuration'] : null, oAuth2ServerRefreshTokenDuration: array_key_exists('oAuth2ServerRefreshTokenDuration', $data) ? $data['oAuth2ServerRefreshTokenDuration'] : null, @@ -280,6 +289,7 @@ public function toArray(): array 'pingedAt' => static::serializeValue($this->pingedAt), 'labels' => static::serializeValue($this->labels), 'status' => static::serializeValue($this->status), + 'onboarding' => static::serializeValue($this->onboarding), 'authMethods' => static::serializeValue($this->authMethods), 'services' => static::serializeValue($this->services), 'protocols' => static::serializeValue($this->protocols), @@ -289,6 +299,7 @@ public function toArray(): array 'oAuth2ServerEnabled' => static::serializeValue($this->oAuth2ServerEnabled), 'oAuth2ServerAuthorizationUrl' => static::serializeValue($this->oAuth2ServerAuthorizationUrl), 'oAuth2ServerScopes' => static::serializeValue($this->oAuth2ServerScopes), + 'oAuth2ServerDefaultScopes' => static::serializeValue($this->oAuth2ServerDefaultScopes), 'oAuth2ServerAuthorizationDetailsTypes' => static::serializeValue($this->oAuth2ServerAuthorizationDetailsTypes), 'oAuth2ServerAccessTokenDuration' => static::serializeValue($this->oAuth2ServerAccessTokenDuration), 'oAuth2ServerRefreshTokenDuration' => static::serializeValue($this->oAuth2ServerRefreshTokenDuration), diff --git a/src/Appwrite/Models/UsageBillingPlan.php b/src/Appwrite/Models/UsageBillingPlan.php new file mode 100644 index 00000000..790e95f0 --- /dev/null +++ b/src/Appwrite/Models/UsageBillingPlan.php @@ -0,0 +1,117 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('bandwidth', $data)) { + throw new \InvalidArgumentException('Missing required field "bandwidth" for ' . static::class . '.'); + } + if (!array_key_exists('executions', $data)) { + throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.'); + } + if (!array_key_exists('member', $data)) { + throw new \InvalidArgumentException('Missing required field "member" for ' . static::class . '.'); + } + if (!array_key_exists('realtime', $data)) { + throw new \InvalidArgumentException('Missing required field "realtime" for ' . static::class . '.'); + } + if (!array_key_exists('realtimeMessages', $data)) { + throw new \InvalidArgumentException('Missing required field "realtimeMessages" for ' . static::class . '.'); + } + if (!array_key_exists('realtimeBandwidth', $data)) { + throw new \InvalidArgumentException('Missing required field "realtimeBandwidth" for ' . static::class . '.'); + } + if (!array_key_exists('storage', $data)) { + throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.'); + } + if (!array_key_exists('users', $data)) { + throw new \InvalidArgumentException('Missing required field "users" for ' . static::class . '.'); + } + if (!array_key_exists('GBHours', $data)) { + throw new \InvalidArgumentException('Missing required field "GBHours" for ' . static::class . '.'); + } + if (!array_key_exists('imageTransformations', $data)) { + throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.'); + } + if (!array_key_exists('credits', $data)) { + throw new \InvalidArgumentException('Missing required field "credits" for ' . static::class . '.'); + } + + return new static( + bandwidth: static::hydrateTypedValue(AdditionalResource::class, $data['bandwidth']), + executions: static::hydrateTypedValue(AdditionalResource::class, $data['executions']), + member: static::hydrateTypedValue(AdditionalResource::class, $data['member']), + realtime: static::hydrateTypedValue(AdditionalResource::class, $data['realtime']), + realtimeMessages: static::hydrateTypedValue(AdditionalResource::class, $data['realtimeMessages']), + realtimeBandwidth: static::hydrateTypedValue(AdditionalResource::class, $data['realtimeBandwidth']), + storage: static::hydrateTypedValue(AdditionalResource::class, $data['storage']), + users: static::hydrateTypedValue(AdditionalResource::class, $data['users']), + gBHours: static::hydrateTypedValue(AdditionalResource::class, $data['GBHours']), + imageTransformations: static::hydrateTypedValue(AdditionalResource::class, $data['imageTransformations']), + credits: static::hydrateTypedValue(AdditionalResource::class, $data['credits']) + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'bandwidth' => static::serializeValue($this->bandwidth), + 'executions' => static::serializeValue($this->executions), + 'member' => static::serializeValue($this->member), + 'realtime' => static::serializeValue($this->realtime), + 'realtimeMessages' => static::serializeValue($this->realtimeMessages), + 'realtimeBandwidth' => static::serializeValue($this->realtimeBandwidth), + 'storage' => static::serializeValue($this->storage), + 'users' => static::serializeValue($this->users), + 'GBHours' => static::serializeValue($this->gBHours), + 'imageTransformations' => static::serializeValue($this->imageTransformations), + 'credits' => static::serializeValue($this->credits) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/UsageEventList.php b/src/Appwrite/Models/UsageEventList.php deleted file mode 100644 index c6fda5bd..00000000 --- a/src/Appwrite/Models/UsageEventList.php +++ /dev/null @@ -1,66 +0,0 @@ - $groups aggregated groups ordered by time ascending. - */ - public function __construct( - public string $metric, - public string $interval, - public array $groups - ) { - } - - /** - * @param array $data - */ - public static function from(array $data): static - { - if (!array_key_exists('metric', $data)) { - throw new \InvalidArgumentException('Missing required field "metric" for ' . static::class . '.'); - } - if (!array_key_exists('interval', $data)) { - throw new \InvalidArgumentException('Missing required field "interval" for ' . static::class . '.'); - } - if (!array_key_exists('groups', $data)) { - throw new \InvalidArgumentException('Missing required field "groups" for ' . static::class . '.'); - } - - return new static( - metric: $data['metric'], - interval: $data['interval'], - groups: is_array($data['groups']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(UsageGroup::class, $item), - $data['groups'] - ) - : $data['groups'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'metric' => static::serializeValue($this->metric), - 'interval' => static::serializeValue($this->interval), - 'groups' => static::serializeValue($this->groups) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/UsageGaugeList.php b/src/Appwrite/Models/UsageGaugeList.php deleted file mode 100644 index d644dad6..00000000 --- a/src/Appwrite/Models/UsageGaugeList.php +++ /dev/null @@ -1,66 +0,0 @@ - $groups aggregated groups ordered by time ascending. each group carries the latest snapshot in its interval (argmax over time). - */ - public function __construct( - public string $metric, - public string $interval, - public array $groups - ) { - } - - /** - * @param array $data - */ - public static function from(array $data): static - { - if (!array_key_exists('metric', $data)) { - throw new \InvalidArgumentException('Missing required field "metric" for ' . static::class . '.'); - } - if (!array_key_exists('interval', $data)) { - throw new \InvalidArgumentException('Missing required field "interval" for ' . static::class . '.'); - } - if (!array_key_exists('groups', $data)) { - throw new \InvalidArgumentException('Missing required field "groups" for ' . static::class . '.'); - } - - return new static( - metric: $data['metric'], - interval: $data['interval'], - groups: is_array($data['groups']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(UsageGroup::class, $item), - $data['groups'] - ) - : $data['groups'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'metric' => static::serializeValue($this->metric), - 'interval' => static::serializeValue($this->interval), - 'groups' => static::serializeValue($this->groups) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/UsageGroup.php b/src/Appwrite/Models/UsageGroup.php deleted file mode 100644 index 8518023c..00000000 --- a/src/Appwrite/Models/UsageGroup.php +++ /dev/null @@ -1,106 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('time', $data)) { - throw new \InvalidArgumentException('Missing required field "time" for ' . static::class . '.'); - } - if (!array_key_exists('value', $data)) { - throw new \InvalidArgumentException('Missing required field "value" for ' . static::class . '.'); - } - - return new static( - time: $data['time'], - value: $data['value'], - path: array_key_exists('path', $data) ? $data['path'] : null, - method: array_key_exists('method', $data) ? $data['method'] : null, - status: array_key_exists('status', $data) ? $data['status'] : null, - service: array_key_exists('service', $data) ? $data['service'] : null, - country: array_key_exists('country', $data) ? $data['country'] : null, - region: array_key_exists('region', $data) ? $data['region'] : null, - hostname: array_key_exists('hostname', $data) ? $data['hostname'] : null, - osName: array_key_exists('osName', $data) ? $data['osName'] : null, - clientType: array_key_exists('clientType', $data) ? $data['clientType'] : null, - clientName: array_key_exists('clientName', $data) ? $data['clientName'] : null, - deviceName: array_key_exists('deviceName', $data) ? $data['deviceName'] : null, - teamId: array_key_exists('teamId', $data) ? $data['teamId'] : null, - resourceId: array_key_exists('resourceId', $data) ? $data['resourceId'] : null - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'time' => static::serializeValue($this->time), - 'value' => static::serializeValue($this->value), - 'path' => static::serializeValue($this->path), - 'method' => static::serializeValue($this->method), - 'status' => static::serializeValue($this->status), - 'service' => static::serializeValue($this->service), - 'country' => static::serializeValue($this->country), - 'region' => static::serializeValue($this->region), - 'hostname' => static::serializeValue($this->hostname), - 'osName' => static::serializeValue($this->osName), - 'clientType' => static::serializeValue($this->clientType), - 'clientName' => static::serializeValue($this->clientName), - 'deviceName' => static::serializeValue($this->deviceName), - 'teamId' => static::serializeValue($this->teamId), - 'resourceId' => static::serializeValue($this->resourceId) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Query.php b/src/Appwrite/Query.php index a4238640..da0abffa 100644 --- a/src/Appwrite/Query.php +++ b/src/Appwrite/Query.php @@ -573,6 +573,42 @@ public static function distanceLessThan(string $attribute, array $values, int|fl return (new Query('distanceLessThan', $attribute, [[$values, $distance, $meters]]))->__toString(); } + /** + * Vector Dot + * + * @param string $attribute + * @param array $vector + * @return string + */ + public static function vectorDot(string $attribute, array $vector): string + { + return (new Query('vectorDot', $attribute, [$vector]))->__toString(); + } + + /** + * Vector Cosine + * + * @param string $attribute + * @param array $vector + * @return string + */ + public static function vectorCosine(string $attribute, array $vector): string + { + return (new Query('vectorCosine', $attribute, [$vector]))->__toString(); + } + + /** + * Vector Euclidean + * + * @param string $attribute + * @param array $vector + * @return string + */ + public static function vectorEuclidean(string $attribute, array $vector): string + { + return (new Query('vectorEuclidean', $attribute, [$vector]))->__toString(); + } + /** * Intersects * diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index d490f2a3..c6cc9542 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -384,15 +384,26 @@ public function deletePolicy(string $policyId): string /** * 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. + * * * @param string $archiveId * @param array $services * @param ?string $newResourceId * @param ?string $newResourceName + * @param ?string $newSpecification * @throws AppwriteException * @return \Appwrite\Models\BackupRestoration */ - public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null): \Appwrite\Models\BackupRestoration + public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null, ?string $newSpecification = null): \Appwrite\Models\BackupRestoration { $apiPath = str_replace( [], @@ -412,6 +423,10 @@ public function createRestoration(string $archiveId, array $services, ?string $n $apiParams['newResourceName'] = $newResourceName; } + if (!is_null($newSpecification)) { + $apiParams['newSpecification'] = $newSpecification; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index a9e1e766..8c7d3a33 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -127,6 +127,9 @@ public function create(string $databaseId, string $name, ?bool $enabled = null): * @param ?array $queries * @throws AppwriteException * @return \Appwrite\Models\TransactionList + * + * @deprecated This API has been deprecated since 1.8.0. Please use `listTransactions` instead. + * @see TablesDB::listTransactions */ public function listTransactions(?array $queries = null): \Appwrite\Models\TransactionList { @@ -167,6 +170,9 @@ public function listTransactions(?array $queries = null): \Appwrite\Models\Trans * @param ?int $ttl * @throws AppwriteException * @return \Appwrite\Models\Transaction + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createTransaction` instead. + * @see TablesDB::createTransaction */ public function createTransaction(?int $ttl = null): \Appwrite\Models\Transaction { @@ -208,6 +214,9 @@ public function createTransaction(?int $ttl = null): \Appwrite\Models\Transactio * @param string $transactionId * @throws AppwriteException * @return \Appwrite\Models\Transaction + * + * @deprecated This API has been deprecated since 1.8.0. Please use `getTransaction` instead. + * @see TablesDB::getTransaction */ public function getTransaction(string $transactionId): \Appwrite\Models\Transaction { @@ -247,6 +256,9 @@ public function getTransaction(string $transactionId): \Appwrite\Models\Transact * @param ?bool $rollback * @throws AppwriteException * @return \Appwrite\Models\Transaction + * + * @deprecated This API has been deprecated since 1.8.0. Please use `updateTransaction` instead. + * @see TablesDB::updateTransaction */ public function updateTransaction(string $transactionId, ?bool $commit = null, ?bool $rollback = null): \Appwrite\Models\Transaction { @@ -293,6 +305,9 @@ public function updateTransaction(string $transactionId, ?bool $commit = null, ? * @param string $transactionId * @throws AppwriteException * @return string + * + * @deprecated This API has been deprecated since 1.8.0. Please use `deleteTransaction` instead. + * @see TablesDB::deleteTransaction */ public function deleteTransaction(string $transactionId): string { @@ -327,6 +342,9 @@ public function deleteTransaction(string $transactionId): string * @param ?array $operations * @throws AppwriteException * @return \Appwrite\Models\Transaction + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createOperations` instead. + * @see TablesDB::createOperations */ public function createOperations(string $transactionId, ?array $operations = null): \Appwrite\Models\Transaction { @@ -1824,6 +1842,9 @@ public function updateLineAttribute(string $databaseId, string $collectionId, st * @param ?bool $encrypt * @throws AppwriteException * @return \Appwrite\Models\AttributeLongtext + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createLongtextColumn` instead. + * @see TablesDB::createLongtextColumn */ public function createLongtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\AttributeLongtext { @@ -1881,6 +1902,9 @@ public function createLongtextAttribute(string $databaseId, string $collectionId * @param ?string $newKey * @throws AppwriteException * @return \Appwrite\Models\AttributeLongtext + * + * @deprecated This API has been deprecated since 1.8.0. Please use `updateLongtextColumn` instead. + * @see TablesDB::updateLongtextColumn */ public function updateLongtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\AttributeLongtext { @@ -1931,6 +1955,9 @@ public function updateLongtextAttribute(string $databaseId, string $collectionId * @param ?bool $encrypt * @throws AppwriteException * @return \Appwrite\Models\AttributeMediumtext + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createMediumtextColumn` instead. + * @see TablesDB::createMediumtextColumn */ public function createMediumtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\AttributeMediumtext { @@ -1988,6 +2015,9 @@ public function createMediumtextAttribute(string $databaseId, string $collection * @param ?string $newKey * @throws AppwriteException * @return \Appwrite\Models\AttributeMediumtext + * + * @deprecated This API has been deprecated since 1.8.0. Please use `updateMediumtextColumn` instead. + * @see TablesDB::updateMediumtextColumn */ public function updateMediumtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\AttributeMediumtext { @@ -2474,6 +2504,9 @@ public function updateStringAttribute(string $databaseId, string $collectionId, * @param ?bool $encrypt * @throws AppwriteException * @return \Appwrite\Models\AttributeText + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createTextColumn` instead. + * @see TablesDB::createTextColumn */ public function createTextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\AttributeText { @@ -2531,6 +2564,9 @@ public function createTextAttribute(string $databaseId, string $collectionId, st * @param ?string $newKey * @throws AppwriteException * @return \Appwrite\Models\AttributeText + * + * @deprecated This API has been deprecated since 1.8.0. Please use `updateTextColumn` instead. + * @see TablesDB::updateTextColumn */ public function updateTextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\AttributeText { @@ -2690,6 +2726,9 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str * @param ?bool $encrypt * @throws AppwriteException * @return \Appwrite\Models\AttributeVarchar + * + * @deprecated This API has been deprecated since 1.8.0. Please use `createVarcharColumn` instead. + * @see TablesDB::createVarcharColumn */ public function createVarcharAttribute(string $databaseId, string $collectionId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\AttributeVarchar { @@ -2749,6 +2788,9 @@ public function createVarcharAttribute(string $databaseId, string $collectionId, * @param ?string $newKey * @throws AppwriteException * @return \Appwrite\Models\AttributeVarchar + * + * @deprecated This API has been deprecated since 1.8.0. Please use `updateVarcharColumn` instead. + * @see TablesDB::updateVarcharColumn */ public function updateVarcharAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault, ?int $size = null, ?string $newKey = null): \Appwrite\Models\AttributeVarchar { diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index 21628d65..1db8154c 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -249,10 +249,11 @@ public function listRuntimes(): \Appwrite\Models\RuntimeList /** * List allowed function specifications for this instance. * + * @param ?string $type * @throws AppwriteException * @return \Appwrite\Models\SpecificationList */ - public function listSpecifications(): \Appwrite\Models\SpecificationList + public function listSpecifications(?string $type = null): \Appwrite\Models\SpecificationList { $apiPath = str_replace( [], @@ -262,6 +263,10 @@ public function listSpecifications(): \Appwrite\Models\SpecificationList $apiParams = []; + if (!is_null($type)) { + $apiParams['type'] = $type; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'application/json'; @@ -416,10 +421,7 @@ public function update(string $functionId, string $name, ?Runtime $runtime = nul } $apiParams['providerBranches'] = $providerBranches; $apiParams['providerPaths'] = $providerPaths; - - if (!is_null($buildSpecification)) { - $apiParams['buildSpecification'] = $buildSpecification; - } + $apiParams['buildSpecification'] = $buildSpecification; if (!is_null($runtimeSpecification)) { $apiParams['runtimeSpecification'] = $runtimeSpecification; @@ -1111,10 +1113,11 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri * @param string $functionId * @param string $deploymentId * @param ?DeploymentDownloadType $type + * @param ?string $token * @throws AppwriteException * @return string */ - public function getDeploymentDownload(string $functionId, string $deploymentId, ?DeploymentDownloadType $type = null): string + public function getDeploymentDownload(string $functionId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { $apiPath = str_replace( ['{functionId}', '{deploymentId}'], @@ -1130,6 +1133,10 @@ public function getDeploymentDownload(string $functionId, string $deploymentId, $apiParams['type'] = $type; } + if (!is_null($token)) { + $apiParams['token'] = $token; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; diff --git a/src/Appwrite/Services/Health.php b/src/Appwrite/Services/Health.php deleted file mode 100644 index 66ea3ea9..00000000 --- a/src/Appwrite/Services/Health.php +++ /dev/null @@ -1,1012 +0,0 @@ -client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatus::from($response); - - } - - /** - * Check the Appwrite Antivirus server is up and connection is successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthAntivirus - */ - public function getAntivirus(): \Appwrite\Models\HealthAntivirus - { - $apiPath = str_replace( - [], - [], - '/health/anti-virus' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthAntivirus::from($response); - - } - - /** - * 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. - * - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatusList - */ - public function getAuditsDB(): \Appwrite\Models\HealthStatusList - { - $apiPath = str_replace( - [], - [], - '/health/audits-db' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatusList::from($response); - - } - - /** - * Check the Appwrite in-memory cache servers are up and connection is - * successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatusList - */ - public function getCache(): \Appwrite\Models\HealthStatusList - { - $apiPath = str_replace( - [], - [], - '/health/cache' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatusList::from($response); - - } - - /** - * Get the SSL certificate for a domain - * - * @param ?string $domain - * @throws AppwriteException - * @return \Appwrite\Models\HealthCertificate - */ - public function getCertificate(?string $domain = null): \Appwrite\Models\HealthCertificate - { - $apiPath = str_replace( - [], - [], - '/health/certificate' - ); - - $apiParams = []; - - if (!is_null($domain)) { - $apiParams['domain'] = $domain; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthCertificate::from($response); - - } - - /** - * Get console pausing health status. Monitors projects approaching the pause - * threshold to detect potential issues with console access tracking. - * - * - * @param ?int $threshold - * @param ?int $inactivityDays - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatus - */ - public function getConsolePausing(?int $threshold = null, ?int $inactivityDays = null): \Appwrite\Models\HealthStatus - { - $apiPath = str_replace( - [], - [], - '/health/console-pausing' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - if (!is_null($inactivityDays)) { - $apiParams['inactivityDays'] = $inactivityDays; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatus::from($response); - - } - - /** - * Check the Appwrite database servers are up and connection is successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatusList - */ - public function getDB(): \Appwrite\Models\HealthStatusList - { - $apiPath = str_replace( - [], - [], - '/health/db' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatusList::from($response); - - } - - /** - * Check the Appwrite pub-sub servers are up and connection is successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatusList - */ - public function getPubSub(): \Appwrite\Models\HealthStatusList - { - $apiPath = str_replace( - [], - [], - '/health/pubsub' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatusList::from($response); - - } - - /** - * Get the number of audit logs that are waiting to be processed in the - * Appwrite internal queue server. - * - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueAudits(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/audits' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of builds that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueBuilds(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/builds' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueCertificates(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/certificates' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of database changes that are waiting to be processed in the - * Appwrite internal queue server. - * - * @param ?string $name - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueDatabases(?string $name = null, ?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/databases' - ); - - $apiParams = []; - - if (!is_null($name)) { - $apiParams['name'] = $name; - } - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of background destructive changes that are waiting to be - * processed in the Appwrite internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueDeletes(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/deletes' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Returns the amount of failed jobs in a given queue. - * - * - * @param HealthQueueName $name - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getFailedJobs(HealthQueueName $name, ?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - ['{name}'], - [$name], - '/health/queue/failed/{name}' - ); - - $apiParams = []; - $apiParams['name'] = $name; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of function executions that are waiting to be processed in - * the Appwrite internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueFunctions(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/functions' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueLogs(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/logs' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of mails that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueMails(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/mails' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of messages that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueMessaging(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/messaging' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of migrations that are waiting to be processed in the - * Appwrite internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueMigrations(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/migrations' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of metrics that are waiting to be processed in the Appwrite - * stats resources queue. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueStatsResources(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/stats-resources' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of metrics that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueUsage(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/stats-usage' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @param ?int $threshold - * @throws AppwriteException - * @return \Appwrite\Models\HealthQueue - */ - public function getQueueWebhooks(?int $threshold = null): \Appwrite\Models\HealthQueue - { - $apiPath = str_replace( - [], - [], - '/health/queue/webhooks' - ); - - $apiParams = []; - - if (!is_null($threshold)) { - $apiParams['threshold'] = $threshold; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthQueue::from($response); - - } - - /** - * Check the Appwrite storage device is up and connection is successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatus - */ - public function getStorage(): \Appwrite\Models\HealthStatus - { - $apiPath = str_replace( - [], - [], - '/health/storage' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatus::from($response); - - } - - /** - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthStatus - */ - public function getStorageLocal(): \Appwrite\Models\HealthStatus - { - $apiPath = str_replace( - [], - [], - '/health/storage/local' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthStatus::from($response); - - } - - /** - * 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. - * - * @throws AppwriteException - * @return \Appwrite\Models\HealthTime - */ - public function getTime(): \Appwrite\Models\HealthTime - { - $apiPath = str_replace( - [], - [], - '/health/time' - ); - - $apiParams = []; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\HealthTime::from($response); - - } -} diff --git a/src/Appwrite/Services/Messaging.php b/src/Appwrite/Services/Messaging.php index 76801acf..ee68c3bc 100644 --- a/src/Appwrite/Services/Messaging.php +++ b/src/Appwrite/Services/Messaging.php @@ -599,53 +599,6 @@ public function delete(string $messageId): string } - /** - * Get the message activity logs listed by its unique ID. - * - * @param string $messageId - * @param ?array $queries - * @param ?bool $total - * @throws AppwriteException - * @return \Appwrite\Models\LogList - */ - public function listMessageLogs(string $messageId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList - { - $apiPath = str_replace( - ['{messageId}'], - [$messageId], - '/messaging/messages/{messageId}/logs' - ); - - $apiParams = []; - $apiParams['messageId'] = $messageId; - - if (!is_null($queries)) { - $apiParams['queries'] = $queries; - } - - if (!is_null($total)) { - $apiParams['total'] = $total; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\LogList::from($response); - - } - /** * Get a list of the targets associated with a message. * @@ -2394,100 +2347,6 @@ public function deleteProvider(string $providerId): string } - /** - * Get the provider activity logs listed by its unique ID. - * - * @param string $providerId - * @param ?array $queries - * @param ?bool $total - * @throws AppwriteException - * @return \Appwrite\Models\LogList - */ - public function listProviderLogs(string $providerId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList - { - $apiPath = str_replace( - ['{providerId}'], - [$providerId], - '/messaging/providers/{providerId}/logs' - ); - - $apiParams = []; - $apiParams['providerId'] = $providerId; - - if (!is_null($queries)) { - $apiParams['queries'] = $queries; - } - - if (!is_null($total)) { - $apiParams['total'] = $total; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\LogList::from($response); - - } - - /** - * Get the subscriber activity logs listed by its unique ID. - * - * @param string $subscriberId - * @param ?array $queries - * @param ?bool $total - * @throws AppwriteException - * @return \Appwrite\Models\LogList - */ - public function listSubscriberLogs(string $subscriberId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList - { - $apiPath = str_replace( - ['{subscriberId}'], - [$subscriberId], - '/messaging/subscribers/{subscriberId}/logs' - ); - - $apiParams = []; - $apiParams['subscriberId'] = $subscriberId; - - if (!is_null($queries)) { - $apiParams['queries'] = $queries; - } - - if (!is_null($total)) { - $apiParams['total'] = $total; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\LogList::from($response); - - } - /** * Get a list of all topics from the current Appwrite project. * @@ -2697,53 +2556,6 @@ public function deleteTopic(string $topicId): string } - /** - * Get the topic activity logs listed by its unique ID. - * - * @param string $topicId - * @param ?array $queries - * @param ?bool $total - * @throws AppwriteException - * @return \Appwrite\Models\LogList - */ - public function listTopicLogs(string $topicId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList - { - $apiPath = str_replace( - ['{topicId}'], - [$topicId], - '/messaging/topics/{topicId}/logs' - ); - - $apiParams = []; - $apiParams['topicId'] = $topicId; - - if (!is_null($queries)) { - $apiParams['queries'] = $queries; - } - - if (!is_null($total)) { - $apiParams['total'] = $total; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\LogList::from($response); - - } - /** * Get a list of all subscribers from the current Appwrite project. * diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php index d99efb5b..e50f89f5 100644 --- a/src/Appwrite/Services/Organization.php +++ b/src/Appwrite/Services/Organization.php @@ -16,6 +16,111 @@ public function __construct(Client $client) parent::__construct($client); } + /** + * Get the current organization. + * + * @throws AppwriteException + * @return \Appwrite\Models\Organization + */ + public function get(): \Appwrite\Models\Organization + { + $apiPath = str_replace( + [], + [], + '/organization' + ); + + $apiParams = []; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Organization::from($response); + + } + + /** + * Update the current organization's name. + * + * @param string $name + * @throws AppwriteException + * @return \Appwrite\Models\Organization + */ + public function update(string $name): \Appwrite\Models\Organization + { + $apiPath = str_replace( + [], + [], + '/organization' + ); + + $apiParams = []; + $apiParams['name'] = $name; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Organization::from($response); + + } + + /** + * Delete the current organization. All projects that belong to the + * organization are deleted as well. + * + * @throws AppwriteException + * @return string + */ + public function delete(): string + { + $apiPath = str_replace( + [], + [], + '/organization' + ); + + $apiParams = []; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * Get a list of all API keys from the current organization. * @@ -222,6 +327,233 @@ public function deleteKey(string $keyId): string } + /** + * Get a list of all memberships from the current organization. + * + * @param ?array $queries + * @param ?string $search + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\MembershipList + */ + public function listMemberships(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList + { + $apiPath = str_replace( + [], + [], + '/organization/memberships' + ); + + $apiParams = []; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\MembershipList::from($response); + + } + + /** + * 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. + * + * @param array $roles + * @param ?string $email + * @param ?string $userId + * @param ?string $phone + * @param ?string $url + * @param ?string $name + * @throws AppwriteException + * @return \Appwrite\Models\Membership + */ + public function createMembership(array $roles, ?string $email = null, ?string $userId = null, ?string $phone = null, ?string $url = null, ?string $name = null): \Appwrite\Models\Membership + { + $apiPath = str_replace( + [], + [], + '/organization/memberships' + ); + + $apiParams = []; + $apiParams['roles'] = $roles; + + if (!is_null($email)) { + $apiParams['email'] = $email; + } + + if (!is_null($userId)) { + $apiParams['userId'] = $userId; + } + + if (!is_null($phone)) { + $apiParams['phone'] = $phone; + } + + if (!is_null($url)) { + $apiParams['url'] = $url; + } + + if (!is_null($name)) { + $apiParams['name'] = $name; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Membership::from($response); + + } + + /** + * Get a membership from the current organization by its unique ID. + * + * @param string $membershipId + * @throws AppwriteException + * @return \Appwrite\Models\Membership + */ + public function getMembership(string $membershipId): \Appwrite\Models\Membership + { + $apiPath = str_replace( + ['{membershipId}'], + [$membershipId], + '/organization/memberships/{membershipId}' + ); + + $apiParams = []; + $apiParams['membershipId'] = $membershipId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Membership::from($response); + + } + + /** + * Modify the roles of a member in the current organization. + * + * @param string $membershipId + * @param array $roles + * @throws AppwriteException + * @return \Appwrite\Models\Membership + */ + public function updateMembership(string $membershipId, array $roles): \Appwrite\Models\Membership + { + $apiPath = str_replace( + ['{membershipId}'], + [$membershipId], + '/organization/memberships/{membershipId}' + ); + + $apiParams = []; + $apiParams['membershipId'] = $membershipId; + $apiParams['roles'] = $roles; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Membership::from($response); + + } + + /** + * Remove a member from the current organization. The member is removed + * whether they accepted the invitation or not; a pending invitation is + * revoked. + * + * @param string $membershipId + * @throws AppwriteException + * @return string + */ + public function deleteMembership(string $membershipId): string + { + $apiPath = str_replace( + ['{membershipId}'], + [$membershipId], + '/organization/memberships/{membershipId}' + ); + + $apiParams = []; + $apiParams['membershipId'] = $membershipId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * Get a list of all projects. You can use the query params to filter your * results. diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index 5e3ba5ac..475d5f8e 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -9,6 +9,7 @@ use Appwrite\Enums\ProjectAuthMethodId; use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\ProjectOAuth2GooglePrompt; +use Appwrite\Enums\ProjectOAuth2OidcPrompt; use Appwrite\Enums\ProjectOAuthProviderId; use Appwrite\Enums\ProjectPolicyId; use Appwrite\Enums\ProjectProtocolId; @@ -685,10 +686,11 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) * @param ?int $userCodeLength * @param ?string $userCodeFormat * @param ?int $deviceCodeDuration + * @param ?array $defaultScopes * @throws AppwriteException * @return \Appwrite\Models\Project */ - public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null): \Appwrite\Models\Project + public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null): \Appwrite\Models\Project { $apiPath = str_replace( [], @@ -723,6 +725,10 @@ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?arr } $apiParams['deviceCodeDuration'] = $deviceCodeDuration; + if (!is_null($defaultScopes)) { + $apiParams['defaultScopes'] = $defaultScopes; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; @@ -831,6 +837,48 @@ public function updateOAuth2Apple(?string $serviceId = null, ?string $keyId = nu } + /** + * Update the project OAuth2 Appwrite configuration. + * + * @param ?string $clientId + * @param ?string $clientSecret + * @param ?bool $enabled + * @throws AppwriteException + * @return \Appwrite\Models\OAuth2Appwrite + */ + public function updateOAuth2Appwrite(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Appwrite + { + $apiPath = str_replace( + [], + [], + '/project/oauth2/appwrite' + ); + + $apiParams = []; + $apiParams['clientId'] = $clientId; + $apiParams['clientSecret'] = $clientSecret; + $apiParams['enabled'] = $enabled; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\OAuth2Appwrite::from($response); + + } + /** * Update the project OAuth2 Auth0 configuration. * @@ -1780,11 +1828,13 @@ public function updateOAuth2Notion(?string $oauthClientId = null, ?string $oauth * @param ?string $authorizationURL * @param ?string $tokenURL * @param ?string $userInfoURL + * @param ?array $prompt + * @param ?int $maxAge * @param ?bool $enabled * @throws AppwriteException * @return \Appwrite\Models\OAuth2Oidc */ - public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret = null, ?string $wellKnownURL = null, ?string $authorizationURL = null, ?string $tokenURL = null, ?string $userInfoURL = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Oidc + public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret = null, ?string $wellKnownURL = null, ?string $authorizationURL = null, ?string $tokenURL = null, ?string $userInfoURL = null, ?array $prompt = null, ?int $maxAge = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Oidc { $apiPath = str_replace( [], @@ -1799,6 +1849,8 @@ public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret $apiParams['authorizationURL'] = $authorizationURL; $apiParams['tokenURL'] = $tokenURL; $apiParams['userInfoURL'] = $userInfoURL; + $apiParams['prompt'] = $prompt; + $apiParams['maxAge'] = $maxAge; $apiParams['enabled'] = $enabled; $apiHeaders = []; diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index 6c2c25e3..b7e44fdb 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -249,10 +249,11 @@ public function listFrameworks(): \Appwrite\Models\FrameworkList /** * List allowed site specifications for this instance. * + * @param ?string $type * @throws AppwriteException * @return \Appwrite\Models\SpecificationList */ - public function listSpecifications(): \Appwrite\Models\SpecificationList + public function listSpecifications(?string $type = null): \Appwrite\Models\SpecificationList { $apiPath = str_replace( [], @@ -262,6 +263,10 @@ public function listSpecifications(): \Appwrite\Models\SpecificationList $apiParams = []; + if (!is_null($type)) { + $apiParams['type'] = $type; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'application/json'; @@ -421,10 +426,7 @@ public function update(string $siteId, string $name, Framework $framework, ?bool } $apiParams['providerBranches'] = $providerBranches; $apiParams['providerPaths'] = $providerPaths; - - if (!is_null($buildSpecification)) { - $apiParams['buildSpecification'] = $buildSpecification; - } + $apiParams['buildSpecification'] = $buildSpecification; if (!is_null($runtimeSpecification)) { $apiParams['runtimeSpecification'] = $runtimeSpecification; diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index 4834e5f2..bff7d67b 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -76,11 +76,11 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @param string $databaseId * @param string $name * @param ?bool $enabled - * @param ?string $dedicatedDatabaseId + * @param ?string $specification * @throws AppwriteException * @return \Appwrite\Models\Database */ - public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $dedicatedDatabaseId = null): \Appwrite\Models\Database + public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $specification = null): \Appwrite\Models\Database { $apiPath = str_replace( [], @@ -96,8 +96,8 @@ public function create(string $databaseId, string $name, ?bool $enabled = null, $apiParams['enabled'] = $enabled; } - if (!is_null($dedicatedDatabaseId)) { - $apiParams['dedicatedDatabaseId'] = $dedicatedDatabaseId; + if (!is_null($specification)) { + $apiParams['specification'] = $specification; } $apiHeaders = []; diff --git a/src/Appwrite/Services/Usage.php b/src/Appwrite/Services/Usage.php deleted file mode 100644 index 5da84817..00000000 --- a/src/Appwrite/Services/Usage.php +++ /dev/null @@ -1,218 +0,0 @@ -client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\UsageEventList::from($response); - - } - - /** - * Aggregate usage gauge snapshots. Gauges are point-in-time values (storage - * totals, resource counts, …); each group carries the latest snapshot in - * its interval via `argMax(value, time)`. `metric` is required. - * - * **Two response shapes**: - * - Omit `interval` for a flat top-N table — `argMax(value, time)` per - * dimension combination over the whole window, no time axis. Useful for "top - * 10 resources by current storage". - * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — - * one snapshot per (time bucket × dimension combination). - * - * `dimensions[]` breaks each row down further — only `resourceId` and - * `teamId` are supported on gauges. `resourceId` and `teamId` parameters - * filter the underlying rows. `orderBy=value`+`orderDir=desc`+`limit=N` - * returns the top-N. When `startAt` is omitted, the default window adapts to - * interval (or 7d when interval is omitted). - * - * @param string $metric - * @param ?string $resourceId - * @param ?string $teamId - * @param ?string $interval - * @param ?array $dimensions - * @param ?string $startAt - * @param ?string $endAt - * @param ?string $orderBy - * @param ?string $orderDir - * @param ?int $limit - * @param ?int $offset - * @throws AppwriteException - * @return \Appwrite\Models\UsageGaugeList - */ - public function listGauges(string $metric, ?string $resourceId = null, ?string $teamId = null, ?string $interval = null, ?array $dimensions = null, ?string $startAt = null, ?string $endAt = null, ?string $orderBy = null, ?string $orderDir = null, ?int $limit = null, ?int $offset = null): \Appwrite\Models\UsageGaugeList - { - $apiPath = str_replace( - [], - [], - '/usage/gauges' - ); - - $apiParams = []; - $apiParams['metric'] = $metric; - - if (!is_null($resourceId)) { - $apiParams['resourceId'] = $resourceId; - } - - if (!is_null($teamId)) { - $apiParams['teamId'] = $teamId; - } - - if (!is_null($interval)) { - $apiParams['interval'] = $interval; - } - - if (!is_null($dimensions)) { - $apiParams['dimensions'] = $dimensions; - } - - if (!is_null($startAt)) { - $apiParams['startAt'] = $startAt; - } - - if (!is_null($endAt)) { - $apiParams['endAt'] = $endAt; - } - - if (!is_null($orderBy)) { - $apiParams['orderBy'] = $orderBy; - } - - if (!is_null($orderDir)) { - $apiParams['orderDir'] = $orderDir; - } - - if (!is_null($limit)) { - $apiParams['limit'] = $limit; - } - - if (!is_null($offset)) { - $apiParams['offset'] = $offset; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_GET, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\UsageGaugeList::from($response); - - } -} diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php index 4f705395..f4daf521 100644 --- a/tests/Appwrite/Services/ActivitiesTest.php +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -41,9 +41,7 @@ public function testMethodListEvents(): void "time" => "2020-10-15T06:38:00.000+00:00", "projectId" => "610fc2f985ee0", "teamId" => "610fc2f985ee0", - "hostname" => "appwrite.io", - "countryCode" => "US", - "countryName" => "United States" + "hostname" => "appwrite.io" ) ) ); @@ -80,9 +78,7 @@ public function testMethodGetEvent(): void "time" => "2020-10-15T06:38:00.000+00:00", "projectId" => "610fc2f985ee0", "teamId" => "610fc2f985ee0", - "hostname" => "appwrite.io", - "countryCode" => "US", - "countryName" => "United States" + "hostname" => "appwrite.io" ); $this->client diff --git a/tests/Appwrite/Services/BackupsTest.php b/tests/Appwrite/Services/BackupsTest.php index ee9d09d4..da100a87 100644 --- a/tests/Appwrite/Services/BackupsTest.php +++ b/tests/Appwrite/Services/BackupsTest.php @@ -280,7 +280,7 @@ public function testMethodCreateRestoration(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName}]}" + "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" ); $this->client @@ -314,7 +314,7 @@ public function testMethodListRestorations(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName}]}" + "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" ) ) ); @@ -344,7 +344,7 @@ public function testMethodGetRestoration(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName}]}" + "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" ); $this->client diff --git a/tests/Appwrite/Services/HealthTest.php b/tests/Appwrite/Services/HealthTest.php deleted file mode 100644 index 7f76bbb3..00000000 --- a/tests/Appwrite/Services/HealthTest.php +++ /dev/null @@ -1,518 +0,0 @@ -client = Mockery::mock(Client::class); - $this->health = new Health($this->client); - } - - public function testMethodGet(): void - { - $data = array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->get(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatus::class, $response); - } - - public function testMethodGetAntivirus(): void - { - $data = array( - "version" => "1.0.0", - "status" => "disabled" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getAntivirus(); - - $this->assertInstanceOf(\Appwrite\Models\HealthAntivirus::class, $response); - } - - public function testMethodGetAuditsDB(): void - { - $data = array( - "total" => 5, - "statuses" => array( - array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getAuditsDB(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatusList::class, $response); - } - - public function testMethodGetCache(): void - { - $data = array( - "total" => 5, - "statuses" => array( - array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getCache(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatusList::class, $response); - } - - public function testMethodGetCertificate(): void - { - $data = array( - "name" => "/CN=www.google.com", - "subjectSN" => "[SUBJECTSN]", - "issuerOrganisation" => "[ISSUERORGANISATION]", - "validFrom" => "1704200998", - "validTo" => "1711458597", - "signatureTypeSN" => "RSA-SHA256" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getCertificate(); - - $this->assertInstanceOf(\Appwrite\Models\HealthCertificate::class, $response); - } - - public function testMethodGetConsolePausing(): void - { - $data = array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getConsolePausing(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatus::class, $response); - } - - public function testMethodGetDB(): void - { - $data = array( - "total" => 5, - "statuses" => array( - array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getDB(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatusList::class, $response); - } - - public function testMethodGetPubSub(): void - { - $data = array( - "total" => 5, - "statuses" => array( - array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getPubSub(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatusList::class, $response); - } - - public function testMethodGetQueueAudits(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueAudits(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueBuilds(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueBuilds(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueCertificates(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueCertificates(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueDatabases(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueDatabases(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueDeletes(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueDeletes(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetFailedJobs(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getFailedJobs( - HealthQueueName::V1DATABASE() - ); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueFunctions(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueFunctions(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueLogs(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueLogs(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueMails(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueMails(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueMessaging(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueMessaging(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueMigrations(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueMigrations(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueStatsResources(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueStatsResources(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueUsage(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueUsage(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetQueueWebhooks(): void - { - $data = array( - "size" => 8 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getQueueWebhooks(); - - $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); - } - - public function testMethodGetStorage(): void - { - $data = array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getStorage(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatus::class, $response); - } - - public function testMethodGetStorageLocal(): void - { - $data = array( - "name" => "database", - "ping" => 128, - "status" => "pass" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getStorageLocal(); - - $this->assertInstanceOf(\Appwrite\Models\HealthStatus::class, $response); - } - - public function testMethodGetTime(): void - { - $data = array( - "remoteTime" => 1639490751, - "localTime" => 1639490844, - "diff" => 93 - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->health->getTime(); - - $this->assertInstanceOf(\Appwrite\Models\HealthTime::class, $response); - } - -} diff --git a/tests/Appwrite/Services/MessagingTest.php b/tests/Appwrite/Services/MessagingTest.php index 7b5a974c..2c51919a 100644 --- a/tests/Appwrite/Services/MessagingTest.php +++ b/tests/Appwrite/Services/MessagingTest.php @@ -276,52 +276,6 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListMessageLogs(): void - { - $data = array( - "total" => 5, - "logs" => array( - array( - "event" => "account.sessions.create", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", - "mode" => "admin", - "userType" => "user", - "ip" => "127.0.0.1", - "time" => "2020-10-15T06:38:00.000+00:00", - "osCode" => "Mac", - "osName" => "Mac", - "osVersion" => "Mac", - "clientType" => "browser", - "clientCode" => "CM", - "clientName" => "Chrome Mobile iOS", - "clientVersion" => "84.0", - "clientEngine" => "WebKit", - "clientEngineVersion" => "605.1.15", - "deviceName" => "smartphone", - "deviceBrand" => "Google", - "deviceModel" => "Nexus 5", - "countryCode" => "US", - "countryName" => "United States" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->messaging->listMessageLogs( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); - } - public function testMethodListTargets(): void { $data = array( @@ -1090,98 +1044,6 @@ public function testMethodDeleteProvider(): void $this->assertSame($data, $response); } - public function testMethodListProviderLogs(): void - { - $data = array( - "total" => 5, - "logs" => array( - array( - "event" => "account.sessions.create", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", - "mode" => "admin", - "userType" => "user", - "ip" => "127.0.0.1", - "time" => "2020-10-15T06:38:00.000+00:00", - "osCode" => "Mac", - "osName" => "Mac", - "osVersion" => "Mac", - "clientType" => "browser", - "clientCode" => "CM", - "clientName" => "Chrome Mobile iOS", - "clientVersion" => "84.0", - "clientEngine" => "WebKit", - "clientEngineVersion" => "605.1.15", - "deviceName" => "smartphone", - "deviceBrand" => "Google", - "deviceModel" => "Nexus 5", - "countryCode" => "US", - "countryName" => "United States" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->messaging->listProviderLogs( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); - } - - public function testMethodListSubscriberLogs(): void - { - $data = array( - "total" => 5, - "logs" => array( - array( - "event" => "account.sessions.create", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", - "mode" => "admin", - "userType" => "user", - "ip" => "127.0.0.1", - "time" => "2020-10-15T06:38:00.000+00:00", - "osCode" => "Mac", - "osName" => "Mac", - "osVersion" => "Mac", - "clientType" => "browser", - "clientCode" => "CM", - "clientName" => "Chrome Mobile iOS", - "clientVersion" => "84.0", - "clientEngine" => "WebKit", - "clientEngineVersion" => "605.1.15", - "deviceName" => "smartphone", - "deviceBrand" => "Google", - "deviceModel" => "Nexus 5", - "countryCode" => "US", - "countryName" => "United States" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->messaging->listSubscriberLogs( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); - } - public function testMethodListTopics(): void { $data = array( @@ -1312,52 +1174,6 @@ public function testMethodDeleteTopic(): void $this->assertSame($data, $response); } - public function testMethodListTopicLogs(): void - { - $data = array( - "total" => 5, - "logs" => array( - array( - "event" => "account.sessions.create", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", - "mode" => "admin", - "userType" => "user", - "ip" => "127.0.0.1", - "time" => "2020-10-15T06:38:00.000+00:00", - "osCode" => "Mac", - "osName" => "Mac", - "osVersion" => "Mac", - "clientType" => "browser", - "clientCode" => "CM", - "clientName" => "Chrome Mobile iOS", - "clientVersion" => "84.0", - "clientEngine" => "WebKit", - "clientEngineVersion" => "605.1.15", - "deviceName" => "smartphone", - "deviceBrand" => "Google", - "deviceModel" => "Nexus 5", - "countryCode" => "US", - "countryName" => "United States" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->messaging->listTopicLogs( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); - } - public function testMethodListSubscribers(): void { $data = array( diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php index 4b573c1b..237ef05f 100644 --- a/tests/Appwrite/Services/OrganizationTest.php +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -20,6 +20,484 @@ protected function setUp(): void $this->organization = new Organization($this->client); } + public function testMethodGet(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "VIP", + "total" => 7, + "prefs" => array(), + "billingBudget" => 50, + "budgetAlerts" => array(), + "billingPlan" => "tier-1", + "billingPlanId" => "tier-1", + "billingPlanDetails" => array( + "\$id" => "tier-0", + "name" => "Hobby", + "desc" => "Hobby plan", + "order" => 0, + "price" => 25, + "trial" => 14, + "bandwidth" => 25, + "storage" => 25, + "imageTransformations" => 100, + "screenshotsGenerated" => 50, + "members" => 25, + "webhooks" => 25, + "projects" => 2, + "platforms" => 3, + "users" => 25, + "teams" => 25, + "databases" => 25, + "databasesReads" => 500000, + "databasesWrites" => 250000, + "databasesBatchSize" => 100, + "buckets" => 25, + "fileSize" => 25, + "functions" => 25, + "sites" => 1, + "executions" => 25, + "executionsRetentionCount" => 10000, + "GBHours" => 100, + "realtime" => 25, + "realtimeMessages" => 100000, + "messages" => 1000, + "topics" => 1, + "authPhone" => 10, + "domains" => 5, + "activityLogs" => 7, + "usageLogs" => 30, + "projectInactivityDays" => 7, + "alertLimit" => 80, + "usage" => array( + "bandwidth" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "executions" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "member" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtime" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtimeMessages" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtimeBandwidth" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "storage" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "users" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "GBHours" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "imageTransformations" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "credits" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ) + ), + "addons" => array( + "seats" => array( + "supported" => true, + "planIncluded" => 1, + "limit" => 5, + "type" => "numeric", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "projects" => array( + "supported" => true, + "planIncluded" => 1, + "limit" => 5, + "type" => "numeric", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ) + ), + "budgetCapEnabled" => true, + "customSmtp" => true, + "emailBranding" => true, + "requiresPaymentMethod" => true, + "requiresBillingAddress" => true, + "isAvailable" => true, + "selfService" => true, + "premiumSupport" => true, + "budgeting" => true, + "supportsMockNumbers" => true, + "supportsOrganizationRoles" => true, + "supportsCredits" => true, + "supportsDisposableEmailValidation" => true, + "supportsCanonicalEmailValidation" => true, + "supportsFreeEmailValidation" => true, + "supportsCorporateEmailValidation" => true, + "supportsProjectSpecificRoles" => true, + "backupsEnabled" => true, + "usagePerProject" => true, + "supportedAddons" => array( + "baa" => true, + "premiumGeoDB" => true, + "premiumGeoDBOrg" => true + ), + "backupPolicies" => true, + "deploymentSize" => 30, + "buildSize" => 2000, + "databasesAllowEncrypt" => true, + "group" => "starter" + ), + "billingEmail" => "billing@org.example", + "billingStartDate" => "2020-10-15T06:38:00.000+00:00", + "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", + "billingNextInvoiceDate" => "2020-10-15T06:38:00.000+00:00", + "billingTrialStartDate" => "2020-10-15T06:38:00.000+00:00", + "billingTrialDays" => 14, + "billingAggregationId" => "adbc3de4rddfsd", + "billingInvoiceId" => "adbc3de4rddfsd", + "paymentMethodId" => "adbc3de4rddfsd", + "billingAddressId" => "adbc3de4rddfsd", + "backupPaymentMethodId" => "adbc3de4rddfsd", + "status" => "active", + "remarks" => "Pending initial payment", + "agreementBAA" => "[AGREEMENTBAA]", + "programManagerName" => "[PROGRAMMANAGERNAME]", + "programManagerCalendar" => "[PROGRAMMANAGERCALENDAR]", + "programDiscordChannelName" => "[PROGRAMDISCORDCHANNELNAME]", + "programDiscordChannelUrl" => "[PROGRAMDISCORDCHANNELURL]", + "billingPlanDowngrade" => "tier-1", + "billingTaxId" => "[BILLINGTAXID]", + "markedForDeletion" => true, + "platform" => "imagine", + "projects" => array() + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->get(); + + $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); + } + + public function testMethodUpdate(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "VIP", + "total" => 7, + "prefs" => array(), + "billingBudget" => 50, + "budgetAlerts" => array(), + "billingPlan" => "tier-1", + "billingPlanId" => "tier-1", + "billingPlanDetails" => array( + "\$id" => "tier-0", + "name" => "Hobby", + "desc" => "Hobby plan", + "order" => 0, + "price" => 25, + "trial" => 14, + "bandwidth" => 25, + "storage" => 25, + "imageTransformations" => 100, + "screenshotsGenerated" => 50, + "members" => 25, + "webhooks" => 25, + "projects" => 2, + "platforms" => 3, + "users" => 25, + "teams" => 25, + "databases" => 25, + "databasesReads" => 500000, + "databasesWrites" => 250000, + "databasesBatchSize" => 100, + "buckets" => 25, + "fileSize" => 25, + "functions" => 25, + "sites" => 1, + "executions" => 25, + "executionsRetentionCount" => 10000, + "GBHours" => 100, + "realtime" => 25, + "realtimeMessages" => 100000, + "messages" => 1000, + "topics" => 1, + "authPhone" => 10, + "domains" => 5, + "activityLogs" => 7, + "usageLogs" => 30, + "projectInactivityDays" => 7, + "alertLimit" => 80, + "usage" => array( + "bandwidth" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "executions" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "member" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtime" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtimeMessages" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "realtimeBandwidth" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "storage" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "users" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "GBHours" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "imageTransformations" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "credits" => array( + "name" => "[NAME]", + "unit" => "GB", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ) + ), + "addons" => array( + "seats" => array( + "supported" => true, + "planIncluded" => 1, + "limit" => 5, + "type" => "numeric", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ), + "projects" => array( + "supported" => true, + "planIncluded" => 1, + "limit" => 5, + "type" => "numeric", + "currency" => "USD", + "price" => 5, + "value" => 25, + "invoiceDesc" => "[INVOICEDESC]" + ) + ), + "budgetCapEnabled" => true, + "customSmtp" => true, + "emailBranding" => true, + "requiresPaymentMethod" => true, + "requiresBillingAddress" => true, + "isAvailable" => true, + "selfService" => true, + "premiumSupport" => true, + "budgeting" => true, + "supportsMockNumbers" => true, + "supportsOrganizationRoles" => true, + "supportsCredits" => true, + "supportsDisposableEmailValidation" => true, + "supportsCanonicalEmailValidation" => true, + "supportsFreeEmailValidation" => true, + "supportsCorporateEmailValidation" => true, + "supportsProjectSpecificRoles" => true, + "backupsEnabled" => true, + "usagePerProject" => true, + "supportedAddons" => array( + "baa" => true, + "premiumGeoDB" => true, + "premiumGeoDBOrg" => true + ), + "backupPolicies" => true, + "deploymentSize" => 30, + "buildSize" => 2000, + "databasesAllowEncrypt" => true, + "group" => "starter" + ), + "billingEmail" => "billing@org.example", + "billingStartDate" => "2020-10-15T06:38:00.000+00:00", + "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", + "billingNextInvoiceDate" => "2020-10-15T06:38:00.000+00:00", + "billingTrialStartDate" => "2020-10-15T06:38:00.000+00:00", + "billingTrialDays" => 14, + "billingAggregationId" => "adbc3de4rddfsd", + "billingInvoiceId" => "adbc3de4rddfsd", + "paymentMethodId" => "adbc3de4rddfsd", + "billingAddressId" => "adbc3de4rddfsd", + "backupPaymentMethodId" => "adbc3de4rddfsd", + "status" => "active", + "remarks" => "Pending initial payment", + "agreementBAA" => "[AGREEMENTBAA]", + "programManagerName" => "[PROGRAMMANAGERNAME]", + "programManagerCalendar" => "[PROGRAMMANAGERCALENDAR]", + "programDiscordChannelName" => "[PROGRAMDISCORDCHANNELNAME]", + "programDiscordChannelUrl" => "[PROGRAMDISCORDCHANNELURL]", + "billingPlanDowngrade" => "tier-1", + "billingTaxId" => "[BILLINGTAXID]", + "markedForDeletion" => true, + "platform" => "imagine", + "projects" => array() + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->update( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); + } + + public function testMethodDelete(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->delete(); + + $this->assertSame($data, $response); + } + public function testMethodListKeys(): void { $data = array( @@ -157,6 +635,164 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } + public function testMethodListMemberships(): void + { + $data = array( + "total" => 5, + "memberships" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "userName" => "John Doe", + "userEmail" => "john@appwrite.io", + "userPhone" => "+1 555 555 5555", + "teamId" => "5e5ea5c16897e", + "teamName" => "VIP", + "invited" => "2020-10-15T06:38:00.000+00:00", + "joined" => "2020-10-15T06:38:00.000+00:00", + "confirm" => true, + "mfa" => true, + "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "roles" => array() + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->listMemberships(); + + $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); + } + + public function testMethodCreateMembership(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "userName" => "John Doe", + "userEmail" => "john@appwrite.io", + "userPhone" => "+1 555 555 5555", + "teamId" => "5e5ea5c16897e", + "teamName" => "VIP", + "invited" => "2020-10-15T06:38:00.000+00:00", + "joined" => "2020-10-15T06:38:00.000+00:00", + "confirm" => true, + "mfa" => true, + "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "roles" => array() + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->createMembership( + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); + } + + public function testMethodGetMembership(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "userName" => "John Doe", + "userEmail" => "john@appwrite.io", + "userPhone" => "+1 555 555 5555", + "teamId" => "5e5ea5c16897e", + "teamName" => "VIP", + "invited" => "2020-10-15T06:38:00.000+00:00", + "joined" => "2020-10-15T06:38:00.000+00:00", + "confirm" => true, + "mfa" => true, + "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "roles" => array() + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->getMembership( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); + } + + public function testMethodUpdateMembership(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "userName" => "John Doe", + "userEmail" => "john@appwrite.io", + "userPhone" => "+1 555 555 5555", + "teamId" => "5e5ea5c16897e", + "teamName" => "VIP", + "invited" => "2020-10-15T06:38:00.000+00:00", + "joined" => "2020-10-15T06:38:00.000+00:00", + "confirm" => true, + "mfa" => true, + "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "roles" => array() + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->updateMembership( + "", + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); + } + + public function testMethodDeleteMembership(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->deleteMembership( + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodListProjects(): void { $data = array( @@ -195,6 +831,7 @@ public function testMethodListProjects(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -218,6 +855,7 @@ public function testMethodListProjects(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -277,6 +915,7 @@ public function testMethodCreateProject(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -300,6 +939,7 @@ public function testMethodCreateProject(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -360,6 +1000,7 @@ public function testMethodGetProject(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -383,6 +1024,7 @@ public function testMethodGetProject(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -442,6 +1084,7 @@ public function testMethodUpdateProject(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -465,6 +1108,7 @@ public function testMethodUpdateProject(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 104c8232..6cf56662 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -9,6 +9,7 @@ use Appwrite\Enums\ProjectAuthMethodId; use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\ProjectOAuth2GooglePrompt; +use Appwrite\Enums\ProjectOAuth2OidcPrompt; use Appwrite\Enums\ProjectOAuthProviderId; use Appwrite\Enums\ProjectPolicyId; use Appwrite\Enums\ProjectProtocolId; @@ -63,6 +64,7 @@ public function testMethodGet(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -86,6 +88,7 @@ public function testMethodGet(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -159,6 +162,7 @@ public function testMethodUpdateAuthMethod(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -182,6 +186,7 @@ public function testMethodUpdateAuthMethod(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -408,6 +413,7 @@ public function testMethodUpdateLabels(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -431,6 +437,7 @@ public function testMethodUpdateLabels(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -624,6 +631,7 @@ public function testMethodUpdateOAuth2Server(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -647,6 +655,7 @@ public function testMethodUpdateOAuth2Server(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -716,6 +725,27 @@ public function testMethodUpdateOAuth2Apple(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Apple::class, $response); } + public function testMethodUpdateOAuth2Appwrite(): void + { + $data = array( + "\$id" => "github", + "enabled" => true, + "clientId" => "6a42000000000000b5a0", + "clientSecret" => "b86afd000000000000000000000000000000000000000000000000000ced5f93" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->project->updateOAuth2Appwrite(); + + $this->assertInstanceOf(\Appwrite\Models\OAuth2Appwrite::class, $response); + } + public function testMethodUpdateOAuth2Auth0(): void { $data = array( @@ -1196,7 +1226,8 @@ public function testMethodUpdateOAuth2Oidc(): void "wellKnownURL" => "https://myoauth.com/.well-known/openid-configuration", "authorizationURL" => "https://myoauth.com/oauth2/authorize", "tokenURL" => "https://myoauth.com/oauth2/token", - "userInfoURL" => "https://myoauth.com/oauth2/userinfo" + "userInfoURL" => "https://myoauth.com/oauth2/userinfo", + "prompt" => array() ); $this->client @@ -1990,6 +2021,7 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2013,6 +2045,7 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2072,6 +2105,7 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2095,6 +2129,7 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2154,6 +2189,7 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2177,6 +2213,7 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2236,6 +2273,7 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2259,6 +2297,7 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2318,6 +2357,7 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2341,6 +2381,7 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2398,6 +2439,7 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2421,6 +2463,7 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2480,6 +2523,7 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2503,6 +2547,7 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2562,6 +2607,7 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2585,6 +2631,7 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2667,6 +2714,7 @@ public function testMethodUpdateSessionAlertPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2690,6 +2738,7 @@ public function testMethodUpdateSessionAlertPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2749,6 +2798,7 @@ public function testMethodUpdateSessionDurationPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2772,6 +2822,7 @@ public function testMethodUpdateSessionDurationPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2831,6 +2882,7 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2854,6 +2906,7 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2913,6 +2966,7 @@ public function testMethodUpdateSessionLimitPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -2936,6 +2990,7 @@ public function testMethodUpdateSessionLimitPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -2995,6 +3050,7 @@ public function testMethodUpdateUserLimitPolicy(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -3018,6 +3074,7 @@ public function testMethodUpdateUserLimitPolicy(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -3103,6 +3160,7 @@ public function testMethodUpdateProtocol(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -3126,6 +3184,7 @@ public function testMethodUpdateProtocol(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -3186,6 +3245,7 @@ public function testMethodUpdateService(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -3209,6 +3269,7 @@ public function testMethodUpdateService(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", @@ -3269,6 +3330,7 @@ public function testMethodUpdateSMTP(): void "pingedAt" => "2020-10-15T06:38:00.000+00:00", "labels" => array(), "status" => "active", + "onboarding" => array(), "authMethods" => array( array( "\$id" => "email-password", @@ -3292,6 +3354,7 @@ public function testMethodUpdateSMTP(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", "projectName" => "My Project", "region" => "fra", "organizationName" => "Acme Inc.", diff --git a/tests/Appwrite/Services/UsageTest.php b/tests/Appwrite/Services/UsageTest.php deleted file mode 100644 index c7ce46cf..00000000 --- a/tests/Appwrite/Services/UsageTest.php +++ /dev/null @@ -1,75 +0,0 @@ -client = Mockery::mock(Client::class); - $this->usage = new Usage($this->client); - } - - public function testMethodListEvents(): void - { - $data = array( - "metric" => "executions", - "interval" => "1d", - "groups" => array( - array( - "time" => "2026-04-09T12:00:00.000+00:00", - "value" => 5000 - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->usage->listEvents( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\UsageEventList::class, $response); - } - - public function testMethodListGauges(): void - { - $data = array( - "metric" => "files.storage", - "interval" => "1d", - "groups" => array( - array( - "time" => "2026-04-09T12:00:00.000+00:00", - "value" => 5000 - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->usage->listGauges( - "" - ); - - $this->assertInstanceOf(\Appwrite\Models\UsageGaugeList::class, $response); - } - -} From 9f39ef81c0fa5c826ec591632b03370b13483bd7 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 12:10:51 +0530 Subject: [PATCH 02/10] chore: update PHP SDK to 27.0.0 --- src/Appwrite/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 2787f561..9a1a4cd9 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -159,7 +159,7 @@ public function setJWT(string $value): Client */ public function setBearer(string $value): Client { - $this->addHeader('Authorization', $value); + $this->addHeader('Authorization', "Bearer {$value}"); $this->config['bearer'] = $value; $this->key = null; $this->authorization = null; From ab3b10f22985ad62335e0bdd292b61599bbac533 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 23 Jul 2026 16:17:21 +0530 Subject: [PATCH 03/10] chore: update PHP SDK to 27.1.0 --- CHANGELOG.md | 10 + docs/account.md | 83 ++ docs/apps.md | 315 +++++ docs/backups.md | 11 +- docs/examples/account/delete-consent-token.md | 17 + docs/examples/account/delete-consent.md | 16 + docs/examples/account/get-consent-token.md | 17 + docs/examples/account/get-consent.md | 16 + docs/examples/account/list-consent-tokens.md | 18 + docs/examples/account/list-consents.md | 17 + .../apps/create-installation-token.md | 17 + docs/examples/apps/create-key.md | 16 + docs/examples/apps/create-secret.md | 16 + docs/examples/apps/create.md | 34 + docs/examples/apps/delete-key.md | 17 + docs/examples/apps/delete-secret.md | 17 + docs/examples/apps/delete-tokens.md | 16 + docs/examples/apps/delete.md | 16 + docs/examples/apps/get-installation.md | 17 + docs/examples/apps/get-key.md | 17 + docs/examples/apps/get-secret.md | 17 + docs/examples/apps/get.md | 16 + .../examples/apps/list-installation-scopes.md | 15 + docs/examples/apps/list-installations.md | 18 + docs/examples/apps/list-keys.md | 18 + docs/examples/apps/list-o-auth-2-scopes.md | 15 + docs/examples/apps/list-secrets.md | 18 + docs/examples/apps/list.md | 17 + docs/examples/apps/update-labels.md | 17 + docs/examples/apps/update-team.md | 17 + docs/examples/apps/update.md | 35 + docs/examples/backups/create-restoration.md | 3 +- docs/examples/oauth2/approve.md | 18 + docs/examples/oauth2/authorize-post.md | 29 + docs/examples/oauth2/authorize.md | 29 + .../oauth2/create-device-authorization.md | 20 + docs/examples/oauth2/create-grant.md | 16 + docs/examples/oauth2/create-par.md | 28 + docs/examples/oauth2/create-token.md | 25 + docs/examples/oauth2/get-grant.md | 16 + docs/examples/oauth2/list-organizations.md | 18 + docs/examples/oauth2/list-projects.md | 18 + docs/examples/oauth2/reject.md | 16 + docs/examples/oauth2/revoke.md | 19 + .../organization/create-installation.md | 17 + .../organization/delete-installation.md | 16 + .../examples/organization/get-installation.md | 16 + .../organization/list-installations.md | 17 + .../organization/update-installation.md | 17 + .../project/update-o-auth-2-server.md | 1 + .../examples/sites/get-deployment-download.md | 3 +- docs/examples/tablesdb/create-failover.md | 17 + docs/examples/tablesdb/create.md | 3 +- docs/examples/tablesdb/get-replicas.md | 16 + docs/examples/tablesdb/get-status.md | 16 + docs/examples/tablesdb/list-specifications.md | 15 + docs/examples/tablesdb/update.md | 3 +- docs/examples/teams/create-installation.md | 18 + docs/examples/teams/delete-installation.md | 17 + docs/examples/teams/get-installation.md | 17 + docs/examples/teams/list-installations.md | 18 + docs/examples/teams/update-installation.md | 18 + docs/functions.md | 2 +- docs/oauth2.md | 230 ++++ docs/organization.md | 68 ++ docs/project.md | 1 + docs/sites.md | 1 + docs/tablesdb.md | 49 + docs/teams.md | 73 ++ src/Appwrite/Client.php | 4 +- src/Appwrite/Enums/DatabaseStatus.php | 99 ++ src/Appwrite/Enums/DatabaseType.php | 27 + src/Appwrite/Enums/OrganizationKeyScopes.php | 18 + src/Appwrite/Enums/ProjectKeyScopes.php | 27 + src/Appwrite/Models/ActivityEvent.php | 83 +- src/Appwrite/Models/App.php | 227 ++++ src/Appwrite/Models/AppInstallation.php | 107 ++ src/Appwrite/Models/AppInstallationList.php | 59 + src/Appwrite/Models/AppKey.php | 100 ++ src/Appwrite/Models/AppKeyList.php | 59 + src/Appwrite/Models/AppScope.php | 75 ++ src/Appwrite/Models/AppScopeList.php | 59 + src/Appwrite/Models/AppSecret.php | 100 ++ src/Appwrite/Models/AppSecretList.php | 59 + src/Appwrite/Models/AppSecretPlaintext.php | 100 ++ src/Appwrite/Models/AppsList.php | 59 + src/Appwrite/Models/BillingPlan.php | 7 + src/Appwrite/Models/Database.php | 60 +- src/Appwrite/Models/DatabaseStatus.php | 106 ++ .../Models/DatabaseStatusConnections.php | 54 + src/Appwrite/Models/DatabaseStatusReplica.php | 65 ++ src/Appwrite/Models/DatabaseStatusVolume.php | 68 ++ src/Appwrite/Models/DedicatedDatabase.php | 377 ++++++ .../Models/DedicatedDatabaseMember.php | 68 ++ .../Models/DedicatedDatabaseReplicas.php | 66 ++ .../Models/DedicatedDatabaseSpecification.php | 103 ++ .../DedicatedDatabaseSpecificationList.php | 66 ++ .../DedicatedDatabaseSpecificationPricing.php | 75 ++ src/Appwrite/Models/Oauth2Approve.php | 47 + src/Appwrite/Models/Oauth2Authorize.php | 54 + src/Appwrite/Models/Oauth2Consent.php | 110 ++ src/Appwrite/Models/Oauth2ConsentList.php | 59 + src/Appwrite/Models/Oauth2ConsentToken.php | 117 ++ .../Models/Oauth2ConsentTokenList.php | 59 + .../Models/Oauth2DeviceAuthorization.php | 82 ++ src/Appwrite/Models/Oauth2Grant.php | 124 ++ src/Appwrite/Models/Oauth2Organization.php | 47 + .../Models/Oauth2OrganizationList.php | 59 + src/Appwrite/Models/Oauth2PAR.php | 54 + src/Appwrite/Models/Oauth2Project.php | 61 + src/Appwrite/Models/Oauth2ProjectList.php | 59 + src/Appwrite/Models/Oauth2Reject.php | 47 + src/Appwrite/Models/Oauth2Token.php | 83 ++ src/Appwrite/Models/Project.php | 11 + src/Appwrite/Services/Account.php | 247 ++++ src/Appwrite/Services/Apps.php | 1026 +++++++++++++++++ src/Appwrite/Services/Backups.php | 38 +- src/Appwrite/Services/Functions.php | 5 +- src/Appwrite/Services/Oauth2.php | 782 +++++++++++++ src/Appwrite/Services/Organization.php | 208 ++++ src/Appwrite/Services/Project.php | 4 +- src/Appwrite/Services/Sites.php | 7 +- src/Appwrite/Services/TablesDB.php | 167 ++- src/Appwrite/Services/Teams.php | 218 ++++ tests/Appwrite/Services/AccountTest.php | 164 +++ tests/Appwrite/Services/ActivitiesTest.php | 26 +- tests/Appwrite/Services/AppsTest.php | 754 ++++++++++++ tests/Appwrite/Services/BackupsTest.php | 6 +- tests/Appwrite/Services/DatabasesTest.php | 120 +- tests/Appwrite/Services/Oauth2Test.php | 297 +++++ tests/Appwrite/Services/OrganizationTest.php | 147 ++- tests/Appwrite/Services/ProjectTest.php | 60 +- tests/Appwrite/Services/TablesDBTest.php | 296 +++-- tests/Appwrite/Services/TeamsTest.php | 139 +++ 134 files changed, 9671 insertions(+), 320 deletions(-) create mode 100644 docs/apps.md 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 create mode 100644 docs/oauth2.md create mode 100644 src/Appwrite/Models/App.php create mode 100644 src/Appwrite/Models/AppInstallation.php create mode 100644 src/Appwrite/Models/AppInstallationList.php create mode 100644 src/Appwrite/Models/AppKey.php create mode 100644 src/Appwrite/Models/AppKeyList.php create mode 100644 src/Appwrite/Models/AppScope.php create mode 100644 src/Appwrite/Models/AppScopeList.php create mode 100644 src/Appwrite/Models/AppSecret.php create mode 100644 src/Appwrite/Models/AppSecretList.php create mode 100644 src/Appwrite/Models/AppSecretPlaintext.php create mode 100644 src/Appwrite/Models/AppsList.php create mode 100644 src/Appwrite/Models/DatabaseStatus.php create mode 100644 src/Appwrite/Models/DatabaseStatusConnections.php create mode 100644 src/Appwrite/Models/DatabaseStatusReplica.php create mode 100644 src/Appwrite/Models/DatabaseStatusVolume.php create mode 100644 src/Appwrite/Models/DedicatedDatabase.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseMember.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseReplicas.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseSpecification.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseSpecificationList.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php create mode 100644 src/Appwrite/Models/Oauth2Approve.php create mode 100644 src/Appwrite/Models/Oauth2Authorize.php create mode 100644 src/Appwrite/Models/Oauth2Consent.php create mode 100644 src/Appwrite/Models/Oauth2ConsentList.php create mode 100644 src/Appwrite/Models/Oauth2ConsentToken.php create mode 100644 src/Appwrite/Models/Oauth2ConsentTokenList.php create mode 100644 src/Appwrite/Models/Oauth2DeviceAuthorization.php create mode 100644 src/Appwrite/Models/Oauth2Grant.php create mode 100644 src/Appwrite/Models/Oauth2Organization.php create mode 100644 src/Appwrite/Models/Oauth2OrganizationList.php create mode 100644 src/Appwrite/Models/Oauth2PAR.php create mode 100644 src/Appwrite/Models/Oauth2Project.php create mode 100644 src/Appwrite/Models/Oauth2ProjectList.php create mode 100644 src/Appwrite/Models/Oauth2Reject.php create mode 100644 src/Appwrite/Models/Oauth2Token.php create mode 100644 src/Appwrite/Services/Apps.php create mode 100644 src/Appwrite/Services/Oauth2.php create mode 100644 tests/Appwrite/Services/AppsTest.php create mode 100644 tests/Appwrite/Services/Oauth2Test.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a41a9e4..099e71cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 27.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 + ## 27.0.0 * Breaking: Removed `Health` service with its models and enums diff --git a/docs/account.md b/docs/account.md index 31ac8d2e..7600b611 100644 --- a/docs/account.md +++ b/docs/account.md @@ -24,6 +24,89 @@ POST https://cloud.appwrite.io/v1/account | name | string | User name. Max length: 128 chars. | | +```http request +GET https://cloud.appwrite.io/v1/account/consents +``` + +** Get a list of the OAuth2 consents the current user has given to third-party apps. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +GET https://cloud.appwrite.io/v1/account/consents/{consentId} +``` + +** Get an OAuth2 consent the current user has given to a third-party app by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| consentId | string | **Required** Consent unique ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/account/consents/{consentId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| consentId | string | **Required** Consent unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/account/consents/{consentId}/tokens +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| consentId | string | **Required** Consent unique ID. | | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +GET https://cloud.appwrite.io/v1/account/consents/{consentId}/tokens/{tokenId} +``` + +** Get a token family issued under an OAuth2 consent by its unique ID. The token secrets themselves are never returned. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| consentId | string | **Required** Consent unique ID. | | +| tokenId | string | **Required** Token unique ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/account/consents/{consentId}/tokens/{tokenId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| consentId | string | **Required** Consent unique ID. | | +| tokenId | string | **Required** Token unique ID. | | + + ```http request PATCH https://cloud.appwrite.io/v1/account/email ``` diff --git a/docs/apps.md b/docs/apps.md new file mode 100644 index 00000000..a8d9a2e8 --- /dev/null +++ b/docs/apps.md @@ -0,0 +1,315 @@ +# Apps Service + + +```http request +GET https://cloud.appwrite.io/v1/apps +``` + +** List applications. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/apps +``` + +** Create a new application. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | +| name | string | Application name. | | +| description | string | Application description shown to users during OAuth2 consent. | | +| clientUri | string | Application homepage URL shown to users during OAuth2 consent. | | +| logoUri | string | Application logo URL shown to users during OAuth2 consent. | | +| privacyPolicyUrl | string | Application privacy policy URL shown to users during OAuth2 consent. | | +| termsUrl | string | Application terms of service URL shown to users during OAuth2 consent. | | +| contacts | array | Application support or security contact emails. Maximum of 100 contacts are allowed. | [] | +| tagline | string | Application tagline shown to users during OAuth2 consent. | | +| tags | array | Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. | [] | +| images | array | Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. | [] | +| supportUrl | string | Application support URL shown to users during OAuth2 consent. | | +| dataDeletionUrl | string | Application data deletion URL shown to users during OAuth2 consent. | | +| redirectUris | array | Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. | | +| postLogoutRedirectUris | array | Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list. | [] | +| enabled | boolean | Is application enabled? | 1 | +| type | string | OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. | confidential | +| deviceFlow | boolean | Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. | | +| teamId | string | Team unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/scopes/installations +``` + +** List scopes an application can request when installed on a team. ** + + +```http request +GET https://cloud.appwrite.io/v1/apps/scopes/oauth2 +``` + +** List scopes an application can request during the OAuth2 flow. ** + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId} +``` + +** Get an application by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID or HTTPS client ID metadata document URL. | | + + +```http request +PUT https://cloud.appwrite.io/v1/apps/{appId} +``` + +** Update an application by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| name | string | Application name. | | +| description | string | Application description shown to users during OAuth2 consent. | | +| clientUri | string | Application homepage URL shown to users during OAuth2 consent. | | +| logoUri | string | Application logo URL shown to users during OAuth2 consent. | | +| privacyPolicyUrl | string | Application privacy policy URL shown to users during OAuth2 consent. | | +| termsUrl | string | Application terms of service URL shown to users during OAuth2 consent. | | +| contacts | array | Application support or security contact emails. Maximum of 100 contacts are allowed. | [] | +| tagline | string | Application tagline shown to users during OAuth2 consent. | | +| tags | array | Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. | [] | +| images | array | Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. | [] | +| supportUrl | string | Application support URL shown to users during OAuth2 consent. | | +| dataDeletionUrl | string | Application data deletion URL shown to users during OAuth2 consent. | | +| enabled | boolean | Is application enabled? | 1 | +| redirectUris | array | Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. | [] | +| postLogoutRedirectUris | array | Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list. | [] | +| type | string | OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. | confidential | +| deviceFlow | boolean | Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. | | +| installationScopes | array | Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed. | [] | +| installationRedirectUrl | string | URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/apps/{appId} +``` + +** Delete an application by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/installations +``` + +** List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| installationId | string | **Required** Installation unique ID. | | + + +```http request +POST https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId}/tokens +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| installationId | string | **Required** Installation unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/keys +``` + +** List app keys for an application. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/apps/{appId}/keys +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/keys/{keyId} +``` + +** Get an app key by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| keyId | string | **Required** App key unique ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/apps/{appId}/keys/{keyId} +``` + +** Delete an app key by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| keyId | string | **Required** App key unique ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/apps/{appId}/labels +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| labels | array | Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/secrets +``` + +** List client secrets for an application. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/apps/{appId}/secrets +``` + +** Create a new client secret for an application. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/apps/{appId}/secrets/{secretId} +``` + +** Get an application client secret by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| secretId | string | **Required** Secret unique ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/apps/{appId}/secrets/{secretId} +``` + +** Delete an application client secret by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| secretId | string | **Required** Secret unique ID. | | + + +```http request +PATCH https://cloud.appwrite.io/v1/apps/{appId}/team +``` + +** Transfer an application to another team by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| teamId | string | Team ID of the team to transfer application to. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/apps/{appId}/tokens +``` + +** Revoke all tokens for an application by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | + diff --git a/docs/backups.md b/docs/backups.md index 3ad1f4eb..3ba25e1d 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -135,7 +135,13 @@ POST https://cloud.appwrite.io/v1/backups/restoration ** 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. ** ### Parameters @@ -144,9 +150,8 @@ When restoring a DocumentsDB or VectorsDB database to a new resource, pass `newS | --- | --- | --- | --- | | archiveId | string | Backup archive ID to restore | | | services | array | Array of services to restore | | -| newResourceId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | +| newResourceId | string | Destination resource ID. Omit to generate a new ID, or pass the archived resource ID to overwrite it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | newResourceName | string | Database name. Max length: 128 chars. | | -| newSpecification | string | Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. | | ```http request diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md new file mode 100644 index 00000000..1cb8fcce --- /dev/null +++ b/docs/examples/account/delete-consent-token.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $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..0aebb0a5 --- /dev/null +++ b/docs/examples/account/delete-consent.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $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..dda1a1ca --- /dev/null +++ b/docs/examples/account/get-consent-token.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $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..f6ce59fc --- /dev/null +++ b/docs/examples/account/get-consent.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $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..0088745c --- /dev/null +++ b/docs/examples/account/list-consent-tokens.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listConsentTokens( + consentId: '', + queries: [], // 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..b2c63a30 --- /dev/null +++ b/docs/examples/account/list-consents.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listConsents( + queries: [], // 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..ef4ca380 --- /dev/null +++ b/docs/examples/apps/create-installation-token.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$apps = new Apps($client); + +$result = $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..7690aeaa --- /dev/null +++ b/docs/examples/apps/create-key.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..cff66b3b --- /dev/null +++ b/docs/examples/apps/create-secret.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->createSecret( + appId: '' +);``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md new file mode 100644 index 00000000..8c7c2869 --- /dev/null +++ b/docs/examples/apps/create.md @@ -0,0 +1,34 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->create( + appId: '', + name: '', + redirectUris: [], + description: '', // optional + clientUri: 'https://example.com', // optional + logoUri: 'https://example.com', // optional + privacyPolicyUrl: 'https://example.com', // optional + termsUrl: 'https://example.com', // optional + contacts: [], // optional + tagline: '', // optional + tags: [], // optional + images: [], // optional + supportUrl: 'https://example.com', // optional + dataDeletionUrl: 'https://example.com', // optional + postLogoutRedirectUris: [], // 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..d07194eb --- /dev/null +++ b/docs/examples/apps/delete-key.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..df614d6a --- /dev/null +++ b/docs/examples/apps/delete-secret.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..200cb924 --- /dev/null +++ b/docs/examples/apps/delete-tokens.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->deleteTokens( + appId: '' +);``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md new file mode 100644 index 00000000..38cfcf55 --- /dev/null +++ b/docs/examples/apps/delete.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..63de2616 --- /dev/null +++ b/docs/examples/apps/get-installation.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$apps = new Apps($client); + +$result = $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..78e30e19 --- /dev/null +++ b/docs/examples/apps/get-key.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..ef4c1d4f --- /dev/null +++ b/docs/examples/apps/get-secret.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->getSecret( + appId: '', + secretId: '' +);``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md new file mode 100644 index 00000000..7c9ce18a --- /dev/null +++ b/docs/examples/apps/get.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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..f60f6c51 --- /dev/null +++ b/docs/examples/apps/list-installation-scopes.md @@ -0,0 +1,15 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->listInstallationScopes(); +``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md new file mode 100644 index 00000000..fbdff242 --- /dev/null +++ b/docs/examples/apps/list-installations.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$apps = new Apps($client); + +$result = $apps->listInstallations( + appId: '', + queries: [], // 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..8d816537 --- /dev/null +++ b/docs/examples/apps/list-keys.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->listKeys( + appId: '', + queries: [], // 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..4bcfa44b --- /dev/null +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -0,0 +1,15 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->listOAuth2Scopes(); +``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md new file mode 100644 index 00000000..341fa345 --- /dev/null +++ b/docs/examples/apps/list-secrets.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->listSecrets( + appId: '', + queries: [], // optional + total: false // optional +);``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md new file mode 100644 index 00000000..9add376d --- /dev/null +++ b/docs/examples/apps/list.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->list( + queries: [], // 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..e3786e42 --- /dev/null +++ b/docs/examples/apps/update-labels.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$apps = new Apps($client); + +$result = $apps->updateLabels( + appId: '', + labels: [] +);``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md new file mode 100644 index 00000000..76ea6ce2 --- /dev/null +++ b/docs/examples/apps/update-team.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $apps->updateTeam( + appId: '', + teamId: '' +);``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md new file mode 100644 index 00000000..5d914c74 --- /dev/null +++ b/docs/examples/apps/update.md @@ -0,0 +1,35 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$apps = new Apps($client); + +$result = $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: [], // optional + tagline: '', // optional + tags: [], // optional + images: [], // optional + supportUrl: 'https://example.com', // optional + dataDeletionUrl: 'https://example.com', // optional + enabled: false, // optional + redirectUris: [], // optional + postLogoutRedirectUris: [], // optional + type: 'public', // optional + deviceFlow: false, // optional + installationScopes: [], // optional + installationRedirectUrl: 'https://example.com' // optional +);``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index e572dd47..61d9e0b2 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -16,6 +16,5 @@ $result = $backups->createRestoration( archiveId: '', services: [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..f3c77d1a --- /dev/null +++ b/docs/examples/oauth2/approve.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->approve( + grantId: '', + authorizationDetails: '', // 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..8f2b1251 --- /dev/null +++ b/docs/examples/oauth2/authorize-post.md @@ -0,0 +1,29 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->authorizePost( + clientId: '', // optional + redirectUri: 'https://example.com', // optional + responseType: '', // optional + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '', // optional + requestUri: '' // optional +);``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md new file mode 100644 index 00000000..c0217125 --- /dev/null +++ b/docs/examples/oauth2/authorize.md @@ -0,0 +1,29 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->authorize( + clientId: '', // optional + redirectUri: 'https://example.com', // optional + responseType: '', // optional + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '', // optional + requestUri: '' // 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..6da66a8b --- /dev/null +++ b/docs/examples/oauth2/create-device-authorization.md @@ -0,0 +1,20 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->createDeviceAuthorization( + clientId: '', // optional + scope: '', // optional + authorizationDetails: '', // 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..598470f6 --- /dev/null +++ b/docs/examples/oauth2/create-grant.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->createGrant( + userCode: '' +);``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md new file mode 100644 index 00000000..ca770f1b --- /dev/null +++ b/docs/examples/oauth2/create-par.md @@ -0,0 +1,28 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->createPAR( + clientId: '', + redirectUri: 'https://example.com', + responseType: 'code', + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // 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..61905d60 --- /dev/null +++ b/docs/examples/oauth2/create-token.md @@ -0,0 +1,25 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->createToken( + grantType: '', + code: '', // optional + refreshToken: '', // optional + deviceCode: '', // optional + clientId: '', // optional + clientSecret: '', // optional + codeVerifier: '', // optional + redirectUri: '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..b4979828 --- /dev/null +++ b/docs/examples/oauth2/get-grant.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->getGrant( + grantId: '' +);``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md new file mode 100644 index 00000000..1c2fb1c4 --- /dev/null +++ b/docs/examples/oauth2/list-organizations.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $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..ea4ff032 --- /dev/null +++ b/docs/examples/oauth2/list-projects.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $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..65deab84 --- /dev/null +++ b/docs/examples/oauth2/reject.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->reject( + grantId: '' +);``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md new file mode 100644 index 00000000..97c7b861 --- /dev/null +++ b/docs/examples/oauth2/revoke.md @@ -0,0 +1,19 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setProject(''); // Your project ID + +$oauth2 = new Oauth2($client); + +$result = $oauth2->revoke( + token: '', + tokenTypeHint: 'access_token', // optional + clientId: '', // optional + clientSecret: '' // optional +);``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md new file mode 100644 index 00000000..51855c47 --- /dev/null +++ b/docs/examples/organization/create-installation.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$organization = new Organization($client); + +$result = $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..23b8e692 --- /dev/null +++ b/docs/examples/organization/delete-installation.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$organization = new Organization($client); + +$result = $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..5e4b6763 --- /dev/null +++ b/docs/examples/organization/get-installation.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$organization = new Organization($client); + +$result = $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..170243d3 --- /dev/null +++ b/docs/examples/organization/list-installations.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$organization = new Organization($client); + +$result = $organization->listInstallations( + queries: [], // 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..a35f797e --- /dev/null +++ b/docs/examples/organization/update-installation.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$organization = new Organization($client); + +$result = $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 9c3eb9a8..4a7782f2 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -20,6 +20,7 @@ $result = $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 5582e964..bfa02f11 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -15,5 +15,6 @@ $sites = new Sites($client); $result = $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..fbd2837b --- /dev/null +++ b/docs/examples/tablesdb/create-failover.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createFailover( + databaseId: '', + targetReplicaId: '' // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 9cbbf307..87c81dd2 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -15,5 +15,6 @@ $result = $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..0bc85769 --- /dev/null +++ b/docs/examples/tablesdb/get-replicas.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $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..e7a227c5 --- /dev/null +++ b/docs/examples/tablesdb/get-status.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $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..b4080072 --- /dev/null +++ b/docs/examples/tablesdb/list-specifications.md @@ -0,0 +1,15 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listSpecifications(); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 126b3caf..e6c703af 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -14,5 +14,6 @@ $tablesDB = new TablesDB($client); $result = $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..e462cf6b --- /dev/null +++ b/docs/examples/teams/create-installation.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $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..091ae091 --- /dev/null +++ b/docs/examples/teams/delete-installation.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $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..440afa82 --- /dev/null +++ b/docs/examples/teams/get-installation.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $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..678ab4bc --- /dev/null +++ b/docs/examples/teams/list-installations.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->listInstallations( + teamId: '', + queries: [], // 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..36cdd030 --- /dev/null +++ b/docs/examples/teams/update-installation.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateInstallation( + teamId: '', + installationId: '', + authorizationDetails: '' // optional +);``` diff --git a/docs/functions.md b/docs/functions.md index 86be1ee9..eb12a051 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -113,7 +113,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | providerBranches | array | List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. | | | providerPaths | array | List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. | | | buildSpecification | string | Build specification for the function deployments. | | -| runtimeSpecification | string | Runtime specification for the function executions. | [] | +| runtimeSpecification | string | Runtime specification for the function executions. | | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | diff --git a/docs/oauth2.md b/docs/oauth2.md new file mode 100644 index 00000000..c5e315e6 --- /dev/null +++ b/docs/oauth2.md @@ -0,0 +1,230 @@ +# Oauth2 Service + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/approve +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| grant_id | string | Grant ID made during authorization, provided to consent screen in URL search params. | | +| authorization_details | string | Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. | | +| scope | string | Space-separated scopes the user consented to. Must be a subset of the scopes originally requested; identity scopes such as `openid` are always retained. Optional; omit to keep the originally requested scopes. | | + + +```http request +GET https://cloud.appwrite.io/v1/oauth2/{project_id}/authorize +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| redirect_uri | string | Redirect URI where visitor will be redirected after authorization, whether successful or not. | | +| response_type | string | OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). | | +| scope | string | Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. | | +| state | string | OAuth2 state. You receive this back in the redirect URI. | | +| nonce | string | OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. | | +| code_challenge | string | PKCE code challenge. Required when OAuth2 app is public. | | +| code_challenge_method | string | PKCE code challenge method. Required when OAuth2 app is public. | | +| prompt | string | OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. | | +| max_age | integer | OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. | | +| authorization_details | string | Rich authorization request. JSON array of objects, each with a `type` and project-defined fields | | +| resource | string | RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. | [] | +| audience | string | Compatibility alias for a single OAuth2 resource indicator URI. | | +| request_uri | string | OAuth2 authorization request handle returned by the pushed authorization request endpoint. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/authorize +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| redirect_uri | string | Redirect URI where visitor will be redirected after authorization, whether successful or not. | | +| response_type | string | OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). | | +| scope | string | Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. | | +| state | string | OAuth2 state. You receive this back in the redirect URI. | | +| nonce | string | OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. | | +| code_challenge | string | PKCE code challenge. Required when OAuth2 app is public. | | +| code_challenge_method | string | PKCE code challenge method. Required when OAuth2 app is public. | | +| prompt | string | OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. | | +| max_age | integer | OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. | | +| authorization_details | string | Rich authorization request. JSON array of objects, each with a `type` and project-defined fields | | +| resource | string | RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. | [] | +| audience | string | Compatibility alias for a single OAuth2 resource indicator URI. | | +| request_uri | string | OAuth2 authorization request handle returned by the pushed authorization request endpoint. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/device_authorization +``` + +** Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| scope | string | Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. | | +| authorization_details | string | Rich authorization request. JSON array of objects, each with a `type` and project-defined fields | | +| resource | string | RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. | [] | +| audience | string | Compatibility alias for a single OAuth2 resource indicator URI. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/grants +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| user_code | string | User code displayed on the device. | | + + +```http request +GET https://cloud.appwrite.io/v1/oauth2/{project_id}/grants/{grant_id} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client that created grant during authorization exists. | | +| grant_id | string | **Required** Grant ID made during authorization, provided to consent screen in URL search params. | | + + +```http request +GET https://cloud.appwrite.io/v1/oauth2/{project_id}/organizations +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID of the console project the OAuth2 access token was issued for. | | +| limit | integer | Maximum number of organizations to return. Between 1 and 5000. | 25 | +| offset | integer | Number of organizations to skip before returning results. Used for pagination. | 0 | +| search | string | Search term to filter your list results. Max length: 256 chars. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/par +``` + +** Store an OAuth2 authorization request server-side and receive a short-lived request_uri handle for the authorize endpoint. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| redirect_uri | string | Redirect URI where visitor will be redirected after authorization, whether successful or not. | | +| response_type | string | OAuth2 / OIDC response type. | | +| scope | string | Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. | | +| state | string | OAuth2 state. You receive this back in the redirect URI. | | +| nonce | string | OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. | | +| code_challenge | string | PKCE code challenge. Required when OAuth2 app is public. | | +| code_challenge_method | string | PKCE code challenge method. Required when OAuth2 app is public. | | +| prompt | string | OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. | | +| max_age | integer | OIDC max_age parameter for customization of consent screen. | | +| authorization_details | string | Rich authorization request. JSON array of objects, each with a `type` and project-defined fields | | +| resource | string | RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. | [] | +| audience | string | Compatibility alias for a single OAuth2 resource indicator URI. | | + + +```http request +GET https://cloud.appwrite.io/v1/oauth2/{project_id}/projects +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID of the console project the OAuth2 access token was issued for. | | +| limit | integer | Maximum number of projects to return. Between 1 and 5000. | 25 | +| offset | integer | Number of projects to skip before returning results. Used for pagination. | 0 | +| search | string | Search term to filter your list results. Max length: 256 chars. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/reject +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| grant_id | string | Grant ID made during authorization, provided to consent screen in URL search params. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/revoke +``` + +** Revoke an OAuth2 access token or refresh token. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| token | string | The access or refresh token to revoke. | | +| token_type_hint | string | Type of token to revoke (access_token or refresh_token). | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| client_secret | string | OAuth2 client secret. Required for confidential apps; omitted for public apps. | | + + +```http request +POST https://cloud.appwrite.io/v1/oauth2/{project_id}/token +``` + +** Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| project_id | string | **Required** Project ID in which OAuth2 client exists. | | +| grant_type | string | OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`. | | +| code | string | Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type. | | +| refresh_token | string | Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type. | | +| device_code | string | Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type. | | +| client_id | string | OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. | | +| client_secret | string | OAuth2 client secret. Required for confidential apps. | | +| code_verifier | string | PKCE code verifier. Required for public apps. | | +| redirect_uri | string | Redirect URI. Required for `authorization_code` grant type. | | +| resource | string | RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. | [] | +| audience | string | Compatibility alias for a single OAuth2 resource indicator URI. | | + diff --git a/docs/organization.md b/docs/organization.md index 65a24932..1508fbc8 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -28,6 +28,74 @@ DELETE https://cloud.appwrite.io/v1/organization ** Delete the current organization. All projects that belong to the organization are deleted as well. ** +```http request +GET https://cloud.appwrite.io/v1/organization/installations +``` + +** List app installations on the organization. Any organization member can read installations. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/organization/installations +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | Application unique ID. | | +| authorizationDetails | string | Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. | | + + +```http request +GET https://cloud.appwrite.io/v1/organization/installations/{installationId} +``` + +** Get an app installation on the organization by its unique ID. Any organization member can read installations. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| installationId | string | **Required** Installation unique ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/organization/installations/{installationId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| installationId | string | **Required** Installation unique ID. | | +| authorizationDetails | string | Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/organization/installations/{installationId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| installationId | string | **Required** Installation unique ID. | | + + ```http request GET https://cloud.appwrite.io/v1/organization/keys ``` diff --git a/docs/project.md b/docs/project.md index ca8f7cb6..c98ef4bc 100644 --- a/docs/project.md +++ b/docs/project.md @@ -232,6 +232,7 @@ PUT https://cloud.appwrite.io/v1/project/oauth2-server | refreshTokenDuration | integer | Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. | | | publicAccessTokenDuration | integer | Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. | | | publicRefreshTokenDuration | integer | Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. | | +| installationAccessTokenDuration | integer | Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. | | | confidentialPkce | boolean | When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. | | | verificationUrl | string | URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. | | | userCodeLength | integer | Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. | | diff --git a/docs/sites.md b/docs/sites.md index 74c000aa..68f9b7d2 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -274,6 +274,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/downl | siteId | string | **Required** Site ID. | | | deploymentId | string | **Required** Deployment ID. | | | type | string | Deployment file to download. Can be: "source", "output". | source | +| token | string | Presigned source-download token for accessing this deployment without a session (jobs-service). | | ```http request diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 1df71a2b..eefcfcde 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -31,6 +31,14 @@ POST https://cloud.appwrite.io/v1/tablesdb | name | string | Database name. Max length: 128 chars. | | | enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 | | specification | string | Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. | serverless | +| replicas | integer | Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. | 0 | + + +```http request +GET https://cloud.appwrite.io/v1/tablesdb/specifications +``` + +** 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. ** ```http request @@ -140,6 +148,7 @@ PUT https://cloud.appwrite.io/v1/tablesdb/{databaseId} | databaseId | string | **Required** Database ID. | | | name | string | Database name. Max length: 128 chars. | | | enabled | boolean | Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 | +| replicas | integer | Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. | | ```http request @@ -155,6 +164,46 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId} | databaseId | string | **Required** Database ID. | | +```http request +POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/failovers +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| targetReplicaId | string | Target replica ID to promote. If not specified, the healthiest replica is selected. | | + + +```http request +GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/replicas +``` + +** Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/status +``` + +** Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | + + ```http request GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables ``` diff --git a/docs/teams.md b/docs/teams.md index 7874cf5d..60315577 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -71,6 +71,79 @@ DELETE https://cloud.appwrite.io/v1/teams/{teamId} | teamId | string | **Required** Team ID. | | +```http request +GET https://cloud.appwrite.io/v1/teams/{teamId}/installations +``` + +** List app installations on a team. Any team member can read installations. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team ID. | | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] | +| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | + + +```http request +POST https://cloud.appwrite.io/v1/teams/{teamId}/installations +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team ID. | | +| appId | string | Application unique ID. | | +| authorizationDetails | string | Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. | | + + +```http request +GET https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} +``` + +** Get an app installation on a team by its unique ID. Any team member can read installations. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team ID. | | +| installationId | string | **Required** Installation unique ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team ID. | | +| installationId | string | **Required** Installation unique ID. | | +| authorizationDetails | string | Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} +``` + +** 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. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team ID. | | +| installationId | string | **Required** Installation unique ID. | | + + ```http request GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 9a1a4cd9..23ee27b6 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -40,11 +40,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/27.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/27.1.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '27.0.0', + 'x-sdk-version'=> '27.1.0', ]; /** diff --git a/src/Appwrite/Enums/DatabaseStatus.php b/src/Appwrite/Enums/DatabaseStatus.php index 0555a062..870c3932 100644 --- a/src/Appwrite/Enums/DatabaseStatus.php +++ b/src/Appwrite/Enums/DatabaseStatus.php @@ -8,7 +8,18 @@ class DatabaseStatus implements JsonSerializable { private static DatabaseStatus $PROVISIONING; private static DatabaseStatus $READY; + private static DatabaseStatus $INACTIVE; + private static DatabaseStatus $PAUSED; private static DatabaseStatus $FAILED; + private static DatabaseStatus $DELETING; + private static DatabaseStatus $DELETED; + private static DatabaseStatus $RESTORING; + private static DatabaseStatus $SCALING; + private static DatabaseStatus $UPGRADING; + private static DatabaseStatus $MIGRATING; + private static DatabaseStatus $PAUSING; + private static DatabaseStatus $RESUMING; + private static DatabaseStatus $FAILINGOVER; private string $value; @@ -41,6 +52,20 @@ public static function READY(): DatabaseStatus } return self::$READY; } + public static function INACTIVE(): DatabaseStatus + { + if (!isset(self::$INACTIVE)) { + self::$INACTIVE = new DatabaseStatus('inactive'); + } + return self::$INACTIVE; + } + public static function PAUSED(): DatabaseStatus + { + if (!isset(self::$PAUSED)) { + self::$PAUSED = new DatabaseStatus('paused'); + } + return self::$PAUSED; + } public static function FAILED(): DatabaseStatus { if (!isset(self::$FAILED)) { @@ -48,13 +73,87 @@ public static function FAILED(): DatabaseStatus } return self::$FAILED; } + public static function DELETING(): DatabaseStatus + { + if (!isset(self::$DELETING)) { + self::$DELETING = new DatabaseStatus('deleting'); + } + return self::$DELETING; + } + public static function DELETED(): DatabaseStatus + { + if (!isset(self::$DELETED)) { + self::$DELETED = new DatabaseStatus('deleted'); + } + return self::$DELETED; + } + public static function RESTORING(): DatabaseStatus + { + if (!isset(self::$RESTORING)) { + self::$RESTORING = new DatabaseStatus('restoring'); + } + return self::$RESTORING; + } + public static function SCALING(): DatabaseStatus + { + if (!isset(self::$SCALING)) { + self::$SCALING = new DatabaseStatus('scaling'); + } + return self::$SCALING; + } + public static function UPGRADING(): DatabaseStatus + { + if (!isset(self::$UPGRADING)) { + self::$UPGRADING = new DatabaseStatus('upgrading'); + } + return self::$UPGRADING; + } + public static function MIGRATING(): DatabaseStatus + { + if (!isset(self::$MIGRATING)) { + self::$MIGRATING = new DatabaseStatus('migrating'); + } + return self::$MIGRATING; + } + public static function PAUSING(): DatabaseStatus + { + if (!isset(self::$PAUSING)) { + self::$PAUSING = new DatabaseStatus('pausing'); + } + return self::$PAUSING; + } + public static function RESUMING(): DatabaseStatus + { + if (!isset(self::$RESUMING)) { + self::$RESUMING = new DatabaseStatus('resuming'); + } + return self::$RESUMING; + } + public static function FAILINGOVER(): DatabaseStatus + { + if (!isset(self::$FAILINGOVER)) { + self::$FAILINGOVER = new DatabaseStatus('failing-over'); + } + return self::$FAILINGOVER; + } public static function from(string $value): self { return match ($value) { 'provisioning' => self::PROVISIONING(), 'ready' => self::READY(), + 'inactive' => self::INACTIVE(), + 'paused' => self::PAUSED(), 'failed' => self::FAILED(), + 'deleting' => self::DELETING(), + 'deleted' => self::DELETED(), + 'restoring' => self::RESTORING(), + 'scaling' => self::SCALING(), + 'upgrading' => self::UPGRADING(), + 'migrating' => self::MIGRATING(), + 'pausing' => self::PAUSING(), + 'resuming' => self::RESUMING(), + 'failing-over' => self::FAILINGOVER(), default => throw new \InvalidArgumentException('Unknown DatabaseStatus value: ' . $value), }; } diff --git a/src/Appwrite/Enums/DatabaseType.php b/src/Appwrite/Enums/DatabaseType.php index e5d7dfe5..56d1cff0 100644 --- a/src/Appwrite/Enums/DatabaseType.php +++ b/src/Appwrite/Enums/DatabaseType.php @@ -10,6 +10,9 @@ class DatabaseType implements JsonSerializable private static DatabaseType $TABLESDB; private static DatabaseType $DOCUMENTSDB; private static DatabaseType $VECTORSDB; + private static DatabaseType $MYSQL; + private static DatabaseType $POSTGRESQL; + private static DatabaseType $MONGODB; private string $value; @@ -56,6 +59,27 @@ public static function VECTORSDB(): DatabaseType } return self::$VECTORSDB; } + public static function MYSQL(): DatabaseType + { + if (!isset(self::$MYSQL)) { + self::$MYSQL = new DatabaseType('mysql'); + } + return self::$MYSQL; + } + public static function POSTGRESQL(): DatabaseType + { + if (!isset(self::$POSTGRESQL)) { + self::$POSTGRESQL = new DatabaseType('postgresql'); + } + return self::$POSTGRESQL; + } + public static function MONGODB(): DatabaseType + { + if (!isset(self::$MONGODB)) { + self::$MONGODB = new DatabaseType('mongodb'); + } + return self::$MONGODB; + } public static function from(string $value): self { @@ -64,6 +88,9 @@ public static function from(string $value): self 'tablesdb' => self::TABLESDB(), 'documentsdb' => self::DOCUMENTSDB(), 'vectorsdb' => self::VECTORSDB(), + 'mysql' => self::MYSQL(), + 'postgresql' => self::POSTGRESQL(), + 'mongodb' => self::MONGODB(), default => throw new \InvalidArgumentException('Unknown DatabaseType value: ' . $value), }; } diff --git a/src/Appwrite/Enums/OrganizationKeyScopes.php b/src/Appwrite/Enums/OrganizationKeyScopes.php index 7bf3987f..2d0e5d85 100644 --- a/src/Appwrite/Enums/OrganizationKeyScopes.php +++ b/src/Appwrite/Enums/OrganizationKeyScopes.php @@ -12,6 +12,8 @@ class OrganizationKeyScopes implements JsonSerializable private static OrganizationKeyScopes $DEVKEYSWRITE; private static OrganizationKeyScopes $ORGANIZATIONKEYSREAD; private static OrganizationKeyScopes $ORGANIZATIONKEYSWRITE; + private static OrganizationKeyScopes $ORGANIZATIONINSTALLATIONSREAD; + private static OrganizationKeyScopes $ORGANIZATIONINSTALLATIONSWRITE; private static OrganizationKeyScopes $ORGANIZATIONMEMBERSHIPSREAD; private static OrganizationKeyScopes $ORGANIZATIONMEMBERSHIPSWRITE; private static OrganizationKeyScopes $ORGANIZATIONREAD; @@ -80,6 +82,20 @@ public static function ORGANIZATIONKEYSWRITE(): OrganizationKeyScopes } return self::$ORGANIZATIONKEYSWRITE; } + public static function ORGANIZATIONINSTALLATIONSREAD(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONINSTALLATIONSREAD)) { + self::$ORGANIZATIONINSTALLATIONSREAD = new OrganizationKeyScopes('organization.installations.read'); + } + return self::$ORGANIZATIONINSTALLATIONSREAD; + } + public static function ORGANIZATIONINSTALLATIONSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONINSTALLATIONSWRITE)) { + self::$ORGANIZATIONINSTALLATIONSWRITE = new OrganizationKeyScopes('organization.installations.write'); + } + return self::$ORGANIZATIONINSTALLATIONSWRITE; + } public static function ORGANIZATIONMEMBERSHIPSREAD(): OrganizationKeyScopes { if (!isset(self::$ORGANIZATIONMEMBERSHIPSREAD)) { @@ -146,6 +162,8 @@ public static function from(string $value): self 'devKeys.write' => self::DEVKEYSWRITE(), 'organization.keys.read' => self::ORGANIZATIONKEYSREAD(), 'organization.keys.write' => self::ORGANIZATIONKEYSWRITE(), + 'organization.installations.read' => self::ORGANIZATIONINSTALLATIONSREAD(), + 'organization.installations.write' => self::ORGANIZATIONINSTALLATIONSWRITE(), 'organization.memberships.read' => self::ORGANIZATIONMEMBERSHIPSREAD(), 'organization.memberships.write' => self::ORGANIZATIONMEMBERSHIPSWRITE(), 'organization.read' => self::ORGANIZATIONREAD(), diff --git a/src/Appwrite/Enums/ProjectKeyScopes.php b/src/Appwrite/Enums/ProjectKeyScopes.php index c087a037..b7d37a76 100644 --- a/src/Appwrite/Enums/ProjectKeyScopes.php +++ b/src/Appwrite/Enums/ProjectKeyScopes.php @@ -101,11 +101,14 @@ class ProjectKeyScopes implements JsonSerializable private static ProjectKeyScopes $DEDICATEDDATABASESEXECUTE; private static ProjectKeyScopes $DOMAINSREAD; private static ProjectKeyScopes $DOMAINSWRITE; + private static ProjectKeyScopes $WAFRULESREAD; + private static ProjectKeyScopes $WAFRULESWRITE; private static ProjectKeyScopes $EVENTSREAD; private static ProjectKeyScopes $APPSREAD; private static ProjectKeyScopes $APPSWRITE; private static ProjectKeyScopes $OAUTH2READ; private static ProjectKeyScopes $OAUTH2WRITE; + private static ProjectKeyScopes $OAUTH2INTROSPECT; private static ProjectKeyScopes $USAGEREAD; private string $value; @@ -790,6 +793,20 @@ public static function DOMAINSWRITE(): ProjectKeyScopes } return self::$DOMAINSWRITE; } + public static function WAFRULESREAD(): ProjectKeyScopes + { + if (!isset(self::$WAFRULESREAD)) { + self::$WAFRULESREAD = new ProjectKeyScopes('wafRules.read'); + } + return self::$WAFRULESREAD; + } + public static function WAFRULESWRITE(): ProjectKeyScopes + { + if (!isset(self::$WAFRULESWRITE)) { + self::$WAFRULESWRITE = new ProjectKeyScopes('wafRules.write'); + } + return self::$WAFRULESWRITE; + } public static function EVENTSREAD(): ProjectKeyScopes { if (!isset(self::$EVENTSREAD)) { @@ -825,6 +842,13 @@ public static function OAUTH2WRITE(): ProjectKeyScopes } return self::$OAUTH2WRITE; } + public static function OAUTH2INTROSPECT(): ProjectKeyScopes + { + if (!isset(self::$OAUTH2INTROSPECT)) { + self::$OAUTH2INTROSPECT = new ProjectKeyScopes('oauth2.introspect'); + } + return self::$OAUTH2INTROSPECT; + } public static function USAGEREAD(): ProjectKeyScopes { if (!isset(self::$USAGEREAD)) { @@ -931,11 +955,14 @@ public static function from(string $value): self 'dedicatedDatabases.execute' => self::DEDICATEDDATABASESEXECUTE(), 'domains.read' => self::DOMAINSREAD(), 'domains.write' => self::DOMAINSWRITE(), + 'wafRules.read' => self::WAFRULESREAD(), + 'wafRules.write' => self::WAFRULESWRITE(), 'events.read' => self::EVENTSREAD(), 'apps.read' => self::APPSREAD(), 'apps.write' => self::APPSWRITE(), 'oauth2.read' => self::OAUTH2READ(), 'oauth2.write' => self::OAUTH2WRITE(), + 'oauth2.introspect' => self::OAUTH2INTROSPECT(), 'usage.read' => self::USAGEREAD(), default => throw new \InvalidArgumentException('Unknown ProjectKeyScopes value: ' . $value), }; diff --git a/src/Appwrite/Models/ActivityEvent.php b/src/Appwrite/Models/ActivityEvent.php index 5c6429ab..3bb7b87c 100644 --- a/src/Appwrite/Models/ActivityEvent.php +++ b/src/Appwrite/Models/ActivityEvent.php @@ -26,10 +26,21 @@ * @param string $ip ip address. * @param string $mode api mode when event triggered. * @param string $country location. + * @param string $continentCode continent code. + * @param string $city city name. + * @param string $subdivisions region/state chain. + * @param string $isp internet service provider. + * @param string $autonomousSystemNumber autonomous system number (asn). + * @param string $autonomousSystemOrganization organization that owns the asn. + * @param string $connectionType connection type (e.g. cable, cellular, corporate). + * @param string $connectionUsageType user type (e.g. residential, business, hosting). + * @param string $connectionOrganization registered organization of the ip. * @param string $time log creation date in iso 8601 format. * @param string $projectId project id. * @param string $teamId team id. * @param string $hostname hostname. + * @param string $sdk name of the sdk that triggered the event. + * @param string $sdkVersion version of the sdk that triggered the event. */ public function __construct( public string $id, @@ -46,10 +57,21 @@ public function __construct( public string $ip, public string $mode, public string $country, + public string $continentCode, + public string $city, + public string $subdivisions, + public string $isp, + public string $autonomousSystemNumber, + public string $autonomousSystemOrganization, + public string $connectionType, + public string $connectionUsageType, + public string $connectionOrganization, public string $time, public string $projectId, public string $teamId, - public string $hostname + public string $hostname, + public string $sdk, + public string $sdkVersion ) { } @@ -100,6 +122,33 @@ public static function from(array $data): static if (!array_key_exists('country', $data)) { throw new \InvalidArgumentException('Missing required field "country" for ' . static::class . '.'); } + if (!array_key_exists('continentCode', $data)) { + throw new \InvalidArgumentException('Missing required field "continentCode" for ' . static::class . '.'); + } + if (!array_key_exists('city', $data)) { + throw new \InvalidArgumentException('Missing required field "city" for ' . static::class . '.'); + } + if (!array_key_exists('subdivisions', $data)) { + throw new \InvalidArgumentException('Missing required field "subdivisions" for ' . static::class . '.'); + } + if (!array_key_exists('isp', $data)) { + throw new \InvalidArgumentException('Missing required field "isp" for ' . static::class . '.'); + } + if (!array_key_exists('autonomousSystemNumber', $data)) { + throw new \InvalidArgumentException('Missing required field "autonomousSystemNumber" for ' . static::class . '.'); + } + if (!array_key_exists('autonomousSystemOrganization', $data)) { + throw new \InvalidArgumentException('Missing required field "autonomousSystemOrganization" for ' . static::class . '.'); + } + if (!array_key_exists('connectionType', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionType" for ' . static::class . '.'); + } + if (!array_key_exists('connectionUsageType', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionUsageType" for ' . static::class . '.'); + } + if (!array_key_exists('connectionOrganization', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionOrganization" for ' . static::class . '.'); + } if (!array_key_exists('time', $data)) { throw new \InvalidArgumentException('Missing required field "time" for ' . static::class . '.'); } @@ -112,6 +161,12 @@ public static function from(array $data): static if (!array_key_exists('hostname', $data)) { throw new \InvalidArgumentException('Missing required field "hostname" for ' . static::class . '.'); } + if (!array_key_exists('sdk', $data)) { + throw new \InvalidArgumentException('Missing required field "sdk" for ' . static::class . '.'); + } + if (!array_key_exists('sdkVersion', $data)) { + throw new \InvalidArgumentException('Missing required field "sdkVersion" for ' . static::class . '.'); + } return new static( id: $data['$id'], @@ -128,10 +183,21 @@ public static function from(array $data): static ip: $data['ip'], mode: $data['mode'], country: $data['country'], + continentCode: $data['continentCode'], + city: $data['city'], + subdivisions: $data['subdivisions'], + isp: $data['isp'], + autonomousSystemNumber: $data['autonomousSystemNumber'], + autonomousSystemOrganization: $data['autonomousSystemOrganization'], + connectionType: $data['connectionType'], + connectionUsageType: $data['connectionUsageType'], + connectionOrganization: $data['connectionOrganization'], time: $data['time'], projectId: $data['projectId'], teamId: $data['teamId'], - hostname: $data['hostname'] + hostname: $data['hostname'], + sdk: $data['sdk'], + sdkVersion: $data['sdkVersion'] ); } @@ -155,10 +221,21 @@ public function toArray(): array 'ip' => static::serializeValue($this->ip), 'mode' => static::serializeValue($this->mode), 'country' => static::serializeValue($this->country), + 'continentCode' => static::serializeValue($this->continentCode), + 'city' => static::serializeValue($this->city), + 'subdivisions' => static::serializeValue($this->subdivisions), + 'isp' => static::serializeValue($this->isp), + 'autonomousSystemNumber' => static::serializeValue($this->autonomousSystemNumber), + 'autonomousSystemOrganization' => static::serializeValue($this->autonomousSystemOrganization), + 'connectionType' => static::serializeValue($this->connectionType), + 'connectionUsageType' => static::serializeValue($this->connectionUsageType), + 'connectionOrganization' => static::serializeValue($this->connectionOrganization), 'time' => static::serializeValue($this->time), 'projectId' => static::serializeValue($this->projectId), 'teamId' => static::serializeValue($this->teamId), - 'hostname' => static::serializeValue($this->hostname) + 'hostname' => static::serializeValue($this->hostname), + 'sdk' => static::serializeValue($this->sdk), + 'sdkVersion' => static::serializeValue($this->sdkVersion) ]; return $result; diff --git a/src/Appwrite/Models/App.php b/src/Appwrite/Models/App.php new file mode 100644 index 00000000..c6d447ef --- /dev/null +++ b/src/Appwrite/Models/App.php @@ -0,0 +1,227 @@ + $secrets list of application secrets. + */ + public function __construct( + public string $id, + public string $createdAt, + public string $updatedAt, + public string $name, + public string $description, + public string $clientUri, + public string $logoUri, + public string $privacyPolicyUrl, + public string $termsUrl, + public array $contacts, + public string $tagline, + public array $tags, + public array $labels, + public array $images, + public string $supportUrl, + public string $dataDeletionUrl, + public array $redirectUris, + public array $postLogoutRedirectUris, + public bool $enabled, + public string $type, + public bool $deviceFlow, + public string $teamId, + public string $userId, + public array $installationScopes, + public string $installationRedirectUrl, + public array $secrets + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('description', $data)) { + throw new \InvalidArgumentException('Missing required field "description" for ' . static::class . '.'); + } + if (!array_key_exists('clientUri', $data)) { + throw new \InvalidArgumentException('Missing required field "clientUri" for ' . static::class . '.'); + } + if (!array_key_exists('logoUri', $data)) { + throw new \InvalidArgumentException('Missing required field "logoUri" for ' . static::class . '.'); + } + if (!array_key_exists('privacyPolicyUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "privacyPolicyUrl" for ' . static::class . '.'); + } + if (!array_key_exists('termsUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "termsUrl" for ' . static::class . '.'); + } + if (!array_key_exists('contacts', $data)) { + throw new \InvalidArgumentException('Missing required field "contacts" for ' . static::class . '.'); + } + if (!array_key_exists('tagline', $data)) { + throw new \InvalidArgumentException('Missing required field "tagline" for ' . static::class . '.'); + } + if (!array_key_exists('tags', $data)) { + throw new \InvalidArgumentException('Missing required field "tags" for ' . static::class . '.'); + } + if (!array_key_exists('labels', $data)) { + throw new \InvalidArgumentException('Missing required field "labels" for ' . static::class . '.'); + } + if (!array_key_exists('images', $data)) { + throw new \InvalidArgumentException('Missing required field "images" for ' . static::class . '.'); + } + if (!array_key_exists('supportUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "supportUrl" for ' . static::class . '.'); + } + if (!array_key_exists('dataDeletionUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "dataDeletionUrl" for ' . static::class . '.'); + } + if (!array_key_exists('redirectUris', $data)) { + throw new \InvalidArgumentException('Missing required field "redirectUris" for ' . static::class . '.'); + } + if (!array_key_exists('postLogoutRedirectUris', $data)) { + throw new \InvalidArgumentException('Missing required field "postLogoutRedirectUris" for ' . static::class . '.'); + } + if (!array_key_exists('enabled', $data)) { + throw new \InvalidArgumentException('Missing required field "enabled" for ' . static::class . '.'); + } + if (!array_key_exists('type', $data)) { + throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); + } + if (!array_key_exists('deviceFlow', $data)) { + throw new \InvalidArgumentException('Missing required field "deviceFlow" for ' . static::class . '.'); + } + if (!array_key_exists('teamId', $data)) { + throw new \InvalidArgumentException('Missing required field "teamId" for ' . static::class . '.'); + } + if (!array_key_exists('userId', $data)) { + throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + } + if (!array_key_exists('installationScopes', $data)) { + throw new \InvalidArgumentException('Missing required field "installationScopes" for ' . static::class . '.'); + } + if (!array_key_exists('installationRedirectUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "installationRedirectUrl" for ' . static::class . '.'); + } + if (!array_key_exists('secrets', $data)) { + throw new \InvalidArgumentException('Missing required field "secrets" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + name: $data['name'], + description: $data['description'], + clientUri: $data['clientUri'], + logoUri: $data['logoUri'], + privacyPolicyUrl: $data['privacyPolicyUrl'], + termsUrl: $data['termsUrl'], + contacts: $data['contacts'], + tagline: $data['tagline'], + tags: $data['tags'], + labels: $data['labels'], + images: $data['images'], + supportUrl: $data['supportUrl'], + dataDeletionUrl: $data['dataDeletionUrl'], + redirectUris: $data['redirectUris'], + postLogoutRedirectUris: $data['postLogoutRedirectUris'], + enabled: $data['enabled'], + type: $data['type'], + deviceFlow: $data['deviceFlow'], + teamId: $data['teamId'], + userId: $data['userId'], + installationScopes: $data['installationScopes'], + installationRedirectUrl: $data['installationRedirectUrl'], + secrets: is_array($data['secrets']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(AppSecret::class, $item), + $data['secrets'] + ) + : $data['secrets'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'name' => static::serializeValue($this->name), + 'description' => static::serializeValue($this->description), + 'clientUri' => static::serializeValue($this->clientUri), + 'logoUri' => static::serializeValue($this->logoUri), + 'privacyPolicyUrl' => static::serializeValue($this->privacyPolicyUrl), + 'termsUrl' => static::serializeValue($this->termsUrl), + 'contacts' => static::serializeValue($this->contacts), + 'tagline' => static::serializeValue($this->tagline), + 'tags' => static::serializeValue($this->tags), + 'labels' => static::serializeValue($this->labels), + 'images' => static::serializeValue($this->images), + 'supportUrl' => static::serializeValue($this->supportUrl), + 'dataDeletionUrl' => static::serializeValue($this->dataDeletionUrl), + 'redirectUris' => static::serializeValue($this->redirectUris), + 'postLogoutRedirectUris' => static::serializeValue($this->postLogoutRedirectUris), + 'enabled' => static::serializeValue($this->enabled), + 'type' => static::serializeValue($this->type), + 'deviceFlow' => static::serializeValue($this->deviceFlow), + 'teamId' => static::serializeValue($this->teamId), + 'userId' => static::serializeValue($this->userId), + 'installationScopes' => static::serializeValue($this->installationScopes), + 'installationRedirectUrl' => static::serializeValue($this->installationRedirectUrl), + 'secrets' => static::serializeValue($this->secrets) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppInstallation.php b/src/Appwrite/Models/AppInstallation.php new file mode 100644 index 00000000..1d13ce2f --- /dev/null +++ b/src/Appwrite/Models/AppInstallation.php @@ -0,0 +1,107 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('teamId', $data)) { + throw new \InvalidArgumentException('Missing required field "teamId" for ' . static::class . '.'); + } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } + if (!array_key_exists('authorizationDetails', $data)) { + throw new \InvalidArgumentException('Missing required field "authorizationDetails" for ' . static::class . '.'); + } + if (!array_key_exists('createdById', $data)) { + throw new \InvalidArgumentException('Missing required field "createdById" for ' . static::class . '.'); + } + if (!array_key_exists('createdByName', $data)) { + throw new \InvalidArgumentException('Missing required field "createdByName" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + appId: $data['appId'], + teamId: $data['teamId'], + scopes: $data['scopes'], + authorizationDetails: $data['authorizationDetails'], + createdById: $data['createdById'], + createdByName: $data['createdByName'], + lastAccessedAt: array_key_exists('lastAccessedAt', $data) ? $data['lastAccessedAt'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'appId' => static::serializeValue($this->appId), + 'teamId' => static::serializeValue($this->teamId), + 'scopes' => static::serializeValue($this->scopes), + 'authorizationDetails' => static::serializeValue($this->authorizationDetails), + 'createdById' => static::serializeValue($this->createdById), + 'createdByName' => static::serializeValue($this->createdByName), + 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppInstallationList.php b/src/Appwrite/Models/AppInstallationList.php new file mode 100644 index 00000000..86a00699 --- /dev/null +++ b/src/Appwrite/Models/AppInstallationList.php @@ -0,0 +1,59 @@ + $installations list of installations. + */ + public function __construct( + public int $total, + public array $installations + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('installations', $data)) { + throw new \InvalidArgumentException('Missing required field "installations" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + installations: is_array($data['installations']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(AppInstallation::class, $item), + $data['installations'] + ) + : $data['installations'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'installations' => static::serializeValue($this->installations) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppKey.php b/src/Appwrite/Models/AppKey.php new file mode 100644 index 00000000..471de01f --- /dev/null +++ b/src/Appwrite/Models/AppKey.php @@ -0,0 +1,100 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('secret', $data)) { + throw new \InvalidArgumentException('Missing required field "secret" for ' . static::class . '.'); + } + if (!array_key_exists('hint', $data)) { + throw new \InvalidArgumentException('Missing required field "hint" for ' . static::class . '.'); + } + if (!array_key_exists('createdById', $data)) { + throw new \InvalidArgumentException('Missing required field "createdById" for ' . static::class . '.'); + } + if (!array_key_exists('createdByName', $data)) { + throw new \InvalidArgumentException('Missing required field "createdByName" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + appId: $data['appId'], + secret: $data['secret'], + hint: $data['hint'], + createdById: $data['createdById'], + createdByName: $data['createdByName'], + lastAccessedAt: array_key_exists('lastAccessedAt', $data) ? $data['lastAccessedAt'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'appId' => static::serializeValue($this->appId), + 'secret' => static::serializeValue($this->secret), + 'hint' => static::serializeValue($this->hint), + 'createdById' => static::serializeValue($this->createdById), + 'createdByName' => static::serializeValue($this->createdByName), + 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppKeyList.php b/src/Appwrite/Models/AppKeyList.php new file mode 100644 index 00000000..a5753ead --- /dev/null +++ b/src/Appwrite/Models/AppKeyList.php @@ -0,0 +1,59 @@ + $keys list of keys. + */ + public function __construct( + public int $total, + public array $keys + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('keys', $data)) { + throw new \InvalidArgumentException('Missing required field "keys" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + keys: is_array($data['keys']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(AppKey::class, $item), + $data['keys'] + ) + : $data['keys'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'keys' => static::serializeValue($this->keys) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppScope.php b/src/Appwrite/Models/AppScope.php new file mode 100644 index 00000000..d0517995 --- /dev/null +++ b/src/Appwrite/Models/AppScope.php @@ -0,0 +1,75 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('value', $data)) { + throw new \InvalidArgumentException('Missing required field "value" for ' . static::class . '.'); + } + if (!array_key_exists('description', $data)) { + throw new \InvalidArgumentException('Missing required field "description" for ' . static::class . '.'); + } + if (!array_key_exists('type', $data)) { + throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); + } + if (!array_key_exists('category', $data)) { + throw new \InvalidArgumentException('Missing required field "category" for ' . static::class . '.'); + } + if (!array_key_exists('deprecated', $data)) { + throw new \InvalidArgumentException('Missing required field "deprecated" for ' . static::class . '.'); + } + + return new static( + value: $data['value'], + description: $data['description'], + type: $data['type'], + category: $data['category'], + deprecated: $data['deprecated'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'value' => static::serializeValue($this->value), + 'description' => static::serializeValue($this->description), + 'type' => static::serializeValue($this->type), + 'category' => static::serializeValue($this->category), + 'deprecated' => static::serializeValue($this->deprecated) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppScopeList.php b/src/Appwrite/Models/AppScopeList.php new file mode 100644 index 00000000..32090a96 --- /dev/null +++ b/src/Appwrite/Models/AppScopeList.php @@ -0,0 +1,59 @@ + $scopes list of scopes. + */ + public function __construct( + public int $total, + public array $scopes + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + scopes: is_array($data['scopes']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(AppScope::class, $item), + $data['scopes'] + ) + : $data['scopes'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'scopes' => static::serializeValue($this->scopes) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppSecret.php b/src/Appwrite/Models/AppSecret.php new file mode 100644 index 00000000..5308587c --- /dev/null +++ b/src/Appwrite/Models/AppSecret.php @@ -0,0 +1,100 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('secret', $data)) { + throw new \InvalidArgumentException('Missing required field "secret" for ' . static::class . '.'); + } + if (!array_key_exists('hint', $data)) { + throw new \InvalidArgumentException('Missing required field "hint" for ' . static::class . '.'); + } + if (!array_key_exists('createdById', $data)) { + throw new \InvalidArgumentException('Missing required field "createdById" for ' . static::class . '.'); + } + if (!array_key_exists('createdByName', $data)) { + throw new \InvalidArgumentException('Missing required field "createdByName" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + appId: $data['appId'], + secret: $data['secret'], + hint: $data['hint'], + createdById: $data['createdById'], + createdByName: $data['createdByName'], + lastAccessedAt: array_key_exists('lastAccessedAt', $data) ? $data['lastAccessedAt'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'appId' => static::serializeValue($this->appId), + 'secret' => static::serializeValue($this->secret), + 'hint' => static::serializeValue($this->hint), + 'createdById' => static::serializeValue($this->createdById), + 'createdByName' => static::serializeValue($this->createdByName), + 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppSecretList.php b/src/Appwrite/Models/AppSecretList.php new file mode 100644 index 00000000..2568f739 --- /dev/null +++ b/src/Appwrite/Models/AppSecretList.php @@ -0,0 +1,59 @@ + $secrets list of secrets. + */ + public function __construct( + public int $total, + public array $secrets + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('secrets', $data)) { + throw new \InvalidArgumentException('Missing required field "secrets" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + secrets: is_array($data['secrets']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(AppSecret::class, $item), + $data['secrets'] + ) + : $data['secrets'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'secrets' => static::serializeValue($this->secrets) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppSecretPlaintext.php b/src/Appwrite/Models/AppSecretPlaintext.php new file mode 100644 index 00000000..35c321cb --- /dev/null +++ b/src/Appwrite/Models/AppSecretPlaintext.php @@ -0,0 +1,100 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('secret', $data)) { + throw new \InvalidArgumentException('Missing required field "secret" for ' . static::class . '.'); + } + if (!array_key_exists('hint', $data)) { + throw new \InvalidArgumentException('Missing required field "hint" for ' . static::class . '.'); + } + if (!array_key_exists('createdById', $data)) { + throw new \InvalidArgumentException('Missing required field "createdById" for ' . static::class . '.'); + } + if (!array_key_exists('createdByName', $data)) { + throw new \InvalidArgumentException('Missing required field "createdByName" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + appId: $data['appId'], + secret: $data['secret'], + hint: $data['hint'], + createdById: $data['createdById'], + createdByName: $data['createdByName'], + lastAccessedAt: array_key_exists('lastAccessedAt', $data) ? $data['lastAccessedAt'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'appId' => static::serializeValue($this->appId), + 'secret' => static::serializeValue($this->secret), + 'hint' => static::serializeValue($this->hint), + 'createdById' => static::serializeValue($this->createdById), + 'createdByName' => static::serializeValue($this->createdByName), + 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/AppsList.php b/src/Appwrite/Models/AppsList.php new file mode 100644 index 00000000..547ab60d --- /dev/null +++ b/src/Appwrite/Models/AppsList.php @@ -0,0 +1,59 @@ + $apps list of apps. + */ + public function __construct( + public int $total, + public array $apps + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('apps', $data)) { + throw new \InvalidArgumentException('Missing required field "apps" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + apps: is_array($data['apps']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(App::class, $item), + $data['apps'] + ) + : $data['apps'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'apps' => static::serializeValue($this->apps) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/BillingPlan.php b/src/Appwrite/Models/BillingPlan.php index dcfd652e..951b4073 100644 --- a/src/Appwrite/Models/BillingPlan.php +++ b/src/Appwrite/Models/BillingPlan.php @@ -26,6 +26,7 @@ * @param int $screenshotsGenerated screenshots generated * @param int $members members * @param int $webhooks webhooks + * @param int $wafRules maximum waf rules per project * @param int $projects projects * @param int $platforms platforms * @param int $users users @@ -96,6 +97,7 @@ public function __construct( public int $screenshotsGenerated, public int $members, public int $webhooks, + public int $wafRules, public int $projects, public int $platforms, public int $users, @@ -196,6 +198,9 @@ public static function from(array $data): static if (!array_key_exists('webhooks', $data)) { throw new \InvalidArgumentException('Missing required field "webhooks" for ' . static::class . '.'); } + if (!array_key_exists('wafRules', $data)) { + throw new \InvalidArgumentException('Missing required field "wafRules" for ' . static::class . '.'); + } if (!array_key_exists('projects', $data)) { throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); } @@ -366,6 +371,7 @@ public static function from(array $data): static screenshotsGenerated: $data['screenshotsGenerated'], members: $data['members'], webhooks: $data['webhooks'], + wafRules: $data['wafRules'], projects: $data['projects'], platforms: $data['platforms'], users: $data['users'], @@ -443,6 +449,7 @@ public function toArray(): array 'screenshotsGenerated' => static::serializeValue($this->screenshotsGenerated), 'members' => static::serializeValue($this->members), 'webhooks' => static::serializeValue($this->webhooks), + 'wafRules' => static::serializeValue($this->wafRules), 'projects' => static::serializeValue($this->projects), 'platforms' => static::serializeValue($this->platforms), 'users' => static::serializeValue($this->users), diff --git a/src/Appwrite/Models/Database.php b/src/Appwrite/Models/Database.php index 6a226440..fb6f77f3 100644 --- a/src/Appwrite/Models/Database.php +++ b/src/Appwrite/Models/Database.php @@ -21,9 +21,12 @@ * @param string $updatedAt database update date in iso 8601 format. * @param bool $enabled if database is enabled. can be 'enabled' or 'disabled'. when disabled, the database is inaccessible to users, but remains accessible to server sdks using api keys. * @param DatabaseType $type database type. - * @param list $policies database backup policies. - * @param list $archives database backup archives. - * @param DatabaseStatus|null $status database status. possible values: `provisioning`, `ready` or `failed` + * @param DatabaseStatus|null $status dedicated database lifecycle status. null when the database has no valid dedicated backing. + * @param string|null $engine underlying engine of the dedicated backing: postgresql, mysql, mariadb, or mongodb. a managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. null when the database has no dedicated backing. + * @param string|null $specification compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. null when the database has no dedicated backing. + * @param int|null $replicas number of secondary high availability replicas, excluding the primary. null when backing configuration is unavailable. + * @param list|null $policies database backup policies. + * @param list|null $archives database backup archives. */ public function __construct( public string $id, @@ -32,9 +35,12 @@ public function __construct( public string $updatedAt, public bool $enabled, public DatabaseType $type, - public array $policies, - public array $archives, - public ?DatabaseStatus $status = null + public ?DatabaseStatus $status = null, + public ?string $engine = null, + public ?string $specification = null, + public ?int $replicas = null, + public ?array $policies = null, + public ?array $archives = null ) { } @@ -61,12 +67,6 @@ public static function from(array $data): static if (!array_key_exists('type', $data)) { throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); } - if (!array_key_exists('policies', $data)) { - throw new \InvalidArgumentException('Missing required field "policies" for ' . static::class . '.'); - } - if (!array_key_exists('archives', $data)) { - throw new \InvalidArgumentException('Missing required field "archives" for ' . static::class . '.'); - } return new static( id: $data['$id'], @@ -75,19 +75,30 @@ public static function from(array $data): static updatedAt: $data['$updatedAt'], enabled: $data['enabled'], type: static::hydrateTypedValue(DatabaseType::class, $data['type']), - policies: is_array($data['policies']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(BackupPolicy::class, $item), - $data['policies'] + status: array_key_exists('status', $data) ? static::hydrateTypedValue(DatabaseStatus::class, $data['status'], true) : null, + engine: array_key_exists('engine', $data) ? $data['engine'] : null, + specification: array_key_exists('specification', $data) ? $data['specification'] : null, + replicas: array_key_exists('replicas', $data) ? $data['replicas'] : null, + policies: array_key_exists('policies', $data) + ? ( + is_array($data['policies']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(BackupPolicy::class, $item), + $data['policies'] + ) + : $data['policies'] ) - : $data['policies'], - archives: is_array($data['archives']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(BackupArchive::class, $item), - $data['archives'] + : null, + archives: array_key_exists('archives', $data) + ? ( + is_array($data['archives']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(BackupArchive::class, $item), + $data['archives'] + ) + : $data['archives'] ) - : $data['archives'], - status: array_key_exists('status', $data) ? static::hydrateTypedValue(DatabaseStatus::class, $data['status'], true) : null + : null ); } @@ -104,6 +115,9 @@ public function toArray(): array 'enabled' => static::serializeValue($this->enabled), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), + 'engine' => static::serializeValue($this->engine), + 'specification' => static::serializeValue($this->specification), + 'replicas' => static::serializeValue($this->replicas), 'policies' => static::serializeValue($this->policies), 'archives' => static::serializeValue($this->archives) ]; diff --git a/src/Appwrite/Models/DatabaseStatus.php b/src/Appwrite/Models/DatabaseStatus.php new file mode 100644 index 00000000..59b30ffd --- /dev/null +++ b/src/Appwrite/Models/DatabaseStatus.php @@ -0,0 +1,106 @@ + $replicas list of database replicas and their status. + * @param list $volumes storage volume information. + */ + public function __construct( + public string $health, + public bool $ready, + public string $engine, + public string $version, + public int $uptime, + public DatabaseStatusConnections $connections, + public array $replicas, + public array $volumes + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('health', $data)) { + throw new \InvalidArgumentException('Missing required field "health" for ' . static::class . '.'); + } + if (!array_key_exists('ready', $data)) { + throw new \InvalidArgumentException('Missing required field "ready" for ' . static::class . '.'); + } + if (!array_key_exists('engine', $data)) { + throw new \InvalidArgumentException('Missing required field "engine" for ' . static::class . '.'); + } + if (!array_key_exists('version', $data)) { + throw new \InvalidArgumentException('Missing required field "version" for ' . static::class . '.'); + } + if (!array_key_exists('uptime', $data)) { + throw new \InvalidArgumentException('Missing required field "uptime" for ' . static::class . '.'); + } + if (!array_key_exists('connections', $data)) { + throw new \InvalidArgumentException('Missing required field "connections" for ' . static::class . '.'); + } + if (!array_key_exists('replicas', $data)) { + throw new \InvalidArgumentException('Missing required field "replicas" for ' . static::class . '.'); + } + if (!array_key_exists('volumes', $data)) { + throw new \InvalidArgumentException('Missing required field "volumes" for ' . static::class . '.'); + } + + return new static( + health: $data['health'], + ready: $data['ready'], + engine: $data['engine'], + version: $data['version'], + uptime: $data['uptime'], + connections: static::hydrateTypedValue(DatabaseStatusConnections::class, $data['connections']), + replicas: is_array($data['replicas']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DatabaseStatusReplica::class, $item), + $data['replicas'] + ) + : $data['replicas'], + volumes: is_array($data['volumes']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DatabaseStatusVolume::class, $item), + $data['volumes'] + ) + : $data['volumes'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'health' => static::serializeValue($this->health), + 'ready' => static::serializeValue($this->ready), + 'engine' => static::serializeValue($this->engine), + 'version' => static::serializeValue($this->version), + 'uptime' => static::serializeValue($this->uptime), + 'connections' => static::serializeValue($this->connections), + 'replicas' => static::serializeValue($this->replicas), + 'volumes' => static::serializeValue($this->volumes) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DatabaseStatusConnections.php b/src/Appwrite/Models/DatabaseStatusConnections.php new file mode 100644 index 00000000..b1917238 --- /dev/null +++ b/src/Appwrite/Models/DatabaseStatusConnections.php @@ -0,0 +1,54 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('current', $data)) { + throw new \InvalidArgumentException('Missing required field "current" for ' . static::class . '.'); + } + if (!array_key_exists('max', $data)) { + throw new \InvalidArgumentException('Missing required field "max" for ' . static::class . '.'); + } + + return new static( + current: $data['current'], + max: $data['max'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'current' => static::serializeValue($this->current), + 'max' => static::serializeValue($this->max) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DatabaseStatusReplica.php b/src/Appwrite/Models/DatabaseStatusReplica.php new file mode 100644 index 00000000..acf6559c --- /dev/null +++ b/src/Appwrite/Models/DatabaseStatusReplica.php @@ -0,0 +1,65 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('index', $data)) { + throw new \InvalidArgumentException('Missing required field "index" for ' . static::class . '.'); + } + if (!array_key_exists('role', $data)) { + throw new \InvalidArgumentException('Missing required field "role" for ' . static::class . '.'); + } + if (!array_key_exists('healthy', $data)) { + throw new \InvalidArgumentException('Missing required field "healthy" for ' . static::class . '.'); + } + + return new static( + index: $data['index'], + role: $data['role'], + healthy: $data['healthy'], + lagSeconds: array_key_exists('lagSeconds', $data) ? $data['lagSeconds'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'index' => static::serializeValue($this->index), + 'role' => static::serializeValue($this->role), + 'healthy' => static::serializeValue($this->healthy), + 'lagSeconds' => static::serializeValue($this->lagSeconds) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DatabaseStatusVolume.php b/src/Appwrite/Models/DatabaseStatusVolume.php new file mode 100644 index 00000000..974ce9cf --- /dev/null +++ b/src/Appwrite/Models/DatabaseStatusVolume.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('path', $data)) { + throw new \InvalidArgumentException('Missing required field "path" for ' . static::class . '.'); + } + if (!array_key_exists('usedPercent', $data)) { + throw new \InvalidArgumentException('Missing required field "usedPercent" for ' . static::class . '.'); + } + if (!array_key_exists('available', $data)) { + throw new \InvalidArgumentException('Missing required field "available" for ' . static::class . '.'); + } + if (!array_key_exists('mounted', $data)) { + throw new \InvalidArgumentException('Missing required field "mounted" for ' . static::class . '.'); + } + + return new static( + path: $data['path'], + usedPercent: $data['usedPercent'], + available: $data['available'], + mounted: $data['mounted'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'path' => static::serializeValue($this->path), + 'usedPercent' => static::serializeValue($this->usedPercent), + 'available' => static::serializeValue($this->available), + 'mounted' => static::serializeValue($this->mounted) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabase.php b/src/Appwrite/Models/DedicatedDatabase.php new file mode 100644 index 00000000..963e95fa --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabase.php @@ -0,0 +1,377 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('projectId', $data)) { + throw new \InvalidArgumentException('Missing required field "projectId" for ' . static::class . '.'); + } + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('api', $data)) { + throw new \InvalidArgumentException('Missing required field "api" for ' . static::class . '.'); + } + if (!array_key_exists('engine', $data)) { + throw new \InvalidArgumentException('Missing required field "engine" for ' . static::class . '.'); + } + if (!array_key_exists('version', $data)) { + throw new \InvalidArgumentException('Missing required field "version" for ' . static::class . '.'); + } + if (!array_key_exists('specification', $data)) { + throw new \InvalidArgumentException('Missing required field "specification" for ' . static::class . '.'); + } + if (!array_key_exists('backend', $data)) { + throw new \InvalidArgumentException('Missing required field "backend" for ' . static::class . '.'); + } + if (!array_key_exists('hostname', $data)) { + throw new \InvalidArgumentException('Missing required field "hostname" for ' . static::class . '.'); + } + if (!array_key_exists('connectionPort', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionPort" for ' . static::class . '.'); + } + if (!array_key_exists('connectionUser', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionUser" for ' . static::class . '.'); + } + if (!array_key_exists('connectionPassword', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionPassword" for ' . static::class . '.'); + } + if (!array_key_exists('connectionString', $data)) { + throw new \InvalidArgumentException('Missing required field "connectionString" for ' . static::class . '.'); + } + if (!array_key_exists('ssl', $data)) { + throw new \InvalidArgumentException('Missing required field "ssl" for ' . static::class . '.'); + } + if (!array_key_exists('status', $data)) { + throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); + } + if (!array_key_exists('containerStatus', $data)) { + throw new \InvalidArgumentException('Missing required field "containerStatus" for ' . static::class . '.'); + } + if (!array_key_exists('lifecycleState', $data)) { + throw new \InvalidArgumentException('Missing required field "lifecycleState" for ' . static::class . '.'); + } + if (!array_key_exists('idleTimeoutMinutes', $data)) { + throw new \InvalidArgumentException('Missing required field "idleTimeoutMinutes" for ' . static::class . '.'); + } + if (!array_key_exists('cpu', $data)) { + throw new \InvalidArgumentException('Missing required field "cpu" for ' . static::class . '.'); + } + if (!array_key_exists('memory', $data)) { + throw new \InvalidArgumentException('Missing required field "memory" for ' . static::class . '.'); + } + if (!array_key_exists('storage', $data)) { + throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.'); + } + if (!array_key_exists('storageClass', $data)) { + throw new \InvalidArgumentException('Missing required field "storageClass" for ' . static::class . '.'); + } + if (!array_key_exists('storageMaxGb', $data)) { + throw new \InvalidArgumentException('Missing required field "storageMaxGb" for ' . static::class . '.'); + } + if (!array_key_exists('nodePool', $data)) { + throw new \InvalidArgumentException('Missing required field "nodePool" for ' . static::class . '.'); + } + if (!array_key_exists('replicas', $data)) { + throw new \InvalidArgumentException('Missing required field "replicas" for ' . static::class . '.'); + } + if (!array_key_exists('syncMode', $data)) { + throw new \InvalidArgumentException('Missing required field "syncMode" for ' . static::class . '.'); + } + if (!array_key_exists('crossRegionReplicas', $data)) { + throw new \InvalidArgumentException('Missing required field "crossRegionReplicas" for ' . static::class . '.'); + } + if (!array_key_exists('networkMaxConnections', $data)) { + throw new \InvalidArgumentException('Missing required field "networkMaxConnections" for ' . static::class . '.'); + } + if (!array_key_exists('networkIdleTimeoutSeconds', $data)) { + throw new \InvalidArgumentException('Missing required field "networkIdleTimeoutSeconds" for ' . static::class . '.'); + } + if (!array_key_exists('networkIPAllowlist', $data)) { + throw new \InvalidArgumentException('Missing required field "networkIPAllowlist" for ' . static::class . '.'); + } + if (!array_key_exists('backupEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "backupEnabled" for ' . static::class . '.'); + } + if (!array_key_exists('pitr', $data)) { + throw new \InvalidArgumentException('Missing required field "pitr" for ' . static::class . '.'); + } + if (!array_key_exists('pitrRetentionDays', $data)) { + throw new \InvalidArgumentException('Missing required field "pitrRetentionDays" for ' . static::class . '.'); + } + if (!array_key_exists('storageAutoscaling', $data)) { + throw new \InvalidArgumentException('Missing required field "storageAutoscaling" for ' . static::class . '.'); + } + if (!array_key_exists('storageAutoscalingThresholdPercent', $data)) { + throw new \InvalidArgumentException('Missing required field "storageAutoscalingThresholdPercent" for ' . static::class . '.'); + } + if (!array_key_exists('storageAutoscalingMaxGb', $data)) { + throw new \InvalidArgumentException('Missing required field "storageAutoscalingMaxGb" for ' . static::class . '.'); + } + if (!array_key_exists('maintenanceWindowDay', $data)) { + throw new \InvalidArgumentException('Missing required field "maintenanceWindowDay" for ' . static::class . '.'); + } + if (!array_key_exists('maintenanceWindowHourUtc', $data)) { + throw new \InvalidArgumentException('Missing required field "maintenanceWindowHourUtc" for ' . static::class . '.'); + } + if (!array_key_exists('metricsEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "metricsEnabled" for ' . static::class . '.'); + } + if (!array_key_exists('sqlApiEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "sqlApiEnabled" for ' . static::class . '.'); + } + if (!array_key_exists('sqlApiAllowedStatements', $data)) { + throw new \InvalidArgumentException('Missing required field "sqlApiAllowedStatements" for ' . static::class . '.'); + } + if (!array_key_exists('sqlApiMaxRows', $data)) { + throw new \InvalidArgumentException('Missing required field "sqlApiMaxRows" for ' . static::class . '.'); + } + if (!array_key_exists('sqlApiMaxBytes', $data)) { + throw new \InvalidArgumentException('Missing required field "sqlApiMaxBytes" for ' . static::class . '.'); + } + if (!array_key_exists('sqlApiTimeoutSeconds', $data)) { + throw new \InvalidArgumentException('Missing required field "sqlApiTimeoutSeconds" for ' . static::class . '.'); + } + if (!array_key_exists('error', $data)) { + throw new \InvalidArgumentException('Missing required field "error" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + projectId: $data['projectId'], + name: $data['name'], + api: $data['api'], + engine: $data['engine'], + version: $data['version'], + specification: $data['specification'], + backend: $data['backend'], + hostname: $data['hostname'], + connectionPort: $data['connectionPort'], + connectionUser: $data['connectionUser'], + connectionPassword: $data['connectionPassword'], + connectionString: $data['connectionString'], + ssl: $data['ssl'], + status: $data['status'], + containerStatus: $data['containerStatus'], + lifecycleState: $data['lifecycleState'], + idleTimeoutMinutes: $data['idleTimeoutMinutes'], + cpu: $data['cpu'], + memory: $data['memory'], + storage: $data['storage'], + storageClass: $data['storageClass'], + storageMaxGb: $data['storageMaxGb'], + nodePool: $data['nodePool'], + replicas: $data['replicas'], + syncMode: $data['syncMode'], + crossRegionReplicas: $data['crossRegionReplicas'], + networkMaxConnections: $data['networkMaxConnections'], + networkIdleTimeoutSeconds: $data['networkIdleTimeoutSeconds'], + networkIPAllowlist: $data['networkIPAllowlist'], + backupEnabled: $data['backupEnabled'], + pitr: $data['pitr'], + pitrRetentionDays: $data['pitrRetentionDays'], + storageAutoscaling: $data['storageAutoscaling'], + storageAutoscalingThresholdPercent: $data['storageAutoscalingThresholdPercent'], + storageAutoscalingMaxGb: $data['storageAutoscalingMaxGb'], + maintenanceWindowDay: $data['maintenanceWindowDay'], + maintenanceWindowHourUtc: $data['maintenanceWindowHourUtc'], + metricsEnabled: $data['metricsEnabled'], + sqlApiEnabled: $data['sqlApiEnabled'], + sqlApiAllowedStatements: $data['sqlApiAllowedStatements'], + sqlApiMaxRows: $data['sqlApiMaxRows'], + sqlApiMaxBytes: $data['sqlApiMaxBytes'], + sqlApiTimeoutSeconds: $data['sqlApiTimeoutSeconds'], + error: $data['error'], + lastAccessedAt: array_key_exists('lastAccessedAt', $data) ? $data['lastAccessedAt'] : null, + idleUntil: array_key_exists('idleUntil', $data) ? $data['idleUntil'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'projectId' => static::serializeValue($this->projectId), + 'name' => static::serializeValue($this->name), + 'api' => static::serializeValue($this->api), + 'engine' => static::serializeValue($this->engine), + 'version' => static::serializeValue($this->version), + 'specification' => static::serializeValue($this->specification), + 'backend' => static::serializeValue($this->backend), + 'hostname' => static::serializeValue($this->hostname), + 'connectionPort' => static::serializeValue($this->connectionPort), + 'connectionUser' => static::serializeValue($this->connectionUser), + 'connectionPassword' => static::serializeValue($this->connectionPassword), + 'connectionString' => static::serializeValue($this->connectionString), + 'ssl' => static::serializeValue($this->ssl), + 'status' => static::serializeValue($this->status), + 'containerStatus' => static::serializeValue($this->containerStatus), + 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt), + 'idleUntil' => static::serializeValue($this->idleUntil), + 'lifecycleState' => static::serializeValue($this->lifecycleState), + 'idleTimeoutMinutes' => static::serializeValue($this->idleTimeoutMinutes), + 'cpu' => static::serializeValue($this->cpu), + 'memory' => static::serializeValue($this->memory), + 'storage' => static::serializeValue($this->storage), + 'storageClass' => static::serializeValue($this->storageClass), + 'storageMaxGb' => static::serializeValue($this->storageMaxGb), + 'nodePool' => static::serializeValue($this->nodePool), + 'replicas' => static::serializeValue($this->replicas), + 'syncMode' => static::serializeValue($this->syncMode), + 'crossRegionReplicas' => static::serializeValue($this->crossRegionReplicas), + 'networkMaxConnections' => static::serializeValue($this->networkMaxConnections), + 'networkIdleTimeoutSeconds' => static::serializeValue($this->networkIdleTimeoutSeconds), + 'networkIPAllowlist' => static::serializeValue($this->networkIPAllowlist), + 'backupEnabled' => static::serializeValue($this->backupEnabled), + 'pitr' => static::serializeValue($this->pitr), + 'pitrRetentionDays' => static::serializeValue($this->pitrRetentionDays), + 'storageAutoscaling' => static::serializeValue($this->storageAutoscaling), + 'storageAutoscalingThresholdPercent' => static::serializeValue($this->storageAutoscalingThresholdPercent), + 'storageAutoscalingMaxGb' => static::serializeValue($this->storageAutoscalingMaxGb), + 'maintenanceWindowDay' => static::serializeValue($this->maintenanceWindowDay), + 'maintenanceWindowHourUtc' => static::serializeValue($this->maintenanceWindowHourUtc), + 'metricsEnabled' => static::serializeValue($this->metricsEnabled), + 'sqlApiEnabled' => static::serializeValue($this->sqlApiEnabled), + 'sqlApiAllowedStatements' => static::serializeValue($this->sqlApiAllowedStatements), + 'sqlApiMaxRows' => static::serializeValue($this->sqlApiMaxRows), + 'sqlApiMaxBytes' => static::serializeValue($this->sqlApiMaxBytes), + 'sqlApiTimeoutSeconds' => static::serializeValue($this->sqlApiTimeoutSeconds), + 'error' => static::serializeValue($this->error) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseMember.php b/src/Appwrite/Models/DedicatedDatabaseMember.php new file mode 100644 index 00000000..ba44af70 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseMember.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('role', $data)) { + throw new \InvalidArgumentException('Missing required field "role" for ' . static::class . '.'); + } + if (!array_key_exists('status', $data)) { + throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); + } + if (!array_key_exists('lagSeconds', $data)) { + throw new \InvalidArgumentException('Missing required field "lagSeconds" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + role: $data['role'], + status: $data['status'], + lagSeconds: $data['lagSeconds'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'role' => static::serializeValue($this->role), + 'status' => static::serializeValue($this->status), + 'lagSeconds' => static::serializeValue($this->lagSeconds) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseReplicas.php b/src/Appwrite/Models/DedicatedDatabaseReplicas.php new file mode 100644 index 00000000..37a760d2 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseReplicas.php @@ -0,0 +1,66 @@ + $members per-pod statuses for the primary and every replica. + */ + public function __construct( + public int $replicas, + public string $syncMode, + public array $members + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('replicas', $data)) { + throw new \InvalidArgumentException('Missing required field "replicas" for ' . static::class . '.'); + } + if (!array_key_exists('syncMode', $data)) { + throw new \InvalidArgumentException('Missing required field "syncMode" for ' . static::class . '.'); + } + if (!array_key_exists('members', $data)) { + throw new \InvalidArgumentException('Missing required field "members" for ' . static::class . '.'); + } + + return new static( + replicas: $data['replicas'], + syncMode: $data['syncMode'], + members: is_array($data['members']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DedicatedDatabaseMember::class, $item), + $data['members'] + ) + : $data['members'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'replicas' => static::serializeValue($this->replicas), + 'syncMode' => static::serializeValue($this->syncMode), + 'members' => static::serializeValue($this->members) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecification.php b/src/Appwrite/Models/DedicatedDatabaseSpecification.php new file mode 100644 index 00000000..5a1a5a29 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseSpecification.php @@ -0,0 +1,103 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('slug', $data)) { + throw new \InvalidArgumentException('Missing required field "slug" for ' . static::class . '.'); + } + if (!array_key_exists('name', $data)) { + throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); + } + if (!array_key_exists('price', $data)) { + throw new \InvalidArgumentException('Missing required field "price" for ' . static::class . '.'); + } + if (!array_key_exists('cpu', $data)) { + throw new \InvalidArgumentException('Missing required field "cpu" for ' . static::class . '.'); + } + if (!array_key_exists('memory', $data)) { + throw new \InvalidArgumentException('Missing required field "memory" for ' . static::class . '.'); + } + if (!array_key_exists('maxConnections', $data)) { + throw new \InvalidArgumentException('Missing required field "maxConnections" for ' . static::class . '.'); + } + if (!array_key_exists('includedStorage', $data)) { + throw new \InvalidArgumentException('Missing required field "includedStorage" for ' . static::class . '.'); + } + if (!array_key_exists('includedBandwidth', $data)) { + throw new \InvalidArgumentException('Missing required field "includedBandwidth" for ' . static::class . '.'); + } + if (!array_key_exists('enabled', $data)) { + throw new \InvalidArgumentException('Missing required field "enabled" for ' . static::class . '.'); + } + + return new static( + slug: $data['slug'], + name: $data['name'], + price: $data['price'], + cpu: $data['cpu'], + memory: $data['memory'], + maxConnections: $data['maxConnections'], + includedStorage: $data['includedStorage'], + includedBandwidth: $data['includedBandwidth'], + enabled: $data['enabled'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'slug' => static::serializeValue($this->slug), + 'name' => static::serializeValue($this->name), + 'price' => static::serializeValue($this->price), + 'cpu' => static::serializeValue($this->cpu), + 'memory' => static::serializeValue($this->memory), + 'maxConnections' => static::serializeValue($this->maxConnections), + 'includedStorage' => static::serializeValue($this->includedStorage), + 'includedBandwidth' => static::serializeValue($this->includedBandwidth), + 'enabled' => static::serializeValue($this->enabled) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php new file mode 100644 index 00000000..fb040cd3 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php @@ -0,0 +1,66 @@ + $specifications list of dedicated database specifications. + * @param int $total total number of specifications. + * @param DedicatedDatabaseSpecificationPricing $pricing overage and add-on pricing shared across all specifications. + */ + public function __construct( + public array $specifications, + public int $total, + public DedicatedDatabaseSpecificationPricing $pricing + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('specifications', $data)) { + throw new \InvalidArgumentException('Missing required field "specifications" for ' . static::class . '.'); + } + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('pricing', $data)) { + throw new \InvalidArgumentException('Missing required field "pricing" for ' . static::class . '.'); + } + + return new static( + specifications: is_array($data['specifications']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DedicatedDatabaseSpecification::class, $item), + $data['specifications'] + ) + : $data['specifications'], + total: $data['total'], + pricing: static::hydrateTypedValue(DedicatedDatabaseSpecificationPricing::class, $data['pricing']) + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'specifications' => static::serializeValue($this->specifications), + 'total' => static::serializeValue($this->total), + 'pricing' => static::serializeValue($this->pricing) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php new file mode 100644 index 00000000..37a3b4c2 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php @@ -0,0 +1,75 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('storageOverageRate', $data)) { + throw new \InvalidArgumentException('Missing required field "storageOverageRate" for ' . static::class . '.'); + } + if (!array_key_exists('bandwidthOverageRate', $data)) { + throw new \InvalidArgumentException('Missing required field "bandwidthOverageRate" for ' . static::class . '.'); + } + if (!array_key_exists('replicaRate', $data)) { + throw new \InvalidArgumentException('Missing required field "replicaRate" for ' . static::class . '.'); + } + if (!array_key_exists('crossRegionReplicaRate', $data)) { + throw new \InvalidArgumentException('Missing required field "crossRegionReplicaRate" for ' . static::class . '.'); + } + if (!array_key_exists('pitrRate', $data)) { + throw new \InvalidArgumentException('Missing required field "pitrRate" for ' . static::class . '.'); + } + + return new static( + storageOverageRate: $data['storageOverageRate'], + bandwidthOverageRate: $data['bandwidthOverageRate'], + replicaRate: $data['replicaRate'], + crossRegionReplicaRate: $data['crossRegionReplicaRate'], + pitrRate: $data['pitrRate'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'storageOverageRate' => static::serializeValue($this->storageOverageRate), + 'bandwidthOverageRate' => static::serializeValue($this->bandwidthOverageRate), + 'replicaRate' => static::serializeValue($this->replicaRate), + 'crossRegionReplicaRate' => static::serializeValue($this->crossRegionReplicaRate), + 'pitrRate' => static::serializeValue($this->pitrRate) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Approve.php b/src/Appwrite/Models/Oauth2Approve.php new file mode 100644 index 00000000..e4f896d3 --- /dev/null +++ b/src/Appwrite/Models/Oauth2Approve.php @@ -0,0 +1,47 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('redirectUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "redirectUrl" for ' . static::class . '.'); + } + + return new static( + redirectUrl: $data['redirectUrl'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'redirectUrl' => static::serializeValue($this->redirectUrl) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Authorize.php b/src/Appwrite/Models/Oauth2Authorize.php new file mode 100644 index 00000000..4667084b --- /dev/null +++ b/src/Appwrite/Models/Oauth2Authorize.php @@ -0,0 +1,54 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('grantId', $data)) { + throw new \InvalidArgumentException('Missing required field "grantId" for ' . static::class . '.'); + } + if (!array_key_exists('redirectUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "redirectUrl" for ' . static::class . '.'); + } + + return new static( + grantId: $data['grantId'], + redirectUrl: $data['redirectUrl'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'grantId' => static::serializeValue($this->grantId), + 'redirectUrl' => static::serializeValue($this->redirectUrl) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Consent.php b/src/Appwrite/Models/Oauth2Consent.php new file mode 100644 index 00000000..248995ec --- /dev/null +++ b/src/Appwrite/Models/Oauth2Consent.php @@ -0,0 +1,110 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('userId', $data)) { + throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('cimdUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "cimdUrl" for ' . static::class . '.'); + } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } + if (!array_key_exists('resources', $data)) { + throw new \InvalidArgumentException('Missing required field "resources" for ' . static::class . '.'); + } + if (!array_key_exists('authorizationDetails', $data)) { + throw new \InvalidArgumentException('Missing required field "authorizationDetails" for ' . static::class . '.'); + } + if (!array_key_exists('expire', $data)) { + throw new \InvalidArgumentException('Missing required field "expire" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + userId: $data['userId'], + appId: $data['appId'], + cimdUrl: $data['cimdUrl'], + scopes: $data['scopes'], + resources: $data['resources'], + authorizationDetails: $data['authorizationDetails'], + expire: $data['expire'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'userId' => static::serializeValue($this->userId), + 'appId' => static::serializeValue($this->appId), + 'cimdUrl' => static::serializeValue($this->cimdUrl), + 'scopes' => static::serializeValue($this->scopes), + 'resources' => static::serializeValue($this->resources), + 'authorizationDetails' => static::serializeValue($this->authorizationDetails), + 'expire' => static::serializeValue($this->expire) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2ConsentList.php b/src/Appwrite/Models/Oauth2ConsentList.php new file mode 100644 index 00000000..e6b0da7b --- /dev/null +++ b/src/Appwrite/Models/Oauth2ConsentList.php @@ -0,0 +1,59 @@ + $consents list of consents. + */ + public function __construct( + public int $total, + public array $consents + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('consents', $data)) { + throw new \InvalidArgumentException('Missing required field "consents" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + consents: is_array($data['consents']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Oauth2Consent::class, $item), + $data['consents'] + ) + : $data['consents'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'consents' => static::serializeValue($this->consents) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2ConsentToken.php b/src/Appwrite/Models/Oauth2ConsentToken.php new file mode 100644 index 00000000..1c363fb4 --- /dev/null +++ b/src/Appwrite/Models/Oauth2ConsentToken.php @@ -0,0 +1,117 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('consentId', $data)) { + throw new \InvalidArgumentException('Missing required field "consentId" for ' . static::class . '.'); + } + if (!array_key_exists('userId', $data)) { + throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('cimdUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "cimdUrl" for ' . static::class . '.'); + } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } + if (!array_key_exists('resources', $data)) { + throw new \InvalidArgumentException('Missing required field "resources" for ' . static::class . '.'); + } + if (!array_key_exists('authorizationDetails', $data)) { + throw new \InvalidArgumentException('Missing required field "authorizationDetails" for ' . static::class . '.'); + } + if (!array_key_exists('expire', $data)) { + throw new \InvalidArgumentException('Missing required field "expire" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + consentId: $data['consentId'], + userId: $data['userId'], + appId: $data['appId'], + cimdUrl: $data['cimdUrl'], + scopes: $data['scopes'], + resources: $data['resources'], + authorizationDetails: $data['authorizationDetails'], + expire: $data['expire'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'consentId' => static::serializeValue($this->consentId), + 'userId' => static::serializeValue($this->userId), + 'appId' => static::serializeValue($this->appId), + 'cimdUrl' => static::serializeValue($this->cimdUrl), + 'scopes' => static::serializeValue($this->scopes), + 'resources' => static::serializeValue($this->resources), + 'authorizationDetails' => static::serializeValue($this->authorizationDetails), + 'expire' => static::serializeValue($this->expire) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2ConsentTokenList.php b/src/Appwrite/Models/Oauth2ConsentTokenList.php new file mode 100644 index 00000000..d24f6382 --- /dev/null +++ b/src/Appwrite/Models/Oauth2ConsentTokenList.php @@ -0,0 +1,59 @@ + $tokens list of tokens. + */ + public function __construct( + public int $total, + public array $tokens + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('tokens', $data)) { + throw new \InvalidArgumentException('Missing required field "tokens" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + tokens: is_array($data['tokens']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Oauth2ConsentToken::class, $item), + $data['tokens'] + ) + : $data['tokens'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'tokens' => static::serializeValue($this->tokens) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2DeviceAuthorization.php b/src/Appwrite/Models/Oauth2DeviceAuthorization.php new file mode 100644 index 00000000..6f295a44 --- /dev/null +++ b/src/Appwrite/Models/Oauth2DeviceAuthorization.php @@ -0,0 +1,82 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('device_code', $data)) { + throw new \InvalidArgumentException('Missing required field "device_code" for ' . static::class . '.'); + } + if (!array_key_exists('user_code', $data)) { + throw new \InvalidArgumentException('Missing required field "user_code" for ' . static::class . '.'); + } + if (!array_key_exists('verification_uri', $data)) { + throw new \InvalidArgumentException('Missing required field "verification_uri" for ' . static::class . '.'); + } + if (!array_key_exists('verification_uri_complete', $data)) { + throw new \InvalidArgumentException('Missing required field "verification_uri_complete" for ' . static::class . '.'); + } + if (!array_key_exists('expires_in', $data)) { + throw new \InvalidArgumentException('Missing required field "expires_in" for ' . static::class . '.'); + } + if (!array_key_exists('interval', $data)) { + throw new \InvalidArgumentException('Missing required field "interval" for ' . static::class . '.'); + } + + return new static( + deviceCode: $data['device_code'], + userCode: $data['user_code'], + verificationUri: $data['verification_uri'], + verificationUriComplete: $data['verification_uri_complete'], + expiresIn: $data['expires_in'], + interval: $data['interval'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'device_code' => static::serializeValue($this->deviceCode), + 'user_code' => static::serializeValue($this->userCode), + 'verification_uri' => static::serializeValue($this->verificationUri), + 'verification_uri_complete' => static::serializeValue($this->verificationUriComplete), + 'expires_in' => static::serializeValue($this->expiresIn), + 'interval' => static::serializeValue($this->interval) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Grant.php b/src/Appwrite/Models/Oauth2Grant.php new file mode 100644 index 00000000..4b8de2f9 --- /dev/null +++ b/src/Appwrite/Models/Oauth2Grant.php @@ -0,0 +1,124 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('userId', $data)) { + throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + } + if (!array_key_exists('appId', $data)) { + throw new \InvalidArgumentException('Missing required field "appId" for ' . static::class . '.'); + } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } + if (!array_key_exists('resources', $data)) { + throw new \InvalidArgumentException('Missing required field "resources" for ' . static::class . '.'); + } + if (!array_key_exists('authorizationDetails', $data)) { + throw new \InvalidArgumentException('Missing required field "authorizationDetails" for ' . static::class . '.'); + } + if (!array_key_exists('prompt', $data)) { + throw new \InvalidArgumentException('Missing required field "prompt" for ' . static::class . '.'); + } + if (!array_key_exists('redirectUri', $data)) { + throw new \InvalidArgumentException('Missing required field "redirectUri" for ' . static::class . '.'); + } + if (!array_key_exists('authTime', $data)) { + throw new \InvalidArgumentException('Missing required field "authTime" for ' . static::class . '.'); + } + if (!array_key_exists('expire', $data)) { + throw new \InvalidArgumentException('Missing required field "expire" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + userId: $data['userId'], + appId: $data['appId'], + scopes: $data['scopes'], + resources: $data['resources'], + authorizationDetails: $data['authorizationDetails'], + prompt: $data['prompt'], + redirectUri: $data['redirectUri'], + authTime: $data['authTime'], + expire: $data['expire'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'userId' => static::serializeValue($this->userId), + 'appId' => static::serializeValue($this->appId), + 'scopes' => static::serializeValue($this->scopes), + 'resources' => static::serializeValue($this->resources), + 'authorizationDetails' => static::serializeValue($this->authorizationDetails), + 'prompt' => static::serializeValue($this->prompt), + 'redirectUri' => static::serializeValue($this->redirectUri), + 'authTime' => static::serializeValue($this->authTime), + 'expire' => static::serializeValue($this->expire) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Organization.php b/src/Appwrite/Models/Oauth2Organization.php new file mode 100644 index 00000000..25a7dcff --- /dev/null +++ b/src/Appwrite/Models/Oauth2Organization.php @@ -0,0 +1,47 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2OrganizationList.php b/src/Appwrite/Models/Oauth2OrganizationList.php new file mode 100644 index 00000000..2f29ee00 --- /dev/null +++ b/src/Appwrite/Models/Oauth2OrganizationList.php @@ -0,0 +1,59 @@ + $organizations list of organizations. + */ + public function __construct( + public int $total, + public array $organizations + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('organizations', $data)) { + throw new \InvalidArgumentException('Missing required field "organizations" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + organizations: is_array($data['organizations']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Oauth2Organization::class, $item), + $data['organizations'] + ) + : $data['organizations'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'organizations' => static::serializeValue($this->organizations) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2PAR.php b/src/Appwrite/Models/Oauth2PAR.php new file mode 100644 index 00000000..d6f7d677 --- /dev/null +++ b/src/Appwrite/Models/Oauth2PAR.php @@ -0,0 +1,54 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('request_uri', $data)) { + throw new \InvalidArgumentException('Missing required field "request_uri" for ' . static::class . '.'); + } + if (!array_key_exists('expires_in', $data)) { + throw new \InvalidArgumentException('Missing required field "expires_in" for ' . static::class . '.'); + } + + return new static( + requestUri: $data['request_uri'], + expiresIn: $data['expires_in'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'request_uri' => static::serializeValue($this->requestUri), + 'expires_in' => static::serializeValue($this->expiresIn) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Project.php b/src/Appwrite/Models/Oauth2Project.php new file mode 100644 index 00000000..e7f9725d --- /dev/null +++ b/src/Appwrite/Models/Oauth2Project.php @@ -0,0 +1,61 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('region', $data)) { + throw new \InvalidArgumentException('Missing required field "region" for ' . static::class . '.'); + } + if (!array_key_exists('endpoint', $data)) { + throw new \InvalidArgumentException('Missing required field "endpoint" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + region: $data['region'], + endpoint: $data['endpoint'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'region' => static::serializeValue($this->region), + 'endpoint' => static::serializeValue($this->endpoint) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2ProjectList.php b/src/Appwrite/Models/Oauth2ProjectList.php new file mode 100644 index 00000000..efa948b8 --- /dev/null +++ b/src/Appwrite/Models/Oauth2ProjectList.php @@ -0,0 +1,59 @@ + $projects list of projects. + */ + public function __construct( + public int $total, + public array $projects + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('projects', $data)) { + throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + projects: is_array($data['projects']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Oauth2Project::class, $item), + $data['projects'] + ) + : $data['projects'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'projects' => static::serializeValue($this->projects) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Reject.php b/src/Appwrite/Models/Oauth2Reject.php new file mode 100644 index 00000000..57304a14 --- /dev/null +++ b/src/Appwrite/Models/Oauth2Reject.php @@ -0,0 +1,47 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('redirectUrl', $data)) { + throw new \InvalidArgumentException('Missing required field "redirectUrl" for ' . static::class . '.'); + } + + return new static( + redirectUrl: $data['redirectUrl'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'redirectUrl' => static::serializeValue($this->redirectUrl) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Oauth2Token.php b/src/Appwrite/Models/Oauth2Token.php new file mode 100644 index 00000000..b9bbb593 --- /dev/null +++ b/src/Appwrite/Models/Oauth2Token.php @@ -0,0 +1,83 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('access_token', $data)) { + throw new \InvalidArgumentException('Missing required field "access_token" for ' . static::class . '.'); + } + if (!array_key_exists('token_type', $data)) { + throw new \InvalidArgumentException('Missing required field "token_type" for ' . static::class . '.'); + } + if (!array_key_exists('expires_in', $data)) { + throw new \InvalidArgumentException('Missing required field "expires_in" for ' . static::class . '.'); + } + if (!array_key_exists('refresh_token', $data)) { + throw new \InvalidArgumentException('Missing required field "refresh_token" for ' . static::class . '.'); + } + if (!array_key_exists('scope', $data)) { + throw new \InvalidArgumentException('Missing required field "scope" for ' . static::class . '.'); + } + + return new static( + accessToken: $data['access_token'], + tokenType: $data['token_type'], + expiresIn: $data['expires_in'], + refreshToken: $data['refresh_token'], + scope: $data['scope'], + authorizationDetails: array_key_exists('authorization_details', $data) ? $data['authorization_details'] : null, + idToken: array_key_exists('id_token', $data) ? $data['id_token'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'access_token' => static::serializeValue($this->accessToken), + 'token_type' => static::serializeValue($this->tokenType), + 'expires_in' => static::serializeValue($this->expiresIn), + 'refresh_token' => static::serializeValue($this->refreshToken), + 'scope' => static::serializeValue($this->scope), + 'authorization_details' => static::serializeValue($this->authorizationDetails), + 'id_token' => static::serializeValue($this->idToken) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index f2af24d4..f9013ca9 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -39,6 +39,7 @@ * @param list $protocols list of protocols. * @param list $blocks project blocks information * @param string $consoleAccessedAt last time the project was accessed via console. used with plan's projectinactivitydays to determine if project is paused. + * @param bool $wafEnabled whether waf enforcement is enabled for the project. * @param BillingLimits|null $billingLimits billing limits reached * @param bool|null $oAuth2ServerEnabled oauth2 server status * @param string|null $oAuth2ServerAuthorizationUrl oauth2 server authorization url @@ -49,6 +50,7 @@ * @param int|null $oAuth2ServerRefreshTokenDuration oauth2 server refresh token duration in seconds for confidential clients * @param int|null $oAuth2ServerPublicAccessTokenDuration oauth2 server access token duration in seconds for public clients (spas, mobile, native) * @param int|null $oAuth2ServerPublicRefreshTokenDuration oauth2 server refresh token duration in seconds for public clients (spas, mobile, native) + * @param int|null $oAuth2ServerInstallationAccessTokenDuration oauth2 server access token duration in seconds for app installation access tokens * @param bool|null $oAuth2ServerConfidentialPkce when enabled, pkce is required for confidential clients (server-side flows using client_secret). pkce is always required for public clients regardless of this setting. * @param string|null $oAuth2ServerVerificationUrl url to your application page where users enter the device flow user code. empty when the device authorization grant is not configured. * @param int|null $oAuth2ServerUserCodeLength number of characters in the device flow user code, excluding the formatting separator. @@ -84,6 +86,7 @@ public function __construct( public array $protocols, public array $blocks, public string $consoleAccessedAt, + public bool $wafEnabled, public ?BillingLimits $billingLimits = null, public ?bool $oAuth2ServerEnabled = null, public ?string $oAuth2ServerAuthorizationUrl = null, @@ -94,6 +97,7 @@ public function __construct( public ?int $oAuth2ServerRefreshTokenDuration = null, public ?int $oAuth2ServerPublicAccessTokenDuration = null, public ?int $oAuth2ServerPublicRefreshTokenDuration = null, + public ?int $oAuth2ServerInstallationAccessTokenDuration = null, public ?bool $oAuth2ServerConfidentialPkce = null, public ?string $oAuth2ServerVerificationUrl = null, public ?int $oAuth2ServerUserCodeLength = null, @@ -189,6 +193,9 @@ public static function from(array $data): static if (!array_key_exists('consoleAccessedAt', $data)) { throw new \InvalidArgumentException('Missing required field "consoleAccessedAt" for ' . static::class . '.'); } + if (!array_key_exists('wafEnabled', $data)) { + throw new \InvalidArgumentException('Missing required field "wafEnabled" for ' . static::class . '.'); + } return new static( id: $data['$id'], @@ -243,6 +250,7 @@ public static function from(array $data): static ) : $data['blocks'], consoleAccessedAt: $data['consoleAccessedAt'], + wafEnabled: $data['wafEnabled'], billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null, oAuth2ServerEnabled: array_key_exists('oAuth2ServerEnabled', $data) ? $data['oAuth2ServerEnabled'] : null, oAuth2ServerAuthorizationUrl: array_key_exists('oAuth2ServerAuthorizationUrl', $data) ? $data['oAuth2ServerAuthorizationUrl'] : null, @@ -253,6 +261,7 @@ public static function from(array $data): static oAuth2ServerRefreshTokenDuration: array_key_exists('oAuth2ServerRefreshTokenDuration', $data) ? $data['oAuth2ServerRefreshTokenDuration'] : null, oAuth2ServerPublicAccessTokenDuration: array_key_exists('oAuth2ServerPublicAccessTokenDuration', $data) ? $data['oAuth2ServerPublicAccessTokenDuration'] : null, oAuth2ServerPublicRefreshTokenDuration: array_key_exists('oAuth2ServerPublicRefreshTokenDuration', $data) ? $data['oAuth2ServerPublicRefreshTokenDuration'] : null, + oAuth2ServerInstallationAccessTokenDuration: array_key_exists('oAuth2ServerInstallationAccessTokenDuration', $data) ? $data['oAuth2ServerInstallationAccessTokenDuration'] : null, oAuth2ServerConfidentialPkce: array_key_exists('oAuth2ServerConfidentialPkce', $data) ? $data['oAuth2ServerConfidentialPkce'] : null, oAuth2ServerVerificationUrl: array_key_exists('oAuth2ServerVerificationUrl', $data) ? $data['oAuth2ServerVerificationUrl'] : null, oAuth2ServerUserCodeLength: array_key_exists('oAuth2ServerUserCodeLength', $data) ? $data['oAuth2ServerUserCodeLength'] : null, @@ -295,6 +304,7 @@ public function toArray(): array 'protocols' => static::serializeValue($this->protocols), 'blocks' => static::serializeValue($this->blocks), 'consoleAccessedAt' => static::serializeValue($this->consoleAccessedAt), + 'wafEnabled' => static::serializeValue($this->wafEnabled), 'billingLimits' => static::serializeValue($this->billingLimits), 'oAuth2ServerEnabled' => static::serializeValue($this->oAuth2ServerEnabled), 'oAuth2ServerAuthorizationUrl' => static::serializeValue($this->oAuth2ServerAuthorizationUrl), @@ -305,6 +315,7 @@ public function toArray(): array 'oAuth2ServerRefreshTokenDuration' => static::serializeValue($this->oAuth2ServerRefreshTokenDuration), 'oAuth2ServerPublicAccessTokenDuration' => static::serializeValue($this->oAuth2ServerPublicAccessTokenDuration), 'oAuth2ServerPublicRefreshTokenDuration' => static::serializeValue($this->oAuth2ServerPublicRefreshTokenDuration), + 'oAuth2ServerInstallationAccessTokenDuration' => static::serializeValue($this->oAuth2ServerInstallationAccessTokenDuration), 'oAuth2ServerConfidentialPkce' => static::serializeValue($this->oAuth2ServerConfidentialPkce), 'oAuth2ServerVerificationUrl' => static::serializeValue($this->oAuth2ServerVerificationUrl), 'oAuth2ServerUserCodeLength' => static::serializeValue($this->oAuth2ServerUserCodeLength), diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index e5b62b63..441e05da 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -105,6 +105,253 @@ public function create(string $userId, string $email, string $password, ?string } + /** + * Get a list of the OAuth2 consents the current user has given to third-party + * apps. + * + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2ConsentList + */ + public function listConsents(?array $queries = null, ?bool $total = null): \Appwrite\Models\Oauth2ConsentList + { + $apiPath = str_replace( + [], + [], + '/account/consents' + ); + + $apiParams = []; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2ConsentList::from($response); + + } + + /** + * Get an OAuth2 consent the current user has given to a third-party app by + * its unique ID. + * + * @param string $consentId + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Consent + */ + public function getConsent(string $consentId): \Appwrite\Models\Oauth2Consent + { + $apiPath = str_replace( + ['{consentId}'], + [$consentId], + '/account/consents/{consentId}' + ); + + $apiParams = []; + $apiParams['consentId'] = $consentId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Consent::from($response); + + } + + /** + * 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. + * + * @param string $consentId + * @throws AppwriteException + * @return string + */ + public function deleteConsent(string $consentId): string + { + $apiPath = str_replace( + ['{consentId}'], + [$consentId], + '/account/consents/{consentId}' + ); + + $apiParams = []; + $apiParams['consentId'] = $consentId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * 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. + * + * @param string $consentId + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2ConsentTokenList + */ + public function listConsentTokens(string $consentId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\Oauth2ConsentTokenList + { + $apiPath = str_replace( + ['{consentId}'], + [$consentId], + '/account/consents/{consentId}/tokens' + ); + + $apiParams = []; + $apiParams['consentId'] = $consentId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2ConsentTokenList::from($response); + + } + + /** + * Get a token family issued under an OAuth2 consent by its unique ID. The + * token secrets themselves are never returned. + * + * @param string $consentId + * @param string $tokenId + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2ConsentToken + */ + public function getConsentToken(string $consentId, string $tokenId): \Appwrite\Models\Oauth2ConsentToken + { + $apiPath = str_replace( + ['{consentId}', '{tokenId}'], + [$consentId, $tokenId], + '/account/consents/{consentId}/tokens/{tokenId}' + ); + + $apiParams = []; + $apiParams['consentId'] = $consentId; + $apiParams['tokenId'] = $tokenId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2ConsentToken::from($response); + + } + + /** + * 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. + * + * @param string $consentId + * @param string $tokenId + * @throws AppwriteException + * @return string + */ + public function deleteConsentToken(string $consentId, string $tokenId): string + { + $apiPath = str_replace( + ['{consentId}', '{tokenId}'], + [$consentId, $tokenId], + '/account/consents/{consentId}/tokens/{tokenId}' + ); + + $apiParams = []; + $apiParams['consentId'] = $consentId; + $apiParams['tokenId'] = $tokenId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * 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/src/Appwrite/Services/Apps.php b/src/Appwrite/Services/Apps.php new file mode 100644 index 00000000..d0a9c896 --- /dev/null +++ b/src/Appwrite/Services/Apps.php @@ -0,0 +1,1026 @@ +client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppsList::from($response); + + } + + /** + * Create a new application. + * + * @param string $appId + * @param string $name + * @param array $redirectUris + * @param ?string $description + * @param ?string $clientUri + * @param ?string $logoUri + * @param ?string $privacyPolicyUrl + * @param ?string $termsUrl + * @param ?array $contacts + * @param ?string $tagline + * @param ?array $tags + * @param ?array $images + * @param ?string $supportUrl + * @param ?string $dataDeletionUrl + * @param ?array $postLogoutRedirectUris + * @param ?bool $enabled + * @param ?string $type + * @param ?bool $deviceFlow + * @param ?string $teamId + * @throws AppwriteException + * @return \Appwrite\Models\App + */ + public function create(string $appId, string $name, array $redirectUris, ?string $description = null, ?string $clientUri = null, ?string $logoUri = null, ?string $privacyPolicyUrl = null, ?string $termsUrl = null, ?array $contacts = null, ?string $tagline = null, ?array $tags = null, ?array $images = null, ?string $supportUrl = null, ?string $dataDeletionUrl = null, ?array $postLogoutRedirectUris = null, ?bool $enabled = null, ?string $type = null, ?bool $deviceFlow = null, ?string $teamId = null): \Appwrite\Models\App + { + $apiPath = str_replace( + [], + [], + '/apps' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['name'] = $name; + $apiParams['redirectUris'] = $redirectUris; + + if (!is_null($description)) { + $apiParams['description'] = $description; + } + + if (!is_null($clientUri)) { + $apiParams['clientUri'] = $clientUri; + } + + if (!is_null($logoUri)) { + $apiParams['logoUri'] = $logoUri; + } + + if (!is_null($privacyPolicyUrl)) { + $apiParams['privacyPolicyUrl'] = $privacyPolicyUrl; + } + + if (!is_null($termsUrl)) { + $apiParams['termsUrl'] = $termsUrl; + } + + if (!is_null($contacts)) { + $apiParams['contacts'] = $contacts; + } + + if (!is_null($tagline)) { + $apiParams['tagline'] = $tagline; + } + + if (!is_null($tags)) { + $apiParams['tags'] = $tags; + } + + if (!is_null($images)) { + $apiParams['images'] = $images; + } + + if (!is_null($supportUrl)) { + $apiParams['supportUrl'] = $supportUrl; + } + + if (!is_null($dataDeletionUrl)) { + $apiParams['dataDeletionUrl'] = $dataDeletionUrl; + } + + if (!is_null($postLogoutRedirectUris)) { + $apiParams['postLogoutRedirectUris'] = $postLogoutRedirectUris; + } + + if (!is_null($enabled)) { + $apiParams['enabled'] = $enabled; + } + + if (!is_null($type)) { + $apiParams['type'] = $type; + } + + if (!is_null($deviceFlow)) { + $apiParams['deviceFlow'] = $deviceFlow; + } + + if (!is_null($teamId)) { + $apiParams['teamId'] = $teamId; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\App::from($response); + + } + + /** + * List scopes an application can request when installed on a team. + * + * @throws AppwriteException + * @return \Appwrite\Models\AppScopeList + */ + public function listInstallationScopes(): \Appwrite\Models\AppScopeList + { + $apiPath = str_replace( + [], + [], + '/apps/scopes/installations' + ); + + $apiParams = []; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppScopeList::from($response); + + } + + /** + * List scopes an application can request during the OAuth2 flow. + * + * @throws AppwriteException + * @return \Appwrite\Models\AppScopeList + */ + public function listOAuth2Scopes(): \Appwrite\Models\AppScopeList + { + $apiPath = str_replace( + [], + [], + '/apps/scopes/oauth2' + ); + + $apiParams = []; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppScopeList::from($response); + + } + + /** + * Get an application by its unique ID. + * + * @param string $appId + * @throws AppwriteException + * @return \Appwrite\Models\App + */ + public function get(string $appId): \Appwrite\Models\App + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\App::from($response); + + } + + /** + * Update an application by its unique ID. + * + * @param string $appId + * @param string $name + * @param ?string $description + * @param ?string $clientUri + * @param ?string $logoUri + * @param ?string $privacyPolicyUrl + * @param ?string $termsUrl + * @param ?array $contacts + * @param ?string $tagline + * @param ?array $tags + * @param ?array $images + * @param ?string $supportUrl + * @param ?string $dataDeletionUrl + * @param ?bool $enabled + * @param ?array $redirectUris + * @param ?array $postLogoutRedirectUris + * @param ?string $type + * @param ?bool $deviceFlow + * @param ?array $installationScopes + * @param ?string $installationRedirectUrl + * @throws AppwriteException + * @return \Appwrite\Models\App + */ + public function update(string $appId, string $name, ?string $description = null, ?string $clientUri = null, ?string $logoUri = null, ?string $privacyPolicyUrl = null, ?string $termsUrl = null, ?array $contacts = null, ?string $tagline = null, ?array $tags = null, ?array $images = null, ?string $supportUrl = null, ?string $dataDeletionUrl = null, ?bool $enabled = null, ?array $redirectUris = null, ?array $postLogoutRedirectUris = null, ?string $type = null, ?bool $deviceFlow = null, ?array $installationScopes = null, ?string $installationRedirectUrl = null): \Appwrite\Models\App + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['name'] = $name; + + if (!is_null($description)) { + $apiParams['description'] = $description; + } + + if (!is_null($clientUri)) { + $apiParams['clientUri'] = $clientUri; + } + + if (!is_null($logoUri)) { + $apiParams['logoUri'] = $logoUri; + } + + if (!is_null($privacyPolicyUrl)) { + $apiParams['privacyPolicyUrl'] = $privacyPolicyUrl; + } + + if (!is_null($termsUrl)) { + $apiParams['termsUrl'] = $termsUrl; + } + + if (!is_null($contacts)) { + $apiParams['contacts'] = $contacts; + } + + if (!is_null($tagline)) { + $apiParams['tagline'] = $tagline; + } + + if (!is_null($tags)) { + $apiParams['tags'] = $tags; + } + + if (!is_null($images)) { + $apiParams['images'] = $images; + } + + if (!is_null($supportUrl)) { + $apiParams['supportUrl'] = $supportUrl; + } + + if (!is_null($dataDeletionUrl)) { + $apiParams['dataDeletionUrl'] = $dataDeletionUrl; + } + + if (!is_null($enabled)) { + $apiParams['enabled'] = $enabled; + } + + if (!is_null($redirectUris)) { + $apiParams['redirectUris'] = $redirectUris; + } + + if (!is_null($postLogoutRedirectUris)) { + $apiParams['postLogoutRedirectUris'] = $postLogoutRedirectUris; + } + + if (!is_null($type)) { + $apiParams['type'] = $type; + } + + if (!is_null($deviceFlow)) { + $apiParams['deviceFlow'] = $deviceFlow; + } + + if (!is_null($installationScopes)) { + $apiParams['installationScopes'] = $installationScopes; + } + + if (!is_null($installationRedirectUrl)) { + $apiParams['installationRedirectUrl'] = $installationRedirectUrl; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\App::from($response); + + } + + /** + * Delete an application by its unique ID. + * + * @param string $appId + * @throws AppwriteException + * @return string + */ + public function delete(string $appId): string + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * List installations of an application. Requires an app key sent in the + * `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * + * @param string $appId + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallationList + */ + public function listInstallations(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/installations' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallationList::from($response); + + } + + /** + * 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. + * + * @param string $appId + * @param string $installationId + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function getInstallation(string $appId, string $installationId): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{appId}', '{installationId}'], + [$appId, $installationId], + '/apps/{appId}/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * 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. + * + * @param string $appId + * @param string $installationId + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Token + */ + public function createInstallationToken(string $appId, string $installationId): \Appwrite\Models\Oauth2Token + { + $apiPath = str_replace( + ['{appId}', '{installationId}'], + [$appId, $installationId], + '/apps/{appId}/installations/{installationId}/tokens' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Token::from($response); + + } + + /** + * List app keys for an application. + * + * @param string $appId + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\AppKeyList + */ + public function listKeys(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppKeyList + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/keys' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppKeyList::from($response); + + } + + /** + * 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. + * + * @param string $appId + * @throws AppwriteException + * @return \Appwrite\Models\AppKey + */ + public function createKey(string $appId): \Appwrite\Models\AppKey + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/keys' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppKey::from($response); + + } + + /** + * Get an app key by its unique ID. + * + * @param string $appId + * @param string $keyId + * @throws AppwriteException + * @return \Appwrite\Models\AppKey + */ + public function getKey(string $appId, string $keyId): \Appwrite\Models\AppKey + { + $apiPath = str_replace( + ['{appId}', '{keyId}'], + [$appId, $keyId], + '/apps/{appId}/keys/{keyId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['keyId'] = $keyId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppKey::from($response); + + } + + /** + * Delete an app key by its unique ID. + * + * @param string $appId + * @param string $keyId + * @throws AppwriteException + * @return string + */ + public function deleteKey(string $appId, string $keyId): string + { + $apiPath = str_replace( + ['{appId}', '{keyId}'], + [$appId, $keyId], + '/apps/{appId}/keys/{keyId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['keyId'] = $keyId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * 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. + * + * @param string $appId + * @param array $labels + * @throws AppwriteException + * @return \Appwrite\Models\App + */ + public function updateLabels(string $appId, array $labels): \Appwrite\Models\App + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/labels' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['labels'] = $labels; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\App::from($response); + + } + + /** + * List client secrets for an application. + * + * @param string $appId + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\AppSecretList + */ + public function listSecrets(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppSecretList + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/secrets' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppSecretList::from($response); + + } + + /** + * Create a new client secret for an application. + * + * @param string $appId + * @throws AppwriteException + * @return \Appwrite\Models\AppSecretPlaintext + */ + public function createSecret(string $appId): \Appwrite\Models\AppSecretPlaintext + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/secrets' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppSecretPlaintext::from($response); + + } + + /** + * Get an application client secret by its unique ID. + * + * @param string $appId + * @param string $secretId + * @throws AppwriteException + * @return \Appwrite\Models\AppSecret + */ + public function getSecret(string $appId, string $secretId): \Appwrite\Models\AppSecret + { + $apiPath = str_replace( + ['{appId}', '{secretId}'], + [$appId, $secretId], + '/apps/{appId}/secrets/{secretId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['secretId'] = $secretId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppSecret::from($response); + + } + + /** + * Delete an application client secret by its unique ID. + * + * @param string $appId + * @param string $secretId + * @throws AppwriteException + * @return string + */ + public function deleteSecret(string $appId, string $secretId): string + { + $apiPath = str_replace( + ['{appId}', '{secretId}'], + [$appId, $secretId], + '/apps/{appId}/secrets/{secretId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['secretId'] = $secretId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * Transfer an application to another team by its unique ID. + * + * @param string $appId + * @param string $teamId + * @throws AppwriteException + * @return \Appwrite\Models\App + */ + public function updateTeam(string $appId, string $teamId): \Appwrite\Models\App + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/team' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['teamId'] = $teamId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\App::from($response); + + } + + /** + * Revoke all tokens for an application by its unique ID. + * + * @param string $appId + * @throws AppwriteException + * @return string + */ + public function deleteTokens(string $appId): string + { + $apiPath = str_replace( + ['{appId}'], + [$appId], + '/apps/{appId}/tokens' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } +} diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index c6cc9542..527176ed 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -385,25 +385,39 @@ public function deletePolicy(string $policyId): string /** * 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. * * * @param string $archiveId * @param array $services * @param ?string $newResourceId * @param ?string $newResourceName - * @param ?string $newSpecification * @throws AppwriteException * @return \Appwrite\Models\BackupRestoration */ - public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null, ?string $newSpecification = null): \Appwrite\Models\BackupRestoration + public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null): \Appwrite\Models\BackupRestoration { $apiPath = str_replace( [], @@ -423,10 +437,6 @@ public function createRestoration(string $archiveId, array $services, ?string $n $apiParams['newResourceName'] = $newResourceName; } - if (!is_null($newSpecification)) { - $apiParams['newSpecification'] = $newSpecification; - } - $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index 1db8154c..52531fd8 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -422,10 +422,7 @@ public function update(string $functionId, string $name, ?Runtime $runtime = nul $apiParams['providerBranches'] = $providerBranches; $apiParams['providerPaths'] = $providerPaths; $apiParams['buildSpecification'] = $buildSpecification; - - if (!is_null($runtimeSpecification)) { - $apiParams['runtimeSpecification'] = $runtimeSpecification; - } + $apiParams['runtimeSpecification'] = $runtimeSpecification; if (!is_null($deploymentRetention)) { $apiParams['deploymentRetention'] = $deploymentRetention; diff --git a/src/Appwrite/Services/Oauth2.php b/src/Appwrite/Services/Oauth2.php new file mode 100644 index 00000000..bc4d8614 --- /dev/null +++ b/src/Appwrite/Services/Oauth2.php @@ -0,0 +1,782 @@ +client->getConfig('project')], + '/oauth2/{project_id}/approve' + ); + + $apiParams = []; + $apiParams['grant_id'] = $grantId; + + if (!is_null($authorizationDetails)) { + $apiParams['authorization_details'] = $authorizationDetails; + } + + if (!is_null($scope)) { + $apiParams['scope'] = $scope; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Approve::from($response); + + } + + /** + * 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. + * + * @param ?string $clientId + * @param ?string $redirectUri + * @param ?string $responseType + * @param ?string $scope + * @param ?string $state + * @param ?string $nonce + * @param ?string $codeChallenge + * @param ?string $codeChallengeMethod + * @param ?string $prompt + * @param ?int $maxAge + * @param ?string $authorizationDetails + * @param ?string $resource + * @param ?string $audience + * @param ?string $requestUri + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Authorize + */ + public function 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, ?int $maxAge = null, ?string $authorizationDetails = null, ?string $resource = null, ?string $audience = null, ?string $requestUri = null): \Appwrite\Models\Oauth2Authorize + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/authorize' + ); + + $apiParams = []; + + if (!is_null($clientId)) { + $apiParams['client_id'] = $clientId; + } + + if (!is_null($redirectUri)) { + $apiParams['redirect_uri'] = $redirectUri; + } + + if (!is_null($responseType)) { + $apiParams['response_type'] = $responseType; + } + + if (!is_null($scope)) { + $apiParams['scope'] = $scope; + } + + if (!is_null($state)) { + $apiParams['state'] = $state; + } + + if (!is_null($nonce)) { + $apiParams['nonce'] = $nonce; + } + + if (!is_null($codeChallenge)) { + $apiParams['code_challenge'] = $codeChallenge; + } + + if (!is_null($codeChallengeMethod)) { + $apiParams['code_challenge_method'] = $codeChallengeMethod; + } + + if (!is_null($prompt)) { + $apiParams['prompt'] = $prompt; + } + + if (!is_null($maxAge)) { + $apiParams['max_age'] = $maxAge; + } + + if (!is_null($authorizationDetails)) { + $apiParams['authorization_details'] = $authorizationDetails; + } + + if (!is_null($resource)) { + $apiParams['resource'] = $resource; + } + + if (!is_null($audience)) { + $apiParams['audience'] = $audience; + } + + if (!is_null($requestUri)) { + $apiParams['request_uri'] = $requestUri; + } + + $apiHeaders = []; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Authorize::from($response); + + } + + /** + * 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. + * + * @param ?string $clientId + * @param ?string $redirectUri + * @param ?string $responseType + * @param ?string $scope + * @param ?string $state + * @param ?string $nonce + * @param ?string $codeChallenge + * @param ?string $codeChallengeMethod + * @param ?string $prompt + * @param ?int $maxAge + * @param ?string $authorizationDetails + * @param ?string $resource + * @param ?string $audience + * @param ?string $requestUri + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Authorize + */ + public function 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, ?int $maxAge = null, ?string $authorizationDetails = null, ?string $resource = null, ?string $audience = null, ?string $requestUri = null): \Appwrite\Models\Oauth2Authorize + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/authorize' + ); + + $apiParams = []; + + if (!is_null($clientId)) { + $apiParams['client_id'] = $clientId; + } + + if (!is_null($redirectUri)) { + $apiParams['redirect_uri'] = $redirectUri; + } + + if (!is_null($responseType)) { + $apiParams['response_type'] = $responseType; + } + + if (!is_null($scope)) { + $apiParams['scope'] = $scope; + } + + if (!is_null($state)) { + $apiParams['state'] = $state; + } + + if (!is_null($nonce)) { + $apiParams['nonce'] = $nonce; + } + + if (!is_null($codeChallenge)) { + $apiParams['code_challenge'] = $codeChallenge; + } + + if (!is_null($codeChallengeMethod)) { + $apiParams['code_challenge_method'] = $codeChallengeMethod; + } + + if (!is_null($prompt)) { + $apiParams['prompt'] = $prompt; + } + $apiParams['max_age'] = $maxAge; + + if (!is_null($authorizationDetails)) { + $apiParams['authorization_details'] = $authorizationDetails; + } + + if (!is_null($resource)) { + $apiParams['resource'] = $resource; + } + + if (!is_null($audience)) { + $apiParams['audience'] = $audience; + } + + if (!is_null($requestUri)) { + $apiParams['request_uri'] = $requestUri; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Authorize::from($response); + + } + + /** + * Start the OAuth2 Device Authorization Grant. Returns the device code, user + * code, verification URL, expiration, and polling interval. + * + * @param ?string $clientId + * @param ?string $scope + * @param ?string $authorizationDetails + * @param ?string $resource + * @param ?string $audience + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2DeviceAuthorization + */ + public function createDeviceAuthorization(?string $clientId = null, ?string $scope = null, ?string $authorizationDetails = null, ?string $resource = null, ?string $audience = null): \Appwrite\Models\Oauth2DeviceAuthorization + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/device_authorization' + ); + + $apiParams = []; + + if (!is_null($clientId)) { + $apiParams['client_id'] = $clientId; + } + + if (!is_null($scope)) { + $apiParams['scope'] = $scope; + } + + if (!is_null($authorizationDetails)) { + $apiParams['authorization_details'] = $authorizationDetails; + } + + if (!is_null($resource)) { + $apiParams['resource'] = $resource; + } + + if (!is_null($audience)) { + $apiParams['audience'] = $audience; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2DeviceAuthorization::from($response); + + } + + /** + * 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. + * + * @param string $userCode + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Grant + */ + public function createGrant(string $userCode): \Appwrite\Models\Oauth2Grant + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/grants' + ); + + $apiParams = []; + $apiParams['user_code'] = $userCode; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Grant::from($response); + + } + + /** + * 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. + * + * @param string $grantId + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Grant + */ + public function getGrant(string $grantId): \Appwrite\Models\Oauth2Grant + { + $apiPath = str_replace( + ['{project_id}', '{grant_id}'], + [$this->client->getConfig('project'), $grantId], + '/oauth2/{project_id}/grants/{grant_id}' + ); + + $apiParams = []; + $apiParams['grant_id'] = $grantId; + + $apiHeaders = []; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Grant::from($response); + + } + + /** + * 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. + * + * @param ?int $limit + * @param ?int $offset + * @param ?string $search + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2OrganizationList + */ + public function listOrganizations(?int $limit = null, ?int $offset = null, ?string $search = null): \Appwrite\Models\Oauth2OrganizationList + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/organizations' + ); + + $apiParams = []; + + if (!is_null($limit)) { + $apiParams['limit'] = $limit; + } + + if (!is_null($offset)) { + $apiParams['offset'] = $offset; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + + $apiHeaders = []; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2OrganizationList::from($response); + + } + + /** + * Store an OAuth2 authorization request server-side and receive a short-lived + * request_uri handle for the authorize endpoint. + * + * @param string $clientId + * @param string $redirectUri + * @param string $responseType + * @param ?string $scope + * @param ?string $state + * @param ?string $nonce + * @param ?string $codeChallenge + * @param ?string $codeChallengeMethod + * @param ?string $prompt + * @param ?int $maxAge + * @param ?string $authorizationDetails + * @param ?string $resource + * @param ?string $audience + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2PAR + */ + public function 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, ?int $maxAge = null, ?string $authorizationDetails = null, ?string $resource = null, ?string $audience = null): \Appwrite\Models\Oauth2PAR + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/par' + ); + + $apiParams = []; + $apiParams['client_id'] = $clientId; + $apiParams['redirect_uri'] = $redirectUri; + $apiParams['response_type'] = $responseType; + + if (!is_null($scope)) { + $apiParams['scope'] = $scope; + } + + if (!is_null($state)) { + $apiParams['state'] = $state; + } + + if (!is_null($nonce)) { + $apiParams['nonce'] = $nonce; + } + + if (!is_null($codeChallenge)) { + $apiParams['code_challenge'] = $codeChallenge; + } + + if (!is_null($codeChallengeMethod)) { + $apiParams['code_challenge_method'] = $codeChallengeMethod; + } + + if (!is_null($prompt)) { + $apiParams['prompt'] = $prompt; + } + $apiParams['max_age'] = $maxAge; + + if (!is_null($authorizationDetails)) { + $apiParams['authorization_details'] = $authorizationDetails; + } + + if (!is_null($resource)) { + $apiParams['resource'] = $resource; + } + + if (!is_null($audience)) { + $apiParams['audience'] = $audience; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2PAR::from($response); + + } + + /** + * 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. + * + * @param ?int $limit + * @param ?int $offset + * @param ?string $search + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2ProjectList + */ + public function listProjects(?int $limit = null, ?int $offset = null, ?string $search = null): \Appwrite\Models\Oauth2ProjectList + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/projects' + ); + + $apiParams = []; + + if (!is_null($limit)) { + $apiParams['limit'] = $limit; + } + + if (!is_null($offset)) { + $apiParams['offset'] = $offset; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + + $apiHeaders = []; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2ProjectList::from($response); + + } + + /** + * 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. + * + * @param string $grantId + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Reject + */ + public function reject(string $grantId): \Appwrite\Models\Oauth2Reject + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/reject' + ); + + $apiParams = []; + $apiParams['grant_id'] = $grantId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Reject::from($response); + + } + + /** + * Revoke an OAuth2 access token or refresh token. + * + * @param string $token + * @param ?string $tokenTypeHint + * @param ?string $clientId + * @param ?string $clientSecret + * @throws AppwriteException + * @return array + */ + public function revoke(string $token, ?string $tokenTypeHint = null, ?string $clientId = null, ?string $clientSecret = null): array + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/revoke' + ); + + $apiParams = []; + $apiParams['token'] = $token; + + if (!is_null($tokenTypeHint)) { + $apiParams['token_type_hint'] = $tokenTypeHint; + } + + if (!is_null($clientId)) { + $apiParams['client_id'] = $clientId; + } + + if (!is_null($clientSecret)) { + $apiParams['client_secret'] = $clientSecret; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * Exchange an OAuth2 authorization code, refresh token, or device code for + * access and refresh tokens. + * + * @param string $grantType + * @param ?string $code + * @param ?string $refreshToken + * @param ?string $deviceCode + * @param ?string $clientId + * @param ?string $clientSecret + * @param ?string $codeVerifier + * @param ?string $redirectUri + * @param ?string $resource + * @param ?string $audience + * @throws AppwriteException + * @return \Appwrite\Models\Oauth2Token + */ + public function 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): \Appwrite\Models\Oauth2Token + { + $apiPath = str_replace( + ['{project_id}'], + [$this->client->getConfig('project')], + '/oauth2/{project_id}/token' + ); + + $apiParams = []; + $apiParams['grant_type'] = $grantType; + + if (!is_null($code)) { + $apiParams['code'] = $code; + } + + if (!is_null($refreshToken)) { + $apiParams['refresh_token'] = $refreshToken; + } + + if (!is_null($deviceCode)) { + $apiParams['device_code'] = $deviceCode; + } + + if (!is_null($clientId)) { + $apiParams['client_id'] = $clientId; + } + + if (!is_null($clientSecret)) { + $apiParams['client_secret'] = $clientSecret; + } + + if (!is_null($codeVerifier)) { + $apiParams['code_verifier'] = $codeVerifier; + } + + if (!is_null($redirectUri)) { + $apiParams['redirect_uri'] = $redirectUri; + } + + if (!is_null($resource)) { + $apiParams['resource'] = $resource; + } + + if (!is_null($audience)) { + $apiParams['audience'] = $audience; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Oauth2Token::from($response); + + } +} diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php index e50f89f5..7c189a8f 100644 --- a/src/Appwrite/Services/Organization.php +++ b/src/Appwrite/Services/Organization.php @@ -121,6 +121,214 @@ public function delete(): string } + /** + * List app installations on the organization. Any organization member can + * read installations. + * + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallationList + */ + public function listInstallations(?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList + { + $apiPath = str_replace( + [], + [], + '/organization/installations' + ); + + $apiParams = []; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallationList::from($response); + + } + + /** + * 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. + * + * @param string $appId + * @param ?string $authorizationDetails + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function createInstallation(string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + [], + [], + '/organization/installations' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + + if (!is_null($authorizationDetails)) { + $apiParams['authorizationDetails'] = $authorizationDetails; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * Get an app installation on the organization by its unique ID. Any + * organization member can read installations. + * + * @param string $installationId + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function getInstallation(string $installationId): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{installationId}'], + [$installationId], + '/organization/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * 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. + * + * @param string $installationId + * @param ?string $authorizationDetails + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function updateInstallation(string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{installationId}'], + [$installationId], + '/organization/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['installationId'] = $installationId; + $apiParams['authorizationDetails'] = $authorizationDetails; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * 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. + * + * @param string $installationId + * @throws AppwriteException + * @return string + */ + public function deleteInstallation(string $installationId): string + { + $apiPath = str_replace( + ['{installationId}'], + [$installationId], + '/organization/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * Get a list of all API keys from the current organization. * diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index 475d5f8e..8ba6055b 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -681,6 +681,7 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) * @param ?int $refreshTokenDuration * @param ?int $publicAccessTokenDuration * @param ?int $publicRefreshTokenDuration + * @param ?int $installationAccessTokenDuration * @param ?bool $confidentialPkce * @param ?string $verificationUrl * @param ?int $userCodeLength @@ -690,7 +691,7 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) * @throws AppwriteException * @return \Appwrite\Models\Project */ - public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null): \Appwrite\Models\Project + public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?int $installationAccessTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null): \Appwrite\Models\Project { $apiPath = str_replace( [], @@ -713,6 +714,7 @@ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?arr $apiParams['refreshTokenDuration'] = $refreshTokenDuration; $apiParams['publicAccessTokenDuration'] = $publicAccessTokenDuration; $apiParams['publicRefreshTokenDuration'] = $publicRefreshTokenDuration; + $apiParams['installationAccessTokenDuration'] = $installationAccessTokenDuration; $apiParams['confidentialPkce'] = $confidentialPkce; if (!is_null($verificationUrl)) { diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index b7e44fdb..0b373273 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -1114,10 +1114,11 @@ public function deleteDeployment(string $siteId, string $deploymentId): string * @param string $siteId * @param string $deploymentId * @param ?DeploymentDownloadType $type + * @param ?string $token * @throws AppwriteException * @return string */ - public function getDeploymentDownload(string $siteId, string $deploymentId, ?DeploymentDownloadType $type = null): string + public function getDeploymentDownload(string $siteId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { $apiPath = str_replace( ['{siteId}', '{deploymentId}'], @@ -1133,6 +1134,10 @@ public function getDeploymentDownload(string $siteId, string $deploymentId, ?Dep $apiParams['type'] = $type; } + if (!is_null($token)) { + $apiParams['token'] = $token; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index bff7d67b..f2c996ff 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -77,10 +77,11 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @param string $name * @param ?bool $enabled * @param ?string $specification + * @param ?int $replicas * @throws AppwriteException * @return \Appwrite\Models\Database */ - public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $specification = null): \Appwrite\Models\Database + public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null): \Appwrite\Models\Database { $apiPath = str_replace( [], @@ -100,6 +101,10 @@ public function create(string $databaseId, string $name, ?bool $enabled = null, $apiParams['specification'] = $specification; } + if (!is_null($replicas)) { + $apiParams['replicas'] = $replicas; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; @@ -120,6 +125,43 @@ public function create(string $databaseId, string $name, ?bool $enabled = null, } + /** + * 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. + * + * @throws AppwriteException + * @return \Appwrite\Models\DedicatedDatabaseSpecificationList + */ + public function listSpecifications(): \Appwrite\Models\DedicatedDatabaseSpecificationList + { + $apiPath = str_replace( + [], + [], + '/tablesdb/specifications' + ); + + $apiParams = []; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DedicatedDatabaseSpecificationList::from($response); + + } + /** * List transactions across all databases. * @@ -406,10 +448,11 @@ public function get(string $databaseId): \Appwrite\Models\Database * @param string $databaseId * @param ?string $name * @param ?bool $enabled + * @param ?int $replicas * @throws AppwriteException * @return \Appwrite\Models\Database */ - public function update(string $databaseId, ?string $name = null, ?bool $enabled = null): \Appwrite\Models\Database + public function update(string $databaseId, ?string $name = null, ?bool $enabled = null, ?int $replicas = null): \Appwrite\Models\Database { $apiPath = str_replace( ['{databaseId}'], @@ -427,6 +470,7 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled if (!is_null($enabled)) { $apiParams['enabled'] = $enabled; } + $apiParams['replicas'] = $replicas; $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); @@ -482,6 +526,125 @@ public function delete(string $databaseId): string } + /** + * 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. + * + * @param string $databaseId + * @param ?string $targetReplicaId + * @throws AppwriteException + * @return \Appwrite\Models\DedicatedDatabase + */ + public function createFailover(string $databaseId, ?string $targetReplicaId = null): \Appwrite\Models\DedicatedDatabase + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/failovers' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['targetReplicaId'] = $targetReplicaId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DedicatedDatabase::from($response); + + } + + /** + * Get high availability status for a dedicated database. Returns replica + * statuses, replication lag, and sync mode. + * + * @param string $databaseId + * @throws AppwriteException + * @return \Appwrite\Models\DedicatedDatabaseReplicas + */ + public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatabaseReplicas + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/replicas' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DedicatedDatabaseReplicas::from($response); + + } + + /** + * Get real-time health and status information for a dedicated database. + * Returns health status, readiness, uptime, connection info, replica status, + * and volume information. + * + * @param string $databaseId + * @throws AppwriteException + * @return \Appwrite\Models\DatabaseStatus + */ + public function getStatus(string $databaseId): \Appwrite\Models\DatabaseStatus + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/status' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DatabaseStatus::from($response); + + } + /** * 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/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index 4c17e3b9..53b32bcb 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -223,6 +223,224 @@ public function delete(string $teamId): string } + /** + * List app installations on a team. Any team member can read installations. + * + * @param string $teamId + * @param ?array $queries + * @param ?bool $total + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallationList + */ + public function listInstallations(string $teamId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList + { + $apiPath = str_replace( + ['{teamId}'], + [$teamId], + '/teams/{teamId}/installations' + ); + + $apiParams = []; + $apiParams['teamId'] = $teamId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallationList::from($response); + + } + + /** + * 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. + * + * @param string $teamId + * @param string $appId + * @param ?string $authorizationDetails + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function createInstallation(string $teamId, string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{teamId}'], + [$teamId], + '/teams/{teamId}/installations' + ); + + $apiParams = []; + $apiParams['teamId'] = $teamId; + $apiParams['appId'] = $appId; + + if (!is_null($authorizationDetails)) { + $apiParams['authorizationDetails'] = $authorizationDetails; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * Get an app installation on a team by its unique ID. Any team member can + * read installations. + * + * @param string $teamId + * @param string $installationId + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function getInstallation(string $teamId, string $installationId): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{teamId}', '{installationId}'], + [$teamId, $installationId], + '/teams/{teamId}/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['teamId'] = $teamId; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * 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. + * + * @param string $teamId + * @param string $installationId + * @param ?string $authorizationDetails + * @throws AppwriteException + * @return \Appwrite\Models\AppInstallation + */ + public function updateInstallation(string $teamId, string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation + { + $apiPath = str_replace( + ['{teamId}', '{installationId}'], + [$teamId, $installationId], + '/teams/{teamId}/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['teamId'] = $teamId; + $apiParams['installationId'] = $installationId; + $apiParams['authorizationDetails'] = $authorizationDetails; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\AppInstallation::from($response); + + } + + /** + * 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. + * + * @param string $teamId + * @param string $installationId + * @throws AppwriteException + * @return string + */ + public function deleteInstallation(string $teamId, string $installationId): string + { + $apiPath = str_replace( + ['{teamId}', '{installationId}'], + [$teamId, $installationId], + '/teams/{teamId}/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['teamId'] = $teamId; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * Use this endpoint to list a team's members using the team's ID. All team * members have read access to this endpoint. Hide sensitive attributes from diff --git a/tests/Appwrite/Services/AccountTest.php b/tests/Appwrite/Services/AccountTest.php index b6c0220e..eabfc829 100644 --- a/tests/Appwrite/Services/AccountTest.php +++ b/tests/Appwrite/Services/AccountTest.php @@ -113,6 +113,170 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } + public function testMethodListConsents(): void + { + $data = array( + "total" => 5, + "consents" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "cimdUrl" => "https://example.com/.well-known/client-metadata.json", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "expire" => "2020-10-15T06:38:00.000+00:00" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->listConsents(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentList::class, $response); + } + + public function testMethodGetConsent(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "cimdUrl" => "https://example.com/.well-known/client-metadata.json", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "expire" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->getConsent( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Consent::class, $response); + } + + public function testMethodDeleteConsent(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->deleteConsent( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListConsentTokens(): void + { + $data = array( + "total" => 5, + "tokens" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "consentId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "cimdUrl" => "https://example.com/.well-known/client-metadata.json", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "expire" => "2020-10-15T06:38:00.000+00:00" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->listConsentTokens( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentTokenList::class, $response); + } + + public function testMethodGetConsentToken(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "consentId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "cimdUrl" => "https://example.com/.well-known/client-metadata.json", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "expire" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->getConsentToken( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentToken::class, $response); + } + + public function testMethodDeleteConsentToken(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->account->deleteConsentToken( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodUpdateEmail(): void { $data = array( diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php index f4daf521..b1d16072 100644 --- a/tests/Appwrite/Services/ActivitiesTest.php +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -38,10 +38,21 @@ public function testMethodListEvents(): void "ip" => "127.0.0.1", "mode" => "admin", "country" => "US", + "continentCode" => "NA", + "city" => "Mountain View", + "subdivisions" => "California", + "isp" => "Google", + "autonomousSystemNumber" => "15169", + "autonomousSystemOrganization" => "GOOGLE", + "connectionType" => "cable", + "connectionUsageType" => "residential", + "connectionOrganization" => "Google LLC", "time" => "2020-10-15T06:38:00.000+00:00", "projectId" => "610fc2f985ee0", "teamId" => "610fc2f985ee0", - "hostname" => "appwrite.io" + "hostname" => "appwrite.io", + "sdk" => "web", + "sdkVersion" => "14.0.0" ) ) ); @@ -75,10 +86,21 @@ public function testMethodGetEvent(): void "ip" => "127.0.0.1", "mode" => "admin", "country" => "US", + "continentCode" => "NA", + "city" => "Mountain View", + "subdivisions" => "California", + "isp" => "Google", + "autonomousSystemNumber" => "15169", + "autonomousSystemOrganization" => "GOOGLE", + "connectionType" => "cable", + "connectionUsageType" => "residential", + "connectionOrganization" => "Google LLC", "time" => "2020-10-15T06:38:00.000+00:00", "projectId" => "610fc2f985ee0", "teamId" => "610fc2f985ee0", - "hostname" => "appwrite.io" + "hostname" => "appwrite.io", + "sdk" => "web", + "sdkVersion" => "14.0.0" ); $this->client diff --git a/tests/Appwrite/Services/AppsTest.php b/tests/Appwrite/Services/AppsTest.php new file mode 100644 index 00000000..63767c7a --- /dev/null +++ b/tests/Appwrite/Services/AppsTest.php @@ -0,0 +1,754 @@ +client = Mockery::mock(Client::class); + $this->apps = new Apps($this->client); + } + + public function testMethodList(): void + { + $data = array( + "total" => 5, + "apps" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->list(); + + $this->assertInstanceOf(\Appwrite\Models\AppsList::class, $response); + } + + public function testMethodCreate(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->create( + "", + "", + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\App::class, $response); + } + + public function testMethodListInstallationScopes(): void + { + $data = array( + "total" => 5, + "scopes" => array( + array( + "value" => "organization:organization.read", + "description" => "Access to read the organization", + "type" => "organization", + "category" => "Organization", + "deprecated" => true + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->listInstallationScopes(); + + $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); + } + + public function testMethodListOAuth2Scopes(): void + { + $data = array( + "total" => 5, + "scopes" => array( + array( + "value" => "organization:organization.read", + "description" => "Access to read the organization", + "type" => "organization", + "category" => "Organization", + "deprecated" => true + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->listOAuth2Scopes(); + + $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); + } + + public function testMethodGet(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->get( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\App::class, $response); + } + + public function testMethodUpdate(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->update( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\App::class, $response); + } + + public function testMethodDelete(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->delete( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListInstallations(): void + { + $data = array( + "total" => 5, + "installations" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->listInstallations( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); + } + + public function testMethodGetInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->getInstallation( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodCreateInstallationToken(): void + { + $data = array( + "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", + "token_type" => "Bearer", + "expires_in" => 3600, + "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", + "scope" => "openid email profile" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->createInstallationToken( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); + } + + public function testMethodListKeys(): void + { + $data = array( + "total" => 5, + "keys" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->listKeys( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppKeyList::class, $response); + } + + public function testMethodCreateKey(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->createKey( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); + } + + public function testMethodGetKey(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->getKey( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); + } + + public function testMethodDeleteKey(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->deleteKey( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateLabels(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->updateLabels( + "", + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\App::class, $response); + } + + public function testMethodListSecrets(): void + { + $data = array( + "total" => 5, + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->listSecrets( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppSecretList::class, $response); + } + + public function testMethodCreateSecret(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->createSecret( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppSecretPlaintext::class, $response); + } + + public function testMethodGetSecret(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->getSecret( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppSecret::class, $response); + } + + public function testMethodDeleteSecret(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->deleteSecret( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateTeam(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Application", + "description" => "Connect your workspace to My Application.", + "clientUri" => "https://example.com", + "logoUri" => "https://example.com/logo.png", + "privacyPolicyUrl" => "https://example.com/privacy", + "termsUrl" => "https://example.com/terms", + "contacts" => array(), + "tagline" => "Automate your workspace.", + "tags" => array(), + "labels" => array(), + "images" => array(), + "supportUrl" => "https://example.com/support", + "dataDeletionUrl" => "https://example.com/data-deletion", + "redirectUris" => array(), + "postLogoutRedirectUris" => array(), + "enabled" => true, + "type" => "confidential", + "deviceFlow" => true, + "teamId" => "5e5ea5c16897e", + "userId" => "5e5ea5c16897e", + "installationScopes" => array(), + "installationRedirectUrl" => "https://example.com/setup", + "secrets" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "secret" => "[SECRET]", + "hint" => "f5c6c7", + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->updateTeam( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\App::class, $response); + } + + public function testMethodDeleteTokens(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->deleteTokens( + "" + ); + + $this->assertSame($data, $response); + } + +} diff --git a/tests/Appwrite/Services/BackupsTest.php b/tests/Appwrite/Services/BackupsTest.php index da100a87..ee9d09d4 100644 --- a/tests/Appwrite/Services/BackupsTest.php +++ b/tests/Appwrite/Services/BackupsTest.php @@ -280,7 +280,7 @@ public function testMethodCreateRestoration(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" + "options" => "{databases.database[{oldId, newId, newName}]}" ); $this->client @@ -314,7 +314,7 @@ public function testMethodListRestorations(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" + "options" => "{databases.database[{oldId, newId, newName}]}" ) ) ); @@ -344,7 +344,7 @@ public function testMethodGetRestoration(): void "migrationId" => "did8jx6ws45jana098ab7", "services" => array(), "resources" => array(), - "options" => "{databases.database[{oldId, newId, newName, newSpecification}]}" + "options" => "{databases.database[{oldId, newId, newName}]}" ); $this->client diff --git a/tests/Appwrite/Services/DatabasesTest.php b/tests/Appwrite/Services/DatabasesTest.php index f7a0e312..cacd8583 100644 --- a/tests/Appwrite/Services/DatabasesTest.php +++ b/tests/Appwrite/Services/DatabasesTest.php @@ -33,35 +33,7 @@ public function testMethodList(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ) ) ); @@ -86,35 +58,7 @@ public function testMethodCreate(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client @@ -284,35 +228,7 @@ public function testMethodGet(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client @@ -337,35 +253,7 @@ public function testMethodUpdate(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client diff --git a/tests/Appwrite/Services/Oauth2Test.php b/tests/Appwrite/Services/Oauth2Test.php new file mode 100644 index 00000000..3bf122fc --- /dev/null +++ b/tests/Appwrite/Services/Oauth2Test.php @@ -0,0 +1,297 @@ +client = Mockery::mock(Client::class); + $this->oauth2 = new Oauth2($this->client); + } + + public function testMethodApprove(): void + { + $data = array( + "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->approve( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Approve::class, $response); + } + + public function testMethodAuthorize(): void + { + $data = array( + "grantId" => "5e5ea5c16897e", + "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->authorize(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); + } + + public function testMethodAuthorizePost(): void + { + $data = array( + "grantId" => "5e5ea5c16897e", + "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->authorizePost(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); + } + + public function testMethodCreateDeviceAuthorization(): void + { + $data = array( + "device_code" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", + "user_code" => "ABCD-EFGH", + "verification_uri" => "https://cloud.appwrite.io/console/oauth2/device", + "verification_uri_complete" => "https://cloud.appwrite.io/console/oauth2/device?user_code=ABCD-EFGH", + "expires_in" => 900, + "interval" => 5 + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->createDeviceAuthorization(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2DeviceAuthorization::class, $response); + } + + public function testMethodCreateGrant(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "prompt" => "login", + "redirectUri" => "https://example.com/callback", + "authTime" => 1592981250, + "expire" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->createGrant( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); + } + + public function testMethodGetGrant(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c16897e", + "appId" => "5e5ea5c16897e", + "scopes" => array(), + "resources" => array(), + "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", + "prompt" => "login", + "redirectUri" => "https://example.com/callback", + "authTime" => 1592981250, + "expire" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->getGrant( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); + } + + public function testMethodListOrganizations(): void + { + $data = array( + "total" => 5, + "organizations" => array( + array( + "\$id" => "5e5ea5c16897e" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->listOrganizations(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2OrganizationList::class, $response); + } + + public function testMethodCreatePAR(): void + { + $data = array( + "request_uri" => "urn:appwrite:oauth2:request:5e5ea5c16897e", + "expires_in" => 600 + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->createPAR( + "", + "https://example.com", + "code" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2PAR::class, $response); + } + + public function testMethodListProjects(): void + { + $data = array( + "total" => 5, + "projects" => array( + array( + "\$id" => "5e5ea5c16897e", + "region" => "fra", + "endpoint" => "https://fra.cloud.appwrite.io/v1" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->listProjects(); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2ProjectList::class, $response); + } + + public function testMethodReject(): void + { + $data = array( + "redirectUrl" => "https://example.com/callback?error=access_denied&state=fghij" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->reject( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Reject::class, $response); + } + + public function testMethodRevoke(): void + { + $data = array(); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->revoke( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateToken(): void + { + $data = array( + "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", + "token_type" => "Bearer", + "expires_in" => 3600, + "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", + "scope" => "openid email profile" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->oauth2->createToken( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); + } + +} diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php index 237ef05f..40c2dd57 100644 --- a/tests/Appwrite/Services/OrganizationTest.php +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -46,6 +46,7 @@ public function testMethodGet(): void "screenshotsGenerated" => 50, "members" => 25, "webhooks" => 25, + "wafRules" => 2, "projects" => 2, "platforms" => 3, "users" => 25, @@ -276,6 +277,7 @@ public function testMethodUpdate(): void "screenshotsGenerated" => 50, "members" => 25, "webhooks" => 25, + "wafRules" => 2, "projects" => 2, "platforms" => 3, "users" => 25, @@ -498,6 +500,139 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } + public function testMethodListInstallations(): void + { + $data = array( + "total" => 5, + "installations" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->listInstallations(); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); + } + + public function testMethodCreateInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->createInstallation( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodGetInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->getInstallation( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodUpdateInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->updateInstallation( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodDeleteInstallation(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->organization->deleteInstallation( + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodListKeys(): void { $data = array( @@ -863,7 +998,8 @@ public function testMethodListProjects(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ) ) ); @@ -947,7 +1083,8 @@ public function testMethodCreateProject(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -1032,7 +1169,8 @@ public function testMethodGetProject(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -1116,7 +1254,8 @@ public function testMethodUpdateProject(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 6cf56662..0213e34c 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -96,7 +96,8 @@ public function testMethodGet(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -194,7 +195,8 @@ public function testMethodUpdateAuthMethod(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -445,7 +447,8 @@ public function testMethodUpdateLabels(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -663,7 +666,8 @@ public function testMethodUpdateOAuth2Server(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2053,7 +2057,8 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2137,7 +2142,8 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2221,7 +2227,8 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2305,7 +2312,8 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2389,7 +2397,8 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2471,7 +2480,8 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2555,7 +2565,8 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2639,7 +2650,8 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2746,7 +2758,8 @@ public function testMethodUpdateSessionAlertPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2830,7 +2843,8 @@ public function testMethodUpdateSessionDurationPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2914,7 +2928,8 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -2998,7 +3013,8 @@ public function testMethodUpdateSessionLimitPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -3082,7 +3098,8 @@ public function testMethodUpdateUserLimitPolicy(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -3192,7 +3209,8 @@ public function testMethodUpdateProtocol(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -3277,7 +3295,8 @@ public function testMethodUpdateService(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client @@ -3362,7 +3381,8 @@ public function testMethodUpdateSMTP(): void "billingPlan" => "pro" ) ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true ); $this->client diff --git a/tests/Appwrite/Services/TablesDBTest.php b/tests/Appwrite/Services/TablesDBTest.php index f298c097..1c75086f 100644 --- a/tests/Appwrite/Services/TablesDBTest.php +++ b/tests/Appwrite/Services/TablesDBTest.php @@ -33,35 +33,7 @@ public function testMethodList(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ) ) ); @@ -86,35 +58,7 @@ public function testMethodCreate(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client @@ -132,6 +76,44 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } + public function testMethodListSpecifications(): void + { + $data = array( + "specifications" => array( + array( + "slug" => "s-2vcpu-2gb", + "name" => "Standard", + "price" => 20, + "cpu" => 2000, + "memory" => 2048, + "maxConnections" => 200, + "includedStorage" => 25, + "includedBandwidth" => 200, + "enabled" => true + ) + ), + "total" => 9, + "pricing" => array( + "storageOverageRate" => 0.125, + "bandwidthOverageRate" => 0.08, + "replicaRate" => 1, + "crossRegionReplicaRate" => 1, + "pitrRate" => 0.2 + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->listSpecifications(); + + $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseSpecificationList::class, $response); + } + public function testMethodListTransactions(): void { $data = array( @@ -284,35 +266,7 @@ public function testMethodGet(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client @@ -337,35 +291,7 @@ public function testMethodUpdate(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, - "type" => "legacy", - "policies" => array( - array( - "\$id" => "5e5ea5c16897e", - "name" => "Hourly backups", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), - "retention" => 7, - "schedule" => "0 * * * *", - "type" => "full", - "enabled" => true - ) - ), - "archives" => array( - array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "policyId" => "did8jx6ws45jana098ab7", - "size" => 100000, - "status" => "completed", - "startedAt" => "2020-10-15T06:38:00.000+00:00", - "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) + "type" => "legacy" ); $this->client @@ -400,6 +326,144 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } + public function testMethodCreateFailover(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "5e5ea5c16897e", + "name" => "My Production Database", + "api" => "postgresql", + "engine" => "postgresql", + "version" => "16", + "specification" => "s-2vcpu-2gb", + "backend" => "edge", + "hostname" => "db-myproject-mydb.fra.appwrite.center", + "connectionPort" => 5432, + "connectionUser" => "appwrite_user", + "connectionPassword" => "••••••••", + "connectionString" => "postgresql://user:pass@db-myproject-mydb.fra.appwrite.center:5432/postgres?sslmode=require", + "ssl" => true, + "status" => "ready", + "containerStatus" => "active", + "lifecycleState" => "active", + "idleTimeoutMinutes" => 15, + "cpu" => 2000, + "memory" => 4096, + "storage" => 100, + "storageClass" => "ssd", + "storageMaxGb" => 100, + "nodePool" => "db-pool-4vcpu-8gb", + "replicas" => 2, + "syncMode" => "async", + "crossRegionReplicas" => 1, + "networkMaxConnections" => 500, + "networkIdleTimeoutSeconds" => 900, + "networkIPAllowlist" => array(), + "backupEnabled" => true, + "pitr" => true, + "pitrRetentionDays" => 14, + "storageAutoscaling" => true, + "storageAutoscalingThresholdPercent" => 85, + "storageAutoscalingMaxGb" => 500, + "maintenanceWindowDay" => "sun", + "maintenanceWindowHourUtc" => 3, + "metricsEnabled" => true, + "sqlApiEnabled" => true, + "sqlApiAllowedStatements" => array(), + "sqlApiMaxRows" => 10000, + "sqlApiMaxBytes" => 10485760, + "sqlApiTimeoutSeconds" => 30, + "error" => "[ERROR]" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->createFailover( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabase::class, $response); + } + + public function testMethodGetReplicas(): void + { + $data = array( + "replicas" => 2, + "syncMode" => "async", + "members" => array( + array( + "\$id" => "1", + "role" => "replica", + "status" => "active", + "lagSeconds" => 0.5 + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->getReplicas( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseReplicas::class, $response); + } + + public function testMethodGetStatus(): void + { + $data = array( + "health" => "healthy", + "ready" => true, + "engine" => "postgresql", + "version" => "17", + "uptime" => 86400, + "connections" => array( + "current" => 12, + "max" => 100 + ), + "replicas" => array( + array( + "index" => 0, + "role" => "primary", + "healthy" => true + ) + ), + "volumes" => array( + array( + "path" => "/var/lib/postgresql/data", + "usedPercent" => "45%", + "available" => "55GB", + "mounted" => true + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->getStatus( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DatabaseStatus::class, $response); + } + public function testMethodListTables(): void { $data = array( diff --git a/tests/Appwrite/Services/TeamsTest.php b/tests/Appwrite/Services/TeamsTest.php index 1e7fb2ff..376e81d1 100644 --- a/tests/Appwrite/Services/TeamsTest.php +++ b/tests/Appwrite/Services/TeamsTest.php @@ -141,6 +141,145 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } + public function testMethodListInstallations(): void + { + $data = array( + "total" => 5, + "installations" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->teams->listInstallations( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); + } + + public function testMethodCreateInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->teams->createInstallation( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodGetInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->teams->getInstallation( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodUpdateInstallation(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "appId" => "5e5ea5c16897e", + "teamId" => "5e5ea5c16897e", + "scopes" => array(), + "authorizationDetails" => array(), + "createdById" => "5e5ea5c16897e", + "createdByName" => "Walter White" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->teams->updateInstallation( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); + } + + public function testMethodDeleteInstallation(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->teams->deleteInstallation( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodListMemberships(): void { $data = array( From ef36220ae621fe1ea4c7007d84d7c6107ec7b252 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 13:41:28 +0530 Subject: [PATCH 04/10] chore: update PHP SDK to 28.0.0 --- CHANGELOG.md | 18 ++ README.md | 2 +- docs/account.md | 23 +- docs/activities.md | 2 +- docs/apps.md | 24 +- docs/backups.md | 6 +- docs/databases.md | 8 +- docs/embeddings.md | 17 ++ docs/examples/activities/list-events.md | 2 +- .../apps/create-installation-token.md | 2 +- .../delete-installation.md} | 9 +- docs/examples/apps/get-installation.md | 2 +- docs/examples/apps/list-installations.md | 2 +- .../embeddings/create-text-embeddings.md | 18 ++ ...te-key.md => update-mfa-factors-policy.md} | 11 +- .../project/update-o-auth-2-server.md | 3 +- .../project/update-session-duration-policy.md | 2 +- .../project/update-user-limit-policy.md | 2 +- docs/examples/proxy/create-invalidation.md | 19 ++ docs/examples/storage/create-file.md | 3 +- docs/examples/tablesdb/create-migration.md | 18 ++ docs/examples/tablesdb/create.md | 3 +- docs/examples/tablesdb/cutover-migration.md | 17 ++ docs/examples/tablesdb/delete-migration.md | 17 ++ docs/examples/tablesdb/get-migration.md | 17 ++ docs/examples/tablesdb/list-migrations.md | 16 + docs/examples/tablesdb/list-operations.md | 19 ++ docs/examples/tablesdb/update.md | 4 +- docs/examples/users/get-mfa-challenge.md | 17 ++ docs/functions.md | 2 +- docs/project.md | 45 ++- docs/proxy.md | 17 ++ docs/sites.md | 2 +- docs/storage.md | 3 +- docs/tablesdb.md | 99 ++++++- docs/users.md | 16 +- src/Appwrite/Client.php | 23 +- src/Appwrite/Enums/AuthenticationFactor.php | 9 + src/Appwrite/Enums/BuildRuntime.php | 9 + src/Appwrite/Enums/EmbeddingModel.php | 70 +++++ src/Appwrite/Enums/InvalidationType.php | 61 ++++ src/Appwrite/Enums/ProjectKeyScopes.php | 18 ++ src/Appwrite/Enums/ProjectPolicyId.php | 9 + src/Appwrite/Enums/Runtime.php | 9 + src/Appwrite/Models/BillingPlan.php | 36 +-- src/Appwrite/Models/BillingPlanAddon.php | 18 +- .../Models/BillingPlanAddonDetails.php | 13 +- src/Appwrite/Models/Database.php | 2 +- src/Appwrite/Models/DatabaseMigration.php | 152 ++++++++++ src/Appwrite/Models/DatabaseMigrationList.php | 59 ++++ src/Appwrite/Models/DatabaseStatus.php | 46 ++- .../Models/DatabaseStatusConnections.php | 2 +- src/Appwrite/Models/DatabaseStatusReplica.php | 4 +- src/Appwrite/Models/DedicatedDatabase.php | 13 +- .../Models/DedicatedDatabaseMember.php | 13 +- .../Models/DedicatedDatabaseOperation.php | 108 +++++++ .../Models/DedicatedDatabaseOperationList.php | 59 ++++ .../Models/DedicatedDatabaseReplicas.php | 35 ++- .../DedicatedDatabaseSpecificationPricing.php | 7 - src/Appwrite/Models/Embedding.php | 68 +++++ src/Appwrite/Models/EmbeddingList.php | 59 ++++ src/Appwrite/Models/File.php | 14 + src/Appwrite/Models/MfaChallengeSecret.php | 75 +++++ src/Appwrite/Models/MfaFactors.php | 13 +- src/Appwrite/Models/Organization.php | 112 +++---- src/Appwrite/Models/PolicyMfaFactors.php | 75 +++++ src/Appwrite/Models/Project.php | 4 + src/Appwrite/Models/ProxyInvalidation.php | 68 +++++ src/Appwrite/Models/UsageBillingPlan.php | 27 +- src/Appwrite/Services/Account.php | 45 --- src/Appwrite/Services/Activities.php | 4 +- src/Appwrite/Services/Apps.php | 57 +++- src/Appwrite/Services/Backups.php | 18 +- src/Appwrite/Services/Embeddings.php | 63 ++++ src/Appwrite/Services/Project.php | 127 ++++---- src/Appwrite/Services/Proxy.php | 50 ++++ src/Appwrite/Services/Storage.php | 7 +- src/Appwrite/Services/TablesDB.php | 275 +++++++++++++++++- src/Appwrite/Services/Users.php | 40 +++ tests/Appwrite/Services/AccountTest.php | 21 +- tests/Appwrite/Services/AppsTest.php | 19 ++ tests/Appwrite/Services/EmbeddingsTest.php | 50 ++++ tests/Appwrite/Services/OrganizationTest.php | 126 +------- tests/Appwrite/Services/ProjectTest.php | 113 +++++-- tests/Appwrite/Services/ProxyTest.php | 25 ++ tests/Appwrite/Services/StorageTest.php | 8 + tests/Appwrite/Services/TablesDBTest.php | 211 +++++++++++++- tests/Appwrite/Services/UsersTest.php | 28 +- 88 files changed, 2505 insertions(+), 559 deletions(-) create mode 100644 docs/embeddings.md rename docs/examples/{account/create-jwt.md => apps/delete-installation.md} (63%) create mode 100644 docs/examples/embeddings/create-text-embeddings.md rename docs/examples/project/{create-key.md => update-mfa-factors-policy.md} (60%) create mode 100644 docs/examples/proxy/create-invalidation.md create mode 100644 docs/examples/tablesdb/create-migration.md create mode 100644 docs/examples/tablesdb/cutover-migration.md create mode 100644 docs/examples/tablesdb/delete-migration.md create mode 100644 docs/examples/tablesdb/get-migration.md create mode 100644 docs/examples/tablesdb/list-migrations.md create mode 100644 docs/examples/tablesdb/list-operations.md create mode 100644 docs/examples/users/get-mfa-challenge.md create mode 100644 src/Appwrite/Enums/EmbeddingModel.php create mode 100644 src/Appwrite/Enums/InvalidationType.php create mode 100644 src/Appwrite/Models/DatabaseMigration.php create mode 100644 src/Appwrite/Models/DatabaseMigrationList.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseOperation.php create mode 100644 src/Appwrite/Models/DedicatedDatabaseOperationList.php create mode 100644 src/Appwrite/Models/Embedding.php create mode 100644 src/Appwrite/Models/EmbeddingList.php create mode 100644 src/Appwrite/Models/MfaChallengeSecret.php create mode 100644 src/Appwrite/Models/PolicyMfaFactors.php create mode 100644 src/Appwrite/Models/ProxyInvalidation.php create mode 100644 src/Appwrite/Services/Embeddings.php create mode 100644 tests/Appwrite/Services/EmbeddingsTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 099e71cb..6e9345fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 28.0.0 + +* Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either +* Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke +* Breaking: `activities.listEvents` `queries` now takes an array instead of a string +* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum +* Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` +* Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum +* Added: `apps.deleteInstallation` +* Added: `users.getMFAChallenge` and the `MfaChallengeSecret` model +* Added: `project.updateMFAFactorsPolicy` and the `PolicyMfaFactors` model +* Added: `client.setOrganization` for organization-scoped requests +* Added: `folder` parameter to `storage.createFile` +* Added: `syncMode` parameter to `tablesDB.create` and `tablesDB.update`, and `specification` to `tablesDB.update` +* Added: `installationScopes` parameter to `project.updateOAuth2Server` +* Added: `custom` authentication factor, `node-26` runtime, `mfa-factors` project policy, and the `embeddings.write` and `proxy.invalidations.write` key scopes +* Updated: response format to `1.9.6` + ## 27.1.0 * Added: `Apps` service for managing OAuth2 applications, keys, and installations diff --git a/README.md b/README.md index a47ec4c5..c5c62c7b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite PHP SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1) -![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square&v=1) +![Version](https://img.shields.io/badge/api%20version-1.9.6-blue.svg?style=flat-square&v=1) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/docs/account.md b/docs/account.md index 7600b611..fcf89b5f 100644 --- a/docs/account.md +++ b/docs/account.md @@ -150,19 +150,6 @@ DELETE https://cloud.appwrite.io/v1/account/identities/{identityId} | identityId | string | **Required** Identity ID. | | -```http request -POST https://cloud.appwrite.io/v1/account/jwts -``` - -** Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 | - - ```http request GET https://cloud.appwrite.io/v1/account/logs ``` @@ -280,7 +267,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenges | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. | | +| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. | | ```http request @@ -293,7 +280,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenges | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. | | +| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. | | ```http request @@ -561,7 +548,7 @@ GET https://cloud.appwrite.io/v1/account/sessions/{sessionId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| sessionId | string | **Required** Session ID. Use the string 'current' to get the current device session. | | +| sessionId | string | **Required** Session ID. Use the string 'current' to get the current device session. | current | ```http request @@ -574,7 +561,7 @@ PATCH https://cloud.appwrite.io/v1/account/sessions/{sessionId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| sessionId | string | **Required** Session ID. Use the string 'current' to update the current device session. | | +| sessionId | string | **Required** Session ID. Use the string 'current' to update the current device session. | current | ```http request @@ -587,7 +574,7 @@ DELETE https://cloud.appwrite.io/v1/account/sessions/{sessionId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| sessionId | string | **Required** Session ID. Use the string 'current' to delete the current device session. | | +| sessionId | string | **Required** Session ID. Use the string 'current' to delete the current device session. | current | ```http request diff --git a/docs/activities.md b/docs/activities.md index 06b40cb6..cf0d0f6c 100644 --- a/docs/activities.md +++ b/docs/activities.md @@ -11,7 +11,7 @@ GET https://cloud.appwrite.io/v1/activities/events | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| queries | string | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. | [] | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. | [] | ```http request diff --git a/docs/apps.md b/docs/apps.md index a8d9a2e8..436275b2 100644 --- a/docs/apps.md +++ b/docs/apps.md @@ -70,7 +70,7 @@ GET https://cloud.appwrite.io/v1/apps/{appId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| appId | string | **Required** Application unique ID or HTTPS client ID metadata document URL. | | +| appId | string | **Required** Application unique ID. | | ```http request @@ -101,7 +101,7 @@ PUT https://cloud.appwrite.io/v1/apps/{appId} | postLogoutRedirectUris | array | Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list. | [] | | type | string | OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. | confidential | | deviceFlow | boolean | Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. | | -| installationScopes | array | Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed. | [] | +| installationScopes | array | Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed. | [] | | installationRedirectUrl | string | URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect. | | @@ -122,7 +122,7 @@ DELETE https://cloud.appwrite.io/v1/apps/{appId} GET https://cloud.appwrite.io/v1/apps/{appId}/installations ``` -** List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. ** +** List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. ** ### Parameters @@ -137,7 +137,21 @@ GET https://cloud.appwrite.io/v1/apps/{appId}/installations GET https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId} ``` -** 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. ** +** 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, or a caller with update access to the app. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| appId | string | **Required** Application unique ID. | | +| installationId | string | **Required** Installation unique ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId} +``` + +** Delete an installation of an application by its unique ID. Requires a caller with update access to the app. Previously issued installation access tokens are revoked. ** ### Parameters @@ -151,7 +165,7 @@ GET https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId} POST https://cloud.appwrite.io/v1/apps/{appId}/installations/{installationId}/tokens ``` -** 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. ** +** 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, or a caller with update access to the app. The returned token carries the scopes and authorization details granted to the installation, and can be used as an `Authorization: Bearer` header everywhere OAuth2 access tokens are accepted. Multiple tokens can be active for the same installation at once; each token stays valid until it expires or the installation is updated or deleted. ** ### Parameters diff --git a/docs/backups.md b/docs/backups.md index 3ba25e1d..24727348 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -135,13 +135,13 @@ POST https://cloud.appwrite.io/v1/backups/restoration ** Create and trigger a new restoration for a backup on a project. -For a backup of one database, the restoration resolves its destination before it is queued. Pass `newResourceId` to restore into that database ID, including the archived database ID to overwrite it. When `newResourceId` is omitted, a new database ID is generated and returned in `options`. +For a backup of one database, the restoration resolves its destination before it is queued. When `newResourceId` is omitted, the archived database is restored in place and its own ID is returned in `options`. Pass a different `newResourceId` to restore alongside it as a new database instead. The restoration migration records the archived database in `resourceId` and `resourceType`, and the resolved database in `destinationResourceId` and `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. +When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. ** ### Parameters @@ -150,7 +150,7 @@ When restoring a DocumentsDB or VectorsDB database to a new resource from a dedi | --- | --- | --- | --- | | archiveId | string | Backup archive ID to restore | | | services | array | Array of services to restore | | -| newResourceId | string | Destination resource ID. Omit to generate a new ID, or pass the archived resource ID to overwrite it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | +| newResourceId | string | Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | newResourceName | string | Database name. Max length: 128 chars. | | diff --git a/docs/databases.md b/docs/databases.md index b3435f40..f976fef2 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -186,7 +186,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections | permissions | array | An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. | 1 | -| attributes | array | Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. | [] | +| attributes | array | Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. | [] | | indexes | array | Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). | [] | @@ -765,11 +765,11 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | databaseId | string | **Required** Database ID. | | | collectionId | string | **Required** Collection ID. | | | relatedCollectionId | string | Related Collection ID. | | -| type | string | Relation type | | +| type | string | Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. | | | twoWay | boolean | Is Two Way? | | | key | string | Attribute Key. | | | twoWayKey | string | Two Way Attribute Key. | | -| onDelete | string | Constraints option | restrict | +| onDelete | string | Delete constraint. Possible values are: cascade, restrict, setNull. | restrict | ```http request @@ -786,7 +786,7 @@ PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectio | databaseId | string | **Required** Database ID. | | | collectionId | string | **Required** Collection ID. | | | key | string | **Required** Attribute Key. | | -| onDelete | string | Constraints option | | +| onDelete | string | Delete constraint. Possible values are: cascade, restrict, setNull. | | | newKey | string | New Attribute Key. | | diff --git a/docs/embeddings.md b/docs/embeddings.md new file mode 100644 index 00000000..50d53b9b --- /dev/null +++ b/docs/embeddings.md @@ -0,0 +1,17 @@ +# Embeddings Service + + +```http request +POST https://cloud.appwrite.io/v1/embeddings/text +``` + +** Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections. + ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| texts | array | Array of text to generate embeddings. | | +| model | string | The embedding model to use for generating vector embeddings. | nomic-embed-text | + diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index ef9a9d70..cab59cfc 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -12,5 +12,5 @@ $client = (new Client()) $activities = new Activities($client); $result = $activities->listEvents( - queries: '' // optional + queries: [] // optional );``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index ef4ca380..33d117ae 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -7,7 +7,7 @@ use Appwrite\Services\Apps; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setKey(''); // Your secret API key + ->setSession(''); // The user session to authenticate with $apps = new Apps($client); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/apps/delete-installation.md similarity index 63% rename from docs/examples/account/create-jwt.md rename to docs/examples/apps/delete-installation.md index 3314407a..e57a12f4 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/apps/delete-installation.md @@ -2,15 +2,16 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with -$account = new Account($client); +$apps = new Apps($client); -$result = $account->createJWT( - duration: 0 // optional +$result = $apps->deleteInstallation( + appId: '', + installationId: '' );``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 63de2616..0f7a9bac 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -7,7 +7,7 @@ use Appwrite\Services\Apps; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setKey(''); // Your secret API key + ->setSession(''); // The user session to authenticate with $apps = new Apps($client); diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index fbdff242..0209cd24 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -7,7 +7,7 @@ use Appwrite\Services\Apps; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setKey(''); // Your secret API key + ->setSession(''); // The user session to authenticate with $apps = new Apps($client); diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 00000000..15f92318 --- /dev/null +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$embeddings = new Embeddings($client); + +$result = $embeddings->createTextEmbeddings( + texts: [], + model: EmbeddingModel::NOMICEMBEDTEXT() // optional +);``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/update-mfa-factors-policy.md similarity index 60% rename from docs/examples/project/create-key.md rename to docs/examples/project/update-mfa-factors-policy.md index cd3dbfd9..8823cc8f 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -3,7 +3,6 @@ use Appwrite\Client; use Appwrite\Services\Project; -use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,9 +11,9 @@ $client = (new Client()) $project = new Project($client); -$result = $project->createKey( - keyId: '', - name: '', - scopes: [ProjectKeyScopes::PROJECTREAD()], - expire: '2020-10-15T06:38:00.000+00:00' // optional +$result = $project->updateMFAFactorsPolicy( + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional );``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 4a7782f2..1d06279a 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -26,5 +26,6 @@ $result = $project->updateOAuth2Server( userCodeLength: 6, // optional userCodeFormat: 'numeric', // optional deviceCodeDuration: 60, // optional - defaultScopes: [] // optional + defaultScopes: [], // optional + installationScopes: [] // optional );``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 89526e79..882e2b2f 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -12,5 +12,5 @@ $client = (new Client()) $project = new Project($client); $result = $project->updateSessionDurationPolicy( - duration: 5 + duration: 60 );``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index bb787e9e..0dc2f1f7 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -12,5 +12,5 @@ $client = (new Client()) $project = new Project($client); $result = $project->updateUserLimitPolicy( - total: 1 + total: 0 );``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md new file mode 100644 index 00000000..00ae00ad --- /dev/null +++ b/docs/examples/proxy/create-invalidation.md @@ -0,0 +1,19 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->createInvalidation( + domain: '', + type: InvalidationType::TAG(), + reference: '' // optional +);``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 62301b10..19c38797 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -18,5 +18,6 @@ $result = $storage->createFile( bucketId: '', fileId: '', file: InputFile::withPath('file.png'), - permissions: [Permission::read(Role::any())] // optional + permissions: [Permission::read(Role::any())], // optional + folder: '' // optional );``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md new file mode 100644 index 00000000..37f670fe --- /dev/null +++ b/docs/examples/tablesdb/create-migration.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createMigration( + databaseId: '', + specification: 's-1vcpu-1gb', + autoCutover: false // optional +);``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 87c81dd2..7df1d49a 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -16,5 +16,6 @@ $result = $tablesDB->create( name: '', enabled: false, // optional specification: 'serverless', // optional - replicas: 0 // optional + replicas: 0, // optional + syncMode: 'async' // optional );``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md new file mode 100644 index 00000000..71a37d33 --- /dev/null +++ b/docs/examples/tablesdb/cutover-migration.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->cutoverMigration( + databaseId: '', + migrationId: '' +);``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md new file mode 100644 index 00000000..255d6aa8 --- /dev/null +++ b/docs/examples/tablesdb/delete-migration.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteMigration( + databaseId: '', + migrationId: '' +);``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md new file mode 100644 index 00000000..88d922b1 --- /dev/null +++ b/docs/examples/tablesdb/get-migration.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getMigration( + databaseId: '', + migrationId: '' +);``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md new file mode 100644 index 00000000..20c8485c --- /dev/null +++ b/docs/examples/tablesdb/list-migrations.md @@ -0,0 +1,16 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listMigrations( + databaseId: '' +);``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md new file mode 100644 index 00000000..311b1464 --- /dev/null +++ b/docs/examples/tablesdb/list-operations.md @@ -0,0 +1,19 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listOperations( + databaseId: '', + status: 'running', // optional + limit: 1, // optional + offset: 0 // optional +);``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index e6c703af..c5bafb8d 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -15,5 +15,7 @@ $result = $tablesDB->update( databaseId: '', name: '', // optional enabled: false, // optional - replicas: 0 // optional + specification: 'serverless', // optional + replicas: 0, // optional + syncMode: 'async' // optional );``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md new file mode 100644 index 00000000..8ef5c4aa --- /dev/null +++ b/docs/examples/users/get-mfa-challenge.md @@ -0,0 +1,17 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$users = new Users($client); + +$result = $users->getMFAChallenge( + userId: '', + challengeId: '' +);``` diff --git a/docs/functions.md b/docs/functions.md index eb12a051..bc4a62ed 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -67,7 +67,7 @@ GET https://cloud.appwrite.io/v1/functions/specifications | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| type | string | Specification type to list. Can be one of: runtimes, builds. | runtimes | +| type | string | Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. | runtimes | ```http request diff --git a/docs/project.md b/docs/project.md index c98ef4bc..39a21349 100644 --- a/docs/project.md +++ b/docs/project.md @@ -43,24 +43,6 @@ GET https://cloud.appwrite.io/v1/project/keys | total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | -```http request -POST https://cloud.appwrite.io/v1/project/keys -``` - -** Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. - -You can also create an ephemeral API key if you need a short-lived key instead. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| keyId | string | Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| name | string | Key name. Max length: 128 chars. | | -| scopes | array | Key scopes list. Maximum of 200 scopes are allowed. | | -| expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | | - - ```http request POST https://cloud.appwrite.io/v1/project/keys/ephemeral ``` @@ -239,6 +221,7 @@ PUT https://cloud.appwrite.io/v1/project/oauth2-server | userCodeFormat | string | Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. | alphanumeric | | deviceCodeDuration | integer | Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. | | | defaultScopes | array | List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. | [] | +| installationScopes | array | List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long. | [] | ```http request @@ -1191,6 +1174,22 @@ PATCH https://cloud.appwrite.io/v1/project/policies/membership-privacy | userAccessedAt | boolean | Set to true if you want make user last access time visible to all team members, or false to hide it. | | +```http request +PATCH https://cloud.appwrite.io/v1/project/policies/mfa-factors +``` + +** Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| totp | boolean | Set to true to allow TOTP to complete an MFA challenge, or false to disable it. | | +| email | boolean | Set to true to allow email to complete an MFA challenge, or false to disable it. | | +| phone | boolean | Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it. | | +| custom | boolean | Set to true to allow the custom factor to complete an MFA challenge, or false to disable it. | | + + ```http request PATCH https://cloud.appwrite.io/v1/project/policies/password-dictionary ``` @@ -1216,7 +1215,7 @@ Keep in mind, while password history policy is disabled, the history is not bein | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| total | integer | Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. | | +| total | integer | Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. | | ```http request @@ -1272,7 +1271,7 @@ PATCH https://cloud.appwrite.io/v1/project/policies/session-duration | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| duration | integer | Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. | | +| duration | integer | Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds. | | ```http request @@ -1298,7 +1297,7 @@ PATCH https://cloud.appwrite.io/v1/project/policies/session-limit | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| total | integer | Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. | | +| total | integer | Set the maximum number of sessions allowed per user. Value can be between 1 and 100. | | ```http request @@ -1311,7 +1310,7 @@ PATCH https://cloud.appwrite.io/v1/project/policies/user-limit | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| total | integer | Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. | | +| total | integer | Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. | | ```http request @@ -1324,7 +1323,7 @@ GET https://cloud.appwrite.io/v1/project/policies/{policyId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| policyId | string | **Required** Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. | | +| policyId | string | **Required** Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. | | ```http request diff --git a/docs/proxy.md b/docs/proxy.md index 3c8d9b51..b429411d 100644 --- a/docs/proxy.md +++ b/docs/proxy.md @@ -1,6 +1,23 @@ # Proxy Service +```http request +POST https://cloud.appwrite.io/v1/proxy/invalidations +``` + +** Create a new CDN cache invalidation for a domain. Executes a hard purge of cached content. + +Depending on type, the invalidation purges a single cache tag, a single URL path, or all cached content for the domain. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| domain | string | Domain name. | | +| type | string | Type of reference passed. Allowed values are: tag, path, all | | +| reference | string | Reference to invalidate. Depending on type this can be: cache tag name (up to 128 characters), URL path (up to 2048 characters). Not required when type is all. | | + + ```http request GET https://cloud.appwrite.io/v1/proxy/rules ``` diff --git a/docs/sites.md b/docs/sites.md index 68f9b7d2..dac7de92 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -68,7 +68,7 @@ GET https://cloud.appwrite.io/v1/sites/specifications | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| type | string | Specification type to list. Can be one of: runtimes, builds. | runtimes | +| type | string | Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. | runtimes | ```http request diff --git a/docs/storage.md b/docs/storage.md index c051c9b5..86acceb0 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -99,7 +99,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files | Field Name | Type | Description | Default | | --- | --- | --- | --- | | bucketId | string | **Required** Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | | -| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded | [] | +| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | | total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 | @@ -125,6 +125,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk | fileId | string | File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | | file | file | Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). | | | permissions | array | An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | +| folder | string | Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root. | | ```http request diff --git a/docs/tablesdb.md b/docs/tablesdb.md index eefcfcde..49f78e2f 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -32,6 +32,7 @@ POST https://cloud.appwrite.io/v1/tablesdb | enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 | | specification | string | Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. | serverless | | replicas | integer | Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. | 0 | +| syncMode | string | Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. | | ```http request @@ -148,7 +149,9 @@ PUT https://cloud.appwrite.io/v1/tablesdb/{databaseId} | databaseId | string | **Required** Database ID. | | | name | string | Database name. Max length: 128 chars. | | | enabled | boolean | Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 | +| specification | string | Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. | | | replicas | integer | Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. | | +| syncMode | string | Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. | | ```http request @@ -168,7 +171,7 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId} POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/failovers ``` -** 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. ** +** Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote. ** ### Parameters @@ -178,6 +181,92 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/failovers | targetReplicaId | string | Target replica ID to promote. If not specified, the healthiest replica is selected. | | +```http request +GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/migrations +``` + +** List the dedicated migrations for a TablesDB database. A database has at most one in-flight migration. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | + + +```http request +POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/migrations +``` + +** Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| specification | string | Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted. | | +| autoCutover | boolean | Whether to cut over automatically once the copy is verified. When disabled the migration parks at ready_to_cutover and holds there until the cutover is performed manually. | 1 | + + +```http request +GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/migrations/{migrationId} +``` + +** Get a single dedicated migration for a TablesDB database by its ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| migrationId | string | **Required** Migration ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId}/migrations/{migrationId} +``` + +** Abort an in-flight TablesDB dedicated migration. Only allowed before cutover; once the migration has cut over it cannot be aborted. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| migrationId | string | **Required** Migration ID. | | + + +```http request +POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/migrations/{migrationId}/cutover +``` + +** Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| migrationId | string | **Required** Migration ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/operations +``` + +** List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| status | string | Filter by operation status. | | +| limit | integer | Maximum number of operations to return. | 25 | +| offset | integer | Number of operations to skip. | 0 | + + ```http request GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/replicas ``` @@ -236,7 +325,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables | permissions | array | An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | rowSecurity | boolean | Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. | 1 | -| columns | array | Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. | [] | +| columns | array | Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. | [] | | indexes | array | Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). | [] | @@ -814,11 +903,11 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/columns | databaseId | string | **Required** Database ID. | | | tableId | string | **Required** Table ID. | | | relatedTableId | string | Related Table ID. | | -| type | string | Relation type | | +| type | string | Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. | | | twoWay | boolean | Is Two Way? | | | key | string | Column Key. | | | twoWayKey | string | Two Way Column Key. | | -| onDelete | string | Constraints option | restrict | +| onDelete | string | Delete constraint. Possible values are: cascade, restrict, setNull. | restrict | ```http request @@ -1024,7 +1113,7 @@ PATCH https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/column | databaseId | string | **Required** Database ID. | | | tableId | string | **Required** Table ID. | | | key | string | **Required** Column Key. | | -| onDelete | string | Constraints option | | +| onDelete | string | Delete constraint. Possible values are: cascade, restrict, setNull. | | | newKey | string | New Column Key. | | diff --git a/docs/users.md b/docs/users.md index 02d1d014..7ded8472 100644 --- a/docs/users.md +++ b/docs/users.md @@ -248,7 +248,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/jwts | Field Name | Type | Description | Default | | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -| sessionId | string | Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. | | +| sessionId | string | Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. | recent | | duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 | @@ -355,6 +355,20 @@ DELETE https://cloud.appwrite.io/v1/users/{userId}/mfa/authenticators/{type} | type | string | **Required** Type of authenticator. | | +```http request +GET https://cloud.appwrite.io/v1/users/{userId}/mfa/challenges/{challengeId} +``` + +** Get a custom MFA challenge for a user, including the code to be delivered through your own channel. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| userId | string | **Required** User ID. | | +| challengeId | string | **Required** ID of the challenge. | | + + ```http request GET https://cloud.appwrite.io/v1/users/{userId}/mfa/factors ``` diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 23ee27b6..e56b2adc 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -40,11 +40,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/27.1.0 ()', + 'user-agent' => 'AppwritePHPSDK/28.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '27.1.0', + 'x-sdk-version'=> '28.0.0', ]; /** @@ -94,7 +94,7 @@ class Client */ public function __construct() { - $this->headers['X-Appwrite-Response-Format'] = '1.9.5'; + $this->headers['X-Appwrite-Response-Format'] = '1.9.6'; } @@ -131,6 +131,23 @@ public function setKey(string $value): Client return $this; } + /** + * Set Organization + * + * Your organization ID + * + * @param string $value + * + * @return Client + */ + public function setOrganization(string $value): Client + { + $this->addHeader('X-Appwrite-Organization', $value); + $this->config['organization'] = $value; + + return $this; + } + /** * Set JWT * diff --git a/src/Appwrite/Enums/AuthenticationFactor.php b/src/Appwrite/Enums/AuthenticationFactor.php index b3694722..046cf53f 100644 --- a/src/Appwrite/Enums/AuthenticationFactor.php +++ b/src/Appwrite/Enums/AuthenticationFactor.php @@ -10,6 +10,7 @@ class AuthenticationFactor implements JsonSerializable private static AuthenticationFactor $PHONE; private static AuthenticationFactor $TOTP; private static AuthenticationFactor $RECOVERYCODE; + private static AuthenticationFactor $CUSTOM; private string $value; @@ -56,6 +57,13 @@ public static function RECOVERYCODE(): AuthenticationFactor } return self::$RECOVERYCODE; } + public static function CUSTOM(): AuthenticationFactor + { + if (!isset(self::$CUSTOM)) { + self::$CUSTOM = new AuthenticationFactor('custom'); + } + return self::$CUSTOM; + } public static function from(string $value): self { @@ -64,6 +72,7 @@ public static function from(string $value): self 'phone' => self::PHONE(), 'totp' => self::TOTP(), 'recoverycode' => self::RECOVERYCODE(), + 'custom' => self::CUSTOM(), default => throw new \InvalidArgumentException('Unknown AuthenticationFactor value: ' . $value), }; } diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php index 186b4de3..ec65bb79 100644 --- a/src/Appwrite/Enums/BuildRuntime.php +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -16,6 +16,7 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $NODE23; private static BuildRuntime $NODE24; private static BuildRuntime $NODE25; + private static BuildRuntime $NODE26; private static BuildRuntime $PHP80; private static BuildRuntime $PHP81; private static BuildRuntime $PHP82; @@ -185,6 +186,13 @@ public static function NODE25(): BuildRuntime } return self::$NODE25; } + public static function NODE26(): BuildRuntime + { + if (!isset(self::$NODE26)) { + self::$NODE26 = new BuildRuntime('node-26'); + } + return self::$NODE26; + } public static function PHP80(): BuildRuntime { if (!isset(self::$PHP80)) { @@ -766,6 +774,7 @@ public static function from(string $value): self 'node-23' => self::NODE23(), 'node-24' => self::NODE24(), 'node-25' => self::NODE25(), + 'node-26' => self::NODE26(), 'php-8.0' => self::PHP80(), 'php-8.1' => self::PHP81(), 'php-8.2' => self::PHP82(), diff --git a/src/Appwrite/Enums/EmbeddingModel.php b/src/Appwrite/Enums/EmbeddingModel.php new file mode 100644 index 00000000..ec104ce9 --- /dev/null +++ b/src/Appwrite/Enums/EmbeddingModel.php @@ -0,0 +1,70 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NOMICEMBEDTEXT(): EmbeddingModel + { + if (!isset(self::$NOMICEMBEDTEXT)) { + self::$NOMICEMBEDTEXT = new EmbeddingModel('nomic-embed-text'); + } + return self::$NOMICEMBEDTEXT; + } + public static function EMBEDDINGGEMMA(): EmbeddingModel + { + if (!isset(self::$EMBEDDINGGEMMA)) { + self::$EMBEDDINGGEMMA = new EmbeddingModel('embedding-gemma'); + } + return self::$EMBEDDINGGEMMA; + } + public static function ALLMINILM(): EmbeddingModel + { + if (!isset(self::$ALLMINILM)) { + self::$ALLMINILM = new EmbeddingModel('all-minilm'); + } + return self::$ALLMINILM; + } + public static function BGESMALL(): EmbeddingModel + { + if (!isset(self::$BGESMALL)) { + self::$BGESMALL = new EmbeddingModel('bge-small'); + } + return self::$BGESMALL; + } + + public static function from(string $value): self + { + return match ($value) { + 'nomic-embed-text' => self::NOMICEMBEDTEXT(), + 'embedding-gemma' => self::EMBEDDINGGEMMA(), + 'all-minilm' => self::ALLMINILM(), + 'bge-small' => self::BGESMALL(), + default => throw new \InvalidArgumentException('Unknown EmbeddingModel value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/InvalidationType.php b/src/Appwrite/Enums/InvalidationType.php new file mode 100644 index 00000000..828bd90d --- /dev/null +++ b/src/Appwrite/Enums/InvalidationType.php @@ -0,0 +1,61 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function TAG(): InvalidationType + { + if (!isset(self::$TAG)) { + self::$TAG = new InvalidationType('tag'); + } + return self::$TAG; + } + public static function PATH(): InvalidationType + { + if (!isset(self::$PATH)) { + self::$PATH = new InvalidationType('path'); + } + return self::$PATH; + } + public static function ALL(): InvalidationType + { + if (!isset(self::$ALL)) { + self::$ALL = new InvalidationType('all'); + } + return self::$ALL; + } + + public static function from(string $value): self + { + return match ($value) { + 'tag' => self::TAG(), + 'path' => self::PATH(), + 'all' => self::ALL(), + default => throw new \InvalidArgumentException('Unknown InvalidationType value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/ProjectKeyScopes.php b/src/Appwrite/Enums/ProjectKeyScopes.php index b7d37a76..a0c12987 100644 --- a/src/Appwrite/Enums/ProjectKeyScopes.php +++ b/src/Appwrite/Enums/ProjectKeyScopes.php @@ -40,6 +40,7 @@ class ProjectKeyScopes implements JsonSerializable private static ProjectKeyScopes $INDEXESWRITE; private static ProjectKeyScopes $ROWSREAD; private static ProjectKeyScopes $ROWSWRITE; + private static ProjectKeyScopes $EMBEDDINGSWRITE; private static ProjectKeyScopes $COLLECTIONSREAD; private static ProjectKeyScopes $COLLECTIONSWRITE; private static ProjectKeyScopes $ATTRIBUTESREAD; @@ -104,6 +105,7 @@ class ProjectKeyScopes implements JsonSerializable private static ProjectKeyScopes $WAFRULESREAD; private static ProjectKeyScopes $WAFRULESWRITE; private static ProjectKeyScopes $EVENTSREAD; + private static ProjectKeyScopes $PROXYINVALIDATIONSWRITE; private static ProjectKeyScopes $APPSREAD; private static ProjectKeyScopes $APPSWRITE; private static ProjectKeyScopes $OAUTH2READ; @@ -366,6 +368,13 @@ public static function ROWSWRITE(): ProjectKeyScopes } return self::$ROWSWRITE; } + public static function EMBEDDINGSWRITE(): ProjectKeyScopes + { + if (!isset(self::$EMBEDDINGSWRITE)) { + self::$EMBEDDINGSWRITE = new ProjectKeyScopes('embeddings.write'); + } + return self::$EMBEDDINGSWRITE; + } public static function COLLECTIONSREAD(): ProjectKeyScopes { if (!isset(self::$COLLECTIONSREAD)) { @@ -814,6 +823,13 @@ public static function EVENTSREAD(): ProjectKeyScopes } return self::$EVENTSREAD; } + public static function PROXYINVALIDATIONSWRITE(): ProjectKeyScopes + { + if (!isset(self::$PROXYINVALIDATIONSWRITE)) { + self::$PROXYINVALIDATIONSWRITE = new ProjectKeyScopes('proxy.invalidations.write'); + } + return self::$PROXYINVALIDATIONSWRITE; + } public static function APPSREAD(): ProjectKeyScopes { if (!isset(self::$APPSREAD)) { @@ -894,6 +910,7 @@ public static function from(string $value): self 'indexes.write' => self::INDEXESWRITE(), 'rows.read' => self::ROWSREAD(), 'rows.write' => self::ROWSWRITE(), + 'embeddings.write' => self::EMBEDDINGSWRITE(), 'collections.read' => self::COLLECTIONSREAD(), 'collections.write' => self::COLLECTIONSWRITE(), 'attributes.read' => self::ATTRIBUTESREAD(), @@ -958,6 +975,7 @@ public static function from(string $value): self 'wafRules.read' => self::WAFRULESREAD(), 'wafRules.write' => self::WAFRULESWRITE(), 'events.read' => self::EVENTSREAD(), + 'proxy.invalidations.write' => self::PROXYINVALIDATIONSWRITE(), 'apps.read' => self::APPSREAD(), 'apps.write' => self::APPSWRITE(), 'oauth2.read' => self::OAUTH2READ(), diff --git a/src/Appwrite/Enums/ProjectPolicyId.php b/src/Appwrite/Enums/ProjectPolicyId.php index 64562d88..7ee3c25d 100644 --- a/src/Appwrite/Enums/ProjectPolicyId.php +++ b/src/Appwrite/Enums/ProjectPolicyId.php @@ -16,6 +16,7 @@ class ProjectPolicyId implements JsonSerializable private static ProjectPolicyId $SESSIONLIMIT; private static ProjectPolicyId $USERLIMIT; private static ProjectPolicyId $MEMBERSHIPPRIVACY; + private static ProjectPolicyId $MFAFACTORS; private static ProjectPolicyId $DENYALIASEDEMAIL; private static ProjectPolicyId $DENYDISPOSABLEEMAIL; private static ProjectPolicyId $DENYFREEEMAIL; @@ -108,6 +109,13 @@ public static function MEMBERSHIPPRIVACY(): ProjectPolicyId } return self::$MEMBERSHIPPRIVACY; } + public static function MFAFACTORS(): ProjectPolicyId + { + if (!isset(self::$MFAFACTORS)) { + self::$MFAFACTORS = new ProjectPolicyId('mfa-factors'); + } + return self::$MFAFACTORS; + } public static function DENYALIASEDEMAIL(): ProjectPolicyId { if (!isset(self::$DENYALIASEDEMAIL)) { @@ -150,6 +158,7 @@ public static function from(string $value): self 'session-limit' => self::SESSIONLIMIT(), 'user-limit' => self::USERLIMIT(), 'membership-privacy' => self::MEMBERSHIPPRIVACY(), + 'mfa-factors' => self::MFAFACTORS(), 'deny-aliased-email' => self::DENYALIASEDEMAIL(), 'deny-disposable-email' => self::DENYDISPOSABLEEMAIL(), 'deny-free-email' => self::DENYFREEEMAIL(), diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index e6f9f263..d082cb86 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -16,6 +16,7 @@ class Runtime implements JsonSerializable private static Runtime $NODE23; private static Runtime $NODE24; private static Runtime $NODE25; + private static Runtime $NODE26; private static Runtime $PHP80; private static Runtime $PHP81; private static Runtime $PHP82; @@ -185,6 +186,13 @@ public static function NODE25(): Runtime } return self::$NODE25; } + public static function NODE26(): Runtime + { + if (!isset(self::$NODE26)) { + self::$NODE26 = new Runtime('node-26'); + } + return self::$NODE26; + } public static function PHP80(): Runtime { if (!isset(self::$PHP80)) { @@ -766,6 +774,7 @@ public static function from(string $value): self 'node-23' => self::NODE23(), 'node-24' => self::NODE24(), 'node-25' => self::NODE25(), + 'node-26' => self::NODE26(), 'php-8.0' => self::PHP80(), 'php-8.1' => self::PHP81(), 'php-8.2' => self::PHP82(), diff --git a/src/Appwrite/Models/BillingPlan.php b/src/Appwrite/Models/BillingPlan.php index 951b4073..3b7f783a 100644 --- a/src/Appwrite/Models/BillingPlan.php +++ b/src/Appwrite/Models/BillingPlan.php @@ -24,7 +24,6 @@ * @param int $storage storage * @param int $imageTransformations image transformations * @param int $screenshotsGenerated screenshots generated - * @param int $members members * @param int $webhooks webhooks * @param int $wafRules maximum waf rules per project * @param int $projects projects @@ -48,7 +47,6 @@ * @param int $topics topics for messaging * @param int $authPhone sms authentications per month * @param int $domains custom domains - * @param int $activityLogs activity log days * @param int $usageLogs usage history days * @param int $projectInactivityDays number of days of console inactivity before a project is paused. 0 means pausing is disabled. * @param int $alertLimit alert threshold percentage @@ -71,15 +69,17 @@ * @param bool $supportsFreeEmailValidation does plan support blocking free email addresses. * @param bool $supportsCorporateEmailValidation does plan support restricting sign-ups to corporate email addresses only. * @param bool $supportsProjectSpecificRoles does plan support project-specific member roles. - * @param bool $backupsEnabled does plan support backup policies. * @param bool $usagePerProject whether usage addons are calculated per project. * @param BillingPlanSupportedAddons $supportedAddons supported addons for this plan - * @param int $backupPolicies how many policies does plan support * @param int $deploymentSize maximum function and site deployment size in mb * @param int $buildSize maximum function and site deployment size in mb * @param bool $databasesAllowEncrypt does the plan support encrypted string attributes or not. * @param BillingPlanGroup $group group of this billing plan for variants + * @param int|null $members members + * @param int|null $activityLogs activity log days * @param array|null $usageLogsIntervals usage log time intervals allowed for this plan (e.g. 15m, 1h, 1d). + * @param bool|null $backupsEnabled does plan support backup policies. + * @param int|null $backupPolicies how many policies does plan support * @param BillingPlanLimits|null $limits plan specific limits * @param Program|null $program details of the program this plan is a part of. * @param BillingPlanDedicatedDatabaseLimits|null $dedicatedDatabases dedicated database limits available to this plan. @@ -95,7 +95,6 @@ public function __construct( public int $storage, public int $imageTransformations, public int $screenshotsGenerated, - public int $members, public int $webhooks, public int $wafRules, public int $projects, @@ -119,7 +118,6 @@ public function __construct( public int $topics, public int $authPhone, public int $domains, - public int $activityLogs, public int $usageLogs, public int $projectInactivityDays, public int $alertLimit, @@ -142,15 +140,17 @@ public function __construct( public bool $supportsFreeEmailValidation, public bool $supportsCorporateEmailValidation, public bool $supportsProjectSpecificRoles, - public bool $backupsEnabled, public bool $usagePerProject, public BillingPlanSupportedAddons $supportedAddons, - public int $backupPolicies, public int $deploymentSize, public int $buildSize, public bool $databasesAllowEncrypt, public BillingPlanGroup $group, + public ?int $members = null, + public ?int $activityLogs = null, public ?array $usageLogsIntervals = null, + public ?bool $backupsEnabled = null, + public ?int $backupPolicies = null, public ?BillingPlanLimits $limits = null, public ?Program $program = null, public ?BillingPlanDedicatedDatabaseLimits $dedicatedDatabases = null @@ -192,9 +192,6 @@ public static function from(array $data): static if (!array_key_exists('screenshotsGenerated', $data)) { throw new \InvalidArgumentException('Missing required field "screenshotsGenerated" for ' . static::class . '.'); } - if (!array_key_exists('members', $data)) { - throw new \InvalidArgumentException('Missing required field "members" for ' . static::class . '.'); - } if (!array_key_exists('webhooks', $data)) { throw new \InvalidArgumentException('Missing required field "webhooks" for ' . static::class . '.'); } @@ -264,9 +261,6 @@ public static function from(array $data): static if (!array_key_exists('domains', $data)) { throw new \InvalidArgumentException('Missing required field "domains" for ' . static::class . '.'); } - if (!array_key_exists('activityLogs', $data)) { - throw new \InvalidArgumentException('Missing required field "activityLogs" for ' . static::class . '.'); - } if (!array_key_exists('usageLogs', $data)) { throw new \InvalidArgumentException('Missing required field "usageLogs" for ' . static::class . '.'); } @@ -333,18 +327,12 @@ public static function from(array $data): static if (!array_key_exists('supportsProjectSpecificRoles', $data)) { throw new \InvalidArgumentException('Missing required field "supportsProjectSpecificRoles" for ' . static::class . '.'); } - if (!array_key_exists('backupsEnabled', $data)) { - throw new \InvalidArgumentException('Missing required field "backupsEnabled" for ' . static::class . '.'); - } if (!array_key_exists('usagePerProject', $data)) { throw new \InvalidArgumentException('Missing required field "usagePerProject" for ' . static::class . '.'); } if (!array_key_exists('supportedAddons', $data)) { throw new \InvalidArgumentException('Missing required field "supportedAddons" for ' . static::class . '.'); } - if (!array_key_exists('backupPolicies', $data)) { - throw new \InvalidArgumentException('Missing required field "backupPolicies" for ' . static::class . '.'); - } if (!array_key_exists('deploymentSize', $data)) { throw new \InvalidArgumentException('Missing required field "deploymentSize" for ' . static::class . '.'); } @@ -369,7 +357,6 @@ public static function from(array $data): static storage: $data['storage'], imageTransformations: $data['imageTransformations'], screenshotsGenerated: $data['screenshotsGenerated'], - members: $data['members'], webhooks: $data['webhooks'], wafRules: $data['wafRules'], projects: $data['projects'], @@ -393,7 +380,6 @@ functions: $data['functions'], topics: $data['topics'], authPhone: $data['authPhone'], domains: $data['domains'], - activityLogs: $data['activityLogs'], usageLogs: $data['usageLogs'], projectInactivityDays: $data['projectInactivityDays'], alertLimit: $data['alertLimit'], @@ -416,15 +402,17 @@ functions: $data['functions'], supportsFreeEmailValidation: $data['supportsFreeEmailValidation'], supportsCorporateEmailValidation: $data['supportsCorporateEmailValidation'], supportsProjectSpecificRoles: $data['supportsProjectSpecificRoles'], - backupsEnabled: $data['backupsEnabled'], usagePerProject: $data['usagePerProject'], supportedAddons: static::hydrateTypedValue(BillingPlanSupportedAddons::class, $data['supportedAddons']), - backupPolicies: $data['backupPolicies'], deploymentSize: $data['deploymentSize'], buildSize: $data['buildSize'], databasesAllowEncrypt: $data['databasesAllowEncrypt'], group: static::hydrateTypedValue(BillingPlanGroup::class, $data['group']), + members: array_key_exists('members', $data) ? $data['members'] : null, + activityLogs: array_key_exists('activityLogs', $data) ? $data['activityLogs'] : null, usageLogsIntervals: array_key_exists('usageLogsIntervals', $data) ? $data['usageLogsIntervals'] : null, + backupsEnabled: array_key_exists('backupsEnabled', $data) ? $data['backupsEnabled'] : null, + backupPolicies: array_key_exists('backupPolicies', $data) ? $data['backupPolicies'] : null, limits: array_key_exists('limits', $data) ? static::hydrateTypedValue(BillingPlanLimits::class, $data['limits'], true) : null, program: array_key_exists('program', $data) ? static::hydrateTypedValue(Program::class, $data['program'], true) : null, dedicatedDatabases: array_key_exists('dedicatedDatabases', $data) ? static::hydrateTypedValue(BillingPlanDedicatedDatabaseLimits::class, $data['dedicatedDatabases'], true) : null diff --git a/src/Appwrite/Models/BillingPlanAddon.php b/src/Appwrite/Models/BillingPlanAddon.php index 7e79ea14..f34340e5 100644 --- a/src/Appwrite/Models/BillingPlanAddon.php +++ b/src/Appwrite/Models/BillingPlanAddon.php @@ -12,12 +12,12 @@ /** * BillingPlanAddon constructor. * - * @param BillingPlanAddonDetails $seats addon seats - * @param BillingPlanAddonDetails $projects addon projects + * @param BillingPlanAddonDetails|null $seats addon seats + * @param BillingPlanAddonDetails|null $projects addon projects */ public function __construct( - public BillingPlanAddonDetails $seats, - public BillingPlanAddonDetails $projects + public ?BillingPlanAddonDetails $seats = null, + public ?BillingPlanAddonDetails $projects = null ) { } @@ -26,16 +26,10 @@ public function __construct( */ public static function from(array $data): static { - if (!array_key_exists('seats', $data)) { - throw new \InvalidArgumentException('Missing required field "seats" for ' . static::class . '.'); - } - if (!array_key_exists('projects', $data)) { - throw new \InvalidArgumentException('Missing required field "projects" for ' . static::class . '.'); - } return new static( - seats: static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['seats']), - projects: static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['projects']) + seats: array_key_exists('seats', $data) ? static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['seats'], true) : null, + projects: array_key_exists('projects', $data) ? static::hydrateTypedValue(BillingPlanAddonDetails::class, $data['projects'], true) : null ); } diff --git a/src/Appwrite/Models/BillingPlanAddonDetails.php b/src/Appwrite/Models/BillingPlanAddonDetails.php index 60f94449..79b8500c 100644 --- a/src/Appwrite/Models/BillingPlanAddonDetails.php +++ b/src/Appwrite/Models/BillingPlanAddonDetails.php @@ -16,20 +16,20 @@ * @param int $planIncluded addon plan included value * @param int $limit addon limit * @param string $type addon type - * @param string $currency price currency * @param float $price price * @param int $value resource value * @param string $invoiceDesc description on invoice + * @param string|null $currency price currency */ public function __construct( public bool $supported, public int $planIncluded, public int $limit, public string $type, - public string $currency, public float $price, public int $value, - public string $invoiceDesc + public string $invoiceDesc, + public ?string $currency = null ) { } @@ -50,9 +50,6 @@ public static function from(array $data): static if (!array_key_exists('type', $data)) { throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); } - if (!array_key_exists('currency', $data)) { - throw new \InvalidArgumentException('Missing required field "currency" for ' . static::class . '.'); - } if (!array_key_exists('price', $data)) { throw new \InvalidArgumentException('Missing required field "price" for ' . static::class . '.'); } @@ -68,10 +65,10 @@ public static function from(array $data): static planIncluded: $data['planIncluded'], limit: $data['limit'], type: $data['type'], - currency: $data['currency'], price: $data['price'], value: $data['value'], - invoiceDesc: $data['invoiceDesc'] + invoiceDesc: $data['invoiceDesc'], + currency: array_key_exists('currency', $data) ? $data['currency'] : null ); } diff --git a/src/Appwrite/Models/Database.php b/src/Appwrite/Models/Database.php index fb6f77f3..b5e4baa0 100644 --- a/src/Appwrite/Models/Database.php +++ b/src/Appwrite/Models/Database.php @@ -22,7 +22,7 @@ * @param bool $enabled if database is enabled. can be 'enabled' or 'disabled'. when disabled, the database is inaccessible to users, but remains accessible to server sdks using api keys. * @param DatabaseType $type database type. * @param DatabaseStatus|null $status dedicated database lifecycle status. null when the database has no valid dedicated backing. - * @param string|null $engine underlying engine of the dedicated backing: postgresql, mysql, mariadb, or mongodb. a managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. null when the database has no dedicated backing. + * @param string|null $engine underlying engine of the dedicated backing: postgresql, mysql, or mongodb. a managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. null when the database has no dedicated backing. * @param string|null $specification compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. null when the database has no dedicated backing. * @param int|null $replicas number of secondary high availability replicas, excluding the primary. null when backing configuration is unavailable. * @param list|null $policies database backup policies. diff --git a/src/Appwrite/Models/DatabaseMigration.php b/src/Appwrite/Models/DatabaseMigration.php new file mode 100644 index 00000000..d8e19ed8 --- /dev/null +++ b/src/Appwrite/Models/DatabaseMigration.php @@ -0,0 +1,152 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('$updatedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$updatedAt" for ' . static::class . '.'); + } + if (!array_key_exists('projectId', $data)) { + throw new \InvalidArgumentException('Missing required field "projectId" for ' . static::class . '.'); + } + if (!array_key_exists('databaseId', $data)) { + throw new \InvalidArgumentException('Missing required field "databaseId" for ' . static::class . '.'); + } + if (!array_key_exists('specification', $data)) { + throw new \InvalidArgumentException('Missing required field "specification" for ' . static::class . '.'); + } + if (!array_key_exists('phase', $data)) { + throw new \InvalidArgumentException('Missing required field "phase" for ' . static::class . '.'); + } + if (!array_key_exists('attempt', $data)) { + throw new \InvalidArgumentException('Missing required field "attempt" for ' . static::class . '.'); + } + if (!array_key_exists('lastError', $data)) { + throw new \InvalidArgumentException('Missing required field "lastError" for ' . static::class . '.'); + } + if (!array_key_exists('lagDocuments', $data)) { + throw new \InvalidArgumentException('Missing required field "lagDocuments" for ' . static::class . '.'); + } + if (!array_key_exists('verifiedAt', $data)) { + throw new \InvalidArgumentException('Missing required field "verifiedAt" for ' . static::class . '.'); + } + if (!array_key_exists('cutoverAt', $data)) { + throw new \InvalidArgumentException('Missing required field "cutoverAt" for ' . static::class . '.'); + } + if (!array_key_exists('soakUntil', $data)) { + throw new \InvalidArgumentException('Missing required field "soakUntil" for ' . static::class . '.'); + } + if (!array_key_exists('autoCutover', $data)) { + throw new \InvalidArgumentException('Missing required field "autoCutover" for ' . static::class . '.'); + } + if (!array_key_exists('cutoverRequested', $data)) { + throw new \InvalidArgumentException('Missing required field "cutoverRequested" for ' . static::class . '.'); + } + if (!array_key_exists('paused', $data)) { + throw new \InvalidArgumentException('Missing required field "paused" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + updatedAt: $data['$updatedAt'], + projectId: $data['projectId'], + databaseId: $data['databaseId'], + specification: $data['specification'], + phase: $data['phase'], + attempt: $data['attempt'], + lastError: $data['lastError'], + lagDocuments: $data['lagDocuments'], + verifiedAt: $data['verifiedAt'], + cutoverAt: $data['cutoverAt'], + soakUntil: $data['soakUntil'], + autoCutover: $data['autoCutover'], + cutoverRequested: $data['cutoverRequested'], + paused: $data['paused'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + '$updatedAt' => static::serializeValue($this->updatedAt), + 'projectId' => static::serializeValue($this->projectId), + 'databaseId' => static::serializeValue($this->databaseId), + 'specification' => static::serializeValue($this->specification), + 'phase' => static::serializeValue($this->phase), + 'attempt' => static::serializeValue($this->attempt), + 'lastError' => static::serializeValue($this->lastError), + 'lagDocuments' => static::serializeValue($this->lagDocuments), + 'verifiedAt' => static::serializeValue($this->verifiedAt), + 'cutoverAt' => static::serializeValue($this->cutoverAt), + 'soakUntil' => static::serializeValue($this->soakUntil), + 'autoCutover' => static::serializeValue($this->autoCutover), + 'cutoverRequested' => static::serializeValue($this->cutoverRequested), + 'paused' => static::serializeValue($this->paused) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DatabaseMigrationList.php b/src/Appwrite/Models/DatabaseMigrationList.php new file mode 100644 index 00000000..d8016eaf --- /dev/null +++ b/src/Appwrite/Models/DatabaseMigrationList.php @@ -0,0 +1,59 @@ + $migrations list of migrations. + */ + public function __construct( + public int $total, + public array $migrations + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('migrations', $data)) { + throw new \InvalidArgumentException('Missing required field "migrations" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + migrations: is_array($data['migrations']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DatabaseMigration::class, $item), + $data['migrations'] + ) + : $data['migrations'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'migrations' => static::serializeValue($this->migrations) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DatabaseStatus.php b/src/Appwrite/Models/DatabaseStatus.php index 59b30ffd..5408a15e 100644 --- a/src/Appwrite/Models/DatabaseStatus.php +++ b/src/Appwrite/Models/DatabaseStatus.php @@ -12,14 +12,20 @@ /** * DatabaseStatus constructor. * - * @param string $health overall health status: healthy, degraded, or unhealthy. + * @param string $health overall health status: healthy, degraded, unhealthy, or unknown when nothing could be measured. * @param bool $ready whether the database is ready to accept connections. - * @param string $engine database engine: postgresql, mysql, mariadb, or mongodb. + * @param string $engine database engine: postgresql, mysql, or mongodb. * @param string $version database engine version. * @param int $uptime database uptime in seconds. * @param DatabaseStatusConnections $connections connection statistics. - * @param list $replicas list of database replicas and their status. + * @param string $syncMode requested replication sync mode. possible values: async, sync, quorum. compare with effectivesyncmode for what the primary is enforcing. + * @param bool $syncDegraded whether the enforced replication is weaker than the requested syncmode. + * @param int $syncAcknowledgements number of standby acknowledgements the primary waits for before a write is committed. + * @param int $syncStandbyCount number of standbys registered with the primary for synchronous replication. + * @param list $replicas list of database replicas and their status. every configured member appears, including one the backend has not brought up, which is reported as not healthy. * @param list $volumes storage volume information. + * @param string|null $effectiveSyncMode replication sync mode the primary is actually enforcing. null when high availability is disabled or the state could not be read. + * @param bool|null $syncStateConfirmed whether the other sync fields are an engine reading rather than a recorded estimate. true when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. false when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. false never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. */ public function __construct( public string $health, @@ -28,8 +34,14 @@ public function __construct( public string $version, public int $uptime, public DatabaseStatusConnections $connections, + public string $syncMode, + public bool $syncDegraded, + public int $syncAcknowledgements, + public int $syncStandbyCount, public array $replicas, - public array $volumes + public array $volumes, + public ?string $effectiveSyncMode = null, + public ?bool $syncStateConfirmed = null ) { } @@ -56,6 +68,18 @@ public static function from(array $data): static if (!array_key_exists('connections', $data)) { throw new \InvalidArgumentException('Missing required field "connections" for ' . static::class . '.'); } + if (!array_key_exists('syncMode', $data)) { + throw new \InvalidArgumentException('Missing required field "syncMode" for ' . static::class . '.'); + } + if (!array_key_exists('syncDegraded', $data)) { + throw new \InvalidArgumentException('Missing required field "syncDegraded" for ' . static::class . '.'); + } + if (!array_key_exists('syncAcknowledgements', $data)) { + throw new \InvalidArgumentException('Missing required field "syncAcknowledgements" for ' . static::class . '.'); + } + if (!array_key_exists('syncStandbyCount', $data)) { + throw new \InvalidArgumentException('Missing required field "syncStandbyCount" for ' . static::class . '.'); + } if (!array_key_exists('replicas', $data)) { throw new \InvalidArgumentException('Missing required field "replicas" for ' . static::class . '.'); } @@ -70,6 +94,10 @@ public static function from(array $data): static version: $data['version'], uptime: $data['uptime'], connections: static::hydrateTypedValue(DatabaseStatusConnections::class, $data['connections']), + syncMode: $data['syncMode'], + syncDegraded: $data['syncDegraded'], + syncAcknowledgements: $data['syncAcknowledgements'], + syncStandbyCount: $data['syncStandbyCount'], replicas: is_array($data['replicas']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(DatabaseStatusReplica::class, $item), @@ -81,7 +109,9 @@ public static function from(array $data): static static fn (mixed $item): mixed => static::hydrateTypedValue(DatabaseStatusVolume::class, $item), $data['volumes'] ) - : $data['volumes'] + : $data['volumes'], + effectiveSyncMode: array_key_exists('effectiveSyncMode', $data) ? $data['effectiveSyncMode'] : null, + syncStateConfirmed: array_key_exists('syncStateConfirmed', $data) ? $data['syncStateConfirmed'] : null ); } @@ -97,6 +127,12 @@ public function toArray(): array 'version' => static::serializeValue($this->version), 'uptime' => static::serializeValue($this->uptime), 'connections' => static::serializeValue($this->connections), + 'syncMode' => static::serializeValue($this->syncMode), + 'effectiveSyncMode' => static::serializeValue($this->effectiveSyncMode), + 'syncDegraded' => static::serializeValue($this->syncDegraded), + 'syncAcknowledgements' => static::serializeValue($this->syncAcknowledgements), + 'syncStandbyCount' => static::serializeValue($this->syncStandbyCount), + 'syncStateConfirmed' => static::serializeValue($this->syncStateConfirmed), 'replicas' => static::serializeValue($this->replicas), 'volumes' => static::serializeValue($this->volumes) ]; diff --git a/src/Appwrite/Models/DatabaseStatusConnections.php b/src/Appwrite/Models/DatabaseStatusConnections.php index b1917238..da68a5b2 100644 --- a/src/Appwrite/Models/DatabaseStatusConnections.php +++ b/src/Appwrite/Models/DatabaseStatusConnections.php @@ -13,7 +13,7 @@ * DatabaseStatusConnections constructor. * * @param int $current current number of active connections. - * @param int $max maximum allowed connections. + * @param int $max the engine's own max_connections. on a pooled database this is the backend limit the pooler multiplexes onto, not the ceiling a client pool may reach — that is networkmaxconnections on the database resource. */ public function __construct( public int $current, diff --git a/src/Appwrite/Models/DatabaseStatusReplica.php b/src/Appwrite/Models/DatabaseStatusReplica.php index acf6559c..8c00b586 100644 --- a/src/Appwrite/Models/DatabaseStatusReplica.php +++ b/src/Appwrite/Models/DatabaseStatusReplica.php @@ -12,8 +12,8 @@ /** * DatabaseStatusReplica constructor. * - * @param int $index statefulset pod index (0 = primary, 1+ = replicas). - * @param string $role replica role: primary or replica. + * @param int $index member index within the database. read `role` for which member accepts writes: a failover moves the primary without renumbering the indexes. + * @param string $role member role. possible values: primary (accepts reads and writes), replica (read-only follower), unknown (placement not established; reported while a transition is moving or restarting the topology, so no member can be named the write target). * @param bool $healthy whether the replica is healthy. * @param float|null $lagSeconds replication lag in seconds (null for primary). */ diff --git a/src/Appwrite/Models/DedicatedDatabase.php b/src/Appwrite/Models/DedicatedDatabase.php index 963e95fa..ce4706f6 100644 --- a/src/Appwrite/Models/DedicatedDatabase.php +++ b/src/Appwrite/Models/DedicatedDatabase.php @@ -18,12 +18,12 @@ * @param string $projectId project id that owns this database. * @param string $name database display name. * @param string $api product api that owns this database: tablesdb, documentsdb, vectorsdb, mysql, postgresql, or mongodb. - * @param string $engine database engine: postgresql, mysql, mariadb, or mongodb. + * @param string $engine database engine: postgresql, mysql, or mongodb. null until the backing reports one. * @param string $version database engine version. * @param string $specification specification identifier. * @param string $backend database backend provider. possible values: prisma, edge. * @param string $hostname database hostname for connections. - * @param int $connectionPort database port for connections. + * @param int $connectionPort database port for connections. derived from the engine when the backing has not reported one yet. * @param string $connectionUser database username for connections. * @param string $connectionPassword database password for connections. * @param string $connectionString full database connection string (uri format). @@ -40,8 +40,7 @@ * @param string $nodePool kubernetes node pool where the database is scheduled. * @param int $replicas number of high availability replicas. high availability is enabled when greater than 0. * @param string $syncMode replication sync mode: async, sync, or quorum. - * @param int $crossRegionReplicas number of cross-region replicas. cross-region availability is enabled when greater than 0. - * @param int $networkMaxConnections maximum concurrent connections. + * @param int $networkMaxConnections maximum concurrent client connections. this is the limit a client pool may reach; the engine's own max_connections reported by the status endpoint is a smaller backend limit the pooler multiplexes onto and does not constrain a client pool. * @param int $networkIdleTimeoutSeconds connection idle timeout in seconds. * @param array $networkIPAllowlist ip addresses/cidr ranges allowed to connect. * @param bool $backupEnabled whether automatic backups are enabled. @@ -91,7 +90,6 @@ public function __construct( public string $nodePool, public int $replicas, public string $syncMode, - public int $crossRegionReplicas, public int $networkMaxConnections, public int $networkIdleTimeoutSeconds, public array $networkIPAllowlist, @@ -204,9 +202,6 @@ public static function from(array $data): static if (!array_key_exists('syncMode', $data)) { throw new \InvalidArgumentException('Missing required field "syncMode" for ' . static::class . '.'); } - if (!array_key_exists('crossRegionReplicas', $data)) { - throw new \InvalidArgumentException('Missing required field "crossRegionReplicas" for ' . static::class . '.'); - } if (!array_key_exists('networkMaxConnections', $data)) { throw new \InvalidArgumentException('Missing required field "networkMaxConnections" for ' . static::class . '.'); } @@ -291,7 +286,6 @@ public static function from(array $data): static nodePool: $data['nodePool'], replicas: $data['replicas'], syncMode: $data['syncMode'], - crossRegionReplicas: $data['crossRegionReplicas'], networkMaxConnections: $data['networkMaxConnections'], networkIdleTimeoutSeconds: $data['networkIdleTimeoutSeconds'], networkIPAllowlist: $data['networkIPAllowlist'], @@ -351,7 +345,6 @@ public function toArray(): array 'nodePool' => static::serializeValue($this->nodePool), 'replicas' => static::serializeValue($this->replicas), 'syncMode' => static::serializeValue($this->syncMode), - 'crossRegionReplicas' => static::serializeValue($this->crossRegionReplicas), 'networkMaxConnections' => static::serializeValue($this->networkMaxConnections), 'networkIdleTimeoutSeconds' => static::serializeValue($this->networkIdleTimeoutSeconds), 'networkIPAllowlist' => static::serializeValue($this->networkIPAllowlist), diff --git a/src/Appwrite/Models/DedicatedDatabaseMember.php b/src/Appwrite/Models/DedicatedDatabaseMember.php index ba44af70..fb6dec1d 100644 --- a/src/Appwrite/Models/DedicatedDatabaseMember.php +++ b/src/Appwrite/Models/DedicatedDatabaseMember.php @@ -13,15 +13,15 @@ * DedicatedDatabaseMember constructor. * * @param string $id member identifier. - * @param string $role member role. possible values: primary (accepts reads and writes), replica (read-only follower). - * @param string $status member pod status. possible values: provisioning (pod missing or pending), starting (running but not ready), active (running and ready), failed (failed phase or crashloopbackoff container), or the lowercased pod phase reported by the cluster. - * @param float $lagSeconds replication lag in seconds. + * @param string $role member role. possible values: primary (accepts reads and writes), replica (read-only follower), unknown (placement not established; reported while a transition is moving or restarting the topology and this member has not been probed, so no member can be named the write target). + * @param string $status member pod status. possible values: pending (configured but absent from the backend topology, so nothing is bringing it up), provisioning (pod missing or pending), starting (running but not ready), active (running and ready), failed (failed phase or crashloopbackoff container), or the lowercased pod phase reported by the cluster. + * @param float|null $lagSeconds replication lag in seconds. null when the lag is not known: a primary has none to report, and a member the backend has not probed has none yet. */ public function __construct( public string $id, public string $role, public string $status, - public float $lagSeconds + public ?float $lagSeconds = null ) { } @@ -39,15 +39,12 @@ public static function from(array $data): static if (!array_key_exists('status', $data)) { throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); } - if (!array_key_exists('lagSeconds', $data)) { - throw new \InvalidArgumentException('Missing required field "lagSeconds" for ' . static::class . '.'); - } return new static( id: $data['$id'], role: $data['role'], status: $data['status'], - lagSeconds: $data['lagSeconds'] + lagSeconds: array_key_exists('lagSeconds', $data) ? $data['lagSeconds'] : null ); } diff --git a/src/Appwrite/Models/DedicatedDatabaseOperation.php b/src/Appwrite/Models/DedicatedDatabaseOperation.php new file mode 100644 index 00000000..628b96a7 --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseOperation.php @@ -0,0 +1,108 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('databaseId', $data)) { + throw new \InvalidArgumentException('Missing required field "databaseId" for ' . static::class . '.'); + } + if (!array_key_exists('type', $data)) { + throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); + } + if (!array_key_exists('status', $data)) { + throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); + } + if (!array_key_exists('attempts', $data)) { + throw new \InvalidArgumentException('Missing required field "attempts" for ' . static::class . '.'); + } + if (!array_key_exists('errorCode', $data)) { + throw new \InvalidArgumentException('Missing required field "errorCode" for ' . static::class . '.'); + } + if (!array_key_exists('errorMessage', $data)) { + throw new \InvalidArgumentException('Missing required field "errorMessage" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + databaseId: $data['databaseId'], + type: $data['type'], + status: $data['status'], + attempts: $data['attempts'], + errorCode: $data['errorCode'], + errorMessage: $data['errorMessage'], + requestedAt: array_key_exists('requestedAt', $data) ? $data['requestedAt'] : null, + startedAt: array_key_exists('startedAt', $data) ? $data['startedAt'] : null, + completedAt: array_key_exists('completedAt', $data) ? $data['completedAt'] : null + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + 'databaseId' => static::serializeValue($this->databaseId), + 'type' => static::serializeValue($this->type), + 'status' => static::serializeValue($this->status), + 'attempts' => static::serializeValue($this->attempts), + 'requestedAt' => static::serializeValue($this->requestedAt), + 'startedAt' => static::serializeValue($this->startedAt), + 'completedAt' => static::serializeValue($this->completedAt), + 'errorCode' => static::serializeValue($this->errorCode), + 'errorMessage' => static::serializeValue($this->errorMessage) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseOperationList.php b/src/Appwrite/Models/DedicatedDatabaseOperationList.php new file mode 100644 index 00000000..0ee0c79d --- /dev/null +++ b/src/Appwrite/Models/DedicatedDatabaseOperationList.php @@ -0,0 +1,59 @@ + $operations list of operations. + */ + public function __construct( + public int $total, + public array $operations + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('operations', $data)) { + throw new \InvalidArgumentException('Missing required field "operations" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + operations: is_array($data['operations']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(DedicatedDatabaseOperation::class, $item), + $data['operations'] + ) + : $data['operations'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'operations' => static::serializeValue($this->operations) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/DedicatedDatabaseReplicas.php b/src/Appwrite/Models/DedicatedDatabaseReplicas.php index 37a760d2..f3728359 100644 --- a/src/Appwrite/Models/DedicatedDatabaseReplicas.php +++ b/src/Appwrite/Models/DedicatedDatabaseReplicas.php @@ -13,13 +13,23 @@ * DedicatedDatabaseReplicas constructor. * * @param int $replicas number of configured replicas. zero means high availability is disabled. - * @param string $syncMode replication sync mode. possible values: async (asynchronous, fastest), sync (synchronous, strong consistency), quorum (quorum-based, majority of replicas must confirm). + * @param string $syncMode requested replication sync mode. possible values: async (asynchronous, fastest), sync (synchronous, strong consistency), quorum (quorum-based, majority of replicas must confirm). this is what was asked for; compare it with effectivesyncmode for what the primary is enforcing. + * @param bool $syncDegraded whether the enforced replication is weaker than the requested syncmode. + * @param int $syncAcknowledgements number of standby acknowledgements the primary waits for before a write is committed. zero means writes are acknowledged locally. + * @param int $syncStandbyCount number of standbys registered with the primary for synchronous replication. * @param list $members per-pod statuses for the primary and every replica. + * @param string|null $effectiveSyncMode replication sync mode the primary is actually enforcing. null when high availability is disabled or the state could not be read. a value below the requested syncmode means writes are being acknowledged with weaker durability than configured. + * @param bool|null $syncStateConfirmed whether the other sync fields are an engine reading rather than a recorded estimate. true when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. false when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. false never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. */ public function __construct( public int $replicas, public string $syncMode, - public array $members + public bool $syncDegraded, + public int $syncAcknowledgements, + public int $syncStandbyCount, + public array $members, + public ?string $effectiveSyncMode = null, + public ?bool $syncStateConfirmed = null ) { } @@ -34,6 +44,15 @@ public static function from(array $data): static if (!array_key_exists('syncMode', $data)) { throw new \InvalidArgumentException('Missing required field "syncMode" for ' . static::class . '.'); } + if (!array_key_exists('syncDegraded', $data)) { + throw new \InvalidArgumentException('Missing required field "syncDegraded" for ' . static::class . '.'); + } + if (!array_key_exists('syncAcknowledgements', $data)) { + throw new \InvalidArgumentException('Missing required field "syncAcknowledgements" for ' . static::class . '.'); + } + if (!array_key_exists('syncStandbyCount', $data)) { + throw new \InvalidArgumentException('Missing required field "syncStandbyCount" for ' . static::class . '.'); + } if (!array_key_exists('members', $data)) { throw new \InvalidArgumentException('Missing required field "members" for ' . static::class . '.'); } @@ -41,12 +60,17 @@ public static function from(array $data): static return new static( replicas: $data['replicas'], syncMode: $data['syncMode'], + syncDegraded: $data['syncDegraded'], + syncAcknowledgements: $data['syncAcknowledgements'], + syncStandbyCount: $data['syncStandbyCount'], members: is_array($data['members']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(DedicatedDatabaseMember::class, $item), $data['members'] ) - : $data['members'] + : $data['members'], + effectiveSyncMode: array_key_exists('effectiveSyncMode', $data) ? $data['effectiveSyncMode'] : null, + syncStateConfirmed: array_key_exists('syncStateConfirmed', $data) ? $data['syncStateConfirmed'] : null ); } @@ -58,6 +82,11 @@ public function toArray(): array $result = [ 'replicas' => static::serializeValue($this->replicas), 'syncMode' => static::serializeValue($this->syncMode), + 'effectiveSyncMode' => static::serializeValue($this->effectiveSyncMode), + 'syncDegraded' => static::serializeValue($this->syncDegraded), + 'syncAcknowledgements' => static::serializeValue($this->syncAcknowledgements), + 'syncStandbyCount' => static::serializeValue($this->syncStandbyCount), + 'syncStateConfirmed' => static::serializeValue($this->syncStateConfirmed), 'members' => static::serializeValue($this->members) ]; diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php index 37a3b4c2..815757e2 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php @@ -15,14 +15,12 @@ * @param float $storageOverageRate price per gb of storage above the included amount, per month, in usd. * @param float $bandwidthOverageRate price per gb of bandwidth above the included amount, per month, in usd. * @param float $replicaRate high availability replica price as a fraction of the specification cost. - * @param float $crossRegionReplicaRate cross-region replica price as a fraction of the specification cost. * @param float $pitrRate point-in-time recovery price as a fraction of the specification cost. */ public function __construct( public float $storageOverageRate, public float $bandwidthOverageRate, public float $replicaRate, - public float $crossRegionReplicaRate, public float $pitrRate ) { } @@ -41,9 +39,6 @@ public static function from(array $data): static if (!array_key_exists('replicaRate', $data)) { throw new \InvalidArgumentException('Missing required field "replicaRate" for ' . static::class . '.'); } - if (!array_key_exists('crossRegionReplicaRate', $data)) { - throw new \InvalidArgumentException('Missing required field "crossRegionReplicaRate" for ' . static::class . '.'); - } if (!array_key_exists('pitrRate', $data)) { throw new \InvalidArgumentException('Missing required field "pitrRate" for ' . static::class . '.'); } @@ -52,7 +47,6 @@ public static function from(array $data): static storageOverageRate: $data['storageOverageRate'], bandwidthOverageRate: $data['bandwidthOverageRate'], replicaRate: $data['replicaRate'], - crossRegionReplicaRate: $data['crossRegionReplicaRate'], pitrRate: $data['pitrRate'] ); } @@ -66,7 +60,6 @@ public function toArray(): array 'storageOverageRate' => static::serializeValue($this->storageOverageRate), 'bandwidthOverageRate' => static::serializeValue($this->bandwidthOverageRate), 'replicaRate' => static::serializeValue($this->replicaRate), - 'crossRegionReplicaRate' => static::serializeValue($this->crossRegionReplicaRate), 'pitrRate' => static::serializeValue($this->pitrRate) ]; diff --git a/src/Appwrite/Models/Embedding.php b/src/Appwrite/Models/Embedding.php new file mode 100644 index 00000000..c38c4787 --- /dev/null +++ b/src/Appwrite/Models/Embedding.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('model', $data)) { + throw new \InvalidArgumentException('Missing required field "model" for ' . static::class . '.'); + } + if (!array_key_exists('dimension', $data)) { + throw new \InvalidArgumentException('Missing required field "dimension" for ' . static::class . '.'); + } + if (!array_key_exists('embedding', $data)) { + throw new \InvalidArgumentException('Missing required field "embedding" for ' . static::class . '.'); + } + if (!array_key_exists('error', $data)) { + throw new \InvalidArgumentException('Missing required field "error" for ' . static::class . '.'); + } + + return new static( + model: $data['model'], + dimension: $data['dimension'], + embedding: $data['embedding'], + error: $data['error'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'model' => static::serializeValue($this->model), + 'dimension' => static::serializeValue($this->dimension), + 'embedding' => static::serializeValue($this->embedding), + 'error' => static::serializeValue($this->error) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/EmbeddingList.php b/src/Appwrite/Models/EmbeddingList.php new file mode 100644 index 00000000..d666e5d5 --- /dev/null +++ b/src/Appwrite/Models/EmbeddingList.php @@ -0,0 +1,59 @@ + $embeddings list of embeddings. + */ + public function __construct( + public int $total, + public array $embeddings + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('embeddings', $data)) { + throw new \InvalidArgumentException('Missing required field "embeddings" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + embeddings: is_array($data['embeddings']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Embedding::class, $item), + $data['embeddings'] + ) + : $data['embeddings'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'embeddings' => static::serializeValue($this->embeddings) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/File.php b/src/Appwrite/Models/File.php index 0853e506..4ce7c537 100644 --- a/src/Appwrite/Models/File.php +++ b/src/Appwrite/Models/File.php @@ -18,6 +18,8 @@ * @param string $updatedAt file update date in iso 8601 format. * @param array $permissions file permissions. [learn more about permissions](https://appwrite.io/docs/permissions). * @param string $name file name. + * @param string $folder virtual folder containing the file, with a trailing slash. empty for the bucket root. + * @param string $key full virtual path of the file: the folder followed by the file name. * @param string $signature file md5 signature. * @param string $mimeType file mime type. * @param int $sizeOriginal file original size in bytes. @@ -34,6 +36,8 @@ public function __construct( public string $updatedAt, public array $permissions, public string $name, + public string $folder, + public string $key, public string $signature, public string $mimeType, public int $sizeOriginal, @@ -68,6 +72,12 @@ public static function from(array $data): static if (!array_key_exists('name', $data)) { throw new \InvalidArgumentException('Missing required field "name" for ' . static::class . '.'); } + if (!array_key_exists('folder', $data)) { + throw new \InvalidArgumentException('Missing required field "folder" for ' . static::class . '.'); + } + if (!array_key_exists('key', $data)) { + throw new \InvalidArgumentException('Missing required field "key" for ' . static::class . '.'); + } if (!array_key_exists('signature', $data)) { throw new \InvalidArgumentException('Missing required field "signature" for ' . static::class . '.'); } @@ -100,6 +110,8 @@ public static function from(array $data): static updatedAt: $data['$updatedAt'], permissions: $data['$permissions'], name: $data['name'], + folder: $data['folder'], + key: $data['key'], signature: $data['signature'], mimeType: $data['mimeType'], sizeOriginal: $data['sizeOriginal'], @@ -123,6 +135,8 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), '$permissions' => static::serializeValue($this->permissions), 'name' => static::serializeValue($this->name), + 'folder' => static::serializeValue($this->folder), + 'key' => static::serializeValue($this->key), 'signature' => static::serializeValue($this->signature), 'mimeType' => static::serializeValue($this->mimeType), 'sizeOriginal' => static::serializeValue($this->sizeOriginal), diff --git a/src/Appwrite/Models/MfaChallengeSecret.php b/src/Appwrite/Models/MfaChallengeSecret.php new file mode 100644 index 00000000..579080ae --- /dev/null +++ b/src/Appwrite/Models/MfaChallengeSecret.php @@ -0,0 +1,75 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('$createdAt', $data)) { + throw new \InvalidArgumentException('Missing required field "$createdAt" for ' . static::class . '.'); + } + if (!array_key_exists('userId', $data)) { + throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + } + if (!array_key_exists('expire', $data)) { + throw new \InvalidArgumentException('Missing required field "expire" for ' . static::class . '.'); + } + if (!array_key_exists('code', $data)) { + throw new \InvalidArgumentException('Missing required field "code" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + createdAt: $data['$createdAt'], + userId: $data['userId'], + expire: $data['expire'], + code: $data['code'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + '$createdAt' => static::serializeValue($this->createdAt), + 'userId' => static::serializeValue($this->userId), + 'expire' => static::serializeValue($this->expire), + 'code' => static::serializeValue($this->code) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/MfaFactors.php b/src/Appwrite/Models/MfaFactors.php index bdfd41a7..eca5d042 100644 --- a/src/Appwrite/Models/MfaFactors.php +++ b/src/Appwrite/Models/MfaFactors.php @@ -16,12 +16,14 @@ * @param bool $phone can phone (sms) be used for mfa challenge for this account. * @param bool $email can email be used for mfa challenge for this account. * @param bool $recoveryCode can recovery code be used for mfa challenge for this account. + * @param bool $custom can custom factor be used for mfa challenge for this account. */ public function __construct( public bool $totp, public bool $phone, public bool $email, - public bool $recoveryCode + public bool $recoveryCode, + public bool $custom ) { } @@ -42,12 +44,16 @@ public static function from(array $data): static if (!array_key_exists('recoveryCode', $data)) { throw new \InvalidArgumentException('Missing required field "recoveryCode" for ' . static::class . '.'); } + if (!array_key_exists('custom', $data)) { + throw new \InvalidArgumentException('Missing required field "custom" for ' . static::class . '.'); + } return new static( totp: $data['totp'], phone: $data['phone'], email: $data['email'], - recoveryCode: $data['recoveryCode'] + recoveryCode: $data['recoveryCode'], + custom: $data['custom'] ); } @@ -60,7 +66,8 @@ public function toArray(): array 'totp' => static::serializeValue($this->totp), 'phone' => static::serializeValue($this->phone), 'email' => static::serializeValue($this->email), - 'recoveryCode' => static::serializeValue($this->recoveryCode) + 'recoveryCode' => static::serializeValue($this->recoveryCode), + 'custom' => static::serializeValue($this->custom) ]; return $result; diff --git a/src/Appwrite/Models/Organization.php b/src/Appwrite/Models/Organization.php index 8842b34f..5eeef10d 100644 --- a/src/Appwrite/Models/Organization.php +++ b/src/Appwrite/Models/Organization.php @@ -18,7 +18,6 @@ * @param string $name team name. * @param int $total total number of team members. * @param Preferences $prefs team preferences as a key-value object - * @param int $billingBudget project budget limit * @param array $budgetAlerts project budget limit * @param string $billingPlan organization's billing plan id. * @param string $billingPlanId organization's billing plan id. @@ -27,26 +26,27 @@ * @param string $billingStartDate billing cycle start date. * @param string $billingCurrentInvoiceDate current invoice cycle start date. * @param string $billingNextInvoiceDate next invoice cycle start date. - * @param string $billingTrialStartDate start date of trial. * @param int $billingTrialDays number of trial days. * @param string $billingAggregationId current active aggregation id. * @param string $billingInvoiceId current active aggregation id. * @param string $paymentMethodId default payment method. - * @param string $billingAddressId default payment method. - * @param string $backupPaymentMethodId backup payment method. * @param string $status team status. - * @param string $remarks remarks on team status. - * @param string $agreementBAA organization agreements - * @param string $programManagerName program manager's name. - * @param string $programManagerCalendar program manager's calendar link. - * @param string $programDiscordChannelName program's discord channel name. - * @param string $programDiscordChannelUrl program's discord channel url. - * @param string $billingPlanDowngrade billing plan selected for downgrade. - * @param string $billingTaxId tax id * @param bool $markedForDeletion marked for deletion * @param string $platform product with which the organization is associated (appwrite or imagine) * @param array $projects selected projects + * @param int|null $billingBudget project budget limit. null when no budget is set. + * @param string|null $billingTrialStartDate start date of trial. + * @param string|null $billingAddressId default payment method. + * @param string|null $backupPaymentMethodId backup payment method. + * @param string|null $remarks remarks on team status. + * @param string|null $agreementBAA organization agreements + * @param string|null $programManagerName program manager's name. + * @param string|null $programManagerCalendar program manager's calendar link. + * @param string|null $programDiscordChannelName program's discord channel name. + * @param string|null $programDiscordChannelUrl program's discord channel url. * @param BillingLimits|null $billingLimits billing limits reached + * @param string|null $billingPlanDowngrade billing plan selected for downgrade. + * @param string|null $billingTaxId tax id */ public function __construct( public string $id, @@ -55,7 +55,6 @@ public function __construct( public string $name, public int $total, public Preferences $prefs, - public int $billingBudget, public array $budgetAlerts, public string $billingPlan, public string $billingPlanId, @@ -64,26 +63,27 @@ public function __construct( public string $billingStartDate, public string $billingCurrentInvoiceDate, public string $billingNextInvoiceDate, - public string $billingTrialStartDate, public int $billingTrialDays, public string $billingAggregationId, public string $billingInvoiceId, public string $paymentMethodId, - public string $billingAddressId, - public string $backupPaymentMethodId, public string $status, - public string $remarks, - public string $agreementBAA, - public string $programManagerName, - public string $programManagerCalendar, - public string $programDiscordChannelName, - public string $programDiscordChannelUrl, - public string $billingPlanDowngrade, - public string $billingTaxId, public bool $markedForDeletion, public string $platform, public array $projects, - public ?BillingLimits $billingLimits = null + public ?int $billingBudget = null, + public ?string $billingTrialStartDate = null, + public ?string $billingAddressId = null, + public ?string $backupPaymentMethodId = null, + public ?string $remarks = null, + public ?string $agreementBAA = null, + public ?string $programManagerName = null, + public ?string $programManagerCalendar = null, + public ?string $programDiscordChannelName = null, + public ?string $programDiscordChannelUrl = null, + public ?BillingLimits $billingLimits = null, + public ?string $billingPlanDowngrade = null, + public ?string $billingTaxId = null ) { } @@ -110,9 +110,6 @@ public static function from(array $data): static if (!array_key_exists('prefs', $data)) { throw new \InvalidArgumentException('Missing required field "prefs" for ' . static::class . '.'); } - if (!array_key_exists('billingBudget', $data)) { - throw new \InvalidArgumentException('Missing required field "billingBudget" for ' . static::class . '.'); - } if (!array_key_exists('budgetAlerts', $data)) { throw new \InvalidArgumentException('Missing required field "budgetAlerts" for ' . static::class . '.'); } @@ -137,9 +134,6 @@ public static function from(array $data): static if (!array_key_exists('billingNextInvoiceDate', $data)) { throw new \InvalidArgumentException('Missing required field "billingNextInvoiceDate" for ' . static::class . '.'); } - if (!array_key_exists('billingTrialStartDate', $data)) { - throw new \InvalidArgumentException('Missing required field "billingTrialStartDate" for ' . static::class . '.'); - } if (!array_key_exists('billingTrialDays', $data)) { throw new \InvalidArgumentException('Missing required field "billingTrialDays" for ' . static::class . '.'); } @@ -152,39 +146,9 @@ public static function from(array $data): static if (!array_key_exists('paymentMethodId', $data)) { throw new \InvalidArgumentException('Missing required field "paymentMethodId" for ' . static::class . '.'); } - if (!array_key_exists('billingAddressId', $data)) { - throw new \InvalidArgumentException('Missing required field "billingAddressId" for ' . static::class . '.'); - } - if (!array_key_exists('backupPaymentMethodId', $data)) { - throw new \InvalidArgumentException('Missing required field "backupPaymentMethodId" for ' . static::class . '.'); - } if (!array_key_exists('status', $data)) { throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); } - if (!array_key_exists('remarks', $data)) { - throw new \InvalidArgumentException('Missing required field "remarks" for ' . static::class . '.'); - } - if (!array_key_exists('agreementBAA', $data)) { - throw new \InvalidArgumentException('Missing required field "agreementBAA" for ' . static::class . '.'); - } - if (!array_key_exists('programManagerName', $data)) { - throw new \InvalidArgumentException('Missing required field "programManagerName" for ' . static::class . '.'); - } - if (!array_key_exists('programManagerCalendar', $data)) { - throw new \InvalidArgumentException('Missing required field "programManagerCalendar" for ' . static::class . '.'); - } - if (!array_key_exists('programDiscordChannelName', $data)) { - throw new \InvalidArgumentException('Missing required field "programDiscordChannelName" for ' . static::class . '.'); - } - if (!array_key_exists('programDiscordChannelUrl', $data)) { - throw new \InvalidArgumentException('Missing required field "programDiscordChannelUrl" for ' . static::class . '.'); - } - if (!array_key_exists('billingPlanDowngrade', $data)) { - throw new \InvalidArgumentException('Missing required field "billingPlanDowngrade" for ' . static::class . '.'); - } - if (!array_key_exists('billingTaxId', $data)) { - throw new \InvalidArgumentException('Missing required field "billingTaxId" for ' . static::class . '.'); - } if (!array_key_exists('markedForDeletion', $data)) { throw new \InvalidArgumentException('Missing required field "markedForDeletion" for ' . static::class . '.'); } @@ -202,7 +166,6 @@ public static function from(array $data): static name: $data['name'], total: $data['total'], prefs: static::hydrateTypedValue(Preferences::class, $data['prefs']), - billingBudget: $data['billingBudget'], budgetAlerts: $data['budgetAlerts'], billingPlan: $data['billingPlan'], billingPlanId: $data['billingPlanId'], @@ -211,26 +174,27 @@ public static function from(array $data): static billingStartDate: $data['billingStartDate'], billingCurrentInvoiceDate: $data['billingCurrentInvoiceDate'], billingNextInvoiceDate: $data['billingNextInvoiceDate'], - billingTrialStartDate: $data['billingTrialStartDate'], billingTrialDays: $data['billingTrialDays'], billingAggregationId: $data['billingAggregationId'], billingInvoiceId: $data['billingInvoiceId'], paymentMethodId: $data['paymentMethodId'], - billingAddressId: $data['billingAddressId'], - backupPaymentMethodId: $data['backupPaymentMethodId'], status: $data['status'], - remarks: $data['remarks'], - agreementBAA: $data['agreementBAA'], - programManagerName: $data['programManagerName'], - programManagerCalendar: $data['programManagerCalendar'], - programDiscordChannelName: $data['programDiscordChannelName'], - programDiscordChannelUrl: $data['programDiscordChannelUrl'], - billingPlanDowngrade: $data['billingPlanDowngrade'], - billingTaxId: $data['billingTaxId'], markedForDeletion: $data['markedForDeletion'], platform: $data['platform'], projects: $data['projects'], - billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null + billingBudget: array_key_exists('billingBudget', $data) ? $data['billingBudget'] : null, + billingTrialStartDate: array_key_exists('billingTrialStartDate', $data) ? $data['billingTrialStartDate'] : null, + billingAddressId: array_key_exists('billingAddressId', $data) ? $data['billingAddressId'] : null, + backupPaymentMethodId: array_key_exists('backupPaymentMethodId', $data) ? $data['backupPaymentMethodId'] : null, + remarks: array_key_exists('remarks', $data) ? $data['remarks'] : null, + agreementBAA: array_key_exists('agreementBAA', $data) ? $data['agreementBAA'] : null, + programManagerName: array_key_exists('programManagerName', $data) ? $data['programManagerName'] : null, + programManagerCalendar: array_key_exists('programManagerCalendar', $data) ? $data['programManagerCalendar'] : null, + programDiscordChannelName: array_key_exists('programDiscordChannelName', $data) ? $data['programDiscordChannelName'] : null, + programDiscordChannelUrl: array_key_exists('programDiscordChannelUrl', $data) ? $data['programDiscordChannelUrl'] : null, + billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null, + billingPlanDowngrade: array_key_exists('billingPlanDowngrade', $data) ? $data['billingPlanDowngrade'] : null, + billingTaxId: array_key_exists('billingTaxId', $data) ? $data['billingTaxId'] : null ); } diff --git a/src/Appwrite/Models/PolicyMfaFactors.php b/src/Appwrite/Models/PolicyMfaFactors.php new file mode 100644 index 00000000..89b49271 --- /dev/null +++ b/src/Appwrite/Models/PolicyMfaFactors.php @@ -0,0 +1,75 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('totp', $data)) { + throw new \InvalidArgumentException('Missing required field "totp" for ' . static::class . '.'); + } + if (!array_key_exists('email', $data)) { + throw new \InvalidArgumentException('Missing required field "email" for ' . static::class . '.'); + } + if (!array_key_exists('phone', $data)) { + throw new \InvalidArgumentException('Missing required field "phone" for ' . static::class . '.'); + } + if (!array_key_exists('custom', $data)) { + throw new \InvalidArgumentException('Missing required field "custom" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + totp: $data['totp'], + email: $data['email'], + phone: $data['phone'], + custom: $data['custom'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'totp' => static::serializeValue($this->totp), + 'email' => static::serializeValue($this->email), + 'phone' => static::serializeValue($this->phone), + 'custom' => static::serializeValue($this->custom) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index f9013ca9..c63ab5bb 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -45,6 +45,7 @@ * @param string|null $oAuth2ServerAuthorizationUrl oauth2 server authorization url * @param array|null $oAuth2ServerScopes oauth2 server allowed scopes * @param array|null $oAuth2ServerDefaultScopes oauth2 server scopes used when an authorization request omits the scope parameter + * @param array|null $oAuth2ServerInstallationScopes scopes an application may request when installed on a team * @param array|null $oAuth2ServerAuthorizationDetailsTypes oauth2 server accepted rfc 9396 authorization_details types * @param int|null $oAuth2ServerAccessTokenDuration oauth2 server access token duration in seconds for confidential clients * @param int|null $oAuth2ServerRefreshTokenDuration oauth2 server refresh token duration in seconds for confidential clients @@ -92,6 +93,7 @@ public function __construct( public ?string $oAuth2ServerAuthorizationUrl = null, public ?array $oAuth2ServerScopes = null, public ?array $oAuth2ServerDefaultScopes = null, + public ?array $oAuth2ServerInstallationScopes = null, public ?array $oAuth2ServerAuthorizationDetailsTypes = null, public ?int $oAuth2ServerAccessTokenDuration = null, public ?int $oAuth2ServerRefreshTokenDuration = null, @@ -256,6 +258,7 @@ public static function from(array $data): static oAuth2ServerAuthorizationUrl: array_key_exists('oAuth2ServerAuthorizationUrl', $data) ? $data['oAuth2ServerAuthorizationUrl'] : null, oAuth2ServerScopes: array_key_exists('oAuth2ServerScopes', $data) ? $data['oAuth2ServerScopes'] : null, oAuth2ServerDefaultScopes: array_key_exists('oAuth2ServerDefaultScopes', $data) ? $data['oAuth2ServerDefaultScopes'] : null, + oAuth2ServerInstallationScopes: array_key_exists('oAuth2ServerInstallationScopes', $data) ? $data['oAuth2ServerInstallationScopes'] : null, oAuth2ServerAuthorizationDetailsTypes: array_key_exists('oAuth2ServerAuthorizationDetailsTypes', $data) ? $data['oAuth2ServerAuthorizationDetailsTypes'] : null, oAuth2ServerAccessTokenDuration: array_key_exists('oAuth2ServerAccessTokenDuration', $data) ? $data['oAuth2ServerAccessTokenDuration'] : null, oAuth2ServerRefreshTokenDuration: array_key_exists('oAuth2ServerRefreshTokenDuration', $data) ? $data['oAuth2ServerRefreshTokenDuration'] : null, @@ -310,6 +313,7 @@ public function toArray(): array 'oAuth2ServerAuthorizationUrl' => static::serializeValue($this->oAuth2ServerAuthorizationUrl), 'oAuth2ServerScopes' => static::serializeValue($this->oAuth2ServerScopes), 'oAuth2ServerDefaultScopes' => static::serializeValue($this->oAuth2ServerDefaultScopes), + 'oAuth2ServerInstallationScopes' => static::serializeValue($this->oAuth2ServerInstallationScopes), 'oAuth2ServerAuthorizationDetailsTypes' => static::serializeValue($this->oAuth2ServerAuthorizationDetailsTypes), 'oAuth2ServerAccessTokenDuration' => static::serializeValue($this->oAuth2ServerAccessTokenDuration), 'oAuth2ServerRefreshTokenDuration' => static::serializeValue($this->oAuth2ServerRefreshTokenDuration), diff --git a/src/Appwrite/Models/ProxyInvalidation.php b/src/Appwrite/Models/ProxyInvalidation.php new file mode 100644 index 00000000..6b35dfeb --- /dev/null +++ b/src/Appwrite/Models/ProxyInvalidation.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('domain', $data)) { + throw new \InvalidArgumentException('Missing required field "domain" for ' . static::class . '.'); + } + if (!array_key_exists('type', $data)) { + throw new \InvalidArgumentException('Missing required field "type" for ' . static::class . '.'); + } + if (!array_key_exists('reference', $data)) { + throw new \InvalidArgumentException('Missing required field "reference" for ' . static::class . '.'); + } + if (!array_key_exists('status', $data)) { + throw new \InvalidArgumentException('Missing required field "status" for ' . static::class . '.'); + } + + return new static( + domain: $data['domain'], + type: $data['type'], + reference: $data['reference'], + status: $data['status'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'domain' => static::serializeValue($this->domain), + 'type' => static::serializeValue($this->type), + 'reference' => static::serializeValue($this->reference), + 'status' => static::serializeValue($this->status) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/UsageBillingPlan.php b/src/Appwrite/Models/UsageBillingPlan.php index 790e95f0..827e4d60 100644 --- a/src/Appwrite/Models/UsageBillingPlan.php +++ b/src/Appwrite/Models/UsageBillingPlan.php @@ -14,28 +14,28 @@ * * @param AdditionalResource $bandwidth bandwidth additional resources * @param AdditionalResource $executions executions additional resources - * @param AdditionalResource $member member additional resources * @param AdditionalResource $realtime realtime additional resources * @param AdditionalResource $realtimeMessages realtime messages additional resources - * @param AdditionalResource $realtimeBandwidth realtime bandwidth additional resources * @param AdditionalResource $storage storage additional resources * @param AdditionalResource $users user additional resources * @param AdditionalResource $gBHours gbhour additional resources * @param AdditionalResource $imageTransformations image transformation additional resources - * @param AdditionalResource $credits credits additional resources + * @param AdditionalResource|null $member member additional resources + * @param AdditionalResource|null $realtimeBandwidth realtime bandwidth additional resources + * @param AdditionalResource|null $credits credits additional resources */ public function __construct( public AdditionalResource $bandwidth, public AdditionalResource $executions, - public AdditionalResource $member, public AdditionalResource $realtime, public AdditionalResource $realtimeMessages, - public AdditionalResource $realtimeBandwidth, public AdditionalResource $storage, public AdditionalResource $users, public AdditionalResource $gBHours, public AdditionalResource $imageTransformations, - public AdditionalResource $credits + public ?AdditionalResource $member = null, + public ?AdditionalResource $realtimeBandwidth = null, + public ?AdditionalResource $credits = null ) { } @@ -50,18 +50,12 @@ public static function from(array $data): static if (!array_key_exists('executions', $data)) { throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.'); } - if (!array_key_exists('member', $data)) { - throw new \InvalidArgumentException('Missing required field "member" for ' . static::class . '.'); - } if (!array_key_exists('realtime', $data)) { throw new \InvalidArgumentException('Missing required field "realtime" for ' . static::class . '.'); } if (!array_key_exists('realtimeMessages', $data)) { throw new \InvalidArgumentException('Missing required field "realtimeMessages" for ' . static::class . '.'); } - if (!array_key_exists('realtimeBandwidth', $data)) { - throw new \InvalidArgumentException('Missing required field "realtimeBandwidth" for ' . static::class . '.'); - } if (!array_key_exists('storage', $data)) { throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.'); } @@ -74,22 +68,19 @@ public static function from(array $data): static if (!array_key_exists('imageTransformations', $data)) { throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.'); } - if (!array_key_exists('credits', $data)) { - throw new \InvalidArgumentException('Missing required field "credits" for ' . static::class . '.'); - } return new static( bandwidth: static::hydrateTypedValue(AdditionalResource::class, $data['bandwidth']), executions: static::hydrateTypedValue(AdditionalResource::class, $data['executions']), - member: static::hydrateTypedValue(AdditionalResource::class, $data['member']), realtime: static::hydrateTypedValue(AdditionalResource::class, $data['realtime']), realtimeMessages: static::hydrateTypedValue(AdditionalResource::class, $data['realtimeMessages']), - realtimeBandwidth: static::hydrateTypedValue(AdditionalResource::class, $data['realtimeBandwidth']), storage: static::hydrateTypedValue(AdditionalResource::class, $data['storage']), users: static::hydrateTypedValue(AdditionalResource::class, $data['users']), gBHours: static::hydrateTypedValue(AdditionalResource::class, $data['GBHours']), imageTransformations: static::hydrateTypedValue(AdditionalResource::class, $data['imageTransformations']), - credits: static::hydrateTypedValue(AdditionalResource::class, $data['credits']) + member: array_key_exists('member', $data) ? static::hydrateTypedValue(AdditionalResource::class, $data['member'], true) : null, + realtimeBandwidth: array_key_exists('realtimeBandwidth', $data) ? static::hydrateTypedValue(AdditionalResource::class, $data['realtimeBandwidth'], true) : null, + credits: array_key_exists('credits', $data) ? static::hydrateTypedValue(AdditionalResource::class, $data['credits'], true) : null ); } diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index 441e05da..fb80d415 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -477,51 +477,6 @@ public function deleteIdentity(string $identityId): string } - /** - * Use this endpoint to create a JSON Web Token. You can use the resulting JWT - * to authenticate on behalf of the current user when working with the - * Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes - * from its creation and will be invalid if the user will logout in that time - * frame. - * - * @param ?int $duration - * @throws AppwriteException - * @return \Appwrite\Models\Jwt - */ - public function createJWT(?int $duration = null): \Appwrite\Models\Jwt - { - $apiPath = str_replace( - [], - [], - '/account/jwts' - ); - - $apiParams = []; - - if (!is_null($duration)) { - $apiParams['duration'] = $duration; - } - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['content-type'] = 'application/json'; - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_POST, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\Jwt::from($response); - - } - /** * Get the list of latest security activity logs for the currently logged in * user. Each log returns user IP address, location and date and time of log. diff --git a/src/Appwrite/Services/Activities.php b/src/Appwrite/Services/Activities.php index 9111586a..925c4c23 100644 --- a/src/Appwrite/Services/Activities.php +++ b/src/Appwrite/Services/Activities.php @@ -17,11 +17,11 @@ public function __construct(Client $client) /** * List all events for selected filters. * - * @param ?string $queries + * @param ?array $queries * @throws AppwriteException * @return \Appwrite\Models\ActivityEventList */ - public function listEvents(?string $queries = null): \Appwrite\Models\ActivityEventList + public function listEvents(?array $queries = null): \Appwrite\Models\ActivityEventList { $apiPath = str_replace( [], diff --git a/src/Appwrite/Services/Apps.php b/src/Appwrite/Services/Apps.php index d0a9c896..69b47975 100644 --- a/src/Appwrite/Services/Apps.php +++ b/src/Appwrite/Services/Apps.php @@ -454,7 +454,8 @@ public function delete(string $appId): string /** * List installations of an application. Requires an app key sent in the - * `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller + * with update access to the app. * * @param string $appId * @param ?array $queries @@ -502,7 +503,8 @@ public function listInstallations(string $appId, ?array $queries = null, ?bool $ /** * Get an installation of an application by its unique ID. Requires an app key - * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, + * or a caller with update access to the app. * * @param string $appId * @param string $installationId @@ -540,14 +542,53 @@ public function getInstallation(string $appId, string $installationId): \Appwrit } + /** + * Delete an installation of an application by its unique ID. Requires a + * caller with update access to the app. Previously issued installation access + * tokens are revoked. + * + * @param string $appId + * @param string $installationId + * @throws AppwriteException + * @return string + */ + public function deleteInstallation(string $appId, string $installationId): string + { + $apiPath = str_replace( + ['{appId}', '{installationId}'], + [$appId, $installationId], + '/apps/{appId}/installations/{installationId}' + ); + + $apiParams = []; + $apiParams['appId'] = $appId; + $apiParams['installationId'] = $installationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + /** * Create a token for an installation of an application. Requires an app key - * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. - * The returned token carries the scopes and authorization details granted to - * the installation, and can be used as an `Authorization: Bearer` header - * everywhere OAuth2 access tokens are accepted. Multiple tokens can be active - * for the same installation at once; each token stays valid until it expires - * or the installation is updated or deleted. + * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, + * or a caller with update access to the app. The returned token carries the + * scopes and authorization details granted to the installation, and can be + * used as an `Authorization: Bearer` header everywhere OAuth2 access tokens + * are accepted. Multiple tokens can be active for the same installation at + * once; each token stays valid until it expires or the installation is + * updated or deleted. * * @param string $appId * @param string $installationId diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index 527176ed..ce513ff4 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -386,9 +386,10 @@ public function deletePolicy(string $policyId): string * Create and trigger a new restoration for a backup on a project. * * For a backup of one database, the restoration resolves its destination - * before it is queued. Pass `newResourceId` to restore into that database ID, - * including the archived database ID to overwrite it. When `newResourceId` is - * omitted, a new database ID is generated and returned in `options`. + * before it is queued. When `newResourceId` is omitted, the archived database + * is restored in place and its own ID is returned in `options`. Pass a + * different `newResourceId` to restore alongside it as a new database + * instead. * * The restoration migration records the archived database in `resourceId` and * `resourceType`, and the resolved database in `destinationResourceId` and @@ -405,9 +406,14 @@ public function deletePolicy(string $policyId): string * operational `resourceType` of a table migration is not rewritten to * `tablesdb`. * - * When restoring a DocumentsDB or VectorsDB database to a new resource from a - * dedicated source, the restore provisions a fresh dedicated backing database - * at the source database's own specification. + * When restoring a DocumentsDB or VectorsDB database from a dedicated source, + * the restore provisions a fresh dedicated backing database at the source + * database's own specification and lands the data there. An in-place restore + * swaps the database onto that backing only once the restore has succeeded, + * and retires the backing it displaced only once that swap is confirmed, so + * the source keeps serving its own data until the restored data is in place + * and any failure leaves it untouched. A serverless source has no dedicated + * backing to clone and restores onto the archived database instead. * * * @param string $archiveId diff --git a/src/Appwrite/Services/Embeddings.php b/src/Appwrite/Services/Embeddings.php new file mode 100644 index 00000000..f1f65d2c --- /dev/null +++ b/src/Appwrite/Services/Embeddings.php @@ -0,0 +1,63 @@ +client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\EmbeddingList::from($response); + + } +} diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index 8ba6055b..e398c92e 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -176,54 +176,6 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } - /** - * Create a new API key. It's recommended to have multiple API keys with - * strict scopes for separate functions within your project. - * - * You can also create an ephemeral API key if you need a short-lived key - * instead. - * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire - * @throws AppwriteException - * @return \Appwrite\Models\Key - */ - public function createKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key - { - $apiPath = str_replace( - [], - [], - '/project/keys' - ); - - $apiParams = []; - $apiParams['keyId'] = $keyId; - $apiParams['name'] = $name; - $apiParams['scopes'] = $scopes; - $apiParams['expire'] = $expire; - - $apiHeaders = []; - $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); - $apiHeaders['content-type'] = 'application/json'; - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_POST, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\Key::from($response); - - } - /** * Create a new ephemeral API key. It's recommended to have multiple API keys * with strict scopes for separate functions within your project. @@ -688,10 +640,11 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) * @param ?string $userCodeFormat * @param ?int $deviceCodeDuration * @param ?array $defaultScopes + * @param ?array $installationScopes * @throws AppwriteException * @return \Appwrite\Models\Project */ - public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?int $installationAccessTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null): \Appwrite\Models\Project + public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?int $installationAccessTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null, ?array $installationScopes = null): \Appwrite\Models\Project { $apiPath = str_replace( [], @@ -731,6 +684,10 @@ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?arr $apiParams['defaultScopes'] = $defaultScopes; } + if (!is_null($installationScopes)) { + $apiParams['installationScopes'] = $installationScopes; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; @@ -3633,6 +3590,66 @@ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userE } + /** + * Updating this policy allows you to control which factors users can use to + * complete an MFA challenge. Disabled factors cannot be used to create a + * challenge and are reported as unavailable when listing factors. The custom + * factor is disabled by default; enable it to deliver challenge codes through + * your own channel. Recovery codes always remain available as a fallback. + * + * @param ?bool $totp + * @param ?bool $email + * @param ?bool $phone + * @param ?bool $custom + * @throws AppwriteException + * @return \Appwrite\Models\Project + */ + public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, ?bool $phone = null, ?bool $custom = null): \Appwrite\Models\Project + { + $apiPath = str_replace( + [], + [], + '/project/policies/mfa-factors' + ); + + $apiParams = []; + + if (!is_null($totp)) { + $apiParams['totp'] = $totp; + } + + if (!is_null($email)) { + $apiParams['email'] = $email; + } + + if (!is_null($phone)) { + $apiParams['phone'] = $phone; + } + + if (!is_null($custom)) { + $apiParams['custom'] = $custom; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\Project::from($response); + + } + /** * Updating this policy allows you to control if new passwords are checked * against most common passwords dictionary. When enabled, and user changes @@ -3946,11 +3963,11 @@ public function updateSessionInvalidationPolicy(bool $enabled): \Appwrite\Models * Update the maximum number of sessions allowed per user. When the limit is * hit, the oldest session will be deleted to make room for new one. * - * @param ?int $total + * @param int $total * @throws AppwriteException * @return \Appwrite\Models\Project */ - public function updateSessionLimitPolicy(?int $total): \Appwrite\Models\Project + public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project { $apiPath = str_replace( [], @@ -4027,9 +4044,9 @@ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project * * @param ProjectPolicyId $policyId * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail + * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail */ - public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail + public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail { $apiPath = str_replace( ['{policyId}'], @@ -4095,6 +4112,10 @@ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPas return \Appwrite\Models\PolicyMembershipPrivacy::from($response); } + if (($response['$id'] ?? null) === 'mfa-factors') { + return \Appwrite\Models\PolicyMfaFactors::from($response); + } + if (($response['$id'] ?? null) === 'deny-aliased-email') { return \Appwrite\Models\PolicyDenyAliasedEmail::from($response); } diff --git a/src/Appwrite/Services/Proxy.php b/src/Appwrite/Services/Proxy.php index 074f7fa9..691efb29 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -6,6 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; +use Appwrite\Enums\InvalidationType; use Appwrite\Enums\StatusCode; use Appwrite\Enums\ProxyResourceType; @@ -16,6 +17,55 @@ public function __construct(Client $client) parent::__construct($client); } + /** + * Create a new CDN cache invalidation for a domain. Executes a hard purge of + * cached content. + * + * Depending on type, the invalidation purges a single cache tag, a single URL + * path, or all cached content for the domain. + * + * @param string $domain + * @param InvalidationType $type + * @param ?string $reference + * @throws AppwriteException + * @return \Appwrite\Models\ProxyInvalidation + */ + public function createInvalidation(string $domain, InvalidationType $type, ?string $reference = null): \Appwrite\Models\ProxyInvalidation + { + $apiPath = str_replace( + [], + [], + '/proxy/invalidations' + ); + + $apiParams = []; + $apiParams['domain'] = $domain; + $apiParams['type'] = $type; + + if (!is_null($reference)) { + $apiParams['reference'] = $reference; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\ProxyInvalidation::from($response); + + } + /** * Get a list of all the proxy rules. You can use the query params to filter * your results. diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index b71fff62..1c273971 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -380,10 +380,11 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea * @param string $fileId * @param InputFile $file * @param ?array $permissions + * @param ?string $folder * @throws AppwriteException * @return \Appwrite\Models\File */ - public function createFile(string $bucketId, string $fileId, InputFile $file, ?array $permissions = null, ?callable $onProgress = null): \Appwrite\Models\File + public function createFile(string $bucketId, string $fileId, InputFile $file, ?array $permissions = null, ?string $folder = null, ?callable $onProgress = null): \Appwrite\Models\File { $apiPath = str_replace( ['{bucketId}'], @@ -400,6 +401,10 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $apiParams['permissions'] = $permissions; } + if (!is_null($folder)) { + $apiParams['folder'] = $folder; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'multipart/form-data'; diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index f2c996ff..c8a8d30e 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -78,10 +78,11 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @param ?bool $enabled * @param ?string $specification * @param ?int $replicas + * @param ?string $syncMode * @throws AppwriteException * @return \Appwrite\Models\Database */ - public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null): \Appwrite\Models\Database + public function create(string $databaseId, string $name, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null, ?string $syncMode = null): \Appwrite\Models\Database { $apiPath = str_replace( [], @@ -104,6 +105,7 @@ public function create(string $databaseId, string $name, ?bool $enabled = null, if (!is_null($replicas)) { $apiParams['replicas'] = $replicas; } + $apiParams['syncMode'] = $syncMode; $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); @@ -448,11 +450,13 @@ public function get(string $databaseId): \Appwrite\Models\Database * @param string $databaseId * @param ?string $name * @param ?bool $enabled + * @param ?string $specification * @param ?int $replicas + * @param ?string $syncMode * @throws AppwriteException * @return \Appwrite\Models\Database */ - public function update(string $databaseId, ?string $name = null, ?bool $enabled = null, ?int $replicas = null): \Appwrite\Models\Database + public function update(string $databaseId, ?string $name = null, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null, ?string $syncMode = null): \Appwrite\Models\Database { $apiPath = str_replace( ['{databaseId}'], @@ -470,7 +474,9 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled if (!is_null($enabled)) { $apiParams['enabled'] = $enabled; } + $apiParams['specification'] = $specification; $apiParams['replicas'] = $replicas; + $apiParams['syncMode'] = $syncMode; $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); @@ -529,7 +535,9 @@ public function delete(string $databaseId): string /** * Trigger a manual failover for a dedicated database with high availability * enabled. Promotes a replica to primary. The failover runs asynchronously; - * poll the database document for status updates. + * poll the database document for status updates. A database left + * mid-operation by a failover that did not finish also accepts this call as a + * repair, provided `targetReplicaId` names the member to promote. * * @param string $databaseId * @param ?string $targetReplicaId @@ -568,6 +576,267 @@ public function createFailover(string $databaseId, ?string $targetReplicaId = nu } + /** + * List the dedicated migrations for a TablesDB database. A database has at + * most one in-flight migration. + * + * @param string $databaseId + * @throws AppwriteException + * @return \Appwrite\Models\DatabaseMigrationList + */ + public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMigrationList + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/migrations' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DatabaseMigrationList::from($response); + + } + + /** + * Start migrating a serverless TablesDB database onto a dedicated MySQL + * compute. Data is copied to the target while the source stays live, with a + * brief read-only window during cutover. + * + * @param string $databaseId + * @param string $specification + * @param ?bool $autoCutover + * @throws AppwriteException + * @return \Appwrite\Models\DatabaseMigration + */ + public function createMigration(string $databaseId, string $specification, ?bool $autoCutover = null): \Appwrite\Models\DatabaseMigration + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/migrations' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['specification'] = $specification; + + if (!is_null($autoCutover)) { + $apiParams['autoCutover'] = $autoCutover; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DatabaseMigration::from($response); + + } + + /** + * Get a single dedicated migration for a TablesDB database by its ID. + * + * @param string $databaseId + * @param string $migrationId + * @throws AppwriteException + * @return \Appwrite\Models\DatabaseMigration + */ + public function getMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration + { + $apiPath = str_replace( + ['{databaseId}', '{migrationId}'], + [$databaseId, $migrationId], + '/tablesdb/{databaseId}/migrations/{migrationId}' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['migrationId'] = $migrationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DatabaseMigration::from($response); + + } + + /** + * Abort an in-flight TablesDB dedicated migration. Only allowed before + * cutover; once the migration has cut over it cannot be aborted. + * + * @param string $databaseId + * @param string $migrationId + * @throws AppwriteException + * @return string + */ + public function deleteMigration(string $databaseId, string $migrationId): string + { + $apiPath = str_replace( + ['{databaseId}', '{migrationId}'], + [$databaseId, $migrationId], + '/tablesdb/{databaseId}/migrations/{migrationId}' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['migrationId'] = $migrationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + + return $response; + + } + + /** + * Cut a verified TablesDB migration over to its dedicated compute. Only + * applies to a migration created with `autoCutover` disabled, which waits at + * `ready_to_cutover` until this is called. The routing flip happens shortly + * after this returns, with a brief read-only window. One call buys one + * attempt: a cutover that fails a check returns the migration to `verifying` + * and parks it again, so call this once more to retry. + * + * @param string $databaseId + * @param string $migrationId + * @throws AppwriteException + * @return \Appwrite\Models\DatabaseMigration + */ + public function cutoverMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration + { + $apiPath = str_replace( + ['{databaseId}', '{migrationId}'], + [$databaseId, $migrationId], + '/tablesdb/{databaseId}/migrations/{migrationId}/cutover' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['migrationId'] = $migrationId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DatabaseMigration::from($response); + + } + + /** + * List the lifecycle operations recorded for a dedicated database, newest + * first. Every provision, update, restore, backup and replication action is + * recorded here with its outcome, including an attempt that was abandoned + * because another worker took over the database. + * + * @param string $databaseId + * @param ?string $status + * @param ?int $limit + * @param ?int $offset + * @throws AppwriteException + * @return \Appwrite\Models\DedicatedDatabaseOperationList + */ + public function listOperations(string $databaseId, ?string $status = null, ?int $limit = null, ?int $offset = null): \Appwrite\Models\DedicatedDatabaseOperationList + { + $apiPath = str_replace( + ['{databaseId}'], + [$databaseId], + '/tablesdb/{databaseId}/operations' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + + if (!is_null($status)) { + $apiParams['status'] = $status; + } + + if (!is_null($limit)) { + $apiParams['limit'] = $limit; + } + + if (!is_null($offset)) { + $apiParams['offset'] = $offset; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\DedicatedDatabaseOperationList::from($response); + + } + /** * Get high availability status for a dedicated database. Returns replica * statuses, replication lag, and sync mode. diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index 81e7f97f..a7ee2eda 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -1004,6 +1004,46 @@ public function deleteMFAAuthenticator(string $userId, AuthenticatorType $type): } + /** + * Get a custom MFA challenge for a user, including the code to be delivered + * through your own channel. + * + * @param string $userId + * @param string $challengeId + * @throws AppwriteException + * @return \Appwrite\Models\MfaChallengeSecret + */ + public function getMFAChallenge(string $userId, string $challengeId): \Appwrite\Models\MfaChallengeSecret + { + $apiPath = str_replace( + ['{userId}', '{challengeId}'], + [$userId, $challengeId], + '/users/{userId}/mfa/challenges/{challengeId}' + ); + + $apiParams = []; + $apiParams['userId'] = $userId; + $apiParams['challengeId'] = $challengeId; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\MfaChallengeSecret::from($response); + + } + /** * List the factors available on the account to be used as a MFA challange. * diff --git a/tests/Appwrite/Services/AccountTest.php b/tests/Appwrite/Services/AccountTest.php index eabfc829..28c9db86 100644 --- a/tests/Appwrite/Services/AccountTest.php +++ b/tests/Appwrite/Services/AccountTest.php @@ -374,24 +374,6 @@ public function testMethodDeleteIdentity(): void $this->assertSame($data, $response); } - public function testMethodCreateJWT(): void - { - $data = array( - "jwt" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->account->createJWT(); - - $this->assertInstanceOf(\Appwrite\Models\Jwt::class, $response); - } - public function testMethodListLogs(): void { $data = array( @@ -646,7 +628,8 @@ public function testMethodListMFAFactors(): void "totp" => true, "phone" => true, "email" => true, - "recoveryCode" => true + "recoveryCode" => true, + "custom" => true ); $this->client diff --git a/tests/Appwrite/Services/AppsTest.php b/tests/Appwrite/Services/AppsTest.php index 63767c7a..2e29a9d9 100644 --- a/tests/Appwrite/Services/AppsTest.php +++ b/tests/Appwrite/Services/AppsTest.php @@ -382,6 +382,25 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } + public function testMethodDeleteInstallation(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->apps->deleteInstallation( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodCreateInstallationToken(): void { $data = array( diff --git a/tests/Appwrite/Services/EmbeddingsTest.php b/tests/Appwrite/Services/EmbeddingsTest.php new file mode 100644 index 00000000..e7717667 --- /dev/null +++ b/tests/Appwrite/Services/EmbeddingsTest.php @@ -0,0 +1,50 @@ +client = Mockery::mock(Client::class); + $this->embeddings = new Embeddings($this->client); + } + + public function testMethodCreateTextEmbeddings(): void + { + $data = array( + "total" => 5, + "embeddings" => array( + array( + "model" => "nomic-embed-text", + "dimension" => 768, + "embedding" => array(), + "error" => "Error message" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->embeddings->createTextEmbeddings( + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\EmbeddingList::class, $response); + } + +} diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php index 40c2dd57..9d24d59c 100644 --- a/tests/Appwrite/Services/OrganizationTest.php +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -29,7 +29,6 @@ public function testMethodGet(): void "name" => "VIP", "total" => 7, "prefs" => array(), - "billingBudget" => 50, "budgetAlerts" => array(), "billingPlan" => "tier-1", "billingPlanId" => "tier-1", @@ -44,7 +43,6 @@ public function testMethodGet(): void "storage" => 25, "imageTransformations" => 100, "screenshotsGenerated" => 50, - "members" => 25, "webhooks" => 25, "wafRules" => 2, "projects" => 2, @@ -68,7 +66,6 @@ public function testMethodGet(): void "topics" => 1, "authPhone" => 10, "domains" => 5, - "activityLogs" => 7, "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, @@ -89,14 +86,6 @@ public function testMethodGet(): void "value" => 25, "invoiceDesc" => "[INVOICEDESC]" ), - "member" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), "realtime" => array( "name" => "[NAME]", "unit" => "GB", @@ -113,14 +102,6 @@ public function testMethodGet(): void "value" => 25, "invoiceDesc" => "[INVOICEDESC]" ), - "realtimeBandwidth" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), "storage" => array( "name" => "[NAME]", "unit" => "GB", @@ -152,38 +133,9 @@ public function testMethodGet(): void "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "credits" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array( - "seats" => array( - "supported" => true, - "planIncluded" => 1, - "limit" => 5, - "type" => "numeric", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), - "projects" => array( - "supported" => true, - "planIncluded" => 1, - "limit" => 5, - "type" => "numeric", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" ) ), + "addons" => array(), "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -201,14 +153,12 @@ public function testMethodGet(): void "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, - "backupsEnabled" => true, "usagePerProject" => true, "supportedAddons" => array( "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true ), - "backupPolicies" => true, "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, @@ -218,22 +168,11 @@ public function testMethodGet(): void "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", "billingNextInvoiceDate" => "2020-10-15T06:38:00.000+00:00", - "billingTrialStartDate" => "2020-10-15T06:38:00.000+00:00", "billingTrialDays" => 14, "billingAggregationId" => "adbc3de4rddfsd", "billingInvoiceId" => "adbc3de4rddfsd", "paymentMethodId" => "adbc3de4rddfsd", - "billingAddressId" => "adbc3de4rddfsd", - "backupPaymentMethodId" => "adbc3de4rddfsd", "status" => "active", - "remarks" => "Pending initial payment", - "agreementBAA" => "[AGREEMENTBAA]", - "programManagerName" => "[PROGRAMMANAGERNAME]", - "programManagerCalendar" => "[PROGRAMMANAGERCALENDAR]", - "programDiscordChannelName" => "[PROGRAMDISCORDCHANNELNAME]", - "programDiscordChannelUrl" => "[PROGRAMDISCORDCHANNELURL]", - "billingPlanDowngrade" => "tier-1", - "billingTaxId" => "[BILLINGTAXID]", "markedForDeletion" => true, "platform" => "imagine", "projects" => array() @@ -260,7 +199,6 @@ public function testMethodUpdate(): void "name" => "VIP", "total" => 7, "prefs" => array(), - "billingBudget" => 50, "budgetAlerts" => array(), "billingPlan" => "tier-1", "billingPlanId" => "tier-1", @@ -275,7 +213,6 @@ public function testMethodUpdate(): void "storage" => 25, "imageTransformations" => 100, "screenshotsGenerated" => 50, - "members" => 25, "webhooks" => 25, "wafRules" => 2, "projects" => 2, @@ -299,7 +236,6 @@ public function testMethodUpdate(): void "topics" => 1, "authPhone" => 10, "domains" => 5, - "activityLogs" => 7, "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, @@ -320,14 +256,6 @@ public function testMethodUpdate(): void "value" => 25, "invoiceDesc" => "[INVOICEDESC]" ), - "member" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), "realtime" => array( "name" => "[NAME]", "unit" => "GB", @@ -344,14 +272,6 @@ public function testMethodUpdate(): void "value" => 25, "invoiceDesc" => "[INVOICEDESC]" ), - "realtimeBandwidth" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), "storage" => array( "name" => "[NAME]", "unit" => "GB", @@ -383,38 +303,9 @@ public function testMethodUpdate(): void "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "credits" => array( - "name" => "[NAME]", - "unit" => "GB", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array( - "seats" => array( - "supported" => true, - "planIncluded" => 1, - "limit" => 5, - "type" => "numeric", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" - ), - "projects" => array( - "supported" => true, - "planIncluded" => 1, - "limit" => 5, - "type" => "numeric", - "currency" => "USD", - "price" => 5, - "value" => 25, - "invoiceDesc" => "[INVOICEDESC]" ) ), + "addons" => array(), "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -432,14 +323,12 @@ public function testMethodUpdate(): void "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, - "backupsEnabled" => true, "usagePerProject" => true, "supportedAddons" => array( "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true ), - "backupPolicies" => true, "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, @@ -449,22 +338,11 @@ public function testMethodUpdate(): void "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", "billingNextInvoiceDate" => "2020-10-15T06:38:00.000+00:00", - "billingTrialStartDate" => "2020-10-15T06:38:00.000+00:00", "billingTrialDays" => 14, "billingAggregationId" => "adbc3de4rddfsd", "billingInvoiceId" => "adbc3de4rddfsd", "paymentMethodId" => "adbc3de4rddfsd", - "billingAddressId" => "adbc3de4rddfsd", - "backupPaymentMethodId" => "adbc3de4rddfsd", "status" => "active", - "remarks" => "Pending initial payment", - "agreementBAA" => "[AGREEMENTBAA]", - "programManagerName" => "[PROGRAMMANAGERNAME]", - "programManagerCalendar" => "[PROGRAMMANAGERCALENDAR]", - "programDiscordChannelName" => "[PROGRAMDISCORDCHANNELNAME]", - "programDiscordChannelUrl" => "[PROGRAMDISCORDCHANNELURL]", - "billingPlanDowngrade" => "tier-1", - "billingTaxId" => "[BILLINGTAXID]", "markedForDeletion" => true, "platform" => "imagine", "projects" => array() diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 0213e34c..deb9bf61 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -245,36 +245,6 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\KeyList::class, $response); } - public function testMethodCreateKey(): void - { - $data = array( - "\$id" => "5e5ea5c16897e", - "\$createdAt" => "2020-10-15T06:38:00.000+00:00", - "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "name" => "My API Key", - "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), - "secret" => "919c2d18fb5d4...a2ae413da83346ad2", - "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->project->createKey( - "", - "", - array(ProjectKeyScopes::PROJECTREAD()) - ); - - $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); - } - public function testMethodCreateEphemeralKey(): void { $data = array( @@ -2413,6 +2383,89 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } + public function testMethodUpdateMFAFactorsPolicy(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "New Project", + "teamId" => "1592981250", + "region" => "fra", + "devKeys" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "Dev API Key", + "expire" => "2020-10-15T06:38:00.000+00:00", + "secret" => "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt" => "2020-10-15T06:38:00.000+00:00", + "sdks" => array() + ) + ), + "smtpEnabled" => true, + "smtpSenderName" => "John Appwrite", + "smtpSenderEmail" => "john@appwrite.io", + "smtpReplyToName" => "Support Team", + "smtpReplyToEmail" => "support@appwrite.io", + "smtpHost" => "mail.appwrite.io", + "smtpPort" => 25, + "smtpUsername" => "emailuser", + "smtpPassword" => "smtp-password", + "smtpSecure" => "tls", + "pingCount" => 1, + "pingedAt" => "2020-10-15T06:38:00.000+00:00", + "labels" => array(), + "status" => "active", + "onboarding" => array(), + "authMethods" => array( + array( + "\$id" => "email-password", + "enabled" => true + ) + ), + "services" => array( + array( + "\$id" => "account", + "enabled" => true + ) + ), + "protocols" => array( + array( + "\$id" => "rest", + "enabled" => true + ) + ), + "blocks" => array( + array( + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceType" => "project", + "resourceId" => "5e5ea5c16897e", + "mode" => "readOnly", + "projectName" => "My Project", + "region" => "fra", + "organizationName" => "Acme Inc.", + "organizationId" => "5e5ea5c16897e", + "billingPlan" => "pro" + ) + ), + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", + "wafEnabled" => true + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->project->updateMFAFactorsPolicy(); + + $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); + } + public function testMethodUpdatePasswordDictionaryPolicy(): void { $data = array( diff --git a/tests/Appwrite/Services/ProxyTest.php b/tests/Appwrite/Services/ProxyTest.php index a7c27ae8..d4b3eab1 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -6,6 +6,7 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; +use Appwrite\Enums\InvalidationType; use Appwrite\Enums\StatusCode; use Appwrite\Enums\ProxyResourceType; @@ -20,6 +21,30 @@ protected function setUp(): void $this->proxy = new Proxy($this->client); } + public function testMethodCreateInvalidation(): void + { + $data = array( + "domain" => "appwrite.company.com", + "type" => "tag", + "reference" => "products", + "status" => "success" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->proxy->createInvalidation( + "", + InvalidationType::TAG() + ); + + $this->assertInstanceOf(\Appwrite\Models\ProxyInvalidation::class, $response); + } + public function testMethodListRules(): void { $data = array( diff --git a/tests/Appwrite/Services/StorageTest.php b/tests/Appwrite/Services/StorageTest.php index 95c1ea7e..3fd5a6f6 100644 --- a/tests/Appwrite/Services/StorageTest.php +++ b/tests/Appwrite/Services/StorageTest.php @@ -188,6 +188,8 @@ public function testMethodListFiles(): void "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "\$permissions" => array(), "name" => "Pink.png", + "folder" => "photos/2026/", + "key" => "photos/2026/Pink.png", "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, @@ -223,6 +225,8 @@ public function testMethodCreateFile(): void "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "\$permissions" => array(), "name" => "Pink.png", + "folder" => "photos/2026/", + "key" => "photos/2026/Pink.png", "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, @@ -258,6 +262,8 @@ public function testMethodGetFile(): void "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "\$permissions" => array(), "name" => "Pink.png", + "folder" => "photos/2026/", + "key" => "photos/2026/Pink.png", "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, @@ -292,6 +298,8 @@ public function testMethodUpdateFile(): void "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "\$permissions" => array(), "name" => "Pink.png", + "folder" => "photos/2026/", + "key" => "photos/2026/Pink.png", "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, diff --git a/tests/Appwrite/Services/TablesDBTest.php b/tests/Appwrite/Services/TablesDBTest.php index 1c75086f..31b4e262 100644 --- a/tests/Appwrite/Services/TablesDBTest.php +++ b/tests/Appwrite/Services/TablesDBTest.php @@ -97,7 +97,6 @@ public function testMethodListSpecifications(): void "storageOverageRate" => 0.125, "bandwidthOverageRate" => 0.08, "replicaRate" => 1, - "crossRegionReplicaRate" => 1, "pitrRate" => 0.2 ) ); @@ -357,7 +356,6 @@ public function testMethodCreateFailover(): void "nodePool" => "db-pool-4vcpu-8gb", "replicas" => 2, "syncMode" => "async", - "crossRegionReplicas" => 1, "networkMaxConnections" => 500, "networkIdleTimeoutSeconds" => 900, "networkIPAllowlist" => array(), @@ -392,17 +390,218 @@ public function testMethodCreateFailover(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabase::class, $response); } + public function testMethodListMigrations(): void + { + $data = array( + "total" => 5, + "migrations" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "5e5ea5c16897e", + "databaseId" => "5e5ea5c16897e", + "specification" => "s-2vcpu-4gb", + "phase" => "pending", + "attempt" => 0, + "lastError" => "[LASTERROR]", + "lagDocuments" => 0, + "verifiedAt" => "2020-10-15T06:38:00.000+00:00", + "cutoverAt" => "2020-10-15T06:38:00.000+00:00", + "soakUntil" => "2020-10-15T06:38:00.000+00:00", + "autoCutover" => true, + "cutoverRequested" => true, + "paused" => true + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->listMigrations( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DatabaseMigrationList::class, $response); + } + + public function testMethodCreateMigration(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "5e5ea5c16897e", + "databaseId" => "5e5ea5c16897e", + "specification" => "s-2vcpu-4gb", + "phase" => "pending", + "attempt" => 0, + "lastError" => "[LASTERROR]", + "lagDocuments" => 0, + "verifiedAt" => "2020-10-15T06:38:00.000+00:00", + "cutoverAt" => "2020-10-15T06:38:00.000+00:00", + "soakUntil" => "2020-10-15T06:38:00.000+00:00", + "autoCutover" => true, + "cutoverRequested" => true, + "paused" => true + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->createMigration( + "", + "s-1vcpu-1gb" + ); + + $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); + } + + public function testMethodGetMigration(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "5e5ea5c16897e", + "databaseId" => "5e5ea5c16897e", + "specification" => "s-2vcpu-4gb", + "phase" => "pending", + "attempt" => 0, + "lastError" => "[LASTERROR]", + "lagDocuments" => 0, + "verifiedAt" => "2020-10-15T06:38:00.000+00:00", + "cutoverAt" => "2020-10-15T06:38:00.000+00:00", + "soakUntil" => "2020-10-15T06:38:00.000+00:00", + "autoCutover" => true, + "cutoverRequested" => true, + "paused" => true + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->getMigration( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); + } + + public function testMethodDeleteMigration(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->deleteMigration( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCutoverMigration(): void + { + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "5e5ea5c16897e", + "databaseId" => "5e5ea5c16897e", + "specification" => "s-2vcpu-4gb", + "phase" => "pending", + "attempt" => 0, + "lastError" => "[LASTERROR]", + "lagDocuments" => 0, + "verifiedAt" => "2020-10-15T06:38:00.000+00:00", + "cutoverAt" => "2020-10-15T06:38:00.000+00:00", + "soakUntil" => "2020-10-15T06:38:00.000+00:00", + "autoCutover" => true, + "cutoverRequested" => true, + "paused" => true + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->cutoverMigration( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); + } + + public function testMethodListOperations(): void + { + $data = array( + "total" => 5, + "operations" => array( + array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "databaseId" => "5e5ea5c16897e", + "type" => "update", + "status" => "completed", + "attempts" => 1, + "errorCode" => "Interrupted", + "errorMessage" => "[ERRORMESSAGE]" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->tablesDB->listOperations( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseOperationList::class, $response); + } + public function testMethodGetReplicas(): void { $data = array( "replicas" => 2, "syncMode" => "async", + "syncDegraded" => true, + "syncAcknowledgements" => 1, + "syncStandbyCount" => 2, "members" => array( array( "\$id" => "1", "role" => "replica", - "status" => "active", - "lagSeconds" => 0.5 + "status" => "active" ) ) ); @@ -433,6 +632,10 @@ public function testMethodGetStatus(): void "current" => 12, "max" => 100 ), + "syncMode" => "async", + "syncDegraded" => true, + "syncAcknowledgements" => 1, + "syncStandbyCount" => 2, "replicas" => array( array( "index" => 0, diff --git a/tests/Appwrite/Services/UsersTest.php b/tests/Appwrite/Services/UsersTest.php index 9f9b0171..6206a767 100644 --- a/tests/Appwrite/Services/UsersTest.php +++ b/tests/Appwrite/Services/UsersTest.php @@ -886,13 +886,39 @@ public function testMethodDeleteMFAAuthenticator(): void $this->assertSame($data, $response); } + public function testMethodGetMFAChallenge(): void + { + $data = array( + "\$id" => "bb8ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "userId" => "5e5ea5c168bb8", + "expire" => "2020-10-15T06:38:00.000+00:00", + "code" => "446372" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->users->getMFAChallenge( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\MfaChallengeSecret::class, $response); + } + public function testMethodListMFAFactors(): void { $data = array( "totp" => true, "phone" => true, "email" => true, - "recoveryCode" => true + "recoveryCode" => true, + "custom" => true ); $this->client From a2e76234e9151b0e7df64e81d4e179a1c7618e2d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 13:50:23 +0530 Subject: [PATCH 05/10] chore: update PHP SDK to 28.0.0 --- CHANGELOG.md | 1 - docs/embeddings.md | 17 ----- .../embeddings/create-text-embeddings.md | 18 ----- src/Appwrite/Enums/EmbeddingModel.php | 70 ------------------- src/Appwrite/Models/Embedding.php | 68 ------------------ src/Appwrite/Models/EmbeddingList.php | 59 ---------------- src/Appwrite/Services/Embeddings.php | 63 ----------------- tests/Appwrite/Services/EmbeddingsTest.php | 50 ------------- 8 files changed, 346 deletions(-) delete mode 100644 docs/embeddings.md delete mode 100644 docs/examples/embeddings/create-text-embeddings.md delete mode 100644 src/Appwrite/Enums/EmbeddingModel.php delete mode 100644 src/Appwrite/Models/Embedding.php delete mode 100644 src/Appwrite/Models/EmbeddingList.php delete mode 100644 src/Appwrite/Services/Embeddings.php delete mode 100644 tests/Appwrite/Services/EmbeddingsTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9345fa..af282346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either * Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke * Breaking: `activities.listEvents` `queries` now takes an array instead of a string -* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum * Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` * Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum * Added: `apps.deleteInstallation` diff --git a/docs/embeddings.md b/docs/embeddings.md deleted file mode 100644 index 50d53b9b..00000000 --- a/docs/embeddings.md +++ /dev/null @@ -1,17 +0,0 @@ -# Embeddings Service - - -```http request -POST https://cloud.appwrite.io/v1/embeddings/text -``` - -** Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections. - ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| texts | array | Array of text to generate embeddings. | | -| model | string | The embedding model to use for generating vector embeddings. | nomic-embed-text | - diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md deleted file mode 100644 index 15f92318..00000000 --- a/docs/examples/embeddings/create-text-embeddings.md +++ /dev/null @@ -1,18 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$embeddings = new Embeddings($client); - -$result = $embeddings->createTextEmbeddings( - texts: [], - model: EmbeddingModel::NOMICEMBEDTEXT() // optional -);``` diff --git a/src/Appwrite/Enums/EmbeddingModel.php b/src/Appwrite/Enums/EmbeddingModel.php deleted file mode 100644 index ec104ce9..00000000 --- a/src/Appwrite/Enums/EmbeddingModel.php +++ /dev/null @@ -1,70 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NOMICEMBEDTEXT(): EmbeddingModel - { - if (!isset(self::$NOMICEMBEDTEXT)) { - self::$NOMICEMBEDTEXT = new EmbeddingModel('nomic-embed-text'); - } - return self::$NOMICEMBEDTEXT; - } - public static function EMBEDDINGGEMMA(): EmbeddingModel - { - if (!isset(self::$EMBEDDINGGEMMA)) { - self::$EMBEDDINGGEMMA = new EmbeddingModel('embedding-gemma'); - } - return self::$EMBEDDINGGEMMA; - } - public static function ALLMINILM(): EmbeddingModel - { - if (!isset(self::$ALLMINILM)) { - self::$ALLMINILM = new EmbeddingModel('all-minilm'); - } - return self::$ALLMINILM; - } - public static function BGESMALL(): EmbeddingModel - { - if (!isset(self::$BGESMALL)) { - self::$BGESMALL = new EmbeddingModel('bge-small'); - } - return self::$BGESMALL; - } - - public static function from(string $value): self - { - return match ($value) { - 'nomic-embed-text' => self::NOMICEMBEDTEXT(), - 'embedding-gemma' => self::EMBEDDINGGEMMA(), - 'all-minilm' => self::ALLMINILM(), - 'bge-small' => self::BGESMALL(), - default => throw new \InvalidArgumentException('Unknown EmbeddingModel value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Models/Embedding.php b/src/Appwrite/Models/Embedding.php deleted file mode 100644 index c38c4787..00000000 --- a/src/Appwrite/Models/Embedding.php +++ /dev/null @@ -1,68 +0,0 @@ - $data - */ - public static function from(array $data): static - { - if (!array_key_exists('model', $data)) { - throw new \InvalidArgumentException('Missing required field "model" for ' . static::class . '.'); - } - if (!array_key_exists('dimension', $data)) { - throw new \InvalidArgumentException('Missing required field "dimension" for ' . static::class . '.'); - } - if (!array_key_exists('embedding', $data)) { - throw new \InvalidArgumentException('Missing required field "embedding" for ' . static::class . '.'); - } - if (!array_key_exists('error', $data)) { - throw new \InvalidArgumentException('Missing required field "error" for ' . static::class . '.'); - } - - return new static( - model: $data['model'], - dimension: $data['dimension'], - embedding: $data['embedding'], - error: $data['error'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'model' => static::serializeValue($this->model), - 'dimension' => static::serializeValue($this->dimension), - 'embedding' => static::serializeValue($this->embedding), - 'error' => static::serializeValue($this->error) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Models/EmbeddingList.php b/src/Appwrite/Models/EmbeddingList.php deleted file mode 100644 index d666e5d5..00000000 --- a/src/Appwrite/Models/EmbeddingList.php +++ /dev/null @@ -1,59 +0,0 @@ - $embeddings list of embeddings. - */ - public function __construct( - public int $total, - public array $embeddings - ) { - } - - /** - * @param array $data - */ - public static function from(array $data): static - { - if (!array_key_exists('total', $data)) { - throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); - } - if (!array_key_exists('embeddings', $data)) { - throw new \InvalidArgumentException('Missing required field "embeddings" for ' . static::class . '.'); - } - - return new static( - total: $data['total'], - embeddings: is_array($data['embeddings']) - ? array_map( - static fn (mixed $item): mixed => static::hydrateTypedValue(Embedding::class, $item), - $data['embeddings'] - ) - : $data['embeddings'] - ); - } - - /** - * @return array - */ - public function toArray(): array - { - $result = [ - 'total' => static::serializeValue($this->total), - 'embeddings' => static::serializeValue($this->embeddings) - ]; - - return $result; - } -} diff --git a/src/Appwrite/Services/Embeddings.php b/src/Appwrite/Services/Embeddings.php deleted file mode 100644 index f1f65d2c..00000000 --- a/src/Appwrite/Services/Embeddings.php +++ /dev/null @@ -1,63 +0,0 @@ -client->getConfig('project'); - $apiHeaders['content-type'] = 'application/json'; - $apiHeaders['accept'] = 'application/json'; - - $response = $this->client->call( - Client::METHOD_POST, - $apiPath, - $apiHeaders, - $apiParams - ); - - if (!is_array($response)) { - throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); - } - - return \Appwrite\Models\EmbeddingList::from($response); - - } -} diff --git a/tests/Appwrite/Services/EmbeddingsTest.php b/tests/Appwrite/Services/EmbeddingsTest.php deleted file mode 100644 index e7717667..00000000 --- a/tests/Appwrite/Services/EmbeddingsTest.php +++ /dev/null @@ -1,50 +0,0 @@ -client = Mockery::mock(Client::class); - $this->embeddings = new Embeddings($this->client); - } - - public function testMethodCreateTextEmbeddings(): void - { - $data = array( - "total" => 5, - "embeddings" => array( - array( - "model" => "nomic-embed-text", - "dimension" => 768, - "embedding" => array(), - "error" => "Error message" - ) - ) - ); - - $this->client - ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) - ->andReturn($data); - $this->client - ->allows()->getConfig(Mockery::any()) - ->andReturn(''); - - $response = $this->embeddings->createTextEmbeddings( - array() - ); - - $this->assertInstanceOf(\Appwrite\Models\EmbeddingList::class, $response); - } - -} From f7adeea9252b21ca68106e5286e049ec193ad50a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 14 Aug 2026 14:00:08 +0530 Subject: [PATCH 06/10] chore: update PHP SDK to 28.0.0 --- CHANGELOG.md | 1 + docs/embeddings.md | 17 +++++ .../embeddings/create-text-embeddings.md | 18 +++++ src/Appwrite/Enums/EmbeddingModel.php | 70 +++++++++++++++++++ src/Appwrite/Models/Embedding.php | 68 ++++++++++++++++++ src/Appwrite/Models/EmbeddingList.php | 59 ++++++++++++++++ src/Appwrite/Services/Embeddings.php | 63 +++++++++++++++++ tests/Appwrite/Services/EmbeddingsTest.php | 50 +++++++++++++ 8 files changed, 346 insertions(+) create mode 100644 docs/embeddings.md create mode 100644 docs/examples/embeddings/create-text-embeddings.md create mode 100644 src/Appwrite/Enums/EmbeddingModel.php create mode 100644 src/Appwrite/Models/Embedding.php create mode 100644 src/Appwrite/Models/EmbeddingList.php create mode 100644 src/Appwrite/Services/Embeddings.php create mode 100644 tests/Appwrite/Services/EmbeddingsTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index af282346..6e9345fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either * Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke * Breaking: `activities.listEvents` `queries` now takes an array instead of a string +* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum * Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` * Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum * Added: `apps.deleteInstallation` diff --git a/docs/embeddings.md b/docs/embeddings.md new file mode 100644 index 00000000..50d53b9b --- /dev/null +++ b/docs/embeddings.md @@ -0,0 +1,17 @@ +# Embeddings Service + + +```http request +POST https://cloud.appwrite.io/v1/embeddings/text +``` + +** Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections. + ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| texts | array | Array of text to generate embeddings. | | +| model | string | The embedding model to use for generating vector embeddings. | nomic-embed-text | + diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 00000000..15f92318 --- /dev/null +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,18 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$embeddings = new Embeddings($client); + +$result = $embeddings->createTextEmbeddings( + texts: [], + model: EmbeddingModel::NOMICEMBEDTEXT() // optional +);``` diff --git a/src/Appwrite/Enums/EmbeddingModel.php b/src/Appwrite/Enums/EmbeddingModel.php new file mode 100644 index 00000000..ec104ce9 --- /dev/null +++ b/src/Appwrite/Enums/EmbeddingModel.php @@ -0,0 +1,70 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NOMICEMBEDTEXT(): EmbeddingModel + { + if (!isset(self::$NOMICEMBEDTEXT)) { + self::$NOMICEMBEDTEXT = new EmbeddingModel('nomic-embed-text'); + } + return self::$NOMICEMBEDTEXT; + } + public static function EMBEDDINGGEMMA(): EmbeddingModel + { + if (!isset(self::$EMBEDDINGGEMMA)) { + self::$EMBEDDINGGEMMA = new EmbeddingModel('embedding-gemma'); + } + return self::$EMBEDDINGGEMMA; + } + public static function ALLMINILM(): EmbeddingModel + { + if (!isset(self::$ALLMINILM)) { + self::$ALLMINILM = new EmbeddingModel('all-minilm'); + } + return self::$ALLMINILM; + } + public static function BGESMALL(): EmbeddingModel + { + if (!isset(self::$BGESMALL)) { + self::$BGESMALL = new EmbeddingModel('bge-small'); + } + return self::$BGESMALL; + } + + public static function from(string $value): self + { + return match ($value) { + 'nomic-embed-text' => self::NOMICEMBEDTEXT(), + 'embedding-gemma' => self::EMBEDDINGGEMMA(), + 'all-minilm' => self::ALLMINILM(), + 'bge-small' => self::BGESMALL(), + default => throw new \InvalidArgumentException('Unknown EmbeddingModel value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Models/Embedding.php b/src/Appwrite/Models/Embedding.php new file mode 100644 index 00000000..c38c4787 --- /dev/null +++ b/src/Appwrite/Models/Embedding.php @@ -0,0 +1,68 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('model', $data)) { + throw new \InvalidArgumentException('Missing required field "model" for ' . static::class . '.'); + } + if (!array_key_exists('dimension', $data)) { + throw new \InvalidArgumentException('Missing required field "dimension" for ' . static::class . '.'); + } + if (!array_key_exists('embedding', $data)) { + throw new \InvalidArgumentException('Missing required field "embedding" for ' . static::class . '.'); + } + if (!array_key_exists('error', $data)) { + throw new \InvalidArgumentException('Missing required field "error" for ' . static::class . '.'); + } + + return new static( + model: $data['model'], + dimension: $data['dimension'], + embedding: $data['embedding'], + error: $data['error'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'model' => static::serializeValue($this->model), + 'dimension' => static::serializeValue($this->dimension), + 'embedding' => static::serializeValue($this->embedding), + 'error' => static::serializeValue($this->error) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/EmbeddingList.php b/src/Appwrite/Models/EmbeddingList.php new file mode 100644 index 00000000..d666e5d5 --- /dev/null +++ b/src/Appwrite/Models/EmbeddingList.php @@ -0,0 +1,59 @@ + $embeddings list of embeddings. + */ + public function __construct( + public int $total, + public array $embeddings + ) { + } + + /** + * @param array $data + */ + public static function from(array $data): static + { + if (!array_key_exists('total', $data)) { + throw new \InvalidArgumentException('Missing required field "total" for ' . static::class . '.'); + } + if (!array_key_exists('embeddings', $data)) { + throw new \InvalidArgumentException('Missing required field "embeddings" for ' . static::class . '.'); + } + + return new static( + total: $data['total'], + embeddings: is_array($data['embeddings']) + ? array_map( + static fn (mixed $item): mixed => static::hydrateTypedValue(Embedding::class, $item), + $data['embeddings'] + ) + : $data['embeddings'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + 'total' => static::serializeValue($this->total), + 'embeddings' => static::serializeValue($this->embeddings) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Services/Embeddings.php b/src/Appwrite/Services/Embeddings.php new file mode 100644 index 00000000..f1f65d2c --- /dev/null +++ b/src/Appwrite/Services/Embeddings.php @@ -0,0 +1,63 @@ +client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + + $response = $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\EmbeddingList::from($response); + + } +} diff --git a/tests/Appwrite/Services/EmbeddingsTest.php b/tests/Appwrite/Services/EmbeddingsTest.php new file mode 100644 index 00000000..e7717667 --- /dev/null +++ b/tests/Appwrite/Services/EmbeddingsTest.php @@ -0,0 +1,50 @@ +client = Mockery::mock(Client::class); + $this->embeddings = new Embeddings($this->client); + } + + public function testMethodCreateTextEmbeddings(): void + { + $data = array( + "total" => 5, + "embeddings" => array( + array( + "model" => "nomic-embed-text", + "dimension" => 768, + "embedding" => array(), + "error" => "Error message" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->embeddings->createTextEmbeddings( + array() + ); + + $this->assertInstanceOf(\Appwrite\Models\EmbeddingList::class, $response); + } + +} From 4a140bc19e63dc2569f9aa2d907a6fcb43501b26 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 26 Aug 2026 22:13:52 +0530 Subject: [PATCH 07/10] chore: update PHP SDK to 29.0.0 --- CHANGELOG.md | 18 + README.md | 2 +- composer.json | 23 +- docs/account.md | 2 +- docs/avatars.md | 17 + .../account/create-anonymous-session.md | 2 + .../account/create-email-password-session.md | 4 +- docs/examples/account/create-email-token.md | 4 +- .../account/create-email-verification.md | 4 +- .../account/create-magic-url-token.md | 4 +- .../account/create-mfa-authenticator.md | 4 +- docs/examples/account/create-mfa-challenge.md | 4 +- .../account/create-mfa-recovery-codes.md | 2 + .../examples/account/create-o-auth-2-token.md | 4 +- docs/examples/account/create-phone-token.md | 4 +- .../account/create-phone-verification.md | 2 + docs/examples/account/create-recovery.md | 4 +- docs/examples/account/create-session.md | 4 +- docs/examples/account/create-verification.md | 4 +- docs/examples/account/create.md | 4 +- docs/examples/account/delete-consent-token.md | 4 +- docs/examples/account/delete-consent.md | 4 +- docs/examples/account/delete-identity.md | 4 +- .../account/delete-mfa-authenticator.md | 4 +- docs/examples/account/delete-session.md | 4 +- docs/examples/account/delete-sessions.md | 2 + docs/examples/account/get-consent-token.md | 4 +- docs/examples/account/get-consent.md | 4 +- .../account/get-mfa-recovery-codes.md | 2 + docs/examples/account/get-prefs.md | 2 + docs/examples/account/get-session.md | 4 +- docs/examples/account/get.md | 2 + docs/examples/account/list-consent-tokens.md | 4 +- docs/examples/account/list-consents.md | 4 +- docs/examples/account/list-identities.md | 4 +- docs/examples/account/list-logs.md | 4 +- docs/examples/account/list-mfa-factors.md | 2 + docs/examples/account/list-sessions.md | 2 + .../account/update-email-verification.md | 4 +- docs/examples/account/update-email.md | 4 +- .../account/update-magic-url-session.md | 4 +- .../account/update-mfa-authenticator.md | 4 +- docs/examples/account/update-mfa-challenge.md | 4 +- .../account/update-mfa-recovery-codes.md | 2 + docs/examples/account/update-mfa.md | 4 +- docs/examples/account/update-name.md | 4 +- docs/examples/account/update-password.md | 4 +- docs/examples/account/update-phone-session.md | 4 +- .../account/update-phone-verification.md | 4 +- docs/examples/account/update-phone.md | 4 +- docs/examples/account/update-prefs.md | 4 +- docs/examples/account/update-recovery.md | 4 +- docs/examples/account/update-session.md | 4 +- docs/examples/account/update-status.md | 2 + docs/examples/account/update-verification.md | 4 +- docs/examples/activities/get-event.md | 4 +- docs/examples/activities/list-events.md | 4 +- docs/examples/advisor/delete-report.md | 4 +- docs/examples/advisor/get-insight.md | 4 +- docs/examples/advisor/get-report.md | 4 +- docs/examples/advisor/list-insights.md | 4 +- docs/examples/advisor/list-reports.md | 4 +- .../apps/create-installation-token.md | 4 +- docs/examples/apps/create-key.md | 4 +- docs/examples/apps/create-secret.md | 4 +- docs/examples/apps/create.md | 4 +- docs/examples/apps/delete-installation.md | 4 +- docs/examples/apps/delete-key.md | 4 +- docs/examples/apps/delete-secret.md | 4 +- docs/examples/apps/delete-tokens.md | 4 +- docs/examples/apps/delete.md | 4 +- docs/examples/apps/get-installation.md | 4 +- docs/examples/apps/get-key.md | 4 +- docs/examples/apps/get-secret.md | 4 +- docs/examples/apps/get.md | 4 +- .../examples/apps/list-installation-scopes.md | 2 + docs/examples/apps/list-installations.md | 4 +- docs/examples/apps/list-keys.md | 4 +- docs/examples/apps/list-o-auth-2-scopes.md | 2 + docs/examples/apps/list-secrets.md | 4 +- docs/examples/apps/list.md | 4 +- docs/examples/apps/update-labels.md | 4 +- docs/examples/apps/update-team.md | 4 +- docs/examples/apps/update.md | 4 +- docs/examples/avatars/get-browser.md | 4 +- docs/examples/avatars/get-credit-card.md | 4 +- docs/examples/avatars/get-favicon.md | 4 +- docs/examples/avatars/get-flag.md | 4 +- docs/examples/avatars/get-image.md | 4 +- docs/examples/avatars/get-initials.md | 4 +- docs/examples/avatars/get-photo.md | 22 + docs/examples/avatars/get-qr.md | 4 +- docs/examples/avatars/get-screenshot.md | 4 +- docs/examples/backups/create-archive.md | 4 +- docs/examples/backups/create-policy.md | 4 +- docs/examples/backups/create-restoration.md | 4 +- docs/examples/backups/delete-archive.md | 4 +- docs/examples/backups/delete-policy.md | 4 +- docs/examples/backups/get-archive.md | 4 +- docs/examples/backups/get-policy.md | 4 +- docs/examples/backups/get-restoration.md | 4 +- docs/examples/backups/list-archives.md | 4 +- docs/examples/backups/list-policies.md | 4 +- docs/examples/backups/list-restorations.md | 4 +- docs/examples/backups/update-policy.md | 4 +- .../databases/create-big-int-attribute.md | 4 +- .../databases/create-boolean-attribute.md | 4 +- docs/examples/databases/create-collection.md | 4 +- .../databases/create-datetime-attribute.md | 4 +- docs/examples/databases/create-document.md | 4 +- docs/examples/databases/create-documents.md | 4 +- .../databases/create-email-attribute.md | 4 +- .../databases/create-enum-attribute.md | 4 +- .../databases/create-float-attribute.md | 4 +- docs/examples/databases/create-index.md | 4 +- .../databases/create-integer-attribute.md | 4 +- .../examples/databases/create-ip-attribute.md | 4 +- .../databases/create-line-attribute.md | 4 +- .../databases/create-longtext-attribute.md | 4 +- .../databases/create-mediumtext-attribute.md | 4 +- docs/examples/databases/create-operations.md | 4 +- .../databases/create-point-attribute.md | 4 +- .../databases/create-polygon-attribute.md | 4 +- .../create-relationship-attribute.md | 4 +- .../databases/create-string-attribute.md | 4 +- .../databases/create-text-attribute.md | 4 +- docs/examples/databases/create-transaction.md | 4 +- .../databases/create-url-attribute.md | 4 +- .../databases/create-varchar-attribute.md | 4 +- docs/examples/databases/create.md | 4 +- .../databases/decrement-document-attribute.md | 4 +- docs/examples/databases/delete-attribute.md | 4 +- docs/examples/databases/delete-collection.md | 4 +- docs/examples/databases/delete-document.md | 4 +- docs/examples/databases/delete-documents.md | 4 +- docs/examples/databases/delete-index.md | 4 +- docs/examples/databases/delete-transaction.md | 4 +- docs/examples/databases/delete.md | 4 +- docs/examples/databases/get-attribute.md | 4 +- docs/examples/databases/get-collection.md | 4 +- docs/examples/databases/get-document.md | 4 +- docs/examples/databases/get-index.md | 4 +- docs/examples/databases/get-transaction.md | 4 +- docs/examples/databases/get.md | 4 +- .../databases/increment-document-attribute.md | 4 +- docs/examples/databases/list-attributes.md | 4 +- docs/examples/databases/list-collections.md | 4 +- docs/examples/databases/list-documents.md | 4 +- docs/examples/databases/list-indexes.md | 4 +- docs/examples/databases/list-transactions.md | 4 +- docs/examples/databases/list.md | 4 +- .../databases/update-big-int-attribute.md | 4 +- .../databases/update-boolean-attribute.md | 4 +- docs/examples/databases/update-collection.md | 4 +- .../databases/update-datetime-attribute.md | 4 +- docs/examples/databases/update-document.md | 4 +- docs/examples/databases/update-documents.md | 4 +- .../databases/update-email-attribute.md | 4 +- .../databases/update-enum-attribute.md | 4 +- .../databases/update-float-attribute.md | 4 +- .../databases/update-integer-attribute.md | 4 +- .../examples/databases/update-ip-attribute.md | 4 +- .../databases/update-line-attribute.md | 4 +- .../databases/update-longtext-attribute.md | 4 +- .../databases/update-mediumtext-attribute.md | 4 +- .../databases/update-point-attribute.md | 4 +- .../databases/update-polygon-attribute.md | 4 +- .../update-relationship-attribute.md | 4 +- .../databases/update-string-attribute.md | 4 +- .../databases/update-text-attribute.md | 4 +- docs/examples/databases/update-transaction.md | 4 +- .../databases/update-url-attribute.md | 4 +- .../databases/update-varchar-attribute.md | 4 +- docs/examples/databases/update.md | 4 +- docs/examples/databases/upsert-document.md | 4 +- docs/examples/databases/upsert-documents.md | 4 +- .../embeddings/create-text-embeddings.md | 4 +- docs/examples/functions/create-deployment.md | 4 +- .../functions/create-duplicate-deployment.md | 4 +- docs/examples/functions/create-execution.md | 4 +- .../functions/create-template-deployment.md | 4 +- docs/examples/functions/create-variable.md | 4 +- .../functions/create-vcs-deployment.md | 4 +- docs/examples/functions/create.md | 4 +- docs/examples/functions/delete-deployment.md | 4 +- docs/examples/functions/delete-execution.md | 4 +- docs/examples/functions/delete-variable.md | 4 +- docs/examples/functions/delete.md | 4 +- .../functions/get-deployment-download.md | 4 +- docs/examples/functions/get-deployment.md | 4 +- docs/examples/functions/get-execution.md | 4 +- docs/examples/functions/get-variable.md | 4 +- docs/examples/functions/get.md | 4 +- docs/examples/functions/list-deployments.md | 4 +- docs/examples/functions/list-executions.md | 4 +- docs/examples/functions/list-runtimes.md | 2 + .../examples/functions/list-specifications.md | 4 +- docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/list.md | 4 +- .../functions/update-deployment-status.md | 4 +- .../functions/update-function-deployment.md | 4 +- docs/examples/functions/update-variable.md | 4 +- docs/examples/functions/update.md | 4 +- docs/examples/graphql/mutation.md | 4 +- docs/examples/graphql/query.md | 4 +- docs/examples/locale/get.md | 2 + docs/examples/locale/list-codes.md | 2 + docs/examples/locale/list-continents.md | 2 + docs/examples/locale/list-countries-eu.md | 2 + docs/examples/locale/list-countries-phones.md | 2 + docs/examples/locale/list-countries.md | 2 + docs/examples/locale/list-currencies.md | 2 + docs/examples/locale/list-languages.md | 2 + .../messaging/create-apns-provider.md | 4 +- docs/examples/messaging/create-email.md | 4 +- .../examples/messaging/create-fcm-provider.md | 4 +- .../messaging/create-mailgun-provider.md | 4 +- .../messaging/create-msg-91-provider.md | 4 +- docs/examples/messaging/create-push.md | 4 +- .../messaging/create-resend-provider.md | 4 +- .../messaging/create-sendgrid-provider.md | 4 +- .../examples/messaging/create-ses-provider.md | 4 +- docs/examples/messaging/create-sms.md | 4 +- .../messaging/create-smtp-provider.md | 4 +- docs/examples/messaging/create-subscriber.md | 4 +- .../messaging/create-telesign-provider.md | 4 +- .../messaging/create-textmagic-provider.md | 4 +- docs/examples/messaging/create-topic.md | 4 +- .../messaging/create-twilio-provider.md | 4 +- .../messaging/create-vonage-provider.md | 4 +- docs/examples/messaging/delete-provider.md | 4 +- docs/examples/messaging/delete-subscriber.md | 4 +- docs/examples/messaging/delete-topic.md | 4 +- docs/examples/messaging/delete.md | 4 +- docs/examples/messaging/get-message.md | 4 +- docs/examples/messaging/get-provider.md | 4 +- docs/examples/messaging/get-subscriber.md | 4 +- docs/examples/messaging/get-topic.md | 4 +- docs/examples/messaging/list-messages.md | 4 +- docs/examples/messaging/list-providers.md | 4 +- docs/examples/messaging/list-subscribers.md | 4 +- docs/examples/messaging/list-targets.md | 4 +- docs/examples/messaging/list-topics.md | 4 +- .../messaging/update-apns-provider.md | 4 +- docs/examples/messaging/update-email.md | 4 +- .../examples/messaging/update-fcm-provider.md | 4 +- .../messaging/update-mailgun-provider.md | 4 +- .../messaging/update-msg-91-provider.md | 4 +- docs/examples/messaging/update-push.md | 4 +- .../messaging/update-resend-provider.md | 4 +- .../messaging/update-sendgrid-provider.md | 4 +- .../examples/messaging/update-ses-provider.md | 4 +- docs/examples/messaging/update-sms.md | 4 +- .../messaging/update-smtp-provider.md | 4 +- .../messaging/update-telesign-provider.md | 4 +- .../messaging/update-textmagic-provider.md | 4 +- docs/examples/messaging/update-topic.md | 4 +- .../messaging/update-twilio-provider.md | 4 +- .../messaging/update-vonage-provider.md | 4 +- docs/examples/oauth2/approve.md | 4 +- docs/examples/oauth2/authorize-post.md | 4 +- docs/examples/oauth2/authorize.md | 4 +- .../oauth2/create-device-authorization.md | 4 +- docs/examples/oauth2/create-grant.md | 4 +- docs/examples/oauth2/create-par.md | 4 +- docs/examples/oauth2/create-token.md | 4 +- docs/examples/oauth2/get-grant.md | 4 +- docs/examples/oauth2/list-organizations.md | 4 +- docs/examples/oauth2/list-projects.md | 4 +- docs/examples/oauth2/reject.md | 4 +- docs/examples/oauth2/revoke.md | 4 +- .../organization/create-installation.md | 4 +- docs/examples/organization/create-key.md | 4 +- .../organization/create-membership.md | 4 +- docs/examples/organization/create-project.md | 4 +- .../organization/delete-installation.md | 4 +- docs/examples/organization/delete-key.md | 4 +- .../organization/delete-membership.md | 4 +- docs/examples/organization/delete-project.md | 4 +- docs/examples/organization/delete.md | 2 + .../examples/organization/get-installation.md | 4 +- docs/examples/organization/get-key.md | 4 +- docs/examples/organization/get-membership.md | 4 +- docs/examples/organization/get-project.md | 4 +- docs/examples/organization/get.md | 2 + .../organization/list-installations.md | 4 +- docs/examples/organization/list-keys.md | 4 +- .../examples/organization/list-memberships.md | 4 +- docs/examples/organization/list-projects.md | 4 +- .../organization/update-installation.md | 4 +- docs/examples/organization/update-key.md | 4 +- .../organization/update-membership.md | 4 +- docs/examples/organization/update-project.md | 4 +- docs/examples/organization/update.md | 4 +- docs/examples/presences/delete.md | 4 +- docs/examples/presences/get.md | 4 +- docs/examples/presences/list.md | 4 +- docs/examples/presences/update.md | 4 +- docs/examples/presences/upsert.md | 4 +- .../project/create-android-platform.md | 4 +- .../examples/project/create-apple-platform.md | 4 +- docs/examples/project/create-ephemeral-key.md | 4 +- .../examples/project/create-linux-platform.md | 4 +- docs/examples/project/create-mock-phone.md | 4 +- docs/examples/project/create-smtp-test.md | 4 +- docs/examples/project/create-variable.md | 4 +- docs/examples/project/create-web-platform.md | 4 +- .../project/create-windows-platform.md | 4 +- docs/examples/project/delete-key.md | 4 +- docs/examples/project/delete-mock-phone.md | 4 +- docs/examples/project/delete-platform.md | 4 +- docs/examples/project/delete-variable.md | 4 +- docs/examples/project/delete.md | 2 + docs/examples/project/get-email-template.md | 4 +- docs/examples/project/get-key.md | 4 +- docs/examples/project/get-mock-phone.md | 4 +- .../examples/project/get-o-auth-2-provider.md | 4 +- docs/examples/project/get-platform.md | 4 +- docs/examples/project/get-policy.md | 4 +- docs/examples/project/get-variable.md | 4 +- docs/examples/project/get.md | 2 + docs/examples/project/list-email-templates.md | 4 +- docs/examples/project/list-keys.md | 4 +- docs/examples/project/list-mock-phones.md | 4 +- .../project/list-o-auth-2-providers.md | 4 +- docs/examples/project/list-platforms.md | 4 +- docs/examples/project/list-policies.md | 4 +- docs/examples/project/list-variables.md | 4 +- .../project/update-android-platform.md | 4 +- .../examples/project/update-apple-platform.md | 4 +- docs/examples/project/update-auth-method.md | 4 +- .../update-deny-aliased-email-policy.md | 4 +- .../update-deny-corporate-email-policy.md | 4 +- .../update-deny-disposable-email-policy.md | 4 +- .../project/update-deny-free-email-policy.md | 4 +- .../examples/project/update-email-template.md | 4 +- docs/examples/project/update-key.md | 4 +- docs/examples/project/update-labels.md | 4 +- .../examples/project/update-linux-platform.md | 4 +- .../update-membership-privacy-policy.md | 4 +- .../project/update-mfa-factors-policy.md | 4 +- docs/examples/project/update-mock-phone.md | 4 +- .../project/update-o-auth-2-amazon.md | 4 +- .../examples/project/update-o-auth-2-apple.md | 4 +- .../project/update-o-auth-2-appwrite.md | 4 +- .../project/update-o-auth-2-auth-0.md | 4 +- .../project/update-o-auth-2-authentik.md | 4 +- .../project/update-o-auth-2-autodesk.md | 4 +- .../project/update-o-auth-2-bitbucket.md | 4 +- .../examples/project/update-o-auth-2-bitly.md | 4 +- docs/examples/project/update-o-auth-2-box.md | 4 +- .../project/update-o-auth-2-dailymotion.md | 4 +- .../project/update-o-auth-2-discord.md | 4 +- .../project/update-o-auth-2-disqus.md | 4 +- .../project/update-o-auth-2-dropbox.md | 4 +- docs/examples/project/update-o-auth-2-etsy.md | 4 +- .../project/update-o-auth-2-facebook.md | 4 +- .../examples/project/update-o-auth-2-figma.md | 4 +- .../project/update-o-auth-2-fusion-auth.md | 4 +- .../project/update-o-auth-2-git-hub.md | 4 +- .../project/update-o-auth-2-gitlab.md | 4 +- .../project/update-o-auth-2-google.md | 4 +- .../project/update-o-auth-2-hugging-face.md | 20 + .../project/update-o-auth-2-keycloak.md | 4 +- docs/examples/project/update-o-auth-2-kick.md | 4 +- .../project/update-o-auth-2-linkedin.md | 4 +- .../project/update-o-auth-2-microsoft.md | 4 +- .../project/update-o-auth-2-notion.md | 4 +- docs/examples/project/update-o-auth-2-oidc.md | 4 +- docs/examples/project/update-o-auth-2-okta.md | 4 +- .../project/update-o-auth-2-paypal-sandbox.md | 4 +- .../project/update-o-auth-2-paypal.md | 4 +- .../examples/project/update-o-auth-2-podio.md | 4 +- .../project/update-o-auth-2-salesforce.md | 4 +- .../project/update-o-auth-2-server.md | 4 +- .../examples/project/update-o-auth-2-slack.md | 4 +- .../project/update-o-auth-2-spotify.md | 4 +- .../project/update-o-auth-2-stripe.md | 4 +- .../update-o-auth-2-tradeshift-sandbox.md | 4 +- .../project/update-o-auth-2-tradeshift.md | 4 +- .../project/update-o-auth-2-twitch.md | 4 +- .../project/update-o-auth-2-word-press.md | 4 +- .../examples/project/update-o-auth-2-yahoo.md | 4 +- .../project/update-o-auth-2-yandex.md | 4 +- docs/examples/project/update-o-auth-2-zoho.md | 4 +- docs/examples/project/update-o-auth-2-zoom.md | 4 +- docs/examples/project/update-o-auth-2x.md | 4 +- .../update-password-dictionary-policy.md | 4 +- .../project/update-password-history-policy.md | 4 +- .../update-password-personal-data-policy.md | 4 +- .../update-password-strength-policy.md | 4 +- docs/examples/project/update-protocol.md | 4 +- docs/examples/project/update-service.md | 4 +- .../project/update-session-alert-policy.md | 4 +- .../project/update-session-duration-policy.md | 4 +- .../update-session-invalidation-policy.md | 4 +- .../project/update-session-limit-policy.md | 4 +- docs/examples/project/update-smtp.md | 4 +- .../project/update-user-limit-policy.md | 4 +- docs/examples/project/update-variable.md | 4 +- docs/examples/project/update-web-platform.md | 4 +- .../project/update-windows-platform.md | 4 +- docs/examples/proxy/create-api-rule.md | 4 +- docs/examples/proxy/create-function-rule.md | 4 +- docs/examples/proxy/create-invalidation.md | 4 +- docs/examples/proxy/create-redirect-rule.md | 4 +- docs/examples/proxy/create-site-rule.md | 4 +- docs/examples/proxy/delete-rule.md | 4 +- docs/examples/proxy/get-rule.md | 4 +- docs/examples/proxy/list-rules.md | 4 +- docs/examples/proxy/update-rule-status.md | 4 +- docs/examples/sites/create-deployment.md | 4 +- .../sites/create-duplicate-deployment.md | 4 +- .../sites/create-template-deployment.md | 4 +- docs/examples/sites/create-variable.md | 4 +- docs/examples/sites/create-vcs-deployment.md | 4 +- docs/examples/sites/create.md | 8 +- docs/examples/sites/delete-deployment.md | 4 +- docs/examples/sites/delete-log.md | 4 +- docs/examples/sites/delete-variable.md | 4 +- docs/examples/sites/delete.md | 4 +- .../examples/sites/get-deployment-download.md | 4 +- docs/examples/sites/get-deployment.md | 4 +- docs/examples/sites/get-log.md | 4 +- docs/examples/sites/get-variable.md | 4 +- docs/examples/sites/get.md | 4 +- docs/examples/sites/list-deployments.md | 4 +- docs/examples/sites/list-frameworks.md | 2 + docs/examples/sites/list-logs.md | 4 +- docs/examples/sites/list-specifications.md | 4 +- docs/examples/sites/list-variables.md | 4 +- docs/examples/sites/list.md | 4 +- .../sites/update-deployment-status.md | 4 +- docs/examples/sites/update-site-deployment.md | 4 +- docs/examples/sites/update-variable.md | 4 +- docs/examples/sites/update.md | 8 +- docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 4 +- docs/examples/storage/delete-bucket.md | 4 +- docs/examples/storage/delete-file.md | 4 +- docs/examples/storage/get-bucket.md | 4 +- docs/examples/storage/get-file-download.md | 4 +- docs/examples/storage/get-file-preview.md | 4 +- docs/examples/storage/get-file-view.md | 4 +- docs/examples/storage/get-file.md | 4 +- docs/examples/storage/list-buckets.md | 4 +- docs/examples/storage/list-files.md | 4 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 4 +- .../tablesdb/create-big-int-column.md | 4 +- .../tablesdb/create-boolean-column.md | 4 +- .../tablesdb/create-datetime-column.md | 4 +- docs/examples/tablesdb/create-email-column.md | 4 +- docs/examples/tablesdb/create-enum-column.md | 4 +- docs/examples/tablesdb/create-failover.md | 4 +- docs/examples/tablesdb/create-float-column.md | 4 +- docs/examples/tablesdb/create-index.md | 4 +- .../tablesdb/create-integer-column.md | 4 +- docs/examples/tablesdb/create-ip-column.md | 4 +- docs/examples/tablesdb/create-line-column.md | 4 +- .../tablesdb/create-longtext-column.md | 4 +- .../tablesdb/create-mediumtext-column.md | 4 +- docs/examples/tablesdb/create-migration.md | 4 +- docs/examples/tablesdb/create-operations.md | 4 +- docs/examples/tablesdb/create-point-column.md | 4 +- .../tablesdb/create-polygon-column.md | 4 +- .../tablesdb/create-relationship-column.md | 4 +- docs/examples/tablesdb/create-row.md | 4 +- docs/examples/tablesdb/create-rows.md | 4 +- .../examples/tablesdb/create-string-column.md | 4 +- docs/examples/tablesdb/create-table.md | 4 +- docs/examples/tablesdb/create-text-column.md | 4 +- docs/examples/tablesdb/create-transaction.md | 4 +- docs/examples/tablesdb/create-url-column.md | 4 +- .../tablesdb/create-varchar-column.md | 4 +- docs/examples/tablesdb/create.md | 4 +- docs/examples/tablesdb/cutover-migration.md | 4 +- .../examples/tablesdb/decrement-row-column.md | 4 +- docs/examples/tablesdb/delete-column.md | 4 +- docs/examples/tablesdb/delete-index.md | 4 +- docs/examples/tablesdb/delete-migration.md | 4 +- docs/examples/tablesdb/delete-row.md | 4 +- docs/examples/tablesdb/delete-rows.md | 4 +- docs/examples/tablesdb/delete-table.md | 4 +- docs/examples/tablesdb/delete-transaction.md | 4 +- docs/examples/tablesdb/delete.md | 4 +- docs/examples/tablesdb/get-column.md | 4 +- docs/examples/tablesdb/get-index.md | 4 +- docs/examples/tablesdb/get-migration.md | 4 +- docs/examples/tablesdb/get-replicas.md | 4 +- docs/examples/tablesdb/get-row.md | 4 +- docs/examples/tablesdb/get-status.md | 4 +- docs/examples/tablesdb/get-table.md | 4 +- docs/examples/tablesdb/get-transaction.md | 4 +- docs/examples/tablesdb/get.md | 4 +- .../examples/tablesdb/increment-row-column.md | 4 +- docs/examples/tablesdb/list-columns.md | 4 +- docs/examples/tablesdb/list-indexes.md | 4 +- docs/examples/tablesdb/list-migrations.md | 4 +- docs/examples/tablesdb/list-operations.md | 4 +- docs/examples/tablesdb/list-rows.md | 4 +- docs/examples/tablesdb/list-specifications.md | 2 + docs/examples/tablesdb/list-tables.md | 4 +- docs/examples/tablesdb/list-transactions.md | 4 +- docs/examples/tablesdb/list.md | 4 +- .../tablesdb/update-big-int-column.md | 4 +- .../tablesdb/update-boolean-column.md | 4 +- .../tablesdb/update-datetime-column.md | 4 +- docs/examples/tablesdb/update-email-column.md | 4 +- docs/examples/tablesdb/update-enum-column.md | 4 +- docs/examples/tablesdb/update-float-column.md | 4 +- .../tablesdb/update-integer-column.md | 4 +- docs/examples/tablesdb/update-ip-column.md | 4 +- docs/examples/tablesdb/update-line-column.md | 4 +- .../tablesdb/update-longtext-column.md | 4 +- .../tablesdb/update-mediumtext-column.md | 4 +- docs/examples/tablesdb/update-point-column.md | 4 +- .../tablesdb/update-polygon-column.md | 4 +- .../tablesdb/update-relationship-column.md | 4 +- docs/examples/tablesdb/update-row.md | 4 +- docs/examples/tablesdb/update-rows.md | 4 +- .../examples/tablesdb/update-string-column.md | 4 +- docs/examples/tablesdb/update-table.md | 4 +- docs/examples/tablesdb/update-text-column.md | 4 +- docs/examples/tablesdb/update-transaction.md | 4 +- docs/examples/tablesdb/update-url-column.md | 4 +- .../tablesdb/update-varchar-column.md | 4 +- docs/examples/tablesdb/update.md | 4 +- docs/examples/tablesdb/upsert-row.md | 4 +- docs/examples/tablesdb/upsert-rows.md | 4 +- docs/examples/teams/create-installation.md | 4 +- docs/examples/teams/create-membership.md | 4 +- docs/examples/teams/create.md | 4 +- docs/examples/teams/delete-installation.md | 4 +- docs/examples/teams/delete-membership.md | 4 +- docs/examples/teams/delete.md | 4 +- docs/examples/teams/get-installation.md | 4 +- docs/examples/teams/get-membership.md | 4 +- docs/examples/teams/get-prefs.md | 4 +- docs/examples/teams/get.md | 4 +- docs/examples/teams/list-installations.md | 4 +- docs/examples/teams/list-memberships.md | 4 +- docs/examples/teams/list.md | 4 +- docs/examples/teams/update-installation.md | 4 +- .../teams/update-membership-status.md | 4 +- docs/examples/teams/update-membership.md | 4 +- docs/examples/teams/update-name.md | 4 +- docs/examples/teams/update-prefs.md | 4 +- docs/examples/tokens/create-file-token.md | 4 +- docs/examples/tokens/delete.md | 4 +- docs/examples/tokens/get.md | 4 +- docs/examples/tokens/list.md | 4 +- docs/examples/tokens/update.md | 4 +- docs/examples/users/create-argon-2-user.md | 4 +- docs/examples/users/create-bcrypt-user.md | 4 +- docs/examples/users/create-jwt.md | 4 +- docs/examples/users/create-md-5-user.md | 4 +- .../users/create-mfa-recovery-codes.md | 4 +- docs/examples/users/create-ph-pass-user.md | 4 +- .../users/create-scrypt-modified-user.md | 4 +- docs/examples/users/create-scrypt-user.md | 4 +- docs/examples/users/create-session.md | 4 +- docs/examples/users/create-sha-user.md | 4 +- docs/examples/users/create-target.md | 4 +- docs/examples/users/create-token.md | 4 +- docs/examples/users/create.md | 4 +- docs/examples/users/delete-identity.md | 4 +- .../users/delete-mfa-authenticator.md | 4 +- docs/examples/users/delete-session.md | 4 +- docs/examples/users/delete-sessions.md | 4 +- docs/examples/users/delete-target.md | 4 +- docs/examples/users/delete.md | 4 +- docs/examples/users/get-mfa-challenge.md | 4 +- docs/examples/users/get-mfa-recovery-codes.md | 4 +- docs/examples/users/get-prefs.md | 4 +- docs/examples/users/get-target.md | 4 +- docs/examples/users/get.md | 4 +- docs/examples/users/list-identities.md | 4 +- docs/examples/users/list-logs.md | 4 +- docs/examples/users/list-memberships.md | 4 +- docs/examples/users/list-mfa-factors.md | 4 +- docs/examples/users/list-sessions.md | 4 +- docs/examples/users/list-targets.md | 4 +- docs/examples/users/list.md | 4 +- .../users/update-email-verification.md | 4 +- docs/examples/users/update-email.md | 4 +- docs/examples/users/update-impersonator.md | 4 +- docs/examples/users/update-labels.md | 4 +- .../users/update-mfa-recovery-codes.md | 4 +- docs/examples/users/update-mfa.md | 4 +- docs/examples/users/update-name.md | 4 +- docs/examples/users/update-password.md | 4 +- .../users/update-phone-verification.md | 4 +- docs/examples/users/update-phone.md | 4 +- docs/examples/users/update-prefs.md | 4 +- docs/examples/users/update-status.md | 4 +- docs/examples/users/update-target.md | 4 +- docs/examples/webhooks/create.md | 4 +- docs/examples/webhooks/delete.md | 4 +- docs/examples/webhooks/get.md | 4 +- docs/examples/webhooks/list.md | 4 +- docs/examples/webhooks/update-secret.md | 4 +- docs/examples/webhooks/update.md | 4 +- docs/organization.md | 2 +- docs/project.md | 15 + docs/sites.md | 2 + docs/tablesdb.md | 2 +- phpstan.neon | 8 + pint.json | 3 + rector.php | 19 + src/Appwrite/AppwriteException.php | 64 +- src/Appwrite/Client.php | 340 ++-- src/Appwrite/Enums/Adapter.php | 10 +- src/Appwrite/Enums/AttributeStatus.php | 10 +- src/Appwrite/Enums/AuthenticationFactor.php | 10 +- src/Appwrite/Enums/AuthenticatorType.php | 10 +- src/Appwrite/Enums/BackupServices.php | 10 +- src/Appwrite/Enums/BillingPlanGroup.php | 10 +- src/Appwrite/Enums/Browser.php | 10 +- src/Appwrite/Enums/BrowserPermission.php | 10 +- src/Appwrite/Enums/BrowserTheme.php | 10 +- src/Appwrite/Enums/BuildRuntime.php | 19 +- src/Appwrite/Enums/ColumnStatus.php | 10 +- src/Appwrite/Enums/Compression.php | 10 +- src/Appwrite/Enums/CreditCard.php | 10 +- src/Appwrite/Enums/DatabaseStatus.php | 10 +- src/Appwrite/Enums/DatabaseType.php | 10 +- src/Appwrite/Enums/DatabasesIndexType.php | 10 +- src/Appwrite/Enums/DeploymentDownloadType.php | 10 +- src/Appwrite/Enums/DeploymentStatus.php | 10 +- src/Appwrite/Enums/EmbeddingModel.php | 10 +- src/Appwrite/Enums/ExecutionMethod.php | 10 +- src/Appwrite/Enums/ExecutionResourceType.php | 52 + src/Appwrite/Enums/ExecutionStatus.php | 10 +- src/Appwrite/Enums/ExecutionTrigger.php | 10 +- src/Appwrite/Enums/Flag.php | 10 +- src/Appwrite/Enums/Framework.php | 10 +- src/Appwrite/Enums/ImageFormat.php | 10 +- src/Appwrite/Enums/ImageGravity.php | 10 +- src/Appwrite/Enums/IndexStatus.php | 10 +- src/Appwrite/Enums/InvalidationType.php | 10 +- src/Appwrite/Enums/MessagePriority.php | 10 +- src/Appwrite/Enums/MessageStatus.php | 10 +- src/Appwrite/Enums/MessagingProviderType.php | 10 +- src/Appwrite/Enums/OAuth2GooglePrompt.php | 10 +- src/Appwrite/Enums/OAuth2OidcPrompt.php | 10 +- src/Appwrite/Enums/OAuthProvider.php | 19 +- src/Appwrite/Enums/OrderBy.php | 10 +- src/Appwrite/Enums/OrganizationKeyScopes.php | 10 +- src/Appwrite/Enums/PasswordHash.php | 10 +- src/Appwrite/Enums/PlatformType.php | 10 +- src/Appwrite/Enums/ProjectAuthMethodId.php | 10 +- src/Appwrite/Enums/ProjectEmailTemplateId.php | 10 +- .../Enums/ProjectEmailTemplateLocale.php | 10 +- src/Appwrite/Enums/ProjectKeyScopes.php | 37 +- .../Enums/ProjectOAuth2GooglePrompt.php | 10 +- .../Enums/ProjectOAuth2OidcPrompt.php | 10 +- src/Appwrite/Enums/ProjectOAuthProviderId.php | 19 +- src/Appwrite/Enums/ProjectPolicyId.php | 10 +- src/Appwrite/Enums/ProjectProtocolId.php | 10 +- src/Appwrite/Enums/ProjectSMTPSecure.php | 10 +- src/Appwrite/Enums/ProjectServiceId.php | 10 +- src/Appwrite/Enums/ProxyResourceType.php | 10 +- .../Enums/ProxyRuleDeploymentResourceType.php | 10 +- src/Appwrite/Enums/ProxyRuleStatus.php | 10 +- src/Appwrite/Enums/Region.php | 10 +- src/Appwrite/Enums/RelationMutate.php | 10 +- src/Appwrite/Enums/RelationshipType.php | 10 +- src/Appwrite/Enums/Runtime.php | 19 +- src/Appwrite/Enums/SmtpEncryption.php | 10 +- src/Appwrite/Enums/StatusCode.php | 10 +- src/Appwrite/Enums/TablesDBIndexType.php | 10 +- src/Appwrite/Enums/TemplateReferenceType.php | 10 +- src/Appwrite/Enums/Timezone.php | 10 +- src/Appwrite/Enums/VCSReferenceType.php | 10 +- src/Appwrite/ID.php | 5 +- src/Appwrite/InputFile.php | 20 +- src/Appwrite/Models/ActivityEvent.php | 8 +- src/Appwrite/Models/ActivityEventList.php | 8 +- src/Appwrite/Models/AdditionalResource.php | 8 +- src/Appwrite/Models/AlgoArgon2.php | 8 +- src/Appwrite/Models/AlgoBcrypt.php | 8 +- src/Appwrite/Models/AlgoMd5.php | 8 +- src/Appwrite/Models/AlgoPhpass.php | 8 +- src/Appwrite/Models/AlgoScrypt.php | 8 +- src/Appwrite/Models/AlgoScryptModified.php | 8 +- src/Appwrite/Models/AlgoSha.php | 8 +- src/Appwrite/Models/App.php | 8 +- src/Appwrite/Models/AppInstallation.php | 10 +- src/Appwrite/Models/AppInstallationList.php | 8 +- src/Appwrite/Models/AppKey.php | 10 +- src/Appwrite/Models/AppKeyList.php | 8 +- src/Appwrite/Models/AppScope.php | 8 +- src/Appwrite/Models/AppScopeList.php | 8 +- src/Appwrite/Models/AppSecret.php | 10 +- src/Appwrite/Models/AppSecretList.php | 8 +- src/Appwrite/Models/AppSecretPlaintext.php | 10 +- src/Appwrite/Models/AppsList.php | 8 +- src/Appwrite/Models/ArraySerializable.php | 12 +- src/Appwrite/Models/AttributeBigint.php | 16 +- src/Appwrite/Models/AttributeBoolean.php | 12 +- src/Appwrite/Models/AttributeDatetime.php | 12 +- src/Appwrite/Models/AttributeEmail.php | 12 +- src/Appwrite/Models/AttributeEnum.php | 12 +- src/Appwrite/Models/AttributeFloat.php | 16 +- src/Appwrite/Models/AttributeInteger.php | 16 +- src/Appwrite/Models/AttributeIp.php | 12 +- src/Appwrite/Models/AttributeLine.php | 12 +- src/Appwrite/Models/AttributeList.php | 8 +- src/Appwrite/Models/AttributeLongtext.php | 14 +- src/Appwrite/Models/AttributeMediumtext.php | 14 +- src/Appwrite/Models/AttributePoint.php | 12 +- src/Appwrite/Models/AttributePolygon.php | 12 +- src/Appwrite/Models/AttributeRelationship.php | 10 +- src/Appwrite/Models/AttributeString.php | 14 +- src/Appwrite/Models/AttributeText.php | 14 +- src/Appwrite/Models/AttributeUrl.php | 12 +- src/Appwrite/Models/AttributeVarchar.php | 14 +- src/Appwrite/Models/BackupArchive.php | 12 +- src/Appwrite/Models/BackupArchiveList.php | 8 +- src/Appwrite/Models/BackupPolicy.php | 12 +- src/Appwrite/Models/BackupPolicyList.php | 8 +- src/Appwrite/Models/BackupRestoration.php | 10 +- src/Appwrite/Models/BackupRestorationList.php | 8 +- src/Appwrite/Models/BillingLimits.php | 24 +- src/Appwrite/Models/BillingPlan.php | 32 +- src/Appwrite/Models/BillingPlanAddon.php | 8 +- .../Models/BillingPlanAddonDetails.php | 10 +- .../BillingPlanDedicatedDatabaseLimits.php | 46 +- src/Appwrite/Models/BillingPlanLimits.php | 12 +- .../Models/BillingPlanSupportedAddons.php | 8 +- src/Appwrite/Models/Block.php | 12 +- src/Appwrite/Models/Bucket.php | 8 +- src/Appwrite/Models/BucketList.php | 8 +- src/Appwrite/Models/Collection.php | 8 +- src/Appwrite/Models/CollectionList.php | 8 +- src/Appwrite/Models/ColumnBigint.php | 16 +- src/Appwrite/Models/ColumnBoolean.php | 12 +- src/Appwrite/Models/ColumnDatetime.php | 12 +- src/Appwrite/Models/ColumnEmail.php | 12 +- src/Appwrite/Models/ColumnEnum.php | 12 +- src/Appwrite/Models/ColumnFloat.php | 16 +- src/Appwrite/Models/ColumnIndex.php | 10 +- src/Appwrite/Models/ColumnIndexList.php | 8 +- src/Appwrite/Models/ColumnInteger.php | 16 +- src/Appwrite/Models/ColumnIp.php | 12 +- src/Appwrite/Models/ColumnLine.php | 12 +- src/Appwrite/Models/ColumnList.php | 8 +- src/Appwrite/Models/ColumnLongtext.php | 14 +- src/Appwrite/Models/ColumnMediumtext.php | 14 +- src/Appwrite/Models/ColumnPoint.php | 12 +- src/Appwrite/Models/ColumnPolygon.php | 12 +- src/Appwrite/Models/ColumnRelationship.php | 10 +- src/Appwrite/Models/ColumnString.php | 14 +- src/Appwrite/Models/ColumnText.php | 14 +- src/Appwrite/Models/ColumnUrl.php | 12 +- src/Appwrite/Models/ColumnVarchar.php | 14 +- src/Appwrite/Models/Continent.php | 8 +- src/Appwrite/Models/ContinentList.php | 8 +- src/Appwrite/Models/Country.php | 8 +- src/Appwrite/Models/CountryList.php | 8 +- src/Appwrite/Models/Currency.php | 8 +- src/Appwrite/Models/CurrencyList.php | 8 +- src/Appwrite/Models/Database.php | 26 +- src/Appwrite/Models/DatabaseList.php | 8 +- src/Appwrite/Models/DatabaseMigration.php | 15 +- src/Appwrite/Models/DatabaseMigrationList.php | 8 +- src/Appwrite/Models/DatabaseStatus.php | 12 +- .../Models/DatabaseStatusConnections.php | 8 +- src/Appwrite/Models/DatabaseStatusReplica.php | 16 +- src/Appwrite/Models/DatabaseStatusVolume.php | 8 +- src/Appwrite/Models/DedicatedDatabase.php | 12 +- .../Models/DedicatedDatabaseMember.php | 16 +- .../Models/DedicatedDatabaseOperation.php | 14 +- .../Models/DedicatedDatabaseOperationList.php | 8 +- .../Models/DedicatedDatabaseReplicas.php | 12 +- .../Models/DedicatedDatabaseSpecification.php | 8 +- .../DedicatedDatabaseSpecificationList.php | 8 +- .../DedicatedDatabaseSpecificationPricing.php | 8 +- src/Appwrite/Models/Deployment.php | 8 +- src/Appwrite/Models/DeploymentList.php | 8 +- src/Appwrite/Models/DevKey.php | 8 +- src/Appwrite/Models/Document.php | 6 +- src/Appwrite/Models/DocumentList.php | 8 +- src/Appwrite/Models/EmailTemplate.php | 8 +- src/Appwrite/Models/EmailTemplateList.php | 8 +- src/Appwrite/Models/Embedding.php | 8 +- src/Appwrite/Models/EmbeddingList.php | 8 +- src/Appwrite/Models/EphemeralKey.php | 8 +- src/Appwrite/Models/Execution.php | 40 +- src/Appwrite/Models/ExecutionList.php | 8 +- src/Appwrite/Models/File.php | 8 +- src/Appwrite/Models/FileList.php | 8 +- src/Appwrite/Models/Framework.php | 8 +- src/Appwrite/Models/FrameworkAdapter.php | 8 +- src/Appwrite/Models/FrameworkList.php | 8 +- src/Appwrite/Models/FunctionList.php | 8 +- src/Appwrite/Models/FunctionModel.php | 8 +- src/Appwrite/Models/Headers.php | 8 +- src/Appwrite/Models/Identity.php | 8 +- src/Appwrite/Models/IdentityList.php | 8 +- src/Appwrite/Models/Index.php | 10 +- src/Appwrite/Models/IndexList.php | 8 +- src/Appwrite/Models/Insight.php | 14 +- src/Appwrite/Models/InsightCTA.php | 8 +- src/Appwrite/Models/InsightList.php | 8 +- src/Appwrite/Models/Jwt.php | 8 +- src/Appwrite/Models/Key.php | 8 +- src/Appwrite/Models/KeyList.php | 8 +- src/Appwrite/Models/Language.php | 8 +- src/Appwrite/Models/LanguageList.php | 8 +- src/Appwrite/Models/Locale.php | 30 +- src/Appwrite/Models/LocaleCode.php | 8 +- src/Appwrite/Models/LocaleCodeList.php | 8 +- src/Appwrite/Models/Log.php | 8 +- src/Appwrite/Models/LogList.php | 8 +- src/Appwrite/Models/Membership.php | 8 +- src/Appwrite/Models/MembershipList.php | 8 +- src/Appwrite/Models/Message.php | 14 +- src/Appwrite/Models/MessageList.php | 8 +- src/Appwrite/Models/MfaChallenge.php | 8 +- src/Appwrite/Models/MfaChallengeSecret.php | 8 +- src/Appwrite/Models/MfaFactors.php | 8 +- src/Appwrite/Models/MfaRecoveryCodes.php | 8 +- src/Appwrite/Models/MfaType.php | 8 +- src/Appwrite/Models/MockNumber.php | 10 +- src/Appwrite/Models/MockNumberList.php | 8 +- src/Appwrite/Models/OAuth2Amazon.php | 8 +- src/Appwrite/Models/OAuth2Apple.php | 8 +- src/Appwrite/Models/OAuth2Appwrite.php | 8 +- src/Appwrite/Models/OAuth2Auth0.php | 8 +- src/Appwrite/Models/OAuth2Authentik.php | 8 +- src/Appwrite/Models/OAuth2Autodesk.php | 8 +- src/Appwrite/Models/OAuth2Bitbucket.php | 8 +- src/Appwrite/Models/OAuth2Bitly.php | 8 +- src/Appwrite/Models/OAuth2Box.php | 8 +- src/Appwrite/Models/OAuth2Dailymotion.php | 8 +- src/Appwrite/Models/OAuth2Discord.php | 8 +- src/Appwrite/Models/OAuth2Disqus.php | 8 +- src/Appwrite/Models/OAuth2Dropbox.php | 8 +- src/Appwrite/Models/OAuth2Etsy.php | 8 +- src/Appwrite/Models/OAuth2Facebook.php | 8 +- src/Appwrite/Models/OAuth2Figma.php | 8 +- src/Appwrite/Models/OAuth2FusionAuth.php | 8 +- src/Appwrite/Models/OAuth2Github.php | 8 +- src/Appwrite/Models/OAuth2Gitlab.php | 8 +- src/Appwrite/Models/OAuth2Google.php | 8 +- src/Appwrite/Models/OAuth2HuggingFace.php | 70 + src/Appwrite/Models/OAuth2Keycloak.php | 8 +- src/Appwrite/Models/OAuth2Kick.php | 8 +- src/Appwrite/Models/OAuth2Linkedin.php | 8 +- src/Appwrite/Models/OAuth2Microsoft.php | 8 +- src/Appwrite/Models/OAuth2Notion.php | 8 +- src/Appwrite/Models/OAuth2Oidc.php | 10 +- src/Appwrite/Models/OAuth2Okta.php | 8 +- src/Appwrite/Models/OAuth2Paypal.php | 8 +- src/Appwrite/Models/OAuth2Podio.php | 8 +- src/Appwrite/Models/OAuth2ProviderList.php | 8 +- src/Appwrite/Models/OAuth2Salesforce.php | 8 +- src/Appwrite/Models/OAuth2Slack.php | 8 +- src/Appwrite/Models/OAuth2Spotify.php | 8 +- src/Appwrite/Models/OAuth2Stripe.php | 8 +- src/Appwrite/Models/OAuth2Tradeshift.php | 8 +- src/Appwrite/Models/OAuth2Twitch.php | 8 +- src/Appwrite/Models/OAuth2WordPress.php | 8 +- src/Appwrite/Models/OAuth2X.php | 8 +- src/Appwrite/Models/OAuth2Yahoo.php | 8 +- src/Appwrite/Models/OAuth2Yandex.php | 8 +- src/Appwrite/Models/OAuth2Zoho.php | 8 +- src/Appwrite/Models/OAuth2Zoom.php | 8 +- src/Appwrite/Models/Oauth2Approve.php | 8 +- src/Appwrite/Models/Oauth2Authorize.php | 8 +- src/Appwrite/Models/Oauth2Consent.php | 8 +- src/Appwrite/Models/Oauth2ConsentList.php | 8 +- src/Appwrite/Models/Oauth2ConsentToken.php | 8 +- .../Models/Oauth2ConsentTokenList.php | 8 +- .../Models/Oauth2DeviceAuthorization.php | 8 +- src/Appwrite/Models/Oauth2Grant.php | 8 +- src/Appwrite/Models/Oauth2Organization.php | 8 +- .../Models/Oauth2OrganizationList.php | 8 +- src/Appwrite/Models/Oauth2PAR.php | 8 +- src/Appwrite/Models/Oauth2Project.php | 8 +- src/Appwrite/Models/Oauth2ProjectList.php | 8 +- src/Appwrite/Models/Oauth2Reject.php | 8 +- src/Appwrite/Models/Oauth2Token.php | 12 +- src/Appwrite/Models/Organization.php | 32 +- src/Appwrite/Models/Phone.php | 8 +- src/Appwrite/Models/PhoneList.php | 8 +- src/Appwrite/Models/PlatformAndroid.php | 8 +- src/Appwrite/Models/PlatformApple.php | 8 +- src/Appwrite/Models/PlatformLinux.php | 8 +- src/Appwrite/Models/PlatformList.php | 8 +- src/Appwrite/Models/PlatformWeb.php | 8 +- src/Appwrite/Models/PlatformWindows.php | 8 +- .../Models/PolicyDenyAliasedEmail.php | 8 +- .../Models/PolicyDenyCorporateEmail.php | 8 +- .../Models/PolicyDenyDisposableEmail.php | 8 +- src/Appwrite/Models/PolicyDenyFreeEmail.php | 8 +- src/Appwrite/Models/PolicyList.php | 8 +- .../Models/PolicyMembershipPrivacy.php | 8 +- src/Appwrite/Models/PolicyMfaFactors.php | 8 +- .../Models/PolicyPasswordDictionary.php | 8 +- src/Appwrite/Models/PolicyPasswordHistory.php | 8 +- .../Models/PolicyPasswordPersonalData.php | 8 +- .../Models/PolicyPasswordStrength.php | 8 +- src/Appwrite/Models/PolicySessionAlert.php | 8 +- src/Appwrite/Models/PolicySessionDuration.php | 8 +- .../Models/PolicySessionInvalidation.php | 8 +- src/Appwrite/Models/PolicySessionLimit.php | 8 +- src/Appwrite/Models/PolicyUserLimit.php | 8 +- src/Appwrite/Models/Preferences.php | 6 +- src/Appwrite/Models/Presence.php | 14 +- src/Appwrite/Models/PresenceList.php | 8 +- src/Appwrite/Models/Program.php | 8 +- src/Appwrite/Models/Project.php | 51 +- src/Appwrite/Models/ProjectAuthMethod.php | 8 +- src/Appwrite/Models/ProjectList.php | 8 +- src/Appwrite/Models/ProjectProtocol.php | 8 +- src/Appwrite/Models/ProjectService.php | 8 +- src/Appwrite/Models/Provider.php | 10 +- src/Appwrite/Models/ProviderList.php | 8 +- src/Appwrite/Models/ProxyInvalidation.php | 8 +- src/Appwrite/Models/ProxyRule.php | 8 +- src/Appwrite/Models/ProxyRuleList.php | 8 +- src/Appwrite/Models/Report.php | 10 +- src/Appwrite/Models/ReportList.php | 8 +- src/Appwrite/Models/ResourceToken.php | 8 +- src/Appwrite/Models/ResourceTokenList.php | 8 +- src/Appwrite/Models/Row.php | 6 +- src/Appwrite/Models/RowList.php | 8 +- src/Appwrite/Models/Runtime.php | 8 +- src/Appwrite/Models/RuntimeList.php | 8 +- src/Appwrite/Models/Session.php | 8 +- src/Appwrite/Models/SessionList.php | 8 +- src/Appwrite/Models/Site.php | 15 +- src/Appwrite/Models/SiteList.php | 8 +- src/Appwrite/Models/Specification.php | 8 +- src/Appwrite/Models/SpecificationList.php | 8 +- src/Appwrite/Models/Subscriber.php | 8 +- src/Appwrite/Models/SubscriberList.php | 8 +- src/Appwrite/Models/Table.php | 8 +- src/Appwrite/Models/TableList.php | 8 +- src/Appwrite/Models/Target.php | 10 +- src/Appwrite/Models/TargetList.php | 8 +- src/Appwrite/Models/Team.php | 8 +- src/Appwrite/Models/TeamList.php | 8 +- src/Appwrite/Models/Token.php | 8 +- src/Appwrite/Models/Topic.php | 8 +- src/Appwrite/Models/TopicList.php | 8 +- src/Appwrite/Models/Transaction.php | 8 +- src/Appwrite/Models/TransactionList.php | 8 +- src/Appwrite/Models/UsageBillingPlan.php | 8 +- src/Appwrite/Models/User.php | 28 +- src/Appwrite/Models/UserList.php | 8 +- src/Appwrite/Models/Variable.php | 8 +- src/Appwrite/Models/VariableList.php | 8 +- src/Appwrite/Models/Webhook.php | 8 +- src/Appwrite/Models/WebhookList.php | 8 +- src/Appwrite/Operator.php | 95 +- src/Appwrite/Permission.php | 2 + src/Appwrite/Query.php | 266 +-- src/Appwrite/Role.php | 46 +- src/Appwrite/Service.php | 7 +- src/Appwrite/Services/Account.php | 279 +-- src/Appwrite/Services/Activities.php | 15 +- src/Appwrite/Services/Advisor.php | 40 +- src/Appwrite/Services/Apps.php | 147 +- src/Appwrite/Services/Avatars.php | 181 +- src/Appwrite/Services/Backups.php | 86 +- src/Appwrite/Services/Databases.php | 579 +----- src/Appwrite/Services/Embeddings.php | 13 +- src/Appwrite/Services/Functions.php | 418 +---- src/Appwrite/Services/Graphql.php | 22 +- src/Appwrite/Services/Locale.php | 26 +- src/Appwrite/Services/Messaging.php | 419 +---- src/Appwrite/Services/Oauth2.php | 112 +- src/Appwrite/Services/Organization.php | 127 +- src/Appwrite/Services/Presences.php | 45 +- src/Appwrite/Services/Project.php | 622 +------ src/Appwrite/Services/Proxy.php | 62 +- src/Appwrite/Services/Sites.php | 413 +---- src/Appwrite/Services/Storage.php | 341 +--- src/Appwrite/Services/TablesDB.php | 632 +------ src/Appwrite/Services/Teams.php | 131 +- src/Appwrite/Services/Tokens.php | 35 +- src/Appwrite/Services/Users.php | 261 +-- src/Appwrite/Services/Webhooks.php | 51 +- tests/Appwrite/ClientTest.php | 194 ++ tests/Appwrite/IDTest.php | 11 +- tests/Appwrite/OperatorTest.php | 65 +- tests/Appwrite/PermissionTest.php | 20 +- tests/Appwrite/QueryTest.php | 150 +- tests/Appwrite/RoleTest.php | 35 +- tests/Appwrite/Services/AccountTest.php | 430 ++--- tests/Appwrite/Services/ActivitiesTest.php | 26 +- tests/Appwrite/Services/AdvisorTest.php | 105 +- tests/Appwrite/Services/AppsTest.php | 290 ++- tests/Appwrite/Services/AvatarsTest.php | 33 +- tests/Appwrite/Services/BackupsTest.php | 130 +- tests/Appwrite/Services/DatabasesTest.php | 533 +++--- tests/Appwrite/Services/EmbeddingsTest.php | 26 +- tests/Appwrite/Services/FunctionsTest.php | 325 ++-- tests/Appwrite/Services/GraphqlTest.php | 18 +- tests/Appwrite/Services/LocaleTest.php | 104 +- tests/Appwrite/Services/MessagingTest.php | 400 ++-- tests/Appwrite/Services/Oauth2Test.php | 90 +- tests/Appwrite/Services/OrganizationTest.php | 492 +++-- tests/Appwrite/Services/PresencesTest.php | 45 +- tests/Appwrite/Services/ProjectTest.php | 1623 ++++++++--------- tests/Appwrite/Services/ProxyTest.php | 57 +- tests/Appwrite/Services/SitesTest.php | 281 ++- tests/Appwrite/Services/StorageTest.php | 97 +- tests/Appwrite/Services/TablesDBTest.php | 643 +++---- tests/Appwrite/Services/TeamsTest.php | 146 +- tests/Appwrite/Services/TokensTest.php | 37 +- tests/Appwrite/Services/UsersTest.php | 505 +++-- tests/Appwrite/Services/WebhooksTest.php | 56 +- 1017 files changed, 8289 insertions(+), 10647 deletions(-) create mode 100644 docs/examples/avatars/get-photo.md create mode 100644 docs/examples/project/update-o-auth-2-hugging-face.md create mode 100644 phpstan.neon create mode 100644 pint.json create mode 100644 rector.php create mode 100644 src/Appwrite/Enums/ExecutionResourceType.php create mode 100644 src/Appwrite/Models/OAuth2HuggingFace.php create mode 100644 tests/Appwrite/ClientTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9345fa..e1d7e04a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 29.0.0 + +* Breaking: requires PHP 8.5 or later, up from PHP 8.2 +* Breaking: HTTP transport rewritten on `utopia-php/client` (PSR-18), now a required dependency +* Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType` +* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes` +* Breaking: `Project.wafEnabled` is now nullable +* Added: `avatars.getPhoto` +* Added: `project.updateOAuth2HuggingFace`, the `OAuth2HuggingFace` model, and the `huggingface` OAuth provider +* Added: `scopes` parameter to `sites.create` and `sites.update`, and `Site.scopes` +* Added: `ExecutionResourceType` enum and the `bun-1.4` runtime +* Added: `Database` fields `containerStatus`, `error`, and `lifecycleState` +* Added: `BillingPlan` fields `supportsDedicatedDatabases` and `databaseComputeCredit` +* Added: `DatabaseMigration.changelogWatermark`, and `replicating` on `DatabaseStatusReplica` and `DedicatedDatabaseMember` +* Updated: enums now implement `Stringable` +* Updated: sources declare `strict_types` and ship `pint`, `phpstan`, and `rector` configs + + ## 28.0.0 * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either diff --git a/README.md b/README.md index c5c62c7b..0afbcba6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ To install via [Composer](http://getcomposer.org/): composer require appwrite/appwrite ``` -Requires PHP 8.2 or later. +Requires PHP 8.5 or later. ## Getting Started diff --git a/composer.json b/composer.json index 54fa8a06..51ce607f 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,11 @@ "email": "team@appwrite.io" }, "scripts": { - "test": "vendor/bin/phpunit" + "test": "vendor/bin/phpunit", + "format": "vendor/bin/pint", + "lint": "vendor/bin/pint --test", + "analyse": "vendor/bin/phpstan analyse --memory-limit=1G", + "refactor": "vendor/bin/rector process --dry-run" }, "autoload": { "psr-4": { @@ -16,14 +20,27 @@ } }, "require": { - "php": ">=8.2.0", + "php": ">=8.5", "ext-curl": "*", "ext-json": "*", + "utopia-php/client": "^0.4.1", "adhocore/jwt": "^1.1" }, "require-dev": { + "laravel/pint": "^1.25", + "mockery/mockery": "1.6.15", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", "phpunit/phpunit": "^12", - "mockery/mockery": "1.6.12" + "rector/rector": "^2.2" + }, + "provide": { + "ext-protobuf": "*" + }, + "config": { + "platform": { + "ext-protobuf": "1.0" + } }, "prefer-stable": true, "minimum-stability": "dev" diff --git a/docs/account.md b/docs/account.md index fcf89b5f..933272a4 100644 --- a/docs/account.md +++ b/docs/account.md @@ -635,7 +635,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | +| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | | success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] | diff --git a/docs/avatars.md b/docs/avatars.md index 11722abf..ee9beb42 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -112,6 +112,23 @@ When one dimension is specified and the other is 0, the image is scaled with pre | background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | | +```http request +GET https://cloud.appwrite.io/v1/avatars/photo +``` + +** Returns the best available profile photo for the currently authenticated user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| width | integer | Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 | +| height | integer | Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 | +| quality | integer | Output image quality between 0 and 100. Defaults to 100. | 100 | +| output | string | Output image format. Defaults to 'png'. | png | +| rating | string | Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. | g | + + ```http request GET https://cloud.appwrite.io/v1/avatars/qr ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 90283cf3..1b58f559 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->createAnonymousSession(); + + ``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 2a80ab61..dc3f7a8c 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createEmailPasswordSession( email: 'email@example.com', password: 'password' -);``` +); + +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 9c20e746..e2fbb11b 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -15,4 +15,6 @@ $result = $account->createEmailToken( userId: '', email: 'email@example.com', phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index 650f5777..5f14a380 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->createEmailVerification( url: 'https://example.com' -);``` +); + +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index a4dde3d7..146bacd4 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -16,4 +16,6 @@ $result = $account->createMagicURLToken( email: 'email@example.com', url: 'https://example.com', // optional phrase: false // optional -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index fbbc193f..16d7938a 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createMFAAuthenticator( type: AuthenticatorType::TOTP() -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 08bf57d8..d44ba734 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createMFAChallenge( factor: AuthenticationFactor::EMAIL() -);``` +); + +``` diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 655663f7..9e4ce17b 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->createMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 170192d6..aace9c9d 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -17,4 +17,6 @@ $result = $account->createOAuth2Token( success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [] // optional -);``` +); + +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index f48754f5..49303f2c 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createPhoneToken( userId: '', phone: '+12065550100' -);``` +); + +``` diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 4cedfba4..b2158136 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->createPhoneVerification(); + + ``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index c6eaadaf..e10f8223 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createRecovery( email: 'email@example.com', url: 'https://example.com' -);``` +); + +``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 6e339b09..d99930f3 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->createSession( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 2266a0f1..97622d89 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->createVerification( url: 'https://example.com' -);``` +); + +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 123538ca..af087d92 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -16,4 +16,6 @@ $result = $account->create( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md index 1cb8fcce..9c44f52a 100644 --- a/docs/examples/account/delete-consent-token.md +++ b/docs/examples/account/delete-consent-token.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->deleteConsentToken( consentId: '', tokenId: '' -);``` +); + +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md index 0aebb0a5..242b7e21 100644 --- a/docs/examples/account/delete-consent.md +++ b/docs/examples/account/delete-consent.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->deleteConsent( consentId: '' -);``` +); + +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 56db56fd..c63e9b55 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->deleteIdentity( identityId: '' -);``` +); + +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index c171381d..9b010f80 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->deleteMFAAuthenticator( type: AuthenticatorType::TOTP() -);``` +); + +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index b200785f..e00952bf 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->deleteSession( sessionId: '' -);``` +); + +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 7886fabf..65d3cf92 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->deleteSessions(); + + ``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index dda1a1ca..fce21689 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->getConsentToken( consentId: '', tokenId: '' -);``` +); + +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index f6ce59fc..f65331de 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->getConsent( consentId: '' -);``` +); + +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 9a99dac2..1de88d8a 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->getMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index e1259176..0787dbb2 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->getPrefs(); + + ``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 7e79a07f..d441989f 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->getSession( sessionId: '' -);``` +); + +``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index d1fb255b..89c95043 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->get(); + + ``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 0088745c..566379b1 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -15,4 +15,6 @@ $result = $account->listConsentTokens( consentId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md index b2c63a30..10d3125b 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->listConsents( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 1bd2ef02..8a7383d3 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->listIdentities( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 763b7727..1bb6b555 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->listLogs( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 96b6021b..d163fa22 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->listMFAFactors(); + + ``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 9c42f8ca..c74648f7 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->listSessions(); + + ``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index 2fa17a54..0dde16ee 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updateEmailVerification( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 8cdfc5f1..b3424766 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updateEmail( email: 'email@example.com', password: 'password' -);``` +); + +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 055f0664..e5deb208 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updateMagicURLSession( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index c2f9dd66..40347461 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -15,4 +15,6 @@ $account = new Account($client); $result = $account->updateMFAAuthenticator( type: AuthenticatorType::TOTP(), otp: '' -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index effbb172..c91895c6 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updateMFAChallenge( challengeId: '', otp: '' -);``` +); + +``` diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index ee16a9c9..f8b417c7 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->updateMFARecoveryCodes(); + + ``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 3d2f9b62..de9d3aa9 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->updateMFA( mfa: false -);``` +); + +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 4a34bc32..e44d0a8e 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->updateName( name: '' -);``` +); + +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 13f03c87..ac60efe6 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updatePassword( password: 'password', oldPassword: 'password' // optional -);``` +); + +``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 67b5816d..44b366b9 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updatePhoneSession( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 877a0346..0485eb44 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updatePhoneVerification( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 6b5e9cad..f21c6573 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updatePhone( phone: '+12065550100', password: 'password' -);``` +); + +``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 4709edd2..c792935c 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -17,4 +17,6 @@ $result = $account->updatePrefs( 'timezone' => 'UTC', 'darkTheme' => true ] -);``` +); + +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 23a626e3..1d2b1c3c 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -15,4 +15,6 @@ $result = $account->updateRecovery( userId: '', secret: '', password: 'password' -);``` +); + +``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index aecf2fe8..9dcf30d0 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -13,4 +13,6 @@ $account = new Account($client); $result = $account->updateSession( sessionId: '' -);``` +); + +``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 7f0088a6..a4fcef8c 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -12,4 +12,6 @@ $client = (new Client()) $account = new Account($client); $result = $account->updateStatus(); + + ``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 24bb3ff0..534d5028 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -14,4 +14,6 @@ $account = new Account($client); $result = $account->updateVerification( userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 6b8f5421..3375c0e5 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -13,4 +13,6 @@ $activities = new Activities($client); $result = $activities->getEvent( eventId: '' -);``` +); + +``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index cab59cfc..977b32f0 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -13,4 +13,6 @@ $activities = new Activities($client); $result = $activities->listEvents( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/advisor/delete-report.md b/docs/examples/advisor/delete-report.md index 997fd5e9..a7af81df 100644 --- a/docs/examples/advisor/delete-report.md +++ b/docs/examples/advisor/delete-report.md @@ -13,4 +13,6 @@ $advisor = new Advisor($client); $result = $advisor->deleteReport( reportId: '' -);``` +); + +``` diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 421a8476..886a8e11 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -14,4 +14,6 @@ $advisor = new Advisor($client); $result = $advisor->getInsight( reportId: '', insightId: '' -);``` +); + +``` diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 8baacab7..c7819700 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -13,4 +13,6 @@ $advisor = new Advisor($client); $result = $advisor->getReport( reportId: '' -);``` +); + +``` diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 10cf4fd9..6f569e1c 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -15,4 +15,6 @@ $result = $advisor->listInsights( reportId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index 29c42206..0d41fcd0 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -14,4 +14,6 @@ $advisor = new Advisor($client); $result = $advisor->listReports( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index 33d117ae..9ce6d416 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->createInstallationToken( appId: '', installationId: '' -);``` +); + +``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index 7690aeaa..4307edde 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -13,4 +13,6 @@ $apps = new Apps($client); $result = $apps->createKey( appId: '' -);``` +); + +``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index cff66b3b..79815d48 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -13,4 +13,6 @@ $apps = new Apps($client); $result = $apps->createSecret( appId: '' -);``` +); + +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 8c7c2869..6ab07f0e 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -31,4 +31,6 @@ $result = $apps->create( type: 'public', // optional deviceFlow: false, // optional teamId: '' // optional -);``` +); + +``` diff --git a/docs/examples/apps/delete-installation.md b/docs/examples/apps/delete-installation.md index e57a12f4..d2813b5b 100644 --- a/docs/examples/apps/delete-installation.md +++ b/docs/examples/apps/delete-installation.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->deleteInstallation( appId: '', installationId: '' -);``` +); + +``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md index d07194eb..555497e2 100644 --- a/docs/examples/apps/delete-key.md +++ b/docs/examples/apps/delete-key.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->deleteKey( appId: '', keyId: '' -);``` +); + +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md index df614d6a..66c2e3e8 100644 --- a/docs/examples/apps/delete-secret.md +++ b/docs/examples/apps/delete-secret.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->deleteSecret( appId: '', secretId: '' -);``` +); + +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md index 200cb924..3be8290b 100644 --- a/docs/examples/apps/delete-tokens.md +++ b/docs/examples/apps/delete-tokens.md @@ -13,4 +13,6 @@ $apps = new Apps($client); $result = $apps->deleteTokens( appId: '' -);``` +); + +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md index 38cfcf55..68699e5c 100644 --- a/docs/examples/apps/delete.md +++ b/docs/examples/apps/delete.md @@ -13,4 +13,6 @@ $apps = new Apps($client); $result = $apps->delete( appId: '' -);``` +); + +``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 0f7a9bac..dd5086fe 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->getInstallation( appId: '', installationId: '' -);``` +); + +``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index 78e30e19..b472e214 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->getKey( appId: '', keyId: '' -);``` +); + +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index ef4c1d4f..43a5e44f 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->getSecret( appId: '', secretId: '' -);``` +); + +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index 7c9ce18a..cf478134 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -13,4 +13,6 @@ $apps = new Apps($client); $result = $apps->get( appId: '' -);``` +); + +``` diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md index f60f6c51..1c9471f0 100644 --- a/docs/examples/apps/list-installation-scopes.md +++ b/docs/examples/apps/list-installation-scopes.md @@ -12,4 +12,6 @@ $client = (new Client()) $apps = new Apps($client); $result = $apps->listInstallationScopes(); + + ``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 0209cd24..22e21f9a 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -15,4 +15,6 @@ $result = $apps->listInstallations( appId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md index 8d816537..08796916 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -15,4 +15,6 @@ $result = $apps->listKeys( appId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md index 4bcfa44b..77f52082 100644 --- a/docs/examples/apps/list-o-auth-2-scopes.md +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -12,4 +12,6 @@ $client = (new Client()) $apps = new Apps($client); $result = $apps->listOAuth2Scopes(); + + ``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index 341fa345..e5db518e 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -15,4 +15,6 @@ $result = $apps->listSecrets( appId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md index 9add376d..0295494c 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->list( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md index e3786e42..acd381a9 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->updateLabels( appId: '', labels: [] -);``` +); + +``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md index 76ea6ce2..9372ee8b 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -14,4 +14,6 @@ $apps = new Apps($client); $result = $apps->updateTeam( appId: '', teamId: '' -);``` +); + +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index 5d914c74..6b957310 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -32,4 +32,6 @@ $result = $apps->update( deviceFlow: false, // optional installationScopes: [], // optional installationRedirectUrl: 'https://example.com' // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index ec2a7599..11385f1e 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -17,4 +17,6 @@ $result = $avatars->getBrowser( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 05ddc247..de19fe4c 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -17,4 +17,6 @@ $result = $avatars->getCreditCard( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 424cea84..362ff7fa 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -13,4 +13,6 @@ $avatars = new Avatars($client); $result = $avatars->getFavicon( url: 'https://example.com' -);``` +); + +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 1a4ef37a..8ffc7d72 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -17,4 +17,6 @@ $result = $avatars->getFlag( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 4ceb8d38..62f89e5a 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -15,4 +15,6 @@ $result = $avatars->getImage( url: 'https://example.com', width: 0, // optional height: 0 // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 2bd523b5..57abcfb1 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -16,4 +16,6 @@ $result = $avatars->getInitials( width: 0, // optional height: 0, // optional background: '' // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md new file mode 100644 index 00000000..ce8e992a --- /dev/null +++ b/docs/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g' // optional +); + +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index ad49bf9e..c26932c2 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -16,4 +16,6 @@ $result = $avatars->getQR( size: 1, // optional margin: 0, // optional download: false // optional -);``` +); + +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index d2381633..fff2b074 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -39,4 +39,6 @@ $result = $avatars->getScreenshot( height: 600, // optional quality: 85, // optional output: ImageFormat::JPEG() // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index d73db2e2..17ba5d4e 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -15,4 +15,6 @@ $backups = new Backups($client); $result = $backups->createArchive( services: [BackupServices::DATABASES()], resourceId: '' // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md index ea87f280..ffdf7180 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -20,4 +20,6 @@ $result = $backups->createPolicy( name: '', // optional resourceId: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 61d9e0b2..6981dd8b 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -17,4 +17,6 @@ $result = $backups->createRestoration( services: [BackupServices::DATABASES()], newResourceId: '', // optional newResourceName: '' // optional -);``` +); + +``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md index a6c3d332..54cff954 100644 --- a/docs/examples/backups/delete-archive.md +++ b/docs/examples/backups/delete-archive.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->deleteArchive( archiveId: '' -);``` +); + +``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md index 3c6df8f4..7a7995a8 100644 --- a/docs/examples/backups/delete-policy.md +++ b/docs/examples/backups/delete-policy.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->deletePolicy( policyId: '' -);``` +); + +``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md index 6fa9ea93..51acbecc 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->getArchive( archiveId: '' -);``` +); + +``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md index e8ce5c8f..69b9f920 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->getPolicy( policyId: '' -);``` +); + +``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md index ed3e94ab..57c2cf50 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->getRestoration( restorationId: '' -);``` +); + +``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index 4060e3c0..dece661e 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->listArchives( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index a8b03316..7ee82d9e 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->listPolicies( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index 2c7132b2..558e4a36 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -13,4 +13,6 @@ $backups = new Backups($client); $result = $backups->listRestorations( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md index fe53fa2b..da6310ee 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -17,4 +17,6 @@ $result = $backups->updatePolicy( retention: 1, // optional schedule: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index eea06b58..563f7c4e 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -20,4 +20,6 @@ $result = $databases->createBigIntAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 746db6be..f1b8056e 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -18,4 +18,6 @@ $result = $databases->createBooleanAttribute( required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index a90e579b..2e4dd3e3 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -22,4 +22,6 @@ $result = $databases->createCollection( enabled: false, // optional attributes: [], // optional indexes: [] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 862ed260..0aa01849 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -18,4 +18,6 @@ $result = $databases->createDatetimeAttribute( required: false, default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f8e7e943..fec6e85a 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -26,4 +26,6 @@ $result = $databases->createDocument( ], permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index f4f153ae..7156ce21 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -16,4 +16,6 @@ $result = $databases->createDocuments( collectionId: '', documents: [], transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 4f53b8ac..a2c54196 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -18,4 +18,6 @@ $result = $databases->createEmailAttribute( required: false, default: 'email@example.com', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 49eb90a5..f80a5014 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -19,4 +19,6 @@ $result = $databases->createEnumAttribute( required: false, default: '', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 60486bbb..23b4864d 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -20,4 +20,6 @@ $result = $databases->createFloatAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 9ecf25ab..3663fbe9 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -21,4 +21,6 @@ $result = $databases->createIndex( attributes: [], orders: [OrderBy::ASC()], // optional lengths: [] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index e1c771fe..c224755d 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -20,4 +20,6 @@ $result = $databases->createIntegerAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index b15fc386..f7a25bff 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -18,4 +18,6 @@ $result = $databases->createIpAttribute( required: false, default: '', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index dd59e00b..ccea2700 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -17,4 +17,6 @@ $result = $databases->createLineAttribute( key: '', required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index cc597b5a..6cc66b9b 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -19,4 +19,6 @@ $result = $databases->createLongtextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 16fbe809..15c26aba 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -19,4 +19,6 @@ $result = $databases->createMediumtextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 10b2e6c5..00cf4e24 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -24,4 +24,6 @@ $result = $databases->createOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 14ced405..9f4c913c 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -17,4 +17,6 @@ $result = $databases->createPointAttribute( key: '', required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 5886cf2c..a0d0bb0e 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -17,4 +17,6 @@ $result = $databases->createPolygonAttribute( key: '', required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 739b27e2..251f73a7 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -22,4 +22,6 @@ $result = $databases->createRelationshipAttribute( key: '', // optional twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index e6da9507..8f4e3fc8 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -20,4 +20,6 @@ $result = $databases->createStringAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 30067dce..b00d8caa 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -19,4 +19,6 @@ $result = $databases->createTextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index 9ca80288..7f145827 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->createTransaction( ttl: 60 // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index c1b432df..4f077794 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -18,4 +18,6 @@ $result = $databases->createUrlAttribute( required: false, default: 'https://example.com', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 1ebbff5f..7a02c976 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -20,4 +20,6 @@ $result = $databases->createVarcharAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 867c31c2..2cd1b249 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -15,4 +15,6 @@ $result = $databases->create( databaseId: '', name: '', enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 2c00e787..5b541ecc 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -19,4 +19,6 @@ $result = $databases->decrementDocumentAttribute( value: null, // optional min: null, // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index cc777436..99c4ea5c 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -15,4 +15,6 @@ $result = $databases->deleteAttribute( databaseId: '', collectionId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 8419bc41..ca0a5d11 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -14,4 +14,6 @@ $databases = new Databases($client); $result = $databases->deleteCollection( databaseId: '', collectionId: '' -);``` +); + +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index c0c620bc..522d09f9 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -16,4 +16,6 @@ $result = $databases->deleteDocument( collectionId: '', documentId: '', transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 124294dc..52ec3331 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -16,4 +16,6 @@ $result = $databases->deleteDocuments( collectionId: '', queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index d8106099..665d34cc 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -15,4 +15,6 @@ $result = $databases->deleteIndex( databaseId: '', collectionId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 3e2db81e..723c28ae 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->deleteTransaction( transactionId: '' -);``` +); + +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 9d89cfbc..242c3b14 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->delete( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 4f3f7f77..cc9c30e7 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -15,4 +15,6 @@ $result = $databases->getAttribute( databaseId: '', collectionId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index e3cccdf3..9d94b681 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -14,4 +14,6 @@ $databases = new Databases($client); $result = $databases->getCollection( databaseId: '', collectionId: '' -);``` +); + +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 90f8760e..8919a74d 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -17,4 +17,6 @@ $result = $databases->getDocument( documentId: '', queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 001fc6ed..d2ec8022 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -15,4 +15,6 @@ $result = $databases->getIndex( databaseId: '', collectionId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 82b34ae6..fd896382 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->getTransaction( transactionId: '' -);``` +); + +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 59a83bf9..d03605ec 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->get( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 8782cf7d..d17f4e2c 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -19,4 +19,6 @@ $result = $databases->incrementDocumentAttribute( value: null, // optional max: null, // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index dac753db..003af12f 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -16,4 +16,6 @@ $result = $databases->listAttributes( collectionId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 7f994e1d..94478581 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -16,4 +16,6 @@ $result = $databases->listCollections( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 8e318580..d35b48ee 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -18,4 +18,6 @@ $result = $databases->listDocuments( transactionId: '', // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 1ebd2692..b784d05d 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -16,4 +16,6 @@ $result = $databases->listIndexes( collectionId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 8990c74e..2456f592 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -13,4 +13,6 @@ $databases = new Databases($client); $result = $databases->listTransactions( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index d439184a..307f9d48 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -15,4 +15,6 @@ $result = $databases->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 5d0eb63e..f4548334 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -20,4 +20,6 @@ $result = $databases->updateBigIntAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index f63e5f3f..27486c4f 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateBooleanAttribute( required: false, default: false, newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index ddd369b1..c21d9dfb 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -21,4 +21,6 @@ $result = $databases->updateCollection( documentSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 9bff9317..5931d72d 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateDatetimeAttribute( required: false, default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 7a185451..08341e10 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -26,4 +26,6 @@ $result = $databases->updateDocument( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index c29a467d..40c85a1d 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -23,4 +23,6 @@ $result = $databases->updateDocuments( ], // optional queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index b4421d5e..104fd3e0 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateEmailAttribute( required: false, default: 'email@example.com', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index c2880f29..83892c7a 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -19,4 +19,6 @@ $result = $databases->updateEnumAttribute( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 3ea48188..10195c69 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -20,4 +20,6 @@ $result = $databases->updateFloatAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 29b7ac6b..73c4b059 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -20,4 +20,6 @@ $result = $databases->updateIntegerAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index c7490c5f..5f9d4368 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateIpAttribute( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 7cb7dabb..ad82721c 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateLineAttribute( required: false, default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index d9a217d2..43e7042d 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateLongtextAttribute( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index bae03412..3523f074 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateMediumtextAttribute( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 1359ec90..7b4b403a 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updatePointAttribute( required: false, default: [1, 2], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index cf799969..d91d6b9b 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updatePolygonAttribute( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 824f1f71..5bb02f3c 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateRelationshipAttribute( key: '', onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 828dda47..b60af694 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -19,4 +19,6 @@ $result = $databases->updateStringAttribute( default: '', size: 1, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 8de8c78c..4d68480f 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateTextAttribute( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index 13137b6b..f015bb69 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -15,4 +15,6 @@ $result = $databases->updateTransaction( transactionId: '', commit: false, // optional rollback: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 461abf55..91cfbd3c 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -18,4 +18,6 @@ $result = $databases->updateUrlAttribute( required: false, default: 'https://example.com', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 0c5dbbe8..62b84088 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -19,4 +19,6 @@ $result = $databases->updateVarcharAttribute( default: '', size: 1, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 67af71aa..4d97f2ac 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -15,4 +15,6 @@ $result = $databases->update( databaseId: '', name: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 9b01b8c2..9a04f48d 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -26,4 +26,6 @@ $result = $databases->upsertDocument( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 5bc04d78..bc526bcc 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -16,4 +16,6 @@ $result = $databases->upsertDocuments( collectionId: '', documents: [], transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 15f92318..81f49595 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -15,4 +15,6 @@ $embeddings = new Embeddings($client); $result = $embeddings->createTextEmbeddings( texts: [], model: EmbeddingModel::NOMICEMBEDTEXT() // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index cdee0ff9..6dcb781c 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -18,4 +18,6 @@ $result = $functions->createDeployment( activate: false, entrypoint: '', // optional commands: '' // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 0cf3a831..bad0eb8e 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -15,4 +15,6 @@ $result = $functions->createDuplicateDeployment( functionId: '', deploymentId: '', buildId: '' // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 70a8fc06..f0496fc5 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -20,4 +20,6 @@ $result = $functions->createExecution( method: ExecutionMethod::GET(), // optional headers: [], // optional scheduledAt: '' // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index c6dae9a9..d22bf77e 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -20,4 +20,6 @@ $result = $functions->createTemplateDeployment( type: TemplateReferenceType::COMMIT(), reference: '', activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 685a21aa..3b0c6a33 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -17,4 +17,6 @@ $result = $functions->createVariable( key: '', value: '', secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 5ccab950..6fc9102f 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -17,4 +17,6 @@ $result = $functions->createVcsDeployment( type: VCSReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 4e8a23d7..08a0cf21 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -36,4 +36,6 @@ $result = $functions->create( buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 96e78e3b..ec396d15 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->deleteDeployment( functionId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index e95d2f70..a9c0d5d6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->deleteExecution( functionId: '', executionId: '' -);``` +); + +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 9be2e174..37636595 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->deleteVariable( functionId: '', variableId: '' -);``` +); + +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index d718bfbf..f0a537c5 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -13,4 +13,6 @@ $functions = new Functions($client); $result = $functions->delete( functionId: '' -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index e267d325..cc13f4c7 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -17,4 +17,6 @@ $result = $functions->getDeploymentDownload( deploymentId: '', type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional -);``` +); + +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index f8d4a26e..22952f40 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->getDeployment( functionId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f647a7fd..cb220cab 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->getExecution( functionId: '', executionId: '' -);``` +); + +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 8d408643..abb818c4 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->getVariable( functionId: '', variableId: '' -);``` +); + +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index e5997ee2..76b51372 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -13,4 +13,6 @@ $functions = new Functions($client); $result = $functions->get( functionId: '' -);``` +); + +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index bc46662a..d5976496 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -16,4 +16,6 @@ $result = $functions->listDeployments( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 9948e862..43df2432 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -15,4 +15,6 @@ $result = $functions->listExecutions( functionId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 320a9dc6..593e808d 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -12,4 +12,6 @@ $client = (new Client()) $functions = new Functions($client); $result = $functions->listRuntimes(); + + ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 7211ce69..be4774e5 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -13,4 +13,6 @@ $functions = new Functions($client); $result = $functions->listSpecifications( type: 'runtimes' // optional -);``` +); + +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 33d09ddf..c4484fc6 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -15,4 +15,6 @@ $result = $functions->listVariables( functionId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 2dc45db0..50add8c3 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -15,4 +15,6 @@ $result = $functions->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 311645e5..314e6b8a 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->updateDeploymentStatus( functionId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index b1c0edb7..fd214aea 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -14,4 +14,6 @@ $functions = new Functions($client); $result = $functions->updateFunctionDeployment( functionId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index c4b9a4c3..b6a8a799 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -17,4 +17,6 @@ $result = $functions->updateVariable( key: '', // optional value: '', // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4eaeb871..53bfa48e 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -36,4 +36,6 @@ $result = $functions->update( buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional -);``` +); + +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 1e25bf73..90aed67c 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -13,4 +13,6 @@ $graphql = new Graphql($client); $result = $graphql->mutation( query: [] -);``` +); + +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 90979942..d3360446 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -13,4 +13,6 @@ $graphql = new Graphql($client); $result = $graphql->query( query: [] -);``` +); + +``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 8b204573..6c957ae5 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->get(); + + ``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 5c99bbf2..fcc57aef 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCodes(); + + ``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 1245b2ec..0fa22fd6 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listContinents(); + + ``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index 9744c8ea..348bbdc9 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountriesEU(); + + ``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index df66061f..1d5a4ce5 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountriesPhones(); + + ``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index f4f96262..37dab2cf 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountries(); + + ``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index f4f1125a..1b012f5a 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCurrencies(); + + ``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index b25fab64..962eb6a1 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -12,4 +12,6 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listLanguages(); + + ``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 768878ac..879ffd5c 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -20,4 +20,6 @@ $result = $messaging->createAPNSProvider( bundleId: '', // optional sandbox: false, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index bde1bb59..c8aa41bf 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -24,4 +24,6 @@ $result = $messaging->createEmail( draft: false, // optional html: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 1ab3e983..4884187f 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -16,4 +16,6 @@ $result = $messaging->createFCMProvider( name: '', serviceAccountJSON: [], // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index ca0a3cb1..17ca677b 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -22,4 +22,6 @@ $result = $messaging->createMailgunProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 78998cf5..874d7342 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -18,4 +18,6 @@ $result = $messaging->createMsg91Provider( senderId: '', // optional authKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7efef532..cb1fe78c 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -32,4 +32,6 @@ $result = $messaging->createPush( contentAvailable: false, // optional critical: false, // optional priority: MessagePriority::NORMAL() // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index e32ad9fc..8b0d4de0 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -20,4 +20,6 @@ $result = $messaging->createResendProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 38f213c4..9d43b261 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -20,4 +20,6 @@ $result = $messaging->createSendgridProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index a9ec11c0..9eb2470f 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -22,4 +22,6 @@ $result = $messaging->createSesProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 1f45876b..e01b8db6 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -19,4 +19,6 @@ $result = $messaging->createSMS( targets: [], // optional draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index a55fd0fc..04b22dc9 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -27,4 +27,6 @@ $result = $messaging->createSMTPProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index f0d27831..4b985e0d 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -15,4 +15,6 @@ $result = $messaging->createSubscriber( topicId: '', subscriberId: '', targetId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 005e6d03..680c4f0f 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -18,4 +18,6 @@ $result = $messaging->createTelesignProvider( customerId: '', // optional apiKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 262a9e2a..40a2262c 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -18,4 +18,6 @@ $result = $messaging->createTextmagicProvider( username: '', // optional apiKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 460168e4..67621985 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -15,4 +15,6 @@ $result = $messaging->createTopic( topicId: '', name: '', subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index f8ee4175..ee09eced 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -18,4 +18,6 @@ $result = $messaging->createTwilioProvider( accountSid: '', // optional authToken: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 450cf9c5..5d30c29d 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -18,4 +18,6 @@ $result = $messaging->createVonageProvider( apiKey: '', // optional apiSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index e0a63c15..95666ab1 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->deleteProvider( providerId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 9720ad07..d816d971 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -14,4 +14,6 @@ $messaging = new Messaging($client); $result = $messaging->deleteSubscriber( topicId: '', subscriberId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 90614515..2841dbd2 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->deleteTopic( topicId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 15489058..31126585 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->delete( messageId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index a1d2f026..02d2859c 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->getMessage( messageId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 6353e54f..cc4fb950 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->getProvider( providerId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index d3a20e95..88d3ee34 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -14,4 +14,6 @@ $messaging = new Messaging($client); $result = $messaging->getSubscriber( topicId: '', subscriberId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 95ff3ff7..c6cee360 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -13,4 +13,6 @@ $messaging = new Messaging($client); $result = $messaging->getTopic( topicId: '' -);``` +); + +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index fa6d57c3..cb4242b0 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -15,4 +15,6 @@ $result = $messaging->listMessages( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 281a5220..c683dfb2 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -15,4 +15,6 @@ $result = $messaging->listProviders( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 096a8f2e..f0b54f62 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -16,4 +16,6 @@ $result = $messaging->listSubscribers( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 0615d820..5ee4763e 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -15,4 +15,6 @@ $result = $messaging->listTargets( messageId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 6386df17..b8e517f2 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -15,4 +15,6 @@ $result = $messaging->listTopics( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index aa0e78f0..2057404a 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -20,4 +20,6 @@ $result = $messaging->updateAPNSProvider( teamId: '', // optional bundleId: '', // optional sandbox: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 80918b1c..4e7e8be5 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -24,4 +24,6 @@ $result = $messaging->updateEmail( bcc: [], // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index a9a54d1c..190fb102 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -16,4 +16,6 @@ $result = $messaging->updateFCMProvider( name: '', // optional enabled: false, // optional serviceAccountJSON: [] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 6392e78b..396014fe 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -22,4 +22,6 @@ $result = $messaging->updateMailgunProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 67b689c9..a5dc4d15 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -18,4 +18,6 @@ $result = $messaging->updateMsg91Provider( templateId: '', // optional senderId: '', // optional authKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 32cb1205..fb6c1ad4 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -32,4 +32,6 @@ $result = $messaging->updatePush( contentAvailable: false, // optional critical: false, // optional priority: MessagePriority::NORMAL() // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index ab60aaf3..adcff5b6 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -20,4 +20,6 @@ $result = $messaging->updateResendProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index e6e0391a..be9c4211 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -20,4 +20,6 @@ $result = $messaging->updateSendgridProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index ee73b5cf..58e6c5f3 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -22,4 +22,6 @@ $result = $messaging->updateSesProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index e59af27c..100118fd 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -19,4 +19,6 @@ $result = $messaging->updateSMS( content: '', // optional draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 73b4b3af..43eaf6e1 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -27,4 +27,6 @@ $result = $messaging->updateSMTPProvider( replyToName: '', // optional replyToEmail: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 33fcbb30..c21ccea8 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -18,4 +18,6 @@ $result = $messaging->updateTelesignProvider( customerId: '', // optional apiKey: '', // optional from: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 96564c70..adecdb2c 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -18,4 +18,6 @@ $result = $messaging->updateTextmagicProvider( username: '', // optional apiKey: '', // optional from: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 257e7544..b7e24d1c 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -15,4 +15,6 @@ $result = $messaging->updateTopic( topicId: '', name: '', // optional subscribe: ["any"] // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index c9bcfa9b..21057d69 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -18,4 +18,6 @@ $result = $messaging->updateTwilioProvider( accountSid: '', // optional authToken: '', // optional from: '' // optional -);``` +); + +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 112745e7..15616e31 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -18,4 +18,6 @@ $result = $messaging->updateVonageProvider( apiKey: '', // optional apiSecret: '', // optional from: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index f3c77d1a..2866f26b 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -15,4 +15,6 @@ $result = $oauth2->approve( grantId: '', authorizationDetails: '', // optional scope: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index 8f2b1251..d2a3f3ef 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -26,4 +26,6 @@ $result = $oauth2->authorizePost( resource: '', // optional audience: '', // optional requestUri: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index c0217125..7f2aa27d 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -26,4 +26,6 @@ $result = $oauth2->authorize( resource: '', // optional audience: '', // optional requestUri: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index 6da66a8b..37ae2cc6 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -17,4 +17,6 @@ $result = $oauth2->createDeviceAuthorization( authorizationDetails: '', // optional resource: '', // optional audience: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 598470f6..c7c31af1 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -13,4 +13,6 @@ $oauth2 = new Oauth2($client); $result = $oauth2->createGrant( userCode: '' -);``` +); + +``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index ca770f1b..e8691f91 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -25,4 +25,6 @@ $result = $oauth2->createPAR( authorizationDetails: '', // optional resource: '', // optional audience: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index 61905d60..8ec540ed 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -22,4 +22,6 @@ $result = $oauth2->createToken( redirectUri: 'https://example.com', // optional resource: '', // optional audience: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index b4979828..fb74fed5 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -13,4 +13,6 @@ $oauth2 = new Oauth2($client); $result = $oauth2->getGrant( grantId: '' -);``` +); + +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index 1c2fb1c4..c0156181 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -15,4 +15,6 @@ $result = $oauth2->listOrganizations( limit: 1, // optional offset: 0, // optional search: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index ea4ff032..64310972 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -15,4 +15,6 @@ $result = $oauth2->listProjects( limit: 1, // optional offset: 0, // optional search: '' // optional -);``` +); + +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index 65deab84..925270c6 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -13,4 +13,6 @@ $oauth2 = new Oauth2($client); $result = $oauth2->reject( grantId: '' -);``` +); + +``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 97c7b861..907a36ff 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -16,4 +16,6 @@ $result = $oauth2->revoke( tokenTypeHint: 'access_token', // optional clientId: '', // optional clientSecret: '' // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index 51855c47..cce4d57f 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->createInstallation( appId: '', authorizationDetails: '' // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md index 67127ca3..f77fe40c 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-key.md @@ -17,4 +17,6 @@ $result = $organization->createKey( name: '', scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index 372c09cc..647fa32e 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -18,4 +18,6 @@ $result = $organization->createMembership( phone: '+12065550100', // optional url: 'https://example.com', // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index ffb08c2e..4b9faa74 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -16,4 +16,6 @@ $result = $organization->createProject( projectId: '', name: '', region: Region::FRA() // optional -);``` +); + +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md index 23b8e692..9dee34a0 100644 --- a/docs/examples/organization/delete-installation.md +++ b/docs/examples/organization/delete-installation.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->deleteInstallation( installationId: '' -);``` +); + +``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md index 34a53d66..656f9ba4 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-key.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->deleteKey( keyId: '' -);``` +); + +``` diff --git a/docs/examples/organization/delete-membership.md b/docs/examples/organization/delete-membership.md index 9da3b64f..1dc7ae49 100644 --- a/docs/examples/organization/delete-membership.md +++ b/docs/examples/organization/delete-membership.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->deleteMembership( membershipId: '' -);``` +); + +``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md index 6900101a..ee35f9b8 100644 --- a/docs/examples/organization/delete-project.md +++ b/docs/examples/organization/delete-project.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->deleteProject( projectId: '' -);``` +); + +``` diff --git a/docs/examples/organization/delete.md b/docs/examples/organization/delete.md index 1160857a..83aec78c 100644 --- a/docs/examples/organization/delete.md +++ b/docs/examples/organization/delete.md @@ -12,4 +12,6 @@ $client = (new Client()) $organization = new Organization($client); $result = $organization->delete(); + + ``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index 5e4b6763..bacc49b7 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->getInstallation( installationId: '' -);``` +); + +``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md index 165b5663..f312776a 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-key.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->getKey( keyId: '' -);``` +); + +``` diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 52e2d17d..317a9b90 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->getMembership( membershipId: '' -);``` +); + +``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index 27a101da..e85ffaea 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->getProject( projectId: '' -);``` +); + +``` diff --git a/docs/examples/organization/get.md b/docs/examples/organization/get.md index 6fb38198..43735ed9 100644 --- a/docs/examples/organization/get.md +++ b/docs/examples/organization/get.md @@ -12,4 +12,6 @@ $client = (new Client()) $organization = new Organization($client); $result = $organization->get(); + + ``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 170243d3..60e6e7f4 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->listInstallations( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md index 7cc16f01..aed10b2d 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-keys.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->listKeys( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index 17858996..fc4493a9 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -15,4 +15,6 @@ $result = $organization->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index 5fafb599..5c8b2048 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -15,4 +15,6 @@ $result = $organization->listProjects( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index a35f797e..7344bb43 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->updateInstallation( installationId: '', authorizationDetails: '' // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md index 1187df49..9e5ccd44 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-key.md @@ -17,4 +17,6 @@ $result = $organization->updateKey( name: '', scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index 7097729e..36abfb40 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->updateMembership( membershipId: '', roles: [] -);``` +); + +``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index 45f1ee4b..ef2e2968 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -14,4 +14,6 @@ $organization = new Organization($client); $result = $organization->updateProject( projectId: '', name: '' -);``` +); + +``` diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index 45e7f0ff..f23a78f8 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -13,4 +13,6 @@ $organization = new Organization($client); $result = $organization->update( name: '' -);``` +); + +``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 225ee6ca..67e3b1ea 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -13,4 +13,6 @@ $presences = new Presences($client); $result = $presences->delete( presenceId: '' -);``` +); + +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index c0196986..14dd2397 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -13,4 +13,6 @@ $presences = new Presences($client); $result = $presences->get( presenceId: '' -);``` +); + +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index 61620297..0630b4a7 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -15,4 +15,6 @@ $result = $presences->list( queries: [], // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 95912f0f..40d62016 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -21,4 +21,6 @@ $result = $presences->update( metadata: [], // optional permissions: [Permission::read(Role::any())], // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index f6d34e2e..f7ceebcb 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -20,4 +20,6 @@ $result = $presences->upsert( permissions: [Permission::read(Role::any())], // optional expiresAt: '2020-10-15T06:38:00.000+00:00', // optional metadata: [] // optional -);``` +); + +``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index 491a36f3..fa629811 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -15,4 +15,6 @@ $result = $project->createAndroidPlatform( platformId: '', name: '', applicationId: '' -);``` +); + +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 38487ce9..020c933e 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -15,4 +15,6 @@ $result = $project->createApplePlatform( platformId: '', name: '', bundleIdentifier: '' -);``` +); + +``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index 29a813a7..77da73e2 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -15,4 +15,6 @@ $project = new Project($client); $result = $project->createEphemeralKey( scopes: [ProjectKeyScopes::PROJECTREAD()], duration: 600 -);``` +); + +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index ff21b34d..2b0da974 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -15,4 +15,6 @@ $result = $project->createLinuxPlatform( platformId: '', name: '', packageName: '' -);``` +); + +``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index 6d73a0b4..1f700138 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->createMockPhone( number: '+12065550100', otp: '' -);``` +); + +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index 98cb7edd..902f7c25 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->createSMTPTest( emails: [] -);``` +); + +``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 9f6d65e0..e09e8e38 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -16,4 +16,6 @@ $result = $project->createVariable( key: '', value: '', secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 932e10e9..8a3c2f75 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -15,4 +15,6 @@ $result = $project->createWebPlatform( platformId: '', name: '', hostname: 'app.example.com' -);``` +); + +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index 9a6f1757..e41b23ca 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -15,4 +15,6 @@ $result = $project->createWindowsPlatform( platformId: '', name: '', packageIdentifierName: '' -);``` +); + +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md index 5e90c2e9..86c4b280 100644 --- a/docs/examples/project/delete-key.md +++ b/docs/examples/project/delete-key.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->deleteKey( keyId: '' -);``` +); + +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md index 6cdfcc1c..d6db1416 100644 --- a/docs/examples/project/delete-mock-phone.md +++ b/docs/examples/project/delete-mock-phone.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->deleteMockPhone( number: '+12065550100' -);``` +); + +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md index ca537aa2..d8edb956 100644 --- a/docs/examples/project/delete-platform.md +++ b/docs/examples/project/delete-platform.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->deletePlatform( platformId: '' -);``` +); + +``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index a6fb65a4..64a151b5 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->deleteVariable( variableId: '' -);``` +); + +``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md index adb63241..4cf71307 100644 --- a/docs/examples/project/delete.md +++ b/docs/examples/project/delete.md @@ -12,4 +12,6 @@ $client = (new Client()) $project = new Project($client); $result = $project->delete(); + + ``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index f06e1c3b..47b3c66e 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -16,4 +16,6 @@ $project = new Project($client); $result = $project->getEmailTemplate( templateId: ProjectEmailTemplateId::VERIFICATION(), locale: ProjectEmailTemplateLocale::AF() // optional -);``` +); + +``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md index 8e8ba5e5..320d811e 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->getKey( keyId: '' -);``` +); + +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index 512d64c4..b78134bc 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->getMockPhone( number: '+12065550100' -);``` +); + +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index ded92e19..d6337365 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->getOAuth2Provider( providerId: ProjectOAuthProviderId::AMAZON() -);``` +); + +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md index 3e783acb..6e42717a 100644 --- a/docs/examples/project/get-platform.md +++ b/docs/examples/project/get-platform.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->getPlatform( platformId: '' -);``` +); + +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index 5f60c812..fd7e88ca 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->getPolicy( policyId: ProjectPolicyId::PASSWORDDICTIONARY() -);``` +); + +``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index f80cd3ba..10d94b46 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->getVariable( variableId: '' -);``` +); + +``` diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md index 4e90450b..956bd10c 100644 --- a/docs/examples/project/get.md +++ b/docs/examples/project/get.md @@ -12,4 +12,6 @@ $client = (new Client()) $project = new Project($client); $result = $project->get(); + + ``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 47c65c4d..6993f43e 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listEmailTemplates( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index 0d1dbffd..7386ec2f 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listKeys( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 5ca11c28..5968ecd8 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listMockPhones( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index 5f661d4b..d3bf0227 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listOAuth2Providers( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 596d6280..90f295a9 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listPlatforms( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index 59d49f3e..915633c8 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listPolicies( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index f6a9bb4f..319a84bb 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->listVariables( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 43df5075..019e7c55 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -15,4 +15,6 @@ $result = $project->updateAndroidPlatform( platformId: '', name: '', applicationId: '' -);``` +); + +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index 2aa4f294..194032ac 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -15,4 +15,6 @@ $result = $project->updateApplePlatform( platformId: '', name: '', bundleIdentifier: '' -);``` +); + +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 3633f132..793f505b 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -15,4 +15,6 @@ $project = new Project($client); $result = $project->updateAuthMethod( methodId: ProjectAuthMethodId::EMAILPASSWORD(), enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-aliased-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md index 3ddc159e..632606ff 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateDenyAliasedEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-corporate-email-policy.md b/docs/examples/project/update-deny-corporate-email-policy.md index 69ed3907..8b5f3931 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateDenyCorporateEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md index 6733b205..faca5877 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateDenyDisposableEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md index 1b8d30f0..ec3cc9ae 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateDenyFreeEmailPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md index ac927772..a8bf6ea3 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -22,4 +22,6 @@ $result = $project->updateEmailTemplate( senderEmail: 'email@example.com', // optional replyToEmail: 'email@example.com', // optional replyToName: '' // optional -);``` +); + +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 1a1e1002..c2397ee3 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -17,4 +17,6 @@ $result = $project->updateKey( name: '', scopes: [ProjectKeyScopes::PROJECTREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md index 1c2897ed..1dccc7bc 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateLabels( labels: [] -);``` +); + +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index b05cbfaa..3d582088 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -15,4 +15,6 @@ $result = $project->updateLinuxPlatform( platformId: '', name: '', packageName: '' -);``` +); + +``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index c41ce611..4f8e41ca 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -18,4 +18,6 @@ $result = $project->updateMembershipPrivacyPolicy( userName: false, // optional userMFA: false, // optional userAccessedAt: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index 8823cc8f..ad88c9c7 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -16,4 +16,6 @@ $result = $project->updateMFAFactorsPolicy( email: false, // optional phone: false, // optional custom: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index f157343f..b5acd20b 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -14,4 +14,6 @@ $project = new Project($client); $result = $project->updateMockPhone( number: '+12065550100', otp: '' -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index 8a473860..bab741e5 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Amazon( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index 3f4516c3..cd7bf71b 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -17,4 +17,6 @@ $result = $project->updateOAuth2Apple( teamId: '', // optional p8File: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-appwrite.md b/docs/examples/project/update-o-auth-2-appwrite.md index be24abdb..2ab41601 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Appwrite( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index d9f17f78..3c1da8be 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -16,4 +16,6 @@ $result = $project->updateOAuth2Auth0( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md index b5c7e27e..d1daadba 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -16,4 +16,6 @@ $result = $project->updateOAuth2Authentik( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index e85b9bb9..70e1d8d8 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Autodesk( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md index 4985215c..edab26c9 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Bitbucket( key: '', // optional secret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md index b8c00ecd..95f4a159 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Bitly( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md index ba88f561..7ad35373 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Box( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md index 44634caa..cc63d2a0 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Dailymotion( apiKey: '', // optional apiSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index d323c92d..7927c4e8 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Discord( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md index 30281862..2151d36d 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Disqus( publicKey: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md index 59575cdc..2591814a 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Dropbox( appKey: '', // optional appSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md index 19aab961..22b0b287 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Etsy( keyString: '', // optional sharedSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md index 8f76d065..2cf833c7 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Facebook( appId: '', // optional appSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md index 71d36ebf..21b71daf 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Figma( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md index 0b3709b2..c94ad657 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -16,4 +16,6 @@ $result = $project->updateOAuth2FusionAuth( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index 62871aa6..5acc8940 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2GitHub( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md index 2532af0c..04ed5984 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -16,4 +16,6 @@ $result = $project->updateOAuth2Gitlab( secret: '', // optional endpoint: 'https://example.com', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index 63466c43..8a3d417f 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -17,4 +17,6 @@ $result = $project->updateOAuth2Google( clientSecret: '', // optional prompt: [ProjectOAuth2GooglePrompt::NONE()], // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-hugging-face.md b/docs/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 00000000..c55c52f7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,20 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2HuggingFace( + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +); + +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md index 3604e4b6..cad00eb7 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -17,4 +17,6 @@ $result = $project->updateOAuth2Keycloak( endpoint: '', // optional realmName: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 02c876fc..876766e3 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Kick( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md index 06451e14..d6a214eb 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Linkedin( clientId: '', // optional primaryClientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index f5a0af73..0ac62ba8 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -16,4 +16,6 @@ $result = $project->updateOAuth2Microsoft( applicationSecret: '', // optional tenant: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md index abf0b430..68221536 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Notion( oauthClientId: '', // optional oauthClientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index 2c06fe89..e4300b96 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -22,4 +22,6 @@ $result = $project->updateOAuth2Oidc( prompt: [ProjectOAuth2OidcPrompt::NONE()], // optional maxAge: 0, // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index 4de41d22..059eccd2 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -17,4 +17,6 @@ $result = $project->updateOAuth2Okta( domain: '', // optional authorizationServerId: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md index 5cb43b6d..ecd6f64d 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2PaypalSandbox( clientId: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md index 51e8935f..71c59cba 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Paypal( clientId: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md index 1c607660..4f66c82e 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Podio( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index 8e0ab044..faccadab 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Salesforce( customerKey: '', // optional customerSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 1d06279a..30047912 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -28,4 +28,6 @@ $result = $project->updateOAuth2Server( deviceCodeDuration: 60, // optional defaultScopes: [], // optional installationScopes: [] // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index 858113c8..2ba8079f 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Slack( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md index 44f22c33..240f6ba3 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Spotify( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md index 9b2276c6..0dad5afd 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Stripe( clientId: '', // optional apiSecretKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md index 24777704..4ac45b9b 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2TradeshiftSandbox( oauth2ClientId: '', // optional oauth2ClientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md index 72177e62..09567933 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Tradeshift( oauth2ClientId: '', // optional oauth2ClientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md index a3cf258d..2f33e435 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Twitch( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md index 3380007c..a0d46c74 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2WordPress( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md index 588c9926..2c2682bd 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Yahoo( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md index c1e5b24d..3966d9e8 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Yandex( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index 08a9b1e1..bbbbf17f 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Zoho( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md index e30af5ba..4c87ac2c 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2Zoom( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md index 86ee07f1..b57524bb 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -15,4 +15,6 @@ $result = $project->updateOAuth2X( customerKey: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index 680edb5f..db8a56c4 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updatePasswordDictionaryPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md index 2fac6d7d..2a5f452d 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updatePasswordHistoryPolicy( total: 1 -);``` +); + +``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index 6cce48c7..17f3956e 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updatePasswordPersonalDataPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index 9bc29daf..c0cee223 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -17,4 +17,6 @@ $result = $project->updatePasswordStrengthPolicy( lowercase: false, // optional number: false, // optional symbols: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index e87fc30d..6d08045a 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -15,4 +15,6 @@ $project = new Project($client); $result = $project->updateProtocol( protocolId: ProjectProtocolId::REST(), enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md index 88e90eab..d7de7cdb 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -15,4 +15,6 @@ $project = new Project($client); $result = $project->updateService( serviceId: ProjectServiceId::ACCOUNT(), enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md index ac10696c..ffe8eefc 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateSessionAlertPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 882e2b2f..ad6e69bd 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateSessionDurationPolicy( duration: 60 -);``` +); + +``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md index fa744e57..f73683ca 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateSessionInvalidationPolicy( enabled: false -);``` +); + +``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md index f1bb2e20..5f442db8 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateSessionLimitPolicy( total: 1 -);``` +); + +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index 71a7b8f0..a187517d 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -23,4 +23,6 @@ $result = $project->updateSMTP( replyToName: '', // optional secure: ProjectSMTPSecure::TLS(), // optional enabled: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index 0dc2f1f7..246a686c 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -13,4 +13,6 @@ $project = new Project($client); $result = $project->updateUserLimitPolicy( total: 0 -);``` +); + +``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 3e44129c..d10d1c0f 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -16,4 +16,6 @@ $result = $project->updateVariable( key: '', // optional value: '', // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index 213e96f7..cea95f56 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -15,4 +15,6 @@ $result = $project->updateWebPlatform( platformId: '', name: '', hostname: 'app.example.com' -);``` +); + +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index 40c881dd..e5880f4c 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -15,4 +15,6 @@ $result = $project->updateWindowsPlatform( platformId: '', name: '', packageIdentifierName: '' -);``` +); + +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index 81d7813d..aa5ea565 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -13,4 +13,6 @@ $proxy = new Proxy($client); $result = $proxy->createAPIRule( domain: '' -);``` +); + +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index 0bd403fa..e5bcf7ce 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -15,4 +15,6 @@ $result = $proxy->createFunctionRule( domain: '', functionId: '', branch: '' // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 00ae00ad..3a2bbc8e 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -16,4 +16,6 @@ $result = $proxy->createInvalidation( domain: '', type: InvalidationType::TAG(), reference: '' // optional -);``` +); + +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 1c2bbc18..b65c4dd6 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -19,4 +19,6 @@ $result = $proxy->createRedirectRule( statusCode: StatusCode::MOVEDPERMANENTLY(), resourceId: '', resourceType: ProxyResourceType::SITE() -);``` +); + +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index e1f0f2da..56fe7b8f 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -15,4 +15,6 @@ $result = $proxy->createSiteRule( domain: '', siteId: '', branch: '' // optional -);``` +); + +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index 45c6c35d..4acd6aaa 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -13,4 +13,6 @@ $proxy = new Proxy($client); $result = $proxy->deleteRule( ruleId: '' -);``` +); + +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index c6f4c693..051ebb76 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -13,4 +13,6 @@ $proxy = new Proxy($client); $result = $proxy->getRule( ruleId: '' -);``` +); + +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index 53c1e1a0..72171d45 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -14,4 +14,6 @@ $proxy = new Proxy($client); $result = $proxy->listRules( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index 0640da6d..5586c24a 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -13,4 +13,6 @@ $proxy = new Proxy($client); $result = $proxy->updateRuleStatus( ruleId: '' -);``` +); + +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 536300d5..e41700e9 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -19,4 +19,6 @@ $result = $sites->createDeployment( buildCommand: '', // optional outputDirectory: '', // optional activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 97fb1f5d..b162a06f 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->createDuplicateDeployment( siteId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 05f039e7..1e4649ff 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -20,4 +20,6 @@ $result = $sites->createTemplateDeployment( type: TemplateReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 5cc10bf0..ed67e854 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -17,4 +17,6 @@ $result = $sites->createVariable( key: '', value: '', secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index d01747bc..7a1ff9b8 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -17,4 +17,6 @@ $result = $sites->createVcsDeployment( type: VCSReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index eab5f21c..76057f76 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -6,6 +6,7 @@ use Appwrite\Services\Sites; use Appwrite\Enums\Framework; use Appwrite\Enums\BuildRuntime; use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -37,5 +38,8 @@ $result = $sites->create( providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional - deploymentRetention: 0 // optional -);``` + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); + +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index 97bb976e..6a2171f7 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->deleteDeployment( siteId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index ed5b3c5b..70f97175 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->deleteLog( siteId: '', logId: '' -);``` +); + +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index bdb2fbf5..51bbe5bd 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->deleteVariable( siteId: '', variableId: '' -);``` +); + +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index c2965d4e..a94561ee 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -13,4 +13,6 @@ $sites = new Sites($client); $result = $sites->delete( siteId: '' -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index bfa02f11..65016abf 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -17,4 +17,6 @@ $result = $sites->getDeploymentDownload( deploymentId: '', type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional -);``` +); + +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 91f83678..608fe033 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->getDeployment( siteId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index a781d20f..cc11cb12 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->getLog( siteId: '', logId: '' -);``` +); + +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 80b61eca..16269c45 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->getVariable( siteId: '', variableId: '' -);``` +); + +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index c8f8c8e2..a3dc1b59 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -13,4 +13,6 @@ $sites = new Sites($client); $result = $sites->get( siteId: '' -);``` +); + +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 82cee298..0fe48dca 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -16,4 +16,6 @@ $result = $sites->listDeployments( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 74ea8821..c601478a 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -12,4 +12,6 @@ $client = (new Client()) $sites = new Sites($client); $result = $sites->listFrameworks(); + + ``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 5626bbb1..2fb47d68 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -15,4 +15,6 @@ $result = $sites->listLogs( siteId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 33bc0c59..04f77e50 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -13,4 +13,6 @@ $sites = new Sites($client); $result = $sites->listSpecifications( type: 'runtimes' // optional -);``` +); + +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 7caa8a5e..17b3782b 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -15,4 +15,6 @@ $result = $sites->listVariables( siteId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 08c13146..0f6b055a 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -15,4 +15,6 @@ $result = $sites->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 06ffc751..0b99b602 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->updateDeploymentStatus( siteId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index bdac54d4..af42e0b0 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -14,4 +14,6 @@ $sites = new Sites($client); $result = $sites->updateSiteDeployment( siteId: '', deploymentId: '' -);``` +); + +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index bbdd3d51..f9380b53 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -17,4 +17,6 @@ $result = $sites->updateVariable( key: '', // optional value: '', // optional secret: false // optional -);``` +); + +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 907e0c6c..17195026 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -6,6 +6,7 @@ use Appwrite\Services\Sites; use Appwrite\Enums\Framework; use Appwrite\Enums\BuildRuntime; use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -37,5 +38,8 @@ $result = $sites->update( providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional - deploymentRetention: 0 // optional -);``` + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); + +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index f00c2c7f..55014afd 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -26,4 +26,6 @@ $result = $storage->createBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 19c38797..a4d741b2 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -20,4 +20,6 @@ $result = $storage->createFile( file: InputFile::withPath('file.png'), permissions: [Permission::read(Role::any())], // optional folder: '' // optional -);``` +); + +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 737f4e1d..ac953809 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -13,4 +13,6 @@ $storage = new Storage($client); $result = $storage->deleteBucket( bucketId: '' -);``` +); + +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index dd2c3a70..2011aaa8 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -14,4 +14,6 @@ $storage = new Storage($client); $result = $storage->deleteFile( bucketId: '', fileId: '' -);``` +); + +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index f6449aec..5425df46 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -13,4 +13,6 @@ $storage = new Storage($client); $result = $storage->getBucket( bucketId: '' -);``` +); + +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index f55376f0..85d14149 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -15,4 +15,6 @@ $result = $storage->getFileDownload( bucketId: '', fileId: '', token: '' // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 8964011b..2b93922e 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -28,4 +28,6 @@ $result = $storage->getFilePreview( background: '', // optional output: ImageFormat::JPG(), // optional token: '' // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 6a729dc8..918c5103 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -15,4 +15,6 @@ $result = $storage->getFileView( bucketId: '', fileId: '', token: '' // optional -);``` +); + +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index b498b604..590ee663 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -14,4 +14,6 @@ $storage = new Storage($client); $result = $storage->getFile( bucketId: '', fileId: '' -);``` +); + +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 3b0d79d7..7e3fc21c 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -15,4 +15,6 @@ $result = $storage->listBuckets( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 77e78cde..263c7c02 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -16,4 +16,6 @@ $result = $storage->listFiles( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index c14e75c3..b327f1c6 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -26,4 +26,6 @@ $result = $storage->updateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); + +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 1e40a492..150c316f 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -18,4 +18,6 @@ $result = $storage->updateFile( fileId: '', name: '', // optional permissions: [Permission::read(Role::any())] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 2833fdd6..fb343745 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->createBigIntColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index b6032a39..3a88eed8 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->createBooleanColumn( required: false, default: false, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 9e21e014..009e3ef7 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->createDatetimeColumn( required: false, default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index f24aa050..515a1fbf 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->createEmailColumn( required: false, default: 'email@example.com', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 95157424..7a90b5a6 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->createEnumColumn( required: false, default: '', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index fbd2837b..f713c165 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->createFailover( databaseId: '', targetReplicaId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index c83abba7..bb7ab5dd 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->createFloatColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 3cd6b12d..703a57ca 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -21,4 +21,6 @@ $result = $tablesDB->createIndex( columns: [], orders: [OrderBy::ASC()], // optional lengths: [] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index a42c8710..e22c0b96 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->createIntegerColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index f40fe61d..ca67398f 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->createIpColumn( required: false, default: '', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index c1d17b82..7a9cced5 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -17,4 +17,6 @@ $result = $tablesDB->createLineColumn( key: '', required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 2b536665..b4a2d1e1 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->createLongtextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 0fbd9cab..be10c8b8 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->createMediumtextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 37f670fe..97992761 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -15,4 +15,6 @@ $result = $tablesDB->createMigration( databaseId: '', specification: 's-1vcpu-1gb', autoCutover: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 45ea4c92..e6987eaa 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -24,4 +24,6 @@ $result = $tablesDB->createOperations( } } ] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index bde57bc3..8948e4c2 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -17,4 +17,6 @@ $result = $tablesDB->createPointColumn( key: '', required: false, default: [1, 2] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index ee340f34..685ea383 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -17,4 +17,6 @@ $result = $tablesDB->createPolygonColumn( key: '', required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 06dd6c0d..b707a404 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -22,4 +22,6 @@ $result = $tablesDB->createRelationshipColumn( key: '', // optional twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index fc253f2b..0df63548 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -26,4 +26,6 @@ $result = $tablesDB->createRow( ], permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 8c08fa57..ab85f50c 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -16,4 +16,6 @@ $result = $tablesDB->createRows( tableId: '', rows: [], transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index a4dd4dac..c3777026 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->createStringColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index fbe44767..6b7ecefe 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -22,4 +22,6 @@ $result = $tablesDB->createTable( enabled: false, // optional columns: [], // optional indexes: [] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 8d283926..0e3d3e8b 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->createTextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 6664c084..cd77db32 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->createTransaction( ttl: 60 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index ceb1dae6..b32c9b00 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->createUrlColumn( required: false, default: 'https://example.com', // optional array: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 2f931922..a6d7dd15 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->createVarcharColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 7df1d49a..a0754fb7 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -18,4 +18,6 @@ $result = $tablesDB->create( specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md index 71a37d33..3393c259 100644 --- a/docs/examples/tablesdb/cutover-migration.md +++ b/docs/examples/tablesdb/cutover-migration.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->cutoverMigration( databaseId: '', migrationId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 0d01314a..2a081078 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->decrementRowColumn( value: null, // optional min: null, // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 97cafced..14b916c1 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -15,4 +15,6 @@ $result = $tablesDB->deleteColumn( databaseId: '', tableId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index abad8248..db9774bc 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -15,4 +15,6 @@ $result = $tablesDB->deleteIndex( databaseId: '', tableId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md index 255d6aa8..d2ec6424 100644 --- a/docs/examples/tablesdb/delete-migration.md +++ b/docs/examples/tablesdb/delete-migration.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteMigration( databaseId: '', migrationId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 05722a0c..5eb7207b 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -16,4 +16,6 @@ $result = $tablesDB->deleteRow( tableId: '', rowId: '', transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 934ea6b7..844f234c 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -16,4 +16,6 @@ $result = $tablesDB->deleteRows( tableId: '', queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index acc711db..054aa9cc 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteTable( databaseId: '', tableId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 2b0c7ff8..e1c18a81 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteTransaction( transactionId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 1b2cc93a..6ffaf88e 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->delete( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 0be374fc..feb16dfa 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -15,4 +15,6 @@ $result = $tablesDB->getColumn( databaseId: '', tableId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 5e79e708..c28b9789 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -15,4 +15,6 @@ $result = $tablesDB->getIndex( databaseId: '', tableId: '', key: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index 88d922b1..3f9c9cff 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getMigration( databaseId: '', migrationId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index 0bc85769..a99a4983 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getReplicas( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index f8871ffa..6fb89f26 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -17,4 +17,6 @@ $result = $tablesDB->getRow( rowId: '', queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index e7a227c5..2808eb95 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getStatus( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 1bc01662..cc7f244b 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -14,4 +14,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getTable( databaseId: '', tableId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index fc4030f5..1864856e 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getTransaction( transactionId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 5dde28d8..17951508 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->get( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 5c6176ee..cd370a4c 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->incrementRowColumn( value: null, // optional max: null, // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 2ecf6542..798043ae 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -16,4 +16,6 @@ $result = $tablesDB->listColumns( tableId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 17428fe1..60bffb96 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -16,4 +16,6 @@ $result = $tablesDB->listIndexes( tableId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index 20c8485c..5647ba36 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listMigrations( databaseId: '' -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index 311b1464..4395eac1 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -16,4 +16,6 @@ $result = $tablesDB->listOperations( status: 'running', // optional limit: 1, // optional offset: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index b70a7598..bfabe595 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -18,4 +18,6 @@ $result = $tablesDB->listRows( transactionId: '', // optional total: false, // optional ttl: 0 // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md index b4080072..a35cfac6 100644 --- a/docs/examples/tablesdb/list-specifications.md +++ b/docs/examples/tablesdb/list-specifications.md @@ -12,4 +12,6 @@ $client = (new Client()) $tablesDB = new TablesDB($client); $result = $tablesDB->listSpecifications(); + + ``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index c74d5a15..a3427f78 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -16,4 +16,6 @@ $result = $tablesDB->listTables( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 58b31a64..88b50603 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -13,4 +13,6 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listTransactions( queries: [] // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 77da5528..5a55042a 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -15,4 +15,6 @@ $result = $tablesDB->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 1a317032..382fc652 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->updateBigIntColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 8a7850fc..2f06fd86 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateBooleanColumn( required: false, default: false, newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 30ef56b8..dd4ff022 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateDatetimeColumn( required: false, default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 8cd10d41..cc0eb8da 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateEmailColumn( required: false, default: 'email@example.com', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 0dcf5747..b8e99cdc 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->updateEnumColumn( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 68a90df3..0f2ca87f 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->updateFloatColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index ba7a781f..69061856 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -20,4 +20,6 @@ $result = $tablesDB->updateIntegerColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 25a71601..f67e12b3 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateIpColumn( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index a7126a39..2fe6a41f 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateLineColumn( required: false, default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index aaccf927..49c651ba 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateLongtextColumn( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 2b06e8d3..a7da2987 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateMediumtextColumn( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 0d137cea..7fdcc3c7 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updatePointColumn( required: false, default: [1, 2], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 5341610c..0fc903c3 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updatePolygonColumn( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 4b153851..2d7bdd4b 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateRelationshipColumn( key: '', onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index f0fd37d6..b8d8de8b 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -26,4 +26,6 @@ $result = $tablesDB->updateRow( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index baf98ecf..3a55cd02 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -23,4 +23,6 @@ $result = $tablesDB->updateRows( ], // optional queries: [], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index ff01707d..bf0305e9 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->updateStringColumn( default: '', size: 1, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 7ce092d1..1fcda66a 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -21,4 +21,6 @@ $result = $tablesDB->updateTable( rowSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 81fa0fec..61c340fc 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateTextColumn( required: false, default: '', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 512760bf..952890bb 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -15,4 +15,6 @@ $result = $tablesDB->updateTransaction( transactionId: '', commit: false, // optional rollback: false // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 6c055168..a6d83946 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -18,4 +18,6 @@ $result = $tablesDB->updateUrlColumn( required: false, default: 'https://example.com', newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index ca4ba824..88a4d396 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -19,4 +19,6 @@ $result = $tablesDB->updateVarcharColumn( default: '', size: 1, // optional newKey: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index c5bafb8d..9a89e9b4 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -18,4 +18,6 @@ $result = $tablesDB->update( specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 5c4645ba..27b2f5ad 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -26,4 +26,6 @@ $result = $tablesDB->upsertRow( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index 6d9d6154..a4f3e6c4 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -16,4 +16,6 @@ $result = $tablesDB->upsertRows( tableId: '', rows: [], transactionId: '' // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index e462cf6b..96f36bde 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -15,4 +15,6 @@ $result = $teams->createInstallation( teamId: '', appId: '', authorizationDetails: '' // optional -);``` +); + +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index ddbddc38..a3c13093 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -19,4 +19,6 @@ $result = $teams->createMembership( phone: '+12065550100', // optional url: 'https://example.com', // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index e0eef909..64771672 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -15,4 +15,6 @@ $result = $teams->create( teamId: '', name: '', roles: [] // optional -);``` +); + +``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md index 091ae091..477e62e7 100644 --- a/docs/examples/teams/delete-installation.md +++ b/docs/examples/teams/delete-installation.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->deleteInstallation( teamId: '', installationId: '' -);``` +); + +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 096d69eb..1b46180c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->deleteMembership( teamId: '', membershipId: '' -);``` +); + +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index e982d579..0cb936c9 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -13,4 +13,6 @@ $teams = new Teams($client); $result = $teams->delete( teamId: '' -);``` +); + +``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index 440afa82..c9a3e196 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->getInstallation( teamId: '', installationId: '' -);``` +); + +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index c696fd0d..3825124b 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->getMembership( teamId: '', membershipId: '' -);``` +); + +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index ea621f3a..946050f5 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -13,4 +13,6 @@ $teams = new Teams($client); $result = $teams->getPrefs( teamId: '' -);``` +); + +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index b0a71242..b9a878f1 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -13,4 +13,6 @@ $teams = new Teams($client); $result = $teams->get( teamId: '' -);``` +); + +``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index 678ab4bc..d8fbcb6d 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -15,4 +15,6 @@ $result = $teams->listInstallations( teamId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 0b4fd915..9ef6d7b5 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -16,4 +16,6 @@ $result = $teams->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 04fdc4fc..f2dfb62e 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -15,4 +15,6 @@ $result = $teams->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index 36cdd030..7f208484 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -15,4 +15,6 @@ $result = $teams->updateInstallation( teamId: '', installationId: '', authorizationDetails: '' // optional -);``` +); + +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 33f891c1..34ff8af1 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -16,4 +16,6 @@ $result = $teams->updateMembershipStatus( membershipId: '', userId: '', secret: '' -);``` +); + +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 0a251890..38e58c9f 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -15,4 +15,6 @@ $result = $teams->updateMembership( teamId: '', membershipId: '', roles: [] -);``` +); + +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index eae3a3bf..61d9f152 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->updateName( teamId: '', name: '' -);``` +); + +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 785f7ba9..865d3b34 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -14,4 +14,6 @@ $teams = new Teams($client); $result = $teams->updatePrefs( teamId: '', prefs: [] -);``` +); + +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index af8391f1..202bb5a5 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -15,4 +15,6 @@ $result = $tokens->createFileToken( bucketId: '', fileId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index d298ed3a..5e39f1f3 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -13,4 +13,6 @@ $tokens = new Tokens($client); $result = $tokens->delete( tokenId: '' -);``` +); + +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index db117e6a..950fccb1 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -13,4 +13,6 @@ $tokens = new Tokens($client); $result = $tokens->get( tokenId: '' -);``` +); + +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 35512617..202018d2 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -16,4 +16,6 @@ $result = $tokens->list( fileId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 870b3fa3..b5bd7ca6 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -14,4 +14,6 @@ $tokens = new Tokens($client); $result = $tokens->update( tokenId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 4813cd8b..70fcee88 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -16,4 +16,6 @@ $result = $users->createArgon2User( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 17a3c7ec..ecf1b41f 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -16,4 +16,6 @@ $result = $users->createBcryptUser( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 9a22a606..de3737b2 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -15,4 +15,6 @@ $result = $users->createJWT( userId: '', sessionId: '', // optional duration: 0 // optional -);``` +); + +``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 85e97f75..581e24ba 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -16,4 +16,6 @@ $result = $users->createMD5User( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 23295475..931caed6 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->createMFARecoveryCodes( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 0e9a62ff..25c1c192 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -16,4 +16,6 @@ $result = $users->createPHPassUser( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 22c18b1e..e34a58af 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -19,4 +19,6 @@ $result = $users->createScryptModifiedUser( passwordSaltSeparator: '', passwordSignerKey: '', name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 8ebc44dd..38284b6c 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -21,4 +21,6 @@ $result = $users->createScryptUser( passwordParallel: null, passwordLength: null, name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 0279835a..4e9db385 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->createSession( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 924224bc..c35afdaa 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -18,4 +18,6 @@ $result = $users->createSHAUser( password: 'password', passwordVersion: PasswordHash::SHA1(), // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 1000574f..79cb3d0c 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -19,4 +19,6 @@ $result = $users->createTarget( identifier: '', providerId: '', // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 4519995f..08a3f8d4 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -15,4 +15,6 @@ $result = $users->createToken( userId: '', length: 4, // optional expire: 60 // optional -);``` +); + +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index a2feb7c3..49454881 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -17,4 +17,6 @@ $result = $users->create( phone: '+12065550100', // optional password: 'password', // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index b364358d..7941b03c 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->deleteIdentity( identityId: '' -);``` +); + +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 15ca8e29..752d7ec3 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -15,4 +15,6 @@ $users = new Users($client); $result = $users->deleteMFAAuthenticator( userId: '', type: AuthenticatorType::TOTP() -);``` +); + +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 9786bde4..c9667ffd 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->deleteSession( userId: '', sessionId: '' -);``` +); + +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 236aeffe..ea502558 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->deleteSessions( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 6d915dbe..7d103ae0 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->deleteTarget( userId: '', targetId: '' -);``` +); + +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index faea96cf..b088e47b 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->delete( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 8ef5c4aa..47389599 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->getMFAChallenge( userId: '', challengeId: '' -);``` +); + +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 90aa08dd..3a624233 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->getMFARecoveryCodes( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 931c5be8..d3072134 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->getPrefs( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 1f3c0028..674066d6 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->getTarget( userId: '', targetId: '' -);``` +); + +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index a777b73b..a2f1af35 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->get( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 37074100..844bac8c 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -15,4 +15,6 @@ $result = $users->listIdentities( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 0d0464e2..13bef5d4 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -15,4 +15,6 @@ $result = $users->listLogs( userId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index c9b3fb54..5b9152b2 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -16,4 +16,6 @@ $result = $users->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index c3cd0453..db27a5f5 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->listMFAFactors( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index e4baa40c..86f83d7f 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->listSessions( userId: '', total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 3e33f9f4..015a497e 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -15,4 +15,6 @@ $result = $users->listTargets( userId: '', queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 39d3189c..27034a93 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -15,4 +15,6 @@ $result = $users->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index b7a3a912..b1f5daf3 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateEmailVerification( userId: '', emailVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 2710f496..bfd94fb9 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateEmail( userId: '', email: 'email@example.com' -);``` +); + +``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index 202f0ed2..ceb92a36 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateImpersonator( userId: '', impersonator: false -);``` +); + +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 56be4fbc..3f9d29c5 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateLabels( userId: '', labels: [] -);``` +); + +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index bee4d183..9faadf3f 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -13,4 +13,6 @@ $users = new Users($client); $result = $users->updateMFARecoveryCodes( userId: '' -);``` +); + +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 9cac2ff9..c39ef665 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateMFA( userId: '', mfa: false -);``` +); + +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index bce3d8c7..13774567 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateName( userId: '', name: '' -);``` +); + +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index d8f2ed1c..02c8bdb7 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updatePassword( userId: '', password: 'password' -);``` +); + +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index f94b1f84..8863a159 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updatePhoneVerification( userId: '', phoneVerification: false -);``` +); + +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index c975eaf1..e7986665 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updatePhone( userId: '', number: '+12065550100' -);``` +); + +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index b276922c..9014d36f 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updatePrefs( userId: '', prefs: [] -);``` +); + +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 1a8346c0..48e7491a 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -14,4 +14,6 @@ $users = new Users($client); $result = $users->updateStatus( userId: '', status: false -);``` +); + +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 89635691..3f38f638 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -17,4 +17,6 @@ $result = $users->updateTarget( identifier: '', // optional providerId: '', // optional name: '' // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index dd8eb1cd..f2e1d51c 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -21,4 +21,6 @@ $result = $webhooks->create( authUsername: '', // optional authPassword: 'password', // optional secret: '' // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md index cab10635..cb034e52 100644 --- a/docs/examples/webhooks/delete.md +++ b/docs/examples/webhooks/delete.md @@ -13,4 +13,6 @@ $webhooks = new Webhooks($client); $result = $webhooks->delete( webhookId: '' -);``` +); + +``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index c8acae75..997404a5 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -13,4 +13,6 @@ $webhooks = new Webhooks($client); $result = $webhooks->get( webhookId: '' -);``` +); + +``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index 7727c468..aa5d616c 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -14,4 +14,6 @@ $webhooks = new Webhooks($client); $result = $webhooks->list( queries: [], // optional total: false // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index 73c3f955..827d48a2 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -14,4 +14,6 @@ $webhooks = new Webhooks($client); $result = $webhooks->updateSecret( webhookId: '', secret: '' // optional -);``` +); + +``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index c6bf00b2..255768a6 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -20,4 +20,6 @@ $result = $webhooks->update( tls: false, // optional authUsername: '', // optional authPassword: 'password' // optional -);``` +); + +``` diff --git a/docs/organization.md b/docs/organization.md index 1508fbc8..93ed38c2 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -268,7 +268,7 @@ POST https://cloud.appwrite.io/v1/organization/projects | --- | --- | --- | --- | | projectId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. | | | name | string | Project name. Max length: 128 chars. | | -| region | string | Project Region. | | +| region | string | Project Region. | default | ```http request diff --git a/docs/project.md b/docs/project.md index 39a21349..47c4b2a3 100644 --- a/docs/project.md +++ b/docs/project.md @@ -531,6 +531,21 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | +```http request +PATCH https://cloud.appwrite.io/v1/project/oauth2/huggingface +``` + +** Update the project OAuth2 Hugging Face configuration. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| clientId | string | 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 | | +| clientSecret | string | 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt | | +| enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | + + ```http request PATCH https://cloud.appwrite.io/v1/project/oauth2/keycloak ``` diff --git a/docs/sites.md b/docs/sites.md index dac7de92..52010d66 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -49,6 +49,7 @@ POST https://cloud.appwrite.io/v1/sites | buildSpecification | string | Build specification for the site deployments. | [] | | runtimeSpecification | string | Runtime specification for the SSR executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | +| scopes | array | List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. | [] | ```http request @@ -117,6 +118,7 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId} | buildSpecification | string | Build specification for the site deployments. | | | runtimeSpecification | string | Runtime specification for the SSR executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | +| scopes | array | List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. | | ```http request diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 49f78e2f..458dbba6 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -171,7 +171,7 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId} POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/failovers ``` -** Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote. ** +** Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. ** ### Parameters diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..0945edb2 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +includes: + - vendor/phpstan/phpstan-mockery/extension.neon + +parameters: + level: 5 + paths: + - src + - tests diff --git a/pint.json b/pint.json new file mode 100644 index 00000000..ea5e72cf --- /dev/null +++ b/pint.json @@ -0,0 +1,3 @@ +{ + "preset": "psr12" +} diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..1f640cfc --- /dev/null +++ b/rector.php @@ -0,0 +1,19 @@ +withPaths([ + getcwd() . '/src', + getcwd() . '/tests', + ]) + ->withPhpSets() + ->withPreparedSets( + deadCode: true, + codeQuality: true, + typeDeclarations: true, + earlyReturn: true, + phpunitCodeQuality: true, + ); diff --git a/src/Appwrite/AppwriteException.php b/src/Appwrite/AppwriteException.php index 31d7927f..463eb3f9 100644 --- a/src/Appwrite/AppwriteException.php +++ b/src/Appwrite/AppwriteException.php @@ -1,51 +1,29 @@ response = $response; - $this->type = $type; - } + public function getType(): string + { + return $this->type; + } - /** - * @return string - */ - public function getType(): string - { - return $this->type; - } - - /** - * @return ?string - */ - final public function getResponse(): ?string - { - return $this->response; - } -} \ No newline at end of file + final public function getResponse(): ?string + { + return $this->response; + } +} diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index e56b2adc..75d272af 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -1,101 +1,116 @@ '', - 'user-agent' => 'AppwritePHPSDK/28.0.0 ()', - 'x-sdk-name'=> 'PHP', - 'x-sdk-platform'=> 'server', - 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '28.0.0', + 'user-agent' => 'AppwritePHPSDK/29.0.0 ()', + 'x-sdk-name' => 'PHP', + 'x-sdk-platform' => 'server', + 'x-sdk-language' => 'php', + 'x-sdk-version' => '29.0.0', ]; /** * Auth/config values used by generated service methods. * - * @var array */ protected array $config = []; /** * API key for JWT generation * - * @var string|null */ protected ?string $key = null; /** * Cached authorization header value * - * @var string|null */ protected ?string $authorization = null; /** * Authorization header expiry time * - * @var \DateTime|null */ protected ?\DateTime $authorizationExpiresAt = null; /** * Timeout in seconds * - * @var int|null */ protected ?int $timeout = null; /** * Connect timeout in seconds * - * @var int|null */ protected ?int $connectTimeout = null; + /** + * Reused Utopia HTTP client (follows redirects). + * + */ + protected ?HttpClient $httpClient = null; + + /** + * Reused Utopia HTTP client that does not follow redirects. + * + */ + protected ?HttpClient $httpClientNoRedirect = null; + + /** + * PSR-7 request factory. + * + */ + protected RequestFactory $requestFactory; + /** * Client constructor. */ public function __construct() { + $this->requestFactory = new RequestFactory(); $this->headers['X-Appwrite-Response-Format'] = '1.9.6'; - } /** @@ -103,9 +118,7 @@ public function __construct() * * Your project ID * - * @param string $value * - * @return Client */ public function setProject(string $value): Client { @@ -119,9 +132,7 @@ public function setProject(string $value): Client * * Your secret API key * - * @param string $value * - * @return Client */ public function setKey(string $value): Client { @@ -136,9 +147,7 @@ public function setKey(string $value): Client * * Your organization ID * - * @param string $value * - * @return Client */ public function setOrganization(string $value): Client { @@ -153,9 +162,7 @@ public function setOrganization(string $value): Client * * Your secret JSON Web Token * - * @param string $value * - * @return Client */ public function setJWT(string $value): Client { @@ -170,9 +177,7 @@ public function setJWT(string $value): Client * * The OAuth access token to authenticate with * - * @param string $value * - * @return Client */ public function setBearer(string $value): Client { @@ -188,9 +193,7 @@ public function setBearer(string $value): Client /** * Set Locale * - * @param string $value * - * @return Client */ public function setLocale(string $value): Client { @@ -205,9 +208,7 @@ public function setLocale(string $value): Client * * The user session to authenticate with * - * @param string $value * - * @return Client */ public function setSession(string $value): Client { @@ -222,9 +223,7 @@ public function setSession(string $value): Client * * The user agent string of the client that made the request * - * @param string $value * - * @return Client */ public function setForwardedUserAgent(string $value): Client { @@ -239,9 +238,7 @@ public function setForwardedUserAgent(string $value): Client * * Your secret dev API key * - * @param string $value * - * @return Client */ public function setDevKey(string $value): Client { @@ -256,9 +253,7 @@ public function setDevKey(string $value): Client * * The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. * - * @param string $value * - * @return Client */ public function setCookie(string $value): Client { @@ -273,9 +268,7 @@ public function setCookie(string $value): Client * * Impersonate a user by ID * - * @param string $value * - * @return Client */ public function setImpersonateUserId(string $value): Client { @@ -290,9 +283,7 @@ public function setImpersonateUserId(string $value): Client * * Impersonate a user by email * - * @param string $value * - * @return Client */ public function setImpersonateUserEmail(string $value): Client { @@ -307,9 +298,7 @@ public function setImpersonateUserEmail(string $value): Client * * Impersonate a user by phone * - * @param string $value * - * @return Client */ public function setImpersonateUserPhone(string $value): Client { @@ -324,9 +313,7 @@ public function setImpersonateUserPhone(string $value): Client * * Set a secret key used to self-sign short-lived JWTs for the Authorization header * - * @param string $key * - * @return Client */ public function setSigningKey(string $key): Client { @@ -345,19 +332,16 @@ public function getConfig(string $key): string } /*** - * @param bool $status - * @return $this */ public function setSelfSigned(bool $status = true): Client { $this->selfSigned = $status; + $this->resetHttpClient(); return $this; } /*** - * @param $endpoint - * @return $this */ public function setEndpoint(string $endpoint): Client { @@ -366,36 +350,36 @@ public function setEndpoint(string $endpoint): Client } $this->endpoint = $endpoint; + $this->resetHttpClient(); + return $this; } /** * Set Timeout * - * @param int $timeout Timeout in seconds - * @return Client */ public function setTimeout(int $timeout): Client { $this->timeout = $timeout; + $this->resetHttpClient(); + return $this; } /** * Set Connect Timeout * - * @param int $connectTimeout Connect timeout in seconds - * @return Client */ public function setConnectTimeout(int $connectTimeout): Client { $this->connectTimeout = $connectTimeout; + $this->resetHttpClient(); + return $this; } /** - * @param $key - * @param $value */ public function addHeader(string $key, string $value): Client { @@ -407,7 +391,6 @@ public function addHeader(string $key, string $value): Client /** * Get the request headers. * - * @return array */ public function getHeaders(): array { @@ -417,7 +400,6 @@ public function getHeaders(): array /** * Get authorization header, generating a new JWT if needed * - * @return string */ private function getAuthorization(): string { @@ -428,7 +410,7 @@ private function getAuthorization(): string $jwt = new JWT($this->key, maxAge: self::JWT_MAX_AGE_SECONDS); $this->authorization = "Bearer {$jwt->encode([])}"; - $this->authorizationExpiresAt = (new \DateTime())->modify('+' . (self::JWT_MAX_AGE_SECONDS - 5) . ' seconds'); + $this->authorizationExpiresAt = new \DateTime()->modify('+' . (self::JWT_MAX_AGE_SECONDS - 5) . ' seconds'); return $this->authorization; } @@ -438,11 +420,6 @@ private function getAuthorization(): string * * Make an API call * - * @param string $method - * @param string $path - * @param array $params - * @param array $headers - * @return array|string * @throws AppwriteException */ public function call( @@ -451,102 +428,74 @@ public function call( array $headers = [], array $params = [], ?string $responseType = null - ) - { + ) { if ($this->key !== null) { $this->headers['authorization'] = $this->getAuthorization(); } $headers = array_merge($this->headers, $headers); - $querySeparator = str_contains($path, '?') ? '&' : '?'; - $ch = curl_init($this->endpoint . $path . (($method == self::METHOD_GET && !empty($params)) ? $querySeparator . http_build_query($params) : '')); - $responseHeaders = []; - - switch ($headers['content-type']) { - case 'application/json': - $query = json_encode($this->prepareParams($params)); - break; - - case 'multipart/form-data': - $query = $this->flatten($params); - break; - - default: - $query = http_build_query($params); - break; - } - - foreach ($headers as $i => $header) { - $headers[] = $i . ':' . $header; - unset($headers[$i]); - } - - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $responseType !== 'location'); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $len = strlen($header); - $header = explode(':', strtolower($header), 2); - - if (count($header) < 2) { // ignore invalid headers - return $len; - } - - $responseHeaders[strtolower(trim($header[0]))] = trim($header[1]); - - return $len; - }); - - if($method != self::METHOD_GET) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $query); - } - - // Allow self signed certificates - if($this->selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + $contentType = strtolower((string) ($headers['content-type'] ?? '')); + if ($contentType === '') { + unset($headers['content-type']); } - - // Set timeout if configured - if($this->timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); - } - - // Set connect timeout if configured - if($this->connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout); + $uri = $this->endpoint . $path; + + try { + $request = match (true) { + $method === self::METHOD_GET => $this->requestFactory->query( + $method, + $uri, + $params, + $headers + ), + $contentType === 'application/json' => $this->requestFactory->json( + $method, + $uri, + $this->prepareParams($params), + $headers + ), + $contentType === 'multipart/form-data' => $this->requestFactory->multipart( + $method, + $uri, + $this->toMultipartParts($params), + $headers + ), + default => $this->requestFactory->form( + $method, + $uri, + $params, + $headers + ), + }; + + $response = $this->getHttpClient($responseType !== 'location')->sendRequest($request); + } catch (ClientExceptionInterface|\JsonException $e) { + throw new AppwriteException($e->getMessage(), (int) $e->getCode()); } - $responseBody = curl_exec($ch); - $contentType = $responseHeaders['content-type'] ?? ''; - $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $responseStatus = $response->getStatusCode(); + $responseContentType = $response->getHeaderLine('content-type'); + $responseBody = (string) $response->getBody(); - $warnings = $responseHeaders['x-appwrite-warning'] ?? ''; + $warnings = $response->getHeaderLine('x-appwrite-warning'); if ($warnings) { - foreach(explode(';', $warnings) as $warning) { + foreach (explode(';', $warnings) as $warning) { \trigger_error($warning, E_USER_WARNING); } } - - if (str_starts_with($contentType, 'application/json')) { - $responseBody = json_decode($responseBody, true); - } - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $responseStatus, $responseBody['type'] ?? '', $responseBody); + if (str_starts_with($responseContentType, 'application/json')) { + $responseBody = json_decode($responseBody, true); } - if($responseStatus >= 400) { - if(is_array($responseBody)) { + if ($responseStatus >= 400) { + if (is_array($responseBody)) { throw new AppwriteException($responseBody['message'], $responseStatus, $responseBody['type'] ?? '', json_encode($responseBody)); - } else { - throw new AppwriteException($responseBody, $responseStatus, '', $responseBody); } + throw new AppwriteException($responseBody, $responseStatus, '', $responseBody); } if ($responseType === 'location') { - return $responseHeaders['location']; + return $response->getHeaderLine('location'); } return $responseBody; @@ -555,20 +504,17 @@ public function call( /** * Flatten params array to PHP multiple format * - * @param array $data - * @param string $prefix - * @return array */ - protected function flatten(array $data, string $prefix = ''): array { + protected function flatten(array $data, string $prefix = ''): array + { $output = []; - foreach($data as $key => $value) { + foreach ($data as $key => $value) { $finalKey = $prefix ? "{$prefix}[{$key}]" : $key; if (is_array($value)) { $output = array_merge($output, $this->flatten($value, $finalKey)); - } - else { + } else { $output[$finalKey] = $value; } } @@ -579,13 +525,11 @@ protected function flatten(array $data, string $prefix = ''): array { /** * Prepare params for JSON encoding by converting model objects to arrays * - * @param mixed $data - * @return mixed */ protected function prepareParams($data) { if (is_array($data)) { - return array_map([$this, 'prepareParams'], $data); + return array_map($this->prepareParams(...), $data); } if (is_object($data) && method_exists($data, 'toArray')) { @@ -594,4 +538,82 @@ protected function prepareParams($data) return $data; } + + /** + * Convert flattened params into Utopia multipart parts. + * + * @param array $data + * @return array + */ + protected function toMultipartParts(array $data): array + { + $parts = []; + + foreach ($this->flatten($data) as $name => $value) { + $name = (string) $name; + + if ($value instanceof Part) { + $parts[$name] = $value; + continue; + } + + if ($value instanceof \CURLFile) { + $path = $value->getFilename(); + $filename = $value->getPostFilename() !== '' ? $value->getPostFilename() : null; + $mimeType = $value->getMimeType() !== '' ? $value->getMimeType() : null; + + if (is_file($path)) { + $parts[$name] = Part::file($name, $path, $filename, $mimeType); + } else { + $contents = @file_get_contents($path); + $parts[$name] = Part::body($name, $contents === false ? '' : $contents, $filename, $mimeType); + } + + continue; + } + + $parts[$name] = $value; + } + + return $parts; + } + + protected function getHttpClient(bool $followRedirects): HttpClient + { + if ($followRedirects) { + return $this->httpClient ??= $this->createHttpClient(true); + } + + return $this->httpClientNoRedirect ??= $this->createHttpClient(false); + } + + protected function resetHttpClient(): void + { + $this->httpClient = null; + $this->httpClientNoRedirect = null; + } + + protected function createHttpClient(bool $followRedirects): HttpClient + { + $adapter = new CurlAdapter(options: [ + CURLOPT_TIMEOUT_MS => 0, + CURLOPT_USERAGENT => php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion(), + ])->withConnectionReuse(); + + $client = new HttpClient($adapter)->withFollowRedirects($followRedirects); + + if ($this->selfSigned) { + $client = $client->withSslVerification(false); + } + + if ($this->timeout !== null) { + $client = $client->withTimeout($this->timeout); + } + + if ($this->connectTimeout !== null) { + return $client->withConnectTimeout($this->connectTimeout); + } + + return $client; + } } diff --git a/src/Appwrite/Enums/Adapter.php b/src/Appwrite/Enums/Adapter.php index b9be67f0..3cfec56a 100644 --- a/src/Appwrite/Enums/Adapter.php +++ b/src/Appwrite/Enums/Adapter.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AttributeStatus.php b/src/Appwrite/Enums/AttributeStatus.php index 9ddf0b5e..f5058135 100644 --- a/src/Appwrite/Enums/AttributeStatus.php +++ b/src/Appwrite/Enums/AttributeStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AuthenticationFactor.php b/src/Appwrite/Enums/AuthenticationFactor.php index 046cf53f..601dbafd 100644 --- a/src/Appwrite/Enums/AuthenticationFactor.php +++ b/src/Appwrite/Enums/AuthenticationFactor.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AuthenticatorType.php b/src/Appwrite/Enums/AuthenticatorType.php index 74fe1c51..8d8b73a6 100644 --- a/src/Appwrite/Enums/AuthenticatorType.php +++ b/src/Appwrite/Enums/AuthenticatorType.php @@ -1,18 +1,18 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BackupServices.php b/src/Appwrite/Enums/BackupServices.php index eea40a7f..841ead28 100644 --- a/src/Appwrite/Enums/BackupServices.php +++ b/src/Appwrite/Enums/BackupServices.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BillingPlanGroup.php b/src/Appwrite/Enums/BillingPlanGroup.php index a58d7e91..04bcb58c 100644 --- a/src/Appwrite/Enums/BillingPlanGroup.php +++ b/src/Appwrite/Enums/BillingPlanGroup.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Browser.php b/src/Appwrite/Enums/Browser.php index c53dc05b..e0d5419d 100644 --- a/src/Appwrite/Enums/Browser.php +++ b/src/Appwrite/Enums/Browser.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BrowserPermission.php b/src/Appwrite/Enums/BrowserPermission.php index 71fa9b1f..003bb409 100644 --- a/src/Appwrite/Enums/BrowserPermission.php +++ b/src/Appwrite/Enums/BrowserPermission.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BrowserTheme.php b/src/Appwrite/Enums/BrowserTheme.php index 838a5a23..b0c284d2 100644 --- a/src/Appwrite/Enums/BrowserTheme.php +++ b/src/Appwrite/Enums/BrowserTheme.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php index ec65bb79..218a8c8f 100644 --- a/src/Appwrite/Enums/BuildRuntime.php +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -662,6 +663,13 @@ public static function BUN13(): BuildRuntime } return self::$BUN13; } + public static function BUN14(): BuildRuntime + { + if (!isset(self::$BUN14)) { + self::$BUN14 = new BuildRuntime('bun-1.4'); + } + return self::$BUN14; + } public static function GO123(): BuildRuntime { if (!isset(self::$GO123)) { @@ -842,6 +850,7 @@ public static function from(string $value): self 'bun-1.1' => self::BUN11(), 'bun-1.2' => self::BUN12(), 'bun-1.3' => self::BUN13(), + 'bun-1.4' => self::BUN14(), 'go-1.23' => self::GO123(), 'go-1.24' => self::GO124(), 'go-1.25' => self::GO125(), diff --git a/src/Appwrite/Enums/ColumnStatus.php b/src/Appwrite/Enums/ColumnStatus.php index 8ed9c71a..a601711b 100644 --- a/src/Appwrite/Enums/ColumnStatus.php +++ b/src/Appwrite/Enums/ColumnStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Compression.php b/src/Appwrite/Enums/Compression.php index ecfab333..fad5e5f2 100644 --- a/src/Appwrite/Enums/Compression.php +++ b/src/Appwrite/Enums/Compression.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/CreditCard.php b/src/Appwrite/Enums/CreditCard.php index c291380f..a99bca63 100644 --- a/src/Appwrite/Enums/CreditCard.php +++ b/src/Appwrite/Enums/CreditCard.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabaseStatus.php b/src/Appwrite/Enums/DatabaseStatus.php index 870c3932..d6e2edcf 100644 --- a/src/Appwrite/Enums/DatabaseStatus.php +++ b/src/Appwrite/Enums/DatabaseStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabaseType.php b/src/Appwrite/Enums/DatabaseType.php index 56d1cff0..9a336563 100644 --- a/src/Appwrite/Enums/DatabaseType.php +++ b/src/Appwrite/Enums/DatabaseType.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabasesIndexType.php b/src/Appwrite/Enums/DatabasesIndexType.php index 52443f4e..d4e6edac 100644 --- a/src/Appwrite/Enums/DatabasesIndexType.php +++ b/src/Appwrite/Enums/DatabasesIndexType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DeploymentDownloadType.php b/src/Appwrite/Enums/DeploymentDownloadType.php index 59d278b2..4e848003 100644 --- a/src/Appwrite/Enums/DeploymentDownloadType.php +++ b/src/Appwrite/Enums/DeploymentDownloadType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DeploymentStatus.php b/src/Appwrite/Enums/DeploymentStatus.php index 930af809..34f9706b 100644 --- a/src/Appwrite/Enums/DeploymentStatus.php +++ b/src/Appwrite/Enums/DeploymentStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/EmbeddingModel.php b/src/Appwrite/Enums/EmbeddingModel.php index ec104ce9..3ffa7a7c 100644 --- a/src/Appwrite/Enums/EmbeddingModel.php +++ b/src/Appwrite/Enums/EmbeddingModel.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionMethod.php b/src/Appwrite/Enums/ExecutionMethod.php index b8a0c3d7..e8a9c82c 100644 --- a/src/Appwrite/Enums/ExecutionMethod.php +++ b/src/Appwrite/Enums/ExecutionMethod.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionResourceType.php b/src/Appwrite/Enums/ExecutionResourceType.php new file mode 100644 index 00000000..948e5619 --- /dev/null +++ b/src/Appwrite/Enums/ExecutionResourceType.php @@ -0,0 +1,52 @@ +value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function FUNCTIONS(): ExecutionResourceType + { + if (!isset(self::$FUNCTIONS)) { + self::$FUNCTIONS = new ExecutionResourceType('functions'); + } + return self::$FUNCTIONS; + } + public static function SITES(): ExecutionResourceType + { + if (!isset(self::$SITES)) { + self::$SITES = new ExecutionResourceType('sites'); + } + return self::$SITES; + } + + public static function from(string $value): self + { + return match ($value) { + 'functions' => self::FUNCTIONS(), + 'sites' => self::SITES(), + default => throw new \InvalidArgumentException('Unknown ExecutionResourceType value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/ExecutionStatus.php b/src/Appwrite/Enums/ExecutionStatus.php index efb2030a..c7cae79a 100644 --- a/src/Appwrite/Enums/ExecutionStatus.php +++ b/src/Appwrite/Enums/ExecutionStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionTrigger.php b/src/Appwrite/Enums/ExecutionTrigger.php index 64449f23..26487f49 100644 --- a/src/Appwrite/Enums/ExecutionTrigger.php +++ b/src/Appwrite/Enums/ExecutionTrigger.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Flag.php b/src/Appwrite/Enums/Flag.php index 0e6965dd..a4d6c501 100644 --- a/src/Appwrite/Enums/Flag.php +++ b/src/Appwrite/Enums/Flag.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Framework.php b/src/Appwrite/Enums/Framework.php index 2dd77c5f..6a620c7f 100644 --- a/src/Appwrite/Enums/Framework.php +++ b/src/Appwrite/Enums/Framework.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ImageFormat.php b/src/Appwrite/Enums/ImageFormat.php index 4b0a5414..7132ce5c 100644 --- a/src/Appwrite/Enums/ImageFormat.php +++ b/src/Appwrite/Enums/ImageFormat.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ImageGravity.php b/src/Appwrite/Enums/ImageGravity.php index a101dc18..384fc1a3 100644 --- a/src/Appwrite/Enums/ImageGravity.php +++ b/src/Appwrite/Enums/ImageGravity.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/IndexStatus.php b/src/Appwrite/Enums/IndexStatus.php index e36b6e28..fc079368 100644 --- a/src/Appwrite/Enums/IndexStatus.php +++ b/src/Appwrite/Enums/IndexStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/InvalidationType.php b/src/Appwrite/Enums/InvalidationType.php index 828bd90d..dd157618 100644 --- a/src/Appwrite/Enums/InvalidationType.php +++ b/src/Appwrite/Enums/InvalidationType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessagePriority.php b/src/Appwrite/Enums/MessagePriority.php index a13ec24f..f08e7bf2 100644 --- a/src/Appwrite/Enums/MessagePriority.php +++ b/src/Appwrite/Enums/MessagePriority.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessageStatus.php b/src/Appwrite/Enums/MessageStatus.php index 15ce9f88..188c52a5 100644 --- a/src/Appwrite/Enums/MessageStatus.php +++ b/src/Appwrite/Enums/MessageStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessagingProviderType.php b/src/Appwrite/Enums/MessagingProviderType.php index f5a7711b..012eed74 100644 --- a/src/Appwrite/Enums/MessagingProviderType.php +++ b/src/Appwrite/Enums/MessagingProviderType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuth2GooglePrompt.php b/src/Appwrite/Enums/OAuth2GooglePrompt.php index f6a6e876..5ed839f2 100644 --- a/src/Appwrite/Enums/OAuth2GooglePrompt.php +++ b/src/Appwrite/Enums/OAuth2GooglePrompt.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuth2OidcPrompt.php b/src/Appwrite/Enums/OAuth2OidcPrompt.php index bbdad5ad..979febd4 100644 --- a/src/Appwrite/Enums/OAuth2OidcPrompt.php +++ b/src/Appwrite/Enums/OAuth2OidcPrompt.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuthProvider.php b/src/Appwrite/Enums/OAuthProvider.php index decb1d46..0c8ab75a 100644 --- a/src/Appwrite/Enums/OAuthProvider.php +++ b/src/Appwrite/Enums/OAuthProvider.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -208,6 +209,13 @@ public static function GOOGLE(): OAuthProvider } return self::$GOOGLE; } + public static function HUGGINGFACE(): OAuthProvider + { + if (!isset(self::$HUGGINGFACE)) { + self::$HUGGINGFACE = new OAuthProvider('huggingface'); + } + return self::$HUGGINGFACE; + } public static function KEYCLOAK(): OAuthProvider { if (!isset(self::$KEYCLOAK)) { @@ -400,6 +408,7 @@ public static function from(string $value): self 'github' => self::GITHUB(), 'gitlab' => self::GITLAB(), 'google' => self::GOOGLE(), + 'huggingface' => self::HUGGINGFACE(), 'keycloak' => self::KEYCLOAK(), 'kick' => self::KICK(), 'linkedin' => self::LINKEDIN(), diff --git a/src/Appwrite/Enums/OrderBy.php b/src/Appwrite/Enums/OrderBy.php index ee63245a..c6060b32 100644 --- a/src/Appwrite/Enums/OrderBy.php +++ b/src/Appwrite/Enums/OrderBy.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OrganizationKeyScopes.php b/src/Appwrite/Enums/OrganizationKeyScopes.php index 2d0e5d85..3b70fd28 100644 --- a/src/Appwrite/Enums/OrganizationKeyScopes.php +++ b/src/Appwrite/Enums/OrganizationKeyScopes.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/PasswordHash.php b/src/Appwrite/Enums/PasswordHash.php index 63de69b7..4ac4aba0 100644 --- a/src/Appwrite/Enums/PasswordHash.php +++ b/src/Appwrite/Enums/PasswordHash.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/PlatformType.php b/src/Appwrite/Enums/PlatformType.php index 4b1651a8..255ec616 100644 --- a/src/Appwrite/Enums/PlatformType.php +++ b/src/Appwrite/Enums/PlatformType.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectAuthMethodId.php b/src/Appwrite/Enums/ProjectAuthMethodId.php index c45572d4..46f1baca 100644 --- a/src/Appwrite/Enums/ProjectAuthMethodId.php +++ b/src/Appwrite/Enums/ProjectAuthMethodId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectEmailTemplateId.php b/src/Appwrite/Enums/ProjectEmailTemplateId.php index 58b14bda..1a2eb118 100644 --- a/src/Appwrite/Enums/ProjectEmailTemplateId.php +++ b/src/Appwrite/Enums/ProjectEmailTemplateId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectEmailTemplateLocale.php b/src/Appwrite/Enums/ProjectEmailTemplateLocale.php index 31971bb9..c8bfcfe5 100644 --- a/src/Appwrite/Enums/ProjectEmailTemplateLocale.php +++ b/src/Appwrite/Enums/ProjectEmailTemplateLocale.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectKeyScopes.php b/src/Appwrite/Enums/ProjectKeyScopes.php index a0c12987..1a7d9dbd 100644 --- a/src/Appwrite/Enums/ProjectKeyScopes.php +++ b/src/Appwrite/Enums/ProjectKeyScopes.php @@ -1,13 +1,17 @@ value = $value; } public function __toString(): string @@ -144,6 +143,13 @@ public static function PROJECTWRITE(): ProjectKeyScopes } return self::$PROJECTWRITE; } + public static function USAGEREAD(): ProjectKeyScopes + { + if (!isset(self::$USAGEREAD)) { + self::$USAGEREAD = new ProjectKeyScopes('usage.read'); + } + return self::$USAGEREAD; + } public static function KEYSREAD(): ProjectKeyScopes { if (!isset(self::$KEYSREAD)) { @@ -781,13 +787,6 @@ public static function RESTORATIONSWRITE(): ProjectKeyScopes } return self::$RESTORATIONSWRITE; } - public static function DEDICATEDDATABASESEXECUTE(): ProjectKeyScopes - { - if (!isset(self::$DEDICATEDDATABASESEXECUTE)) { - self::$DEDICATEDDATABASESEXECUTE = new ProjectKeyScopes('dedicatedDatabases.execute'); - } - return self::$DEDICATEDDATABASESEXECUTE; - } public static function DOMAINSREAD(): ProjectKeyScopes { if (!isset(self::$DOMAINSREAD)) { @@ -865,19 +864,13 @@ public static function OAUTH2INTROSPECT(): ProjectKeyScopes } return self::$OAUTH2INTROSPECT; } - public static function USAGEREAD(): ProjectKeyScopes - { - if (!isset(self::$USAGEREAD)) { - self::$USAGEREAD = new ProjectKeyScopes('usage.read'); - } - return self::$USAGEREAD; - } public static function from(string $value): self { return match ($value) { 'project.read' => self::PROJECTREAD(), 'project.write' => self::PROJECTWRITE(), + 'usage.read' => self::USAGEREAD(), 'keys.read' => self::KEYSREAD(), 'keys.write' => self::KEYSWRITE(), 'platforms.read' => self::PLATFORMSREAD(), @@ -969,7 +962,6 @@ public static function from(string $value): self 'archives.write' => self::ARCHIVESWRITE(), 'restorations.read' => self::RESTORATIONSREAD(), 'restorations.write' => self::RESTORATIONSWRITE(), - 'dedicatedDatabases.execute' => self::DEDICATEDDATABASESEXECUTE(), 'domains.read' => self::DOMAINSREAD(), 'domains.write' => self::DOMAINSWRITE(), 'wafRules.read' => self::WAFRULESREAD(), @@ -981,7 +973,6 @@ public static function from(string $value): self 'oauth2.read' => self::OAUTH2READ(), 'oauth2.write' => self::OAUTH2WRITE(), 'oauth2.introspect' => self::OAUTH2INTROSPECT(), - 'usage.read' => self::USAGEREAD(), default => throw new \InvalidArgumentException('Unknown ProjectKeyScopes value: ' . $value), }; } diff --git a/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php b/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php index d9e83492..bcff0b43 100644 --- a/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php +++ b/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php index 867ee098..579084bc 100644 --- a/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php +++ b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectOAuthProviderId.php b/src/Appwrite/Enums/ProjectOAuthProviderId.php index 7f697114..2f838e78 100644 --- a/src/Appwrite/Enums/ProjectOAuthProviderId.php +++ b/src/Appwrite/Enums/ProjectOAuthProviderId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -208,6 +209,13 @@ public static function GOOGLE(): ProjectOAuthProviderId } return self::$GOOGLE; } + public static function HUGGINGFACE(): ProjectOAuthProviderId + { + if (!isset(self::$HUGGINGFACE)) { + self::$HUGGINGFACE = new ProjectOAuthProviderId('huggingface'); + } + return self::$HUGGINGFACE; + } public static function KEYCLOAK(): ProjectOAuthProviderId { if (!isset(self::$KEYCLOAK)) { @@ -400,6 +408,7 @@ public static function from(string $value): self 'github' => self::GITHUB(), 'gitlab' => self::GITLAB(), 'google' => self::GOOGLE(), + 'huggingface' => self::HUGGINGFACE(), 'keycloak' => self::KEYCLOAK(), 'kick' => self::KICK(), 'linkedin' => self::LINKEDIN(), diff --git a/src/Appwrite/Enums/ProjectPolicyId.php b/src/Appwrite/Enums/ProjectPolicyId.php index 7ee3c25d..575f8b4b 100644 --- a/src/Appwrite/Enums/ProjectPolicyId.php +++ b/src/Appwrite/Enums/ProjectPolicyId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectProtocolId.php b/src/Appwrite/Enums/ProjectProtocolId.php index c6d340c2..9dda1106 100644 --- a/src/Appwrite/Enums/ProjectProtocolId.php +++ b/src/Appwrite/Enums/ProjectProtocolId.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectSMTPSecure.php b/src/Appwrite/Enums/ProjectSMTPSecure.php index b53c9349..8a6d1b0f 100644 --- a/src/Appwrite/Enums/ProjectSMTPSecure.php +++ b/src/Appwrite/Enums/ProjectSMTPSecure.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectServiceId.php b/src/Appwrite/Enums/ProjectServiceId.php index 59921ae9..42ab4dbf 100644 --- a/src/Appwrite/Enums/ProjectServiceId.php +++ b/src/Appwrite/Enums/ProjectServiceId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyResourceType.php b/src/Appwrite/Enums/ProxyResourceType.php index 65a0a1bd..d588cf80 100644 --- a/src/Appwrite/Enums/ProxyResourceType.php +++ b/src/Appwrite/Enums/ProxyResourceType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php b/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php index 983314fc..c9b572ba 100644 --- a/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php +++ b/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyRuleStatus.php b/src/Appwrite/Enums/ProxyRuleStatus.php index 8bac5eb8..b49ad0a3 100644 --- a/src/Appwrite/Enums/ProxyRuleStatus.php +++ b/src/Appwrite/Enums/ProxyRuleStatus.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Region.php b/src/Appwrite/Enums/Region.php index 7695a582..b0a7214f 100644 --- a/src/Appwrite/Enums/Region.php +++ b/src/Appwrite/Enums/Region.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/RelationMutate.php b/src/Appwrite/Enums/RelationMutate.php index 6e02d82e..fee5320b 100644 --- a/src/Appwrite/Enums/RelationMutate.php +++ b/src/Appwrite/Enums/RelationMutate.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/RelationshipType.php b/src/Appwrite/Enums/RelationshipType.php index f2d6e2e8..64a7e2ea 100644 --- a/src/Appwrite/Enums/RelationshipType.php +++ b/src/Appwrite/Enums/RelationshipType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index d082cb86..f2ed8a42 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -662,6 +663,13 @@ public static function BUN13(): Runtime } return self::$BUN13; } + public static function BUN14(): Runtime + { + if (!isset(self::$BUN14)) { + self::$BUN14 = new Runtime('bun-1.4'); + } + return self::$BUN14; + } public static function GO123(): Runtime { if (!isset(self::$GO123)) { @@ -842,6 +850,7 @@ public static function from(string $value): self 'bun-1.1' => self::BUN11(), 'bun-1.2' => self::BUN12(), 'bun-1.3' => self::BUN13(), + 'bun-1.4' => self::BUN14(), 'go-1.23' => self::GO123(), 'go-1.24' => self::GO124(), 'go-1.25' => self::GO125(), diff --git a/src/Appwrite/Enums/SmtpEncryption.php b/src/Appwrite/Enums/SmtpEncryption.php index 6f0e2f1e..fc5e6f82 100644 --- a/src/Appwrite/Enums/SmtpEncryption.php +++ b/src/Appwrite/Enums/SmtpEncryption.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/StatusCode.php b/src/Appwrite/Enums/StatusCode.php index 8a31157e..76dbda86 100644 --- a/src/Appwrite/Enums/StatusCode.php +++ b/src/Appwrite/Enums/StatusCode.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/TablesDBIndexType.php b/src/Appwrite/Enums/TablesDBIndexType.php index e9fa1747..32425eda 100644 --- a/src/Appwrite/Enums/TablesDBIndexType.php +++ b/src/Appwrite/Enums/TablesDBIndexType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/TemplateReferenceType.php b/src/Appwrite/Enums/TemplateReferenceType.php index e81e29c7..765e85df 100644 --- a/src/Appwrite/Enums/TemplateReferenceType.php +++ b/src/Appwrite/Enums/TemplateReferenceType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Timezone.php b/src/Appwrite/Enums/Timezone.php index 47805f7b..532f4434 100644 --- a/src/Appwrite/Enums/Timezone.php +++ b/src/Appwrite/Enums/Timezone.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/VCSReferenceType.php b/src/Appwrite/Enums/VCSReferenceType.php index e47aa03b..582c7435 100644 --- a/src/Appwrite/Enums/VCSReferenceType.php +++ b/src/Appwrite/Enums/VCSReferenceType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/ID.php b/src/Appwrite/ID.php index 43db4c0d..7a9d8ee1 100644 --- a/src/Appwrite/ID.php +++ b/src/Appwrite/ID.php @@ -1,8 +1,11 @@ mimeType = $mimeType; $instance->filename = $filename; return $instance; - } + } public static function withData(string $data, ?string $mimeType = null, ?string $filename = null): InputFile { @@ -48,4 +50,4 @@ public static function withData(string $data, ?string $mimeType = null, ?string $instance->filename = $filename; return $instance; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Models/ActivityEvent.php b/src/Appwrite/Models/ActivityEvent.php index 3bb7b87c..f1af42c6 100644 --- a/src/Appwrite/Models/ActivityEvent.php +++ b/src/Appwrite/Models/ActivityEvent.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'actorType' => static::serializeValue($this->actorType), 'actorId' => static::serializeValue($this->actorId), @@ -237,7 +241,5 @@ public function toArray(): array 'sdk' => static::serializeValue($this->sdk), 'sdkVersion' => static::serializeValue($this->sdkVersion) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ActivityEventList.php b/src/Appwrite/Models/ActivityEventList.php index 7039b9c6..191d993d 100644 --- a/src/Appwrite/Models/ActivityEventList.php +++ b/src/Appwrite/Models/ActivityEventList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'events' => static::serializeValue($this->events) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AdditionalResource.php b/src/Appwrite/Models/AdditionalResource.php index 22ccf01a..532bf02f 100644 --- a/src/Appwrite/Models/AdditionalResource.php +++ b/src/Appwrite/Models/AdditionalResource.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'unit' => static::serializeValue($this->unit), 'currency' => static::serializeValue($this->currency), @@ -76,7 +80,5 @@ public function toArray(): array 'value' => static::serializeValue($this->value), 'invoiceDesc' => static::serializeValue($this->invoiceDesc) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoArgon2.php b/src/Appwrite/Models/AlgoArgon2.php index aa6de2ee..c5acb0ab 100644 --- a/src/Appwrite/Models/AlgoArgon2.php +++ b/src/Appwrite/Models/AlgoArgon2.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'memoryCost' => static::serializeValue($this->memoryCost), 'timeCost' => static::serializeValue($this->timeCost), 'threads' => static::serializeValue($this->threads) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoBcrypt.php b/src/Appwrite/Models/AlgoBcrypt.php index a2a1a945..a2a916bb 100644 --- a/src/Appwrite/Models/AlgoBcrypt.php +++ b/src/Appwrite/Models/AlgoBcrypt.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoMd5.php b/src/Appwrite/Models/AlgoMd5.php index 06a1f851..3abcce42 100644 --- a/src/Appwrite/Models/AlgoMd5.php +++ b/src/Appwrite/Models/AlgoMd5.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoPhpass.php b/src/Appwrite/Models/AlgoPhpass.php index 353f8809..9ce1b082 100644 --- a/src/Appwrite/Models/AlgoPhpass.php +++ b/src/Appwrite/Models/AlgoPhpass.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoScrypt.php b/src/Appwrite/Models/AlgoScrypt.php index e602f313..fd2e3e39 100644 --- a/src/Appwrite/Models/AlgoScrypt.php +++ b/src/Appwrite/Models/AlgoScrypt.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'costCpu' => static::serializeValue($this->costCpu), 'costMemory' => static::serializeValue($this->costMemory), 'costParallel' => static::serializeValue($this->costParallel), 'length' => static::serializeValue($this->length) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoScryptModified.php b/src/Appwrite/Models/AlgoScryptModified.php index c8018a36..20e306e4 100644 --- a/src/Appwrite/Models/AlgoScryptModified.php +++ b/src/Appwrite/Models/AlgoScryptModified.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'salt' => static::serializeValue($this->salt), 'saltSeparator' => static::serializeValue($this->saltSeparator), 'signerKey' => static::serializeValue($this->signerKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoSha.php b/src/Appwrite/Models/AlgoSha.php index 4da8de8c..69661214 100644 --- a/src/Appwrite/Models/AlgoSha.php +++ b/src/Appwrite/Models/AlgoSha.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/App.php b/src/Appwrite/Models/App.php index c6d447ef..78e5c79a 100644 --- a/src/Appwrite/Models/App.php +++ b/src/Appwrite/Models/App.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -221,7 +225,5 @@ public function toArray(): array 'installationRedirectUrl' => static::serializeValue($this->installationRedirectUrl), 'secrets' => static::serializeValue($this->secrets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppInstallation.php b/src/Appwrite/Models/AppInstallation.php index 1d13ce2f..ccb07f61 100644 --- a/src/Appwrite/Models/AppInstallation.php +++ b/src/Appwrite/Models/AppInstallation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -101,7 +105,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppInstallationList.php b/src/Appwrite/Models/AppInstallationList.php index 86a00699..9c03edc3 100644 --- a/src/Appwrite/Models/AppInstallationList.php +++ b/src/Appwrite/Models/AppInstallationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'installations' => static::serializeValue($this->installations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppKey.php b/src/Appwrite/Models/AppKey.php index 471de01f..49a44339 100644 --- a/src/Appwrite/Models/AppKey.php +++ b/src/Appwrite/Models/AppKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppKeyList.php b/src/Appwrite/Models/AppKeyList.php index a5753ead..47febab3 100644 --- a/src/Appwrite/Models/AppKeyList.php +++ b/src/Appwrite/Models/AppKeyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'keys' => static::serializeValue($this->keys) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppScope.php b/src/Appwrite/Models/AppScope.php index d0517995..2c34b679 100644 --- a/src/Appwrite/Models/AppScope.php +++ b/src/Appwrite/Models/AppScope.php @@ -1,9 +1,13 @@ static::serializeValue($this->value), 'description' => static::serializeValue($this->description), 'type' => static::serializeValue($this->type), 'category' => static::serializeValue($this->category), 'deprecated' => static::serializeValue($this->deprecated) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppScopeList.php b/src/Appwrite/Models/AppScopeList.php index 32090a96..09bf0e49 100644 --- a/src/Appwrite/Models/AppScopeList.php +++ b/src/Appwrite/Models/AppScopeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'scopes' => static::serializeValue($this->scopes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecret.php b/src/Appwrite/Models/AppSecret.php index 5308587c..60d74c0b 100644 --- a/src/Appwrite/Models/AppSecret.php +++ b/src/Appwrite/Models/AppSecret.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecretList.php b/src/Appwrite/Models/AppSecretList.php index 2568f739..fe952101 100644 --- a/src/Appwrite/Models/AppSecretList.php +++ b/src/Appwrite/Models/AppSecretList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'secrets' => static::serializeValue($this->secrets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecretPlaintext.php b/src/Appwrite/Models/AppSecretPlaintext.php index 35c321cb..3e44cd97 100644 --- a/src/Appwrite/Models/AppSecretPlaintext.php +++ b/src/Appwrite/Models/AppSecretPlaintext.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppsList.php b/src/Appwrite/Models/AppsList.php index 547ab60d..08258206 100644 --- a/src/Appwrite/Models/AppsList.php +++ b/src/Appwrite/Models/AppsList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'apps' => static::serializeValue($this->apps) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ArraySerializable.php b/src/Appwrite/Models/ArraySerializable.php index b387f3cf..1aff26d0 100644 --- a/src/Appwrite/Models/ArraySerializable.php +++ b/src/Appwrite/Models/ArraySerializable.php @@ -1,5 +1,7 @@ $knownFields * @return array */ - private static function extractAdditionalPropertiesFromFields(array $data, array $knownFields): array + protected static function extractAdditionalPropertiesFromFields(array $data, array $knownFields): array { if (!\in_array('data', $knownFields, true) && isset($data['data']) && is_array($data['data'])) { return $data['data']; @@ -21,7 +23,7 @@ private static function extractAdditionalPropertiesFromFields(array $data, array /** * @return array */ - private static function serializeAdditionalProperties(mixed $value): array + protected static function serializeAdditionalProperties(mixed $value): array { if (!is_array($value)) { return []; @@ -36,7 +38,7 @@ private static function serializeAdditionalProperties(mixed $value): array return $result; } - private static function hydrateTypedValue(string $type, mixed $value, bool $allowsNull = false): mixed + protected static function hydrateTypedValue(string $type, mixed $value, bool $allowsNull = false): mixed { if ($value === null || !method_exists($type, 'from')) { return $value; @@ -49,7 +51,7 @@ private static function hydrateTypedValue(string $type, mixed $value, bool $allo return is_array($value) ? $type::from($value) : $type::from((string) $value); } - private static function serializeValue(mixed $value): mixed + protected static function serializeValue(mixed $value): mixed { if ($value === null) { return null; @@ -57,7 +59,7 @@ private static function serializeValue(mixed $value): mixed if (is_array($value)) { return array_map( - static fn (mixed $item): mixed => static::serializeValue($item), + static::serializeValue(...), $value ); } diff --git a/src/Appwrite/Models/AttributeBigint.php b/src/Appwrite/Models/AttributeBigint.php index bcd175c2..d82efa63 100644 --- a/src/Appwrite/Models/AttributeBigint.php +++ b/src/Appwrite/Models/AttributeBigint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeBoolean.php b/src/Appwrite/Models/AttributeBoolean.php index a1ff7ce4..0f07edee 100644 --- a/src/Appwrite/Models/AttributeBoolean.php +++ b/src/Appwrite/Models/AttributeBoolean.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeDatetime.php b/src/Appwrite/Models/AttributeDatetime.php index ad7f5405..f5bdb09e 100644 --- a/src/Appwrite/Models/AttributeDatetime.php +++ b/src/Appwrite/Models/AttributeDatetime.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeEmail.php b/src/Appwrite/Models/AttributeEmail.php index c1da0b1b..40c7713d 100644 --- a/src/Appwrite/Models/AttributeEmail.php +++ b/src/Appwrite/Models/AttributeEmail.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeEnum.php b/src/Appwrite/Models/AttributeEnum.php index c6730f3b..2e787048 100644 --- a/src/Appwrite/Models/AttributeEnum.php +++ b/src/Appwrite/Models/AttributeEnum.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -107,7 +111,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeFloat.php b/src/Appwrite/Models/AttributeFloat.php index b319ed00..70dd498b 100644 --- a/src/Appwrite/Models/AttributeFloat.php +++ b/src/Appwrite/Models/AttributeFloat.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeInteger.php b/src/Appwrite/Models/AttributeInteger.php index 540a18bb..096bb3ae 100644 --- a/src/Appwrite/Models/AttributeInteger.php +++ b/src/Appwrite/Models/AttributeInteger.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeIp.php b/src/Appwrite/Models/AttributeIp.php index 13b19d06..f4b8cd2f 100644 --- a/src/Appwrite/Models/AttributeIp.php +++ b/src/Appwrite/Models/AttributeIp.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeLine.php b/src/Appwrite/Models/AttributeLine.php index 6867fc6c..c0b86b2a 100644 --- a/src/Appwrite/Models/AttributeLine.php +++ b/src/Appwrite/Models/AttributeLine.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeList.php b/src/Appwrite/Models/AttributeList.php index bb3ee377..851af79a 100644 --- a/src/Appwrite/Models/AttributeList.php +++ b/src/Appwrite/Models/AttributeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'attributes' => static::serializeValue($this->attributes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeLongtext.php b/src/Appwrite/Models/AttributeLongtext.php index 6232eecd..ca6cdc7e 100644 --- a/src/Appwrite/Models/AttributeLongtext.php +++ b/src/Appwrite/Models/AttributeLongtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeMediumtext.php b/src/Appwrite/Models/AttributeMediumtext.php index 10aee46c..e0369578 100644 --- a/src/Appwrite/Models/AttributeMediumtext.php +++ b/src/Appwrite/Models/AttributeMediumtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributePoint.php b/src/Appwrite/Models/AttributePoint.php index 55bfb48a..36d4bacf 100644 --- a/src/Appwrite/Models/AttributePoint.php +++ b/src/Appwrite/Models/AttributePoint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributePolygon.php b/src/Appwrite/Models/AttributePolygon.php index 50e512f0..6416edd1 100644 --- a/src/Appwrite/Models/AttributePolygon.php +++ b/src/Appwrite/Models/AttributePolygon.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeRelationship.php b/src/Appwrite/Models/AttributeRelationship.php index 571a692e..3ccb2c38 100644 --- a/src/Appwrite/Models/AttributeRelationship.php +++ b/src/Appwrite/Models/AttributeRelationship.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -131,7 +135,5 @@ public function toArray(): array 'onDelete' => static::serializeValue($this->onDelete), 'side' => static::serializeValue($this->side) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeString.php b/src/Appwrite/Models/AttributeString.php index 306bdeaf..51b74698 100644 --- a/src/Appwrite/Models/AttributeString.php +++ b/src/Appwrite/Models/AttributeString.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeText.php b/src/Appwrite/Models/AttributeText.php index 3a0556ee..5efc568b 100644 --- a/src/Appwrite/Models/AttributeText.php +++ b/src/Appwrite/Models/AttributeText.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeUrl.php b/src/Appwrite/Models/AttributeUrl.php index d33d3b2a..3396b69d 100644 --- a/src/Appwrite/Models/AttributeUrl.php +++ b/src/Appwrite/Models/AttributeUrl.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeVarchar.php b/src/Appwrite/Models/AttributeVarchar.php index ad4c9857..cb8e0858 100644 --- a/src/Appwrite/Models/AttributeVarchar.php +++ b/src/Appwrite/Models/AttributeVarchar.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupArchive.php b/src/Appwrite/Models/BackupArchive.php index 2a0fcfa5..f70d7a99 100644 --- a/src/Appwrite/Models/BackupArchive.php +++ b/src/Appwrite/Models/BackupArchive.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -112,7 +116,5 @@ public function toArray(): array 'resourceId' => static::serializeValue($this->resourceId), 'resourceType' => static::serializeValue($this->resourceType) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupArchiveList.php b/src/Appwrite/Models/BackupArchiveList.php index 7426257e..635f8ccd 100644 --- a/src/Appwrite/Models/BackupArchiveList.php +++ b/src/Appwrite/Models/BackupArchiveList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'archives' => static::serializeValue($this->archives) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupPolicy.php b/src/Appwrite/Models/BackupPolicy.php index 424f002c..1ccc459f 100644 --- a/src/Appwrite/Models/BackupPolicy.php +++ b/src/Appwrite/Models/BackupPolicy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'name' => static::serializeValue($this->name), '$createdAt' => static::serializeValue($this->createdAt), @@ -112,7 +116,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupPolicyList.php b/src/Appwrite/Models/BackupPolicyList.php index 3189b4e2..0cc3171a 100644 --- a/src/Appwrite/Models/BackupPolicyList.php +++ b/src/Appwrite/Models/BackupPolicyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'policies' => static::serializeValue($this->policies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupRestoration.php b/src/Appwrite/Models/BackupRestoration.php index c6d4e5be..7e43ad0b 100644 --- a/src/Appwrite/Models/BackupRestoration.php +++ b/src/Appwrite/Models/BackupRestoration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -111,7 +115,5 @@ public function toArray(): array 'resources' => static::serializeValue($this->resources), 'options' => static::serializeValue($this->options) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupRestorationList.php b/src/Appwrite/Models/BackupRestorationList.php index 32537e79..707421f7 100644 --- a/src/Appwrite/Models/BackupRestorationList.php +++ b/src/Appwrite/Models/BackupRestorationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'restorations' => static::serializeValue($this->restorations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingLimits.php b/src/Appwrite/Models/BillingLimits.php index 83362ae4..580e88ea 100644 --- a/src/Appwrite/Models/BillingLimits.php +++ b/src/Appwrite/Models/BillingLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->bandwidth), 'storage' => static::serializeValue($this->storage), 'users' => static::serializeValue($this->users), @@ -66,7 +70,5 @@ public function toArray(): array 'authPhone' => static::serializeValue($this->authPhone), 'budgetLimit' => static::serializeValue($this->budgetLimit) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlan.php b/src/Appwrite/Models/BillingPlan.php index 3b7f783a..73d1a0d0 100644 --- a/src/Appwrite/Models/BillingPlan.php +++ b/src/Appwrite/Models/BillingPlan.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'name' => static::serializeValue($this->name), 'desc' => static::serializeValue($this->desc), @@ -478,6 +494,7 @@ public function toArray(): array 'supportsMockNumbers' => static::serializeValue($this->supportsMockNumbers), 'supportsOrganizationRoles' => static::serializeValue($this->supportsOrganizationRoles), 'supportsCredits' => static::serializeValue($this->supportsCredits), + 'supportsDedicatedDatabases' => static::serializeValue($this->supportsDedicatedDatabases), 'supportsDisposableEmailValidation' => static::serializeValue($this->supportsDisposableEmailValidation), 'supportsCanonicalEmailValidation' => static::serializeValue($this->supportsCanonicalEmailValidation), 'supportsFreeEmailValidation' => static::serializeValue($this->supportsFreeEmailValidation), @@ -493,9 +510,8 @@ public function toArray(): array 'limits' => static::serializeValue($this->limits), 'group' => static::serializeValue($this->group), 'program' => static::serializeValue($this->program), + 'databaseComputeCredit' => static::serializeValue($this->databaseComputeCredit), 'dedicatedDatabases' => static::serializeValue($this->dedicatedDatabases) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanAddon.php b/src/Appwrite/Models/BillingPlanAddon.php index f34340e5..9478e8cd 100644 --- a/src/Appwrite/Models/BillingPlanAddon.php +++ b/src/Appwrite/Models/BillingPlanAddon.php @@ -1,9 +1,13 @@ static::serializeValue($this->seats), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanAddonDetails.php b/src/Appwrite/Models/BillingPlanAddonDetails.php index 79b8500c..cc972f38 100644 --- a/src/Appwrite/Models/BillingPlanAddonDetails.php +++ b/src/Appwrite/Models/BillingPlanAddonDetails.php @@ -1,9 +1,13 @@ static::serializeValue($this->supported), 'planIncluded' => static::serializeValue($this->planIncluded), 'limit' => static::serializeValue($this->limit), @@ -87,7 +91,5 @@ public function toArray(): array 'value' => static::serializeValue($this->value), 'invoiceDesc' => static::serializeValue($this->invoiceDesc) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php index 97a088b1..921c6d9d 100644 --- a/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php +++ b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->minCpu), 'maxCpu' => static::serializeValue($this->maxCpu), 'minMemoryMb' => static::serializeValue($this->minMemoryMb), @@ -110,7 +114,5 @@ public function toArray(): array 'allowedStorageClasses' => static::serializeValue($this->allowedStorageClasses), 'allowedSyncModes' => static::serializeValue($this->allowedSyncModes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanLimits.php b/src/Appwrite/Models/BillingPlanLimits.php index 2f8d9d86..b45caba5 100644 --- a/src/Appwrite/Models/BillingPlanLimits.php +++ b/src/Appwrite/Models/BillingPlanLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->credits), 'dailyCredits' => static::serializeValue($this->dailyCredits) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanSupportedAddons.php b/src/Appwrite/Models/BillingPlanSupportedAddons.php index 344ce998..0ecbe7bb 100644 --- a/src/Appwrite/Models/BillingPlanSupportedAddons.php +++ b/src/Appwrite/Models/BillingPlanSupportedAddons.php @@ -1,9 +1,13 @@ static::serializeValue($this->baa), 'premiumGeoDB' => static::serializeValue($this->premiumGeoDB), 'premiumGeoDBOrg' => static::serializeValue($this->premiumGeoDBOrg) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Block.php b/src/Appwrite/Models/Block.php index 4079f849..16f0841e 100644 --- a/src/Appwrite/Models/Block.php +++ b/src/Appwrite/Models/Block.php @@ -1,9 +1,13 @@ static::serializeValue($this->createdAt), 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId), @@ -105,7 +109,5 @@ public function toArray(): array 'organizationId' => static::serializeValue($this->organizationId), 'billingPlan' => static::serializeValue($this->billingPlan) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Bucket.php b/src/Appwrite/Models/Bucket.php index 50a2927c..b3589932 100644 --- a/src/Appwrite/Models/Bucket.php +++ b/src/Appwrite/Models/Bucket.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -132,7 +136,5 @@ public function toArray(): array 'transformations' => static::serializeValue($this->transformations), 'totalSize' => static::serializeValue($this->totalSize) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BucketList.php b/src/Appwrite/Models/BucketList.php index 79edabbf..c94dc2e2 100644 --- a/src/Appwrite/Models/BucketList.php +++ b/src/Appwrite/Models/BucketList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'buckets' => static::serializeValue($this->buckets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Collection.php b/src/Appwrite/Models/Collection.php index a5d8af5d..de2e7910 100644 --- a/src/Appwrite/Models/Collection.php +++ b/src/Appwrite/Models/Collection.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -123,7 +127,5 @@ public function toArray(): array 'bytesMax' => static::serializeValue($this->bytesMax), 'bytesUsed' => static::serializeValue($this->bytesUsed) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CollectionList.php b/src/Appwrite/Models/CollectionList.php index de3a804a..3617db98 100644 --- a/src/Appwrite/Models/CollectionList.php +++ b/src/Appwrite/Models/CollectionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'collections' => static::serializeValue($this->collections) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnBigint.php b/src/Appwrite/Models/ColumnBigint.php index dcf0372b..34e70cfc 100644 --- a/src/Appwrite/Models/ColumnBigint.php +++ b/src/Appwrite/Models/ColumnBigint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnBoolean.php b/src/Appwrite/Models/ColumnBoolean.php index 174c0ce9..7bbc0305 100644 --- a/src/Appwrite/Models/ColumnBoolean.php +++ b/src/Appwrite/Models/ColumnBoolean.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnDatetime.php b/src/Appwrite/Models/ColumnDatetime.php index 0596eda8..7eb241b5 100644 --- a/src/Appwrite/Models/ColumnDatetime.php +++ b/src/Appwrite/Models/ColumnDatetime.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnEmail.php b/src/Appwrite/Models/ColumnEmail.php index 5d5b77dd..f24369ed 100644 --- a/src/Appwrite/Models/ColumnEmail.php +++ b/src/Appwrite/Models/ColumnEmail.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnEnum.php b/src/Appwrite/Models/ColumnEnum.php index 748df535..925a656b 100644 --- a/src/Appwrite/Models/ColumnEnum.php +++ b/src/Appwrite/Models/ColumnEnum.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -107,7 +111,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnFloat.php b/src/Appwrite/Models/ColumnFloat.php index 5ccc00ee..c446e11a 100644 --- a/src/Appwrite/Models/ColumnFloat.php +++ b/src/Appwrite/Models/ColumnFloat.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIndex.php b/src/Appwrite/Models/ColumnIndex.php index d46c91d4..2ef80f49 100644 --- a/src/Appwrite/Models/ColumnIndex.php +++ b/src/Appwrite/Models/ColumnIndex.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -101,7 +105,5 @@ public function toArray(): array 'lengths' => static::serializeValue($this->lengths), 'orders' => static::serializeValue($this->orders) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIndexList.php b/src/Appwrite/Models/ColumnIndexList.php index 893e04f7..a5107ea5 100644 --- a/src/Appwrite/Models/ColumnIndexList.php +++ b/src/Appwrite/Models/ColumnIndexList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'indexes' => static::serializeValue($this->indexes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnInteger.php b/src/Appwrite/Models/ColumnInteger.php index 1782d1c8..e0bb2706 100644 --- a/src/Appwrite/Models/ColumnInteger.php +++ b/src/Appwrite/Models/ColumnInteger.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIp.php b/src/Appwrite/Models/ColumnIp.php index 48c658dc..a9d00a06 100644 --- a/src/Appwrite/Models/ColumnIp.php +++ b/src/Appwrite/Models/ColumnIp.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnLine.php b/src/Appwrite/Models/ColumnLine.php index 5c3b2ed0..93b337c8 100644 --- a/src/Appwrite/Models/ColumnLine.php +++ b/src/Appwrite/Models/ColumnLine.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnList.php b/src/Appwrite/Models/ColumnList.php index cccaa203..2c513f5d 100644 --- a/src/Appwrite/Models/ColumnList.php +++ b/src/Appwrite/Models/ColumnList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'columns' => static::serializeValue($this->columns) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnLongtext.php b/src/Appwrite/Models/ColumnLongtext.php index 07961098..7017212e 100644 --- a/src/Appwrite/Models/ColumnLongtext.php +++ b/src/Appwrite/Models/ColumnLongtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnMediumtext.php b/src/Appwrite/Models/ColumnMediumtext.php index feb94f18..9bea0bbc 100644 --- a/src/Appwrite/Models/ColumnMediumtext.php +++ b/src/Appwrite/Models/ColumnMediumtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnPoint.php b/src/Appwrite/Models/ColumnPoint.php index e626d146..92671a50 100644 --- a/src/Appwrite/Models/ColumnPoint.php +++ b/src/Appwrite/Models/ColumnPoint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnPolygon.php b/src/Appwrite/Models/ColumnPolygon.php index fcfb0a4f..293e5df4 100644 --- a/src/Appwrite/Models/ColumnPolygon.php +++ b/src/Appwrite/Models/ColumnPolygon.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnRelationship.php b/src/Appwrite/Models/ColumnRelationship.php index 05ea8fa2..71ce5770 100644 --- a/src/Appwrite/Models/ColumnRelationship.php +++ b/src/Appwrite/Models/ColumnRelationship.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -131,7 +135,5 @@ public function toArray(): array 'onDelete' => static::serializeValue($this->onDelete), 'side' => static::serializeValue($this->side) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnString.php b/src/Appwrite/Models/ColumnString.php index f93426f7..11e3fc95 100644 --- a/src/Appwrite/Models/ColumnString.php +++ b/src/Appwrite/Models/ColumnString.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnText.php b/src/Appwrite/Models/ColumnText.php index 69cd4745..d8c265bc 100644 --- a/src/Appwrite/Models/ColumnText.php +++ b/src/Appwrite/Models/ColumnText.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnUrl.php b/src/Appwrite/Models/ColumnUrl.php index 60d849e3..a2c66da5 100644 --- a/src/Appwrite/Models/ColumnUrl.php +++ b/src/Appwrite/Models/ColumnUrl.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnVarchar.php b/src/Appwrite/Models/ColumnVarchar.php index 467b20bd..bb9ac368 100644 --- a/src/Appwrite/Models/ColumnVarchar.php +++ b/src/Appwrite/Models/ColumnVarchar.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Continent.php b/src/Appwrite/Models/Continent.php index ce841743..3b0084d5 100644 --- a/src/Appwrite/Models/Continent.php +++ b/src/Appwrite/Models/Continent.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ContinentList.php b/src/Appwrite/Models/ContinentList.php index 33d61231..fdcc1705 100644 --- a/src/Appwrite/Models/ContinentList.php +++ b/src/Appwrite/Models/ContinentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'continents' => static::serializeValue($this->continents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Country.php b/src/Appwrite/Models/Country.php index 942ce59c..e41c058f 100644 --- a/src/Appwrite/Models/Country.php +++ b/src/Appwrite/Models/Country.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CountryList.php b/src/Appwrite/Models/CountryList.php index ee4b1eb5..ae208f01 100644 --- a/src/Appwrite/Models/CountryList.php +++ b/src/Appwrite/Models/CountryList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'countries' => static::serializeValue($this->countries) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Currency.php b/src/Appwrite/Models/Currency.php index 97aa3d91..87ee856f 100644 --- a/src/Appwrite/Models/Currency.php +++ b/src/Appwrite/Models/Currency.php @@ -1,9 +1,13 @@ static::serializeValue($this->symbol), 'name' => static::serializeValue($this->name), 'symbolNative' => static::serializeValue($this->symbolNative), @@ -83,7 +87,5 @@ public function toArray(): array 'code' => static::serializeValue($this->code), 'namePlural' => static::serializeValue($this->namePlural) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CurrencyList.php b/src/Appwrite/Models/CurrencyList.php index 42fa537a..718ebae5 100644 --- a/src/Appwrite/Models/CurrencyList.php +++ b/src/Appwrite/Models/CurrencyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'currencies' => static::serializeValue($this->currencies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Database.php b/src/Appwrite/Models/Database.php index b5e4baa0..62382d90 100644 --- a/src/Appwrite/Models/Database.php +++ b/src/Appwrite/Models/Database.php @@ -1,5 +1,7 @@ |null $policies database backup policies. * @param list|null $archives database backup archives. */ @@ -39,6 +46,9 @@ public function __construct( public ?string $engine = null, public ?string $specification = null, public ?int $replicas = null, + public ?string $error = null, + public ?string $containerStatus = null, + public ?string $lifecycleState = null, public ?array $policies = null, public ?array $archives = null ) { @@ -76,9 +86,12 @@ public static function from(array $data): static enabled: $data['enabled'], type: static::hydrateTypedValue(DatabaseType::class, $data['type']), status: array_key_exists('status', $data) ? static::hydrateTypedValue(DatabaseStatus::class, $data['status'], true) : null, - engine: array_key_exists('engine', $data) ? $data['engine'] : null, - specification: array_key_exists('specification', $data) ? $data['specification'] : null, - replicas: array_key_exists('replicas', $data) ? $data['replicas'] : null, + engine: $data['engine'] ?? null, + specification: $data['specification'] ?? null, + replicas: $data['replicas'] ?? null, + error: $data['error'] ?? null, + containerStatus: $data['containerStatus'] ?? null, + lifecycleState: $data['lifecycleState'] ?? null, policies: array_key_exists('policies', $data) ? ( is_array($data['policies']) @@ -107,7 +120,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), 'name' => static::serializeValue($this->name), '$createdAt' => static::serializeValue($this->createdAt), @@ -118,10 +131,11 @@ public function toArray(): array 'engine' => static::serializeValue($this->engine), 'specification' => static::serializeValue($this->specification), 'replicas' => static::serializeValue($this->replicas), + 'error' => static::serializeValue($this->error), + 'containerStatus' => static::serializeValue($this->containerStatus), + 'lifecycleState' => static::serializeValue($this->lifecycleState), 'policies' => static::serializeValue($this->policies), 'archives' => static::serializeValue($this->archives) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseList.php b/src/Appwrite/Models/DatabaseList.php index bb164284..2f109442 100644 --- a/src/Appwrite/Models/DatabaseList.php +++ b/src/Appwrite/Models/DatabaseList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'databases' => static::serializeValue($this->databases) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseMigration.php b/src/Appwrite/Models/DatabaseMigration.php index d8e19ed8..3e2cce0e 100644 --- a/src/Appwrite/Models/DatabaseMigration.php +++ b/src/Appwrite/Models/DatabaseMigration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,6 +149,7 @@ public function toArray(): array 'attempt' => static::serializeValue($this->attempt), 'lastError' => static::serializeValue($this->lastError), 'lagDocuments' => static::serializeValue($this->lagDocuments), + 'changelogWatermark' => static::serializeValue($this->changelogWatermark), 'verifiedAt' => static::serializeValue($this->verifiedAt), 'cutoverAt' => static::serializeValue($this->cutoverAt), 'soakUntil' => static::serializeValue($this->soakUntil), @@ -146,7 +157,5 @@ public function toArray(): array 'cutoverRequested' => static::serializeValue($this->cutoverRequested), 'paused' => static::serializeValue($this->paused) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseMigrationList.php b/src/Appwrite/Models/DatabaseMigrationList.php index d8016eaf..2fa2cfbb 100644 --- a/src/Appwrite/Models/DatabaseMigrationList.php +++ b/src/Appwrite/Models/DatabaseMigrationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'migrations' => static::serializeValue($this->migrations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatus.php b/src/Appwrite/Models/DatabaseStatus.php index 5408a15e..f2597558 100644 --- a/src/Appwrite/Models/DatabaseStatus.php +++ b/src/Appwrite/Models/DatabaseStatus.php @@ -1,9 +1,13 @@ static::serializeValue($this->health), 'ready' => static::serializeValue($this->ready), 'engine' => static::serializeValue($this->engine), @@ -136,7 +140,5 @@ public function toArray(): array 'replicas' => static::serializeValue($this->replicas), 'volumes' => static::serializeValue($this->volumes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusConnections.php b/src/Appwrite/Models/DatabaseStatusConnections.php index da68a5b2..f0862f3c 100644 --- a/src/Appwrite/Models/DatabaseStatusConnections.php +++ b/src/Appwrite/Models/DatabaseStatusConnections.php @@ -1,9 +1,13 @@ static::serializeValue($this->current), 'max' => static::serializeValue($this->max) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusReplica.php b/src/Appwrite/Models/DatabaseStatusReplica.php index 8c00b586..b313589f 100644 --- a/src/Appwrite/Models/DatabaseStatusReplica.php +++ b/src/Appwrite/Models/DatabaseStatusReplica.php @@ -1,9 +1,13 @@ static::serializeValue($this->index), 'role' => static::serializeValue($this->role), 'healthy' => static::serializeValue($this->healthy), + 'replicating' => static::serializeValue($this->replicating), 'lagSeconds' => static::serializeValue($this->lagSeconds) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusVolume.php b/src/Appwrite/Models/DatabaseStatusVolume.php index 974ce9cf..a0f6aed7 100644 --- a/src/Appwrite/Models/DatabaseStatusVolume.php +++ b/src/Appwrite/Models/DatabaseStatusVolume.php @@ -1,9 +1,13 @@ static::serializeValue($this->path), 'usedPercent' => static::serializeValue($this->usedPercent), 'available' => static::serializeValue($this->available), 'mounted' => static::serializeValue($this->mounted) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabase.php b/src/Appwrite/Models/DedicatedDatabase.php index ce4706f6..a1560b58 100644 --- a/src/Appwrite/Models/DedicatedDatabase.php +++ b/src/Appwrite/Models/DedicatedDatabase.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -364,7 +368,5 @@ public function toArray(): array 'sqlApiTimeoutSeconds' => static::serializeValue($this->sqlApiTimeoutSeconds), 'error' => static::serializeValue($this->error) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseMember.php b/src/Appwrite/Models/DedicatedDatabaseMember.php index fb6dec1d..990c9093 100644 --- a/src/Appwrite/Models/DedicatedDatabaseMember.php +++ b/src/Appwrite/Models/DedicatedDatabaseMember.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'role' => static::serializeValue($this->role), 'status' => static::serializeValue($this->status), + 'replicating' => static::serializeValue($this->replicating), 'lagSeconds' => static::serializeValue($this->lagSeconds) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseOperation.php b/src/Appwrite/Models/DedicatedDatabaseOperation.php index 628b96a7..bee49abc 100644 --- a/src/Appwrite/Models/DedicatedDatabaseOperation.php +++ b/src/Appwrite/Models/DedicatedDatabaseOperation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'databaseId' => static::serializeValue($this->databaseId), @@ -102,7 +106,5 @@ public function toArray(): array 'errorCode' => static::serializeValue($this->errorCode), 'errorMessage' => static::serializeValue($this->errorMessage) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseOperationList.php b/src/Appwrite/Models/DedicatedDatabaseOperationList.php index 0ee0c79d..9802ab1f 100644 --- a/src/Appwrite/Models/DedicatedDatabaseOperationList.php +++ b/src/Appwrite/Models/DedicatedDatabaseOperationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'operations' => static::serializeValue($this->operations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseReplicas.php b/src/Appwrite/Models/DedicatedDatabaseReplicas.php index f3728359..512864bb 100644 --- a/src/Appwrite/Models/DedicatedDatabaseReplicas.php +++ b/src/Appwrite/Models/DedicatedDatabaseReplicas.php @@ -1,9 +1,13 @@ static::serializeValue($this->replicas), 'syncMode' => static::serializeValue($this->syncMode), 'effectiveSyncMode' => static::serializeValue($this->effectiveSyncMode), @@ -89,7 +93,5 @@ public function toArray(): array 'syncStateConfirmed' => static::serializeValue($this->syncStateConfirmed), 'members' => static::serializeValue($this->members) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecification.php b/src/Appwrite/Models/DedicatedDatabaseSpecification.php index 5a1a5a29..d73bc7e3 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecification.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecification.php @@ -1,9 +1,13 @@ static::serializeValue($this->slug), 'name' => static::serializeValue($this->name), 'price' => static::serializeValue($this->price), @@ -97,7 +101,5 @@ public function toArray(): array 'includedBandwidth' => static::serializeValue($this->includedBandwidth), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php index fb040cd3..a223990e 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->specifications), 'total' => static::serializeValue($this->total), 'pricing' => static::serializeValue($this->pricing) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php index 815757e2..c8a11f5f 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php @@ -1,9 +1,13 @@ static::serializeValue($this->storageOverageRate), 'bandwidthOverageRate' => static::serializeValue($this->bandwidthOverageRate), 'replicaRate' => static::serializeValue($this->replicaRate), 'pitrRate' => static::serializeValue($this->pitrRate) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Deployment.php b/src/Appwrite/Models/Deployment.php index 702be010..b4d00c66 100644 --- a/src/Appwrite/Models/Deployment.php +++ b/src/Appwrite/Models/Deployment.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -225,7 +229,5 @@ public function toArray(): array 'providerBranch' => static::serializeValue($this->providerBranch), 'providerBranchUrl' => static::serializeValue($this->providerBranchUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DeploymentList.php b/src/Appwrite/Models/DeploymentList.php index adb27646..843c077e 100644 --- a/src/Appwrite/Models/DeploymentList.php +++ b/src/Appwrite/Models/DeploymentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'deployments' => static::serializeValue($this->deployments) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DevKey.php b/src/Appwrite/Models/DevKey.php index 24aa9908..971c16fa 100644 --- a/src/Appwrite/Models/DevKey.php +++ b/src/Appwrite/Models/DevKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Document.php b/src/Appwrite/Models/Document.php index 0aa44b25..c02e196c 100644 --- a/src/Appwrite/Models/Document.php +++ b/src/Appwrite/Models/Document.php @@ -1,16 +1,18 @@ static::serializeValue($this->total), 'documents' => static::serializeValue($this->documents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmailTemplate.php b/src/Appwrite/Models/EmailTemplate.php index 0eb72fa6..6af65e24 100644 --- a/src/Appwrite/Models/EmailTemplate.php +++ b/src/Appwrite/Models/EmailTemplate.php @@ -1,9 +1,13 @@ static::serializeValue($this->templateId), 'locale' => static::serializeValue($this->locale), 'message' => static::serializeValue($this->message), @@ -90,7 +94,5 @@ public function toArray(): array 'replyToName' => static::serializeValue($this->replyToName), 'subject' => static::serializeValue($this->subject) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmailTemplateList.php b/src/Appwrite/Models/EmailTemplateList.php index a39660b0..0c2df1ee 100644 --- a/src/Appwrite/Models/EmailTemplateList.php +++ b/src/Appwrite/Models/EmailTemplateList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'templates' => static::serializeValue($this->templates) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Embedding.php b/src/Appwrite/Models/Embedding.php index c38c4787..b68d820f 100644 --- a/src/Appwrite/Models/Embedding.php +++ b/src/Appwrite/Models/Embedding.php @@ -1,9 +1,13 @@ static::serializeValue($this->model), 'dimension' => static::serializeValue($this->dimension), 'embedding' => static::serializeValue($this->embedding), 'error' => static::serializeValue($this->error) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmbeddingList.php b/src/Appwrite/Models/EmbeddingList.php index d666e5d5..029d802b 100644 --- a/src/Appwrite/Models/EmbeddingList.php +++ b/src/Appwrite/Models/EmbeddingList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'embeddings' => static::serializeValue($this->embeddings) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EphemeralKey.php b/src/Appwrite/Models/EphemeralKey.php index 16729bec..a3823c45 100644 --- a/src/Appwrite/Models/EphemeralKey.php +++ b/src/Appwrite/Models/EphemeralKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Execution.php b/src/Appwrite/Models/Execution.php index 877f42a7..b95fab15 100644 --- a/src/Appwrite/Models/Execution.php +++ b/src/Appwrite/Models/Execution.php @@ -1,12 +1,17 @@ $requestHeaders http request headers as a key-value object. this will return only whitelisted headers. all headers are returned if execution is created as synchronous. * @param int $responseStatusCode http response status code. * @param string $responseBody http response body. this will return empty unless execution is created as synchronous. * @param list $responseHeaders http response headers as a key-value object. this will return only whitelisted headers. all headers are returned if execution is created as synchronous. - * @param string $logs function logs. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. - * @param string $errors function errors. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. + * @param string $logs resource logs. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. + * @param string $errors resource errors. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. * @param float $duration resource(function/site) execution duration in seconds. * @param string|null $scheduledAt the scheduled time for execution. if left empty, execution will be queued immediately. */ @@ -39,7 +45,8 @@ public function __construct( public string $createdAt, public string $updatedAt, public array $permissions, - public string $functionId, + public string $resourceId, + public ExecutionResourceType $resourceType, public string $deploymentId, public ExecutionTrigger $trigger, public ExecutionStatus $status, @@ -73,8 +80,11 @@ public static function from(array $data): static if (!array_key_exists('$permissions', $data)) { throw new \InvalidArgumentException('Missing required field "$permissions" for ' . static::class . '.'); } - if (!array_key_exists('functionId', $data)) { - throw new \InvalidArgumentException('Missing required field "functionId" for ' . static::class . '.'); + if (!array_key_exists('resourceId', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceId" for ' . static::class . '.'); + } + if (!array_key_exists('resourceType', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceType" for ' . static::class . '.'); } if (!array_key_exists('deploymentId', $data)) { throw new \InvalidArgumentException('Missing required field "deploymentId" for ' . static::class . '.'); @@ -118,7 +128,8 @@ public static function from(array $data): static createdAt: $data['$createdAt'], updatedAt: $data['$updatedAt'], permissions: $data['$permissions'], - functionId: $data['functionId'], + resourceId: $data['resourceId'], + resourceType: static::hydrateTypedValue(ExecutionResourceType::class, $data['resourceType']), deploymentId: $data['deploymentId'], trigger: static::hydrateTypedValue(ExecutionTrigger::class, $data['trigger']), status: static::hydrateTypedValue(ExecutionStatus::class, $data['status']), @@ -141,7 +152,7 @@ functionId: $data['functionId'], logs: $data['logs'], errors: $data['errors'], duration: $data['duration'], - scheduledAt: array_key_exists('scheduledAt', $data) ? $data['scheduledAt'] : null + scheduledAt: $data['scheduledAt'] ?? null ); } @@ -150,12 +161,13 @@ functionId: $data['functionId'], */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), '$permissions' => static::serializeValue($this->permissions), - 'functionId' => static::serializeValue($this->functionId), + 'resourceId' => static::serializeValue($this->resourceId), + 'resourceType' => static::serializeValue($this->resourceType), 'deploymentId' => static::serializeValue($this->deploymentId), 'trigger' => static::serializeValue($this->trigger), 'status' => static::serializeValue($this->status), @@ -170,7 +182,5 @@ public function toArray(): array 'duration' => static::serializeValue($this->duration), 'scheduledAt' => static::serializeValue($this->scheduledAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ExecutionList.php b/src/Appwrite/Models/ExecutionList.php index c9b4b04a..e2b8e14f 100644 --- a/src/Appwrite/Models/ExecutionList.php +++ b/src/Appwrite/Models/ExecutionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'executions' => static::serializeValue($this->executions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/File.php b/src/Appwrite/Models/File.php index 4ce7c537..24304528 100644 --- a/src/Appwrite/Models/File.php +++ b/src/Appwrite/Models/File.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'bucketId' => static::serializeValue($this->bucketId), '$createdAt' => static::serializeValue($this->createdAt), @@ -146,7 +150,5 @@ public function toArray(): array 'encryption' => static::serializeValue($this->encryption), 'compression' => static::serializeValue($this->compression) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FileList.php b/src/Appwrite/Models/FileList.php index 2232f238..178e2d69 100644 --- a/src/Appwrite/Models/FileList.php +++ b/src/Appwrite/Models/FileList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'files' => static::serializeValue($this->files) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Framework.php b/src/Appwrite/Models/Framework.php index 04230237..ea4376e5 100644 --- a/src/Appwrite/Models/Framework.php +++ b/src/Appwrite/Models/Framework.php @@ -1,9 +1,13 @@ static::serializeValue($this->key), 'name' => static::serializeValue($this->name), 'buildRuntime' => static::serializeValue($this->buildRuntime), 'runtimes' => static::serializeValue($this->runtimes), 'adapters' => static::serializeValue($this->adapters) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FrameworkAdapter.php b/src/Appwrite/Models/FrameworkAdapter.php index a76a7110..b1e6b01e 100644 --- a/src/Appwrite/Models/FrameworkAdapter.php +++ b/src/Appwrite/Models/FrameworkAdapter.php @@ -1,9 +1,13 @@ static::serializeValue($this->key), 'installCommand' => static::serializeValue($this->installCommand), 'buildCommand' => static::serializeValue($this->buildCommand), 'outputDirectory' => static::serializeValue($this->outputDirectory), 'fallbackFile' => static::serializeValue($this->fallbackFile) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FrameworkList.php b/src/Appwrite/Models/FrameworkList.php index 42c11864..becb9ef9 100644 --- a/src/Appwrite/Models/FrameworkList.php +++ b/src/Appwrite/Models/FrameworkList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'frameworks' => static::serializeValue($this->frameworks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FunctionList.php b/src/Appwrite/Models/FunctionList.php index c66430ec..6127a13e 100644 --- a/src/Appwrite/Models/FunctionList.php +++ b/src/Appwrite/Models/FunctionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'functions' => static::serializeValue($this->functions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FunctionModel.php b/src/Appwrite/Models/FunctionModel.php index fa68aa6b..48dd3e3d 100644 --- a/src/Appwrite/Models/FunctionModel.php +++ b/src/Appwrite/Models/FunctionModel.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -263,7 +267,5 @@ public function toArray(): array 'buildSpecification' => static::serializeValue($this->buildSpecification), 'runtimeSpecification' => static::serializeValue($this->runtimeSpecification) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Headers.php b/src/Appwrite/Models/Headers.php index afd48cef..548d7cff 100644 --- a/src/Appwrite/Models/Headers.php +++ b/src/Appwrite/Models/Headers.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'value' => static::serializeValue($this->value) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Identity.php b/src/Appwrite/Models/Identity.php index 16920c7e..7ce5e10b 100644 --- a/src/Appwrite/Models/Identity.php +++ b/src/Appwrite/Models/Identity.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -104,7 +108,5 @@ public function toArray(): array 'providerAccessTokenExpiry' => static::serializeValue($this->providerAccessTokenExpiry), 'providerRefreshToken' => static::serializeValue($this->providerRefreshToken) ]; - - return $result; } } diff --git a/src/Appwrite/Models/IdentityList.php b/src/Appwrite/Models/IdentityList.php index dece9ec9..f5b571bb 100644 --- a/src/Appwrite/Models/IdentityList.php +++ b/src/Appwrite/Models/IdentityList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'identities' => static::serializeValue($this->identities) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Index.php b/src/Appwrite/Models/Index.php index 39383747..4fb538ae 100644 --- a/src/Appwrite/Models/Index.php +++ b/src/Appwrite/Models/Index.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -103,7 +107,5 @@ public function toArray(): array 'lengths' => static::serializeValue($this->lengths), 'orders' => static::serializeValue($this->orders) ]; - - return $result; } } diff --git a/src/Appwrite/Models/IndexList.php b/src/Appwrite/Models/IndexList.php index 126f3b92..37a7c03d 100644 --- a/src/Appwrite/Models/IndexList.php +++ b/src/Appwrite/Models/IndexList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'indexes' => static::serializeValue($this->indexes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Insight.php b/src/Appwrite/Models/Insight.php index 84a73171..0692f83f 100644 --- a/src/Appwrite/Models/Insight.php +++ b/src/Appwrite/Models/Insight.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -149,7 +153,5 @@ public function toArray(): array 'dismissedAt' => static::serializeValue($this->dismissedAt), 'dismissedBy' => static::serializeValue($this->dismissedBy) ]; - - return $result; } } diff --git a/src/Appwrite/Models/InsightCTA.php b/src/Appwrite/Models/InsightCTA.php index b1b5bd68..303aae57 100644 --- a/src/Appwrite/Models/InsightCTA.php +++ b/src/Appwrite/Models/InsightCTA.php @@ -1,9 +1,13 @@ static::serializeValue($this->label), 'service' => static::serializeValue($this->service), 'method' => static::serializeValue($this->method), 'params' => static::serializeValue($this->params) ]; - - return $result; } } diff --git a/src/Appwrite/Models/InsightList.php b/src/Appwrite/Models/InsightList.php index d8dc4e66..c535a6ed 100644 --- a/src/Appwrite/Models/InsightList.php +++ b/src/Appwrite/Models/InsightList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'insights' => static::serializeValue($this->insights) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Jwt.php b/src/Appwrite/Models/Jwt.php index 80fcac52..6c544ee2 100644 --- a/src/Appwrite/Models/Jwt.php +++ b/src/Appwrite/Models/Jwt.php @@ -1,9 +1,13 @@ static::serializeValue($this->jwt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Key.php b/src/Appwrite/Models/Key.php index 3f2802ea..3f957a1a 100644 --- a/src/Appwrite/Models/Key.php +++ b/src/Appwrite/Models/Key.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/KeyList.php b/src/Appwrite/Models/KeyList.php index 3c297404..e17d4766 100644 --- a/src/Appwrite/Models/KeyList.php +++ b/src/Appwrite/Models/KeyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'keys' => static::serializeValue($this->keys) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Language.php b/src/Appwrite/Models/Language.php index 56ae4b3e..8c3b18bf 100644 --- a/src/Appwrite/Models/Language.php +++ b/src/Appwrite/Models/Language.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code), 'nativeName' => static::serializeValue($this->nativeName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LanguageList.php b/src/Appwrite/Models/LanguageList.php index 3756bb22..fb46caeb 100644 --- a/src/Appwrite/Models/LanguageList.php +++ b/src/Appwrite/Models/LanguageList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'languages' => static::serializeValue($this->languages) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Locale.php b/src/Appwrite/Models/Locale.php index e7ab2726..55c2ba92 100644 --- a/src/Appwrite/Models/Locale.php +++ b/src/Appwrite/Models/Locale.php @@ -1,9 +1,13 @@ static::serializeValue($this->ip), 'countryCode' => static::serializeValue($this->countryCode), 'country' => static::serializeValue($this->country), @@ -127,7 +131,5 @@ public function toArray(): array 'connectionUsageType' => static::serializeValue($this->connectionUsageType), 'connectionOrganization' => static::serializeValue($this->connectionOrganization) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LocaleCode.php b/src/Appwrite/Models/LocaleCode.php index 6969516c..44699043 100644 --- a/src/Appwrite/Models/LocaleCode.php +++ b/src/Appwrite/Models/LocaleCode.php @@ -1,9 +1,13 @@ static::serializeValue($this->code), 'name' => static::serializeValue($this->name) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LocaleCodeList.php b/src/Appwrite/Models/LocaleCodeList.php index 147f5180..c2b2a62e 100644 --- a/src/Appwrite/Models/LocaleCodeList.php +++ b/src/Appwrite/Models/LocaleCodeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'localeCodes' => static::serializeValue($this->localeCodes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Log.php b/src/Appwrite/Models/Log.php index 8cb811db..01bfb02f 100644 --- a/src/Appwrite/Models/Log.php +++ b/src/Appwrite/Models/Log.php @@ -1,9 +1,13 @@ static::serializeValue($this->event), 'userId' => static::serializeValue($this->userId), 'userEmail' => static::serializeValue($this->userEmail), @@ -188,7 +192,5 @@ public function toArray(): array 'countryCode' => static::serializeValue($this->countryCode), 'countryName' => static::serializeValue($this->countryName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LogList.php b/src/Appwrite/Models/LogList.php index 16291a55..944b82ca 100644 --- a/src/Appwrite/Models/LogList.php +++ b/src/Appwrite/Models/LogList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'logs' => static::serializeValue($this->logs) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Membership.php b/src/Appwrite/Models/Membership.php index 5f78877a..0887a74f 100644 --- a/src/Appwrite/Models/Membership.php +++ b/src/Appwrite/Models/Membership.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,7 +143,5 @@ public function toArray(): array 'userAccessedAt' => static::serializeValue($this->userAccessedAt), 'roles' => static::serializeValue($this->roles) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MembershipList.php b/src/Appwrite/Models/MembershipList.php index eb747649..713ff2cf 100644 --- a/src/Appwrite/Models/MembershipList.php +++ b/src/Appwrite/Models/MembershipList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'memberships' => static::serializeValue($this->memberships) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Message.php b/src/Appwrite/Models/Message.php index fd11026e..0a2d84b3 100644 --- a/src/Appwrite/Models/Message.php +++ b/src/Appwrite/Models/Message.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -118,7 +122,5 @@ public function toArray(): array 'data' => static::serializeValue($this->data), 'status' => static::serializeValue($this->status) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MessageList.php b/src/Appwrite/Models/MessageList.php index acc5788e..de505118 100644 --- a/src/Appwrite/Models/MessageList.php +++ b/src/Appwrite/Models/MessageList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'messages' => static::serializeValue($this->messages) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaChallenge.php b/src/Appwrite/Models/MfaChallenge.php index 695d72dc..cf630a67 100644 --- a/src/Appwrite/Models/MfaChallenge.php +++ b/src/Appwrite/Models/MfaChallenge.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaChallengeSecret.php b/src/Appwrite/Models/MfaChallengeSecret.php index 579080ae..d2eabe86 100644 --- a/src/Appwrite/Models/MfaChallengeSecret.php +++ b/src/Appwrite/Models/MfaChallengeSecret.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), 'expire' => static::serializeValue($this->expire), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaFactors.php b/src/Appwrite/Models/MfaFactors.php index eca5d042..638840d4 100644 --- a/src/Appwrite/Models/MfaFactors.php +++ b/src/Appwrite/Models/MfaFactors.php @@ -1,9 +1,13 @@ static::serializeValue($this->totp), 'phone' => static::serializeValue($this->phone), 'email' => static::serializeValue($this->email), 'recoveryCode' => static::serializeValue($this->recoveryCode), 'custom' => static::serializeValue($this->custom) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaRecoveryCodes.php b/src/Appwrite/Models/MfaRecoveryCodes.php index c63cfb5b..ea9e5533 100644 --- a/src/Appwrite/Models/MfaRecoveryCodes.php +++ b/src/Appwrite/Models/MfaRecoveryCodes.php @@ -1,9 +1,13 @@ static::serializeValue($this->recoveryCodes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaType.php b/src/Appwrite/Models/MfaType.php index 051c9c32..f4097590 100644 --- a/src/Appwrite/Models/MfaType.php +++ b/src/Appwrite/Models/MfaType.php @@ -1,9 +1,13 @@ static::serializeValue($this->secret), 'uri' => static::serializeValue($this->uri) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MockNumber.php b/src/Appwrite/Models/MockNumber.php index 2bbb1814..1ef79997 100644 --- a/src/Appwrite/Models/MockNumber.php +++ b/src/Appwrite/Models/MockNumber.php @@ -1,9 +1,13 @@ static::serializeValue($this->number), 'otp' => static::serializeValue($this->otp), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MockNumberList.php b/src/Appwrite/Models/MockNumberList.php index 1d47405f..106ce4e3 100644 --- a/src/Appwrite/Models/MockNumberList.php +++ b/src/Appwrite/Models/MockNumberList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'mockNumbers' => static::serializeValue($this->mockNumbers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Amazon.php b/src/Appwrite/Models/OAuth2Amazon.php index 4b431fb7..35884ef5 100644 --- a/src/Appwrite/Models/OAuth2Amazon.php +++ b/src/Appwrite/Models/OAuth2Amazon.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Apple.php b/src/Appwrite/Models/OAuth2Apple.php index 3c7029bb..778fed67 100644 --- a/src/Appwrite/Models/OAuth2Apple.php +++ b/src/Appwrite/Models/OAuth2Apple.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'serviceId' => static::serializeValue($this->serviceId), @@ -76,7 +80,5 @@ public function toArray(): array 'teamId' => static::serializeValue($this->teamId), 'p8File' => static::serializeValue($this->p8File) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Appwrite.php b/src/Appwrite/Models/OAuth2Appwrite.php index 1ae1b35a..4c9c3225 100644 --- a/src/Appwrite/Models/OAuth2Appwrite.php +++ b/src/Appwrite/Models/OAuth2Appwrite.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Auth0.php b/src/Appwrite/Models/OAuth2Auth0.php index 8c72ff7e..0c47d143 100644 --- a/src/Appwrite/Models/OAuth2Auth0.php +++ b/src/Appwrite/Models/OAuth2Auth0.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Authentik.php b/src/Appwrite/Models/OAuth2Authentik.php index c939589d..2cc6a7d3 100644 --- a/src/Appwrite/Models/OAuth2Authentik.php +++ b/src/Appwrite/Models/OAuth2Authentik.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Autodesk.php b/src/Appwrite/Models/OAuth2Autodesk.php index ea2067be..5be4ac9f 100644 --- a/src/Appwrite/Models/OAuth2Autodesk.php +++ b/src/Appwrite/Models/OAuth2Autodesk.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Bitbucket.php b/src/Appwrite/Models/OAuth2Bitbucket.php index f1a6e42f..bef81cf4 100644 --- a/src/Appwrite/Models/OAuth2Bitbucket.php +++ b/src/Appwrite/Models/OAuth2Bitbucket.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'key' => static::serializeValue($this->key), 'secret' => static::serializeValue($this->secret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Bitly.php b/src/Appwrite/Models/OAuth2Bitly.php index 8dd8ab8a..c315fbea 100644 --- a/src/Appwrite/Models/OAuth2Bitly.php +++ b/src/Appwrite/Models/OAuth2Bitly.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Box.php b/src/Appwrite/Models/OAuth2Box.php index 7b4b14e6..92adcd4f 100644 --- a/src/Appwrite/Models/OAuth2Box.php +++ b/src/Appwrite/Models/OAuth2Box.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Dailymotion.php b/src/Appwrite/Models/OAuth2Dailymotion.php index 8bc52f6b..4fa40091 100644 --- a/src/Appwrite/Models/OAuth2Dailymotion.php +++ b/src/Appwrite/Models/OAuth2Dailymotion.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'apiKey' => static::serializeValue($this->apiKey), 'apiSecret' => static::serializeValue($this->apiSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Discord.php b/src/Appwrite/Models/OAuth2Discord.php index f9c1d5b3..7b99a738 100644 --- a/src/Appwrite/Models/OAuth2Discord.php +++ b/src/Appwrite/Models/OAuth2Discord.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Disqus.php b/src/Appwrite/Models/OAuth2Disqus.php index 1bc8367c..05560127 100644 --- a/src/Appwrite/Models/OAuth2Disqus.php +++ b/src/Appwrite/Models/OAuth2Disqus.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'publicKey' => static::serializeValue($this->publicKey), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Dropbox.php b/src/Appwrite/Models/OAuth2Dropbox.php index b0474ab4..af477a69 100644 --- a/src/Appwrite/Models/OAuth2Dropbox.php +++ b/src/Appwrite/Models/OAuth2Dropbox.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'appKey' => static::serializeValue($this->appKey), 'appSecret' => static::serializeValue($this->appSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Etsy.php b/src/Appwrite/Models/OAuth2Etsy.php index 120cf59a..5b8242d3 100644 --- a/src/Appwrite/Models/OAuth2Etsy.php +++ b/src/Appwrite/Models/OAuth2Etsy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'keyString' => static::serializeValue($this->keyString), 'sharedSecret' => static::serializeValue($this->sharedSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Facebook.php b/src/Appwrite/Models/OAuth2Facebook.php index 9a9e8adb..f3912238 100644 --- a/src/Appwrite/Models/OAuth2Facebook.php +++ b/src/Appwrite/Models/OAuth2Facebook.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'appId' => static::serializeValue($this->appId), 'appSecret' => static::serializeValue($this->appSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Figma.php b/src/Appwrite/Models/OAuth2Figma.php index 02eab723..d3ee4b85 100644 --- a/src/Appwrite/Models/OAuth2Figma.php +++ b/src/Appwrite/Models/OAuth2Figma.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2FusionAuth.php b/src/Appwrite/Models/OAuth2FusionAuth.php index 0e2a7042..98c639b8 100644 --- a/src/Appwrite/Models/OAuth2FusionAuth.php +++ b/src/Appwrite/Models/OAuth2FusionAuth.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Github.php b/src/Appwrite/Models/OAuth2Github.php index c103d864..e9e939c0 100644 --- a/src/Appwrite/Models/OAuth2Github.php +++ b/src/Appwrite/Models/OAuth2Github.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Gitlab.php b/src/Appwrite/Models/OAuth2Gitlab.php index 61b54587..8dd63025 100644 --- a/src/Appwrite/Models/OAuth2Gitlab.php +++ b/src/Appwrite/Models/OAuth2Gitlab.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'applicationId' => static::serializeValue($this->applicationId), 'secret' => static::serializeValue($this->secret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Google.php b/src/Appwrite/Models/OAuth2Google.php index be1ab206..687f946c 100644 --- a/src/Appwrite/Models/OAuth2Google.php +++ b/src/Appwrite/Models/OAuth2Google.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'prompt' => static::serializeValue($this->prompt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2HuggingFace.php b/src/Appwrite/Models/OAuth2HuggingFace.php new file mode 100644 index 00000000..44f6e011 --- /dev/null +++ b/src/Appwrite/Models/OAuth2HuggingFace.php @@ -0,0 +1,70 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('enabled', $data)) { + throw new \InvalidArgumentException('Missing required field "enabled" for ' . static::class . '.'); + } + if (!array_key_exists('clientId', $data)) { + throw new \InvalidArgumentException('Missing required field "clientId" for ' . static::class . '.'); + } + if (!array_key_exists('clientSecret', $data)) { + throw new \InvalidArgumentException('Missing required field "clientSecret" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'], + clientId: $data['clientId'], + clientSecret: $data['clientSecret'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + '$id' => static::serializeValue($this->id), + 'enabled' => static::serializeValue($this->enabled), + 'clientId' => static::serializeValue($this->clientId), + 'clientSecret' => static::serializeValue($this->clientSecret) + ]; + } +} diff --git a/src/Appwrite/Models/OAuth2Keycloak.php b/src/Appwrite/Models/OAuth2Keycloak.php index 8f7ca6d5..4c149cab 100644 --- a/src/Appwrite/Models/OAuth2Keycloak.php +++ b/src/Appwrite/Models/OAuth2Keycloak.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -76,7 +80,5 @@ public function toArray(): array 'endpoint' => static::serializeValue($this->endpoint), 'realmName' => static::serializeValue($this->realmName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Kick.php b/src/Appwrite/Models/OAuth2Kick.php index cbf58c7c..e9bcba0e 100644 --- a/src/Appwrite/Models/OAuth2Kick.php +++ b/src/Appwrite/Models/OAuth2Kick.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Linkedin.php b/src/Appwrite/Models/OAuth2Linkedin.php index e3676882..109d947d 100644 --- a/src/Appwrite/Models/OAuth2Linkedin.php +++ b/src/Appwrite/Models/OAuth2Linkedin.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'primaryClientSecret' => static::serializeValue($this->primaryClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Microsoft.php b/src/Appwrite/Models/OAuth2Microsoft.php index dc086930..4de9c591 100644 --- a/src/Appwrite/Models/OAuth2Microsoft.php +++ b/src/Appwrite/Models/OAuth2Microsoft.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'applicationId' => static::serializeValue($this->applicationId), 'applicationSecret' => static::serializeValue($this->applicationSecret), 'tenant' => static::serializeValue($this->tenant) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Notion.php b/src/Appwrite/Models/OAuth2Notion.php index f2612124..055b5382 100644 --- a/src/Appwrite/Models/OAuth2Notion.php +++ b/src/Appwrite/Models/OAuth2Notion.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'oauthClientId' => static::serializeValue($this->oauthClientId), 'oauthClientSecret' => static::serializeValue($this->oauthClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Oidc.php b/src/Appwrite/Models/OAuth2Oidc.php index 26a21ce1..f2021019 100644 --- a/src/Appwrite/Models/OAuth2Oidc.php +++ b/src/Appwrite/Models/OAuth2Oidc.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -108,7 +112,5 @@ public function toArray(): array 'prompt' => static::serializeValue($this->prompt), 'maxAge' => static::serializeValue($this->maxAge) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Okta.php b/src/Appwrite/Models/OAuth2Okta.php index 5ddd3f50..d2a252e3 100644 --- a/src/Appwrite/Models/OAuth2Okta.php +++ b/src/Appwrite/Models/OAuth2Okta.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -76,7 +80,5 @@ public function toArray(): array 'domain' => static::serializeValue($this->domain), 'authorizationServerId' => static::serializeValue($this->authorizationServerId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Paypal.php b/src/Appwrite/Models/OAuth2Paypal.php index fbe8ded0..db84e72a 100644 --- a/src/Appwrite/Models/OAuth2Paypal.php +++ b/src/Appwrite/Models/OAuth2Paypal.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Podio.php b/src/Appwrite/Models/OAuth2Podio.php index 53d92cdf..edecdfc1 100644 --- a/src/Appwrite/Models/OAuth2Podio.php +++ b/src/Appwrite/Models/OAuth2Podio.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2ProviderList.php b/src/Appwrite/Models/OAuth2ProviderList.php index 91f22677..fb40014e 100644 --- a/src/Appwrite/Models/OAuth2ProviderList.php +++ b/src/Appwrite/Models/OAuth2ProviderList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'providers' => static::serializeValue($this->providers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Salesforce.php b/src/Appwrite/Models/OAuth2Salesforce.php index 7c43e7b3..02244d4c 100644 --- a/src/Appwrite/Models/OAuth2Salesforce.php +++ b/src/Appwrite/Models/OAuth2Salesforce.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'customerKey' => static::serializeValue($this->customerKey), 'customerSecret' => static::serializeValue($this->customerSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Slack.php b/src/Appwrite/Models/OAuth2Slack.php index 15d38489..b53be944 100644 --- a/src/Appwrite/Models/OAuth2Slack.php +++ b/src/Appwrite/Models/OAuth2Slack.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Spotify.php b/src/Appwrite/Models/OAuth2Spotify.php index c632a878..b03ad821 100644 --- a/src/Appwrite/Models/OAuth2Spotify.php +++ b/src/Appwrite/Models/OAuth2Spotify.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Stripe.php b/src/Appwrite/Models/OAuth2Stripe.php index d779a8d5..d9fb9a2c 100644 --- a/src/Appwrite/Models/OAuth2Stripe.php +++ b/src/Appwrite/Models/OAuth2Stripe.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'apiSecretKey' => static::serializeValue($this->apiSecretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Tradeshift.php b/src/Appwrite/Models/OAuth2Tradeshift.php index 1fda081e..d5becb06 100644 --- a/src/Appwrite/Models/OAuth2Tradeshift.php +++ b/src/Appwrite/Models/OAuth2Tradeshift.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'oauth2ClientId' => static::serializeValue($this->oauth2ClientId), 'oauth2ClientSecret' => static::serializeValue($this->oauth2ClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Twitch.php b/src/Appwrite/Models/OAuth2Twitch.php index 0d003260..d931eac6 100644 --- a/src/Appwrite/Models/OAuth2Twitch.php +++ b/src/Appwrite/Models/OAuth2Twitch.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2WordPress.php b/src/Appwrite/Models/OAuth2WordPress.php index 4748f573..ce0d76ff 100644 --- a/src/Appwrite/Models/OAuth2WordPress.php +++ b/src/Appwrite/Models/OAuth2WordPress.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2X.php b/src/Appwrite/Models/OAuth2X.php index 0d63599b..f197b677 100644 --- a/src/Appwrite/Models/OAuth2X.php +++ b/src/Appwrite/Models/OAuth2X.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'customerKey' => static::serializeValue($this->customerKey), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Yahoo.php b/src/Appwrite/Models/OAuth2Yahoo.php index 0d2fad34..1250e72a 100644 --- a/src/Appwrite/Models/OAuth2Yahoo.php +++ b/src/Appwrite/Models/OAuth2Yahoo.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Yandex.php b/src/Appwrite/Models/OAuth2Yandex.php index e2b43d52..76102249 100644 --- a/src/Appwrite/Models/OAuth2Yandex.php +++ b/src/Appwrite/Models/OAuth2Yandex.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Zoho.php b/src/Appwrite/Models/OAuth2Zoho.php index 73eab938..47dfabf1 100644 --- a/src/Appwrite/Models/OAuth2Zoho.php +++ b/src/Appwrite/Models/OAuth2Zoho.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Zoom.php b/src/Appwrite/Models/OAuth2Zoom.php index 34454121..21ebd869 100644 --- a/src/Appwrite/Models/OAuth2Zoom.php +++ b/src/Appwrite/Models/OAuth2Zoom.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Approve.php b/src/Appwrite/Models/Oauth2Approve.php index e4f896d3..38e866b5 100644 --- a/src/Appwrite/Models/Oauth2Approve.php +++ b/src/Appwrite/Models/Oauth2Approve.php @@ -1,9 +1,13 @@ static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Authorize.php b/src/Appwrite/Models/Oauth2Authorize.php index 4667084b..e5d9957d 100644 --- a/src/Appwrite/Models/Oauth2Authorize.php +++ b/src/Appwrite/Models/Oauth2Authorize.php @@ -1,9 +1,13 @@ static::serializeValue($this->grantId), 'redirectUrl' => static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Consent.php b/src/Appwrite/Models/Oauth2Consent.php index 248995ec..22b11a08 100644 --- a/src/Appwrite/Models/Oauth2Consent.php +++ b/src/Appwrite/Models/Oauth2Consent.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -104,7 +108,5 @@ public function toArray(): array 'authorizationDetails' => static::serializeValue($this->authorizationDetails), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentList.php b/src/Appwrite/Models/Oauth2ConsentList.php index e6b0da7b..f53d6af6 100644 --- a/src/Appwrite/Models/Oauth2ConsentList.php +++ b/src/Appwrite/Models/Oauth2ConsentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'consents' => static::serializeValue($this->consents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentToken.php b/src/Appwrite/Models/Oauth2ConsentToken.php index 1c363fb4..cb708cb2 100644 --- a/src/Appwrite/Models/Oauth2ConsentToken.php +++ b/src/Appwrite/Models/Oauth2ConsentToken.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -111,7 +115,5 @@ public function toArray(): array 'authorizationDetails' => static::serializeValue($this->authorizationDetails), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentTokenList.php b/src/Appwrite/Models/Oauth2ConsentTokenList.php index d24f6382..a86ff2df 100644 --- a/src/Appwrite/Models/Oauth2ConsentTokenList.php +++ b/src/Appwrite/Models/Oauth2ConsentTokenList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tokens' => static::serializeValue($this->tokens) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2DeviceAuthorization.php b/src/Appwrite/Models/Oauth2DeviceAuthorization.php index 6f295a44..f8dd64b4 100644 --- a/src/Appwrite/Models/Oauth2DeviceAuthorization.php +++ b/src/Appwrite/Models/Oauth2DeviceAuthorization.php @@ -1,9 +1,13 @@ static::serializeValue($this->deviceCode), 'user_code' => static::serializeValue($this->userCode), 'verification_uri' => static::serializeValue($this->verificationUri), @@ -76,7 +80,5 @@ public function toArray(): array 'expires_in' => static::serializeValue($this->expiresIn), 'interval' => static::serializeValue($this->interval) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Grant.php b/src/Appwrite/Models/Oauth2Grant.php index 4b8de2f9..0d0991c4 100644 --- a/src/Appwrite/Models/Oauth2Grant.php +++ b/src/Appwrite/Models/Oauth2Grant.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -118,7 +122,5 @@ public function toArray(): array 'authTime' => static::serializeValue($this->authTime), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Organization.php b/src/Appwrite/Models/Oauth2Organization.php index 25a7dcff..d251fa22 100644 --- a/src/Appwrite/Models/Oauth2Organization.php +++ b/src/Appwrite/Models/Oauth2Organization.php @@ -1,9 +1,13 @@ static::serializeValue($this->id) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2OrganizationList.php b/src/Appwrite/Models/Oauth2OrganizationList.php index 2f29ee00..e7ca6867 100644 --- a/src/Appwrite/Models/Oauth2OrganizationList.php +++ b/src/Appwrite/Models/Oauth2OrganizationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'organizations' => static::serializeValue($this->organizations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2PAR.php b/src/Appwrite/Models/Oauth2PAR.php index d6f7d677..07b21311 100644 --- a/src/Appwrite/Models/Oauth2PAR.php +++ b/src/Appwrite/Models/Oauth2PAR.php @@ -1,9 +1,13 @@ static::serializeValue($this->requestUri), 'expires_in' => static::serializeValue($this->expiresIn) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Project.php b/src/Appwrite/Models/Oauth2Project.php index e7f9725d..3919e543 100644 --- a/src/Appwrite/Models/Oauth2Project.php +++ b/src/Appwrite/Models/Oauth2Project.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'region' => static::serializeValue($this->region), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ProjectList.php b/src/Appwrite/Models/Oauth2ProjectList.php index efa948b8..b4aa53b4 100644 --- a/src/Appwrite/Models/Oauth2ProjectList.php +++ b/src/Appwrite/Models/Oauth2ProjectList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Reject.php b/src/Appwrite/Models/Oauth2Reject.php index 57304a14..0db98197 100644 --- a/src/Appwrite/Models/Oauth2Reject.php +++ b/src/Appwrite/Models/Oauth2Reject.php @@ -1,9 +1,13 @@ static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Token.php b/src/Appwrite/Models/Oauth2Token.php index b9bbb593..53f0add4 100644 --- a/src/Appwrite/Models/Oauth2Token.php +++ b/src/Appwrite/Models/Oauth2Token.php @@ -1,9 +1,13 @@ static::serializeValue($this->accessToken), 'token_type' => static::serializeValue($this->tokenType), 'expires_in' => static::serializeValue($this->expiresIn), @@ -77,7 +81,5 @@ public function toArray(): array 'authorization_details' => static::serializeValue($this->authorizationDetails), 'id_token' => static::serializeValue($this->idToken) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Organization.php b/src/Appwrite/Models/Organization.php index 5eeef10d..92160ce5 100644 --- a/src/Appwrite/Models/Organization.php +++ b/src/Appwrite/Models/Organization.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -240,7 +244,5 @@ public function toArray(): array 'platform' => static::serializeValue($this->platform), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Phone.php b/src/Appwrite/Models/Phone.php index f8c56c24..1c99fe93 100644 --- a/src/Appwrite/Models/Phone.php +++ b/src/Appwrite/Models/Phone.php @@ -1,9 +1,13 @@ static::serializeValue($this->code), 'countryCode' => static::serializeValue($this->countryCode), 'countryName' => static::serializeValue($this->countryName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PhoneList.php b/src/Appwrite/Models/PhoneList.php index afa2e30e..76d7227e 100644 --- a/src/Appwrite/Models/PhoneList.php +++ b/src/Appwrite/Models/PhoneList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'phones' => static::serializeValue($this->phones) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformAndroid.php b/src/Appwrite/Models/PlatformAndroid.php index 3994c7ca..48ace53b 100644 --- a/src/Appwrite/Models/PlatformAndroid.php +++ b/src/Appwrite/Models/PlatformAndroid.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'applicationId' => static::serializeValue($this->applicationId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformApple.php b/src/Appwrite/Models/PlatformApple.php index 5919d10d..610f8153 100644 --- a/src/Appwrite/Models/PlatformApple.php +++ b/src/Appwrite/Models/PlatformApple.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'bundleIdentifier' => static::serializeValue($this->bundleIdentifier) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformLinux.php b/src/Appwrite/Models/PlatformLinux.php index 5a456a12..64f3b0de 100644 --- a/src/Appwrite/Models/PlatformLinux.php +++ b/src/Appwrite/Models/PlatformLinux.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'packageName' => static::serializeValue($this->packageName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformList.php b/src/Appwrite/Models/PlatformList.php index cd6653f0..50513f56 100644 --- a/src/Appwrite/Models/PlatformList.php +++ b/src/Appwrite/Models/PlatformList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'platforms' => static::serializeValue($this->platforms) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformWeb.php b/src/Appwrite/Models/PlatformWeb.php index f21bf514..4f9d78a6 100644 --- a/src/Appwrite/Models/PlatformWeb.php +++ b/src/Appwrite/Models/PlatformWeb.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'hostname' => static::serializeValue($this->hostname) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformWindows.php b/src/Appwrite/Models/PlatformWindows.php index 3e5ec245..107f7715 100644 --- a/src/Appwrite/Models/PlatformWindows.php +++ b/src/Appwrite/Models/PlatformWindows.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'packageIdentifierName' => static::serializeValue($this->packageIdentifierName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyAliasedEmail.php b/src/Appwrite/Models/PolicyDenyAliasedEmail.php index 1bcd1d34..977ceb60 100644 --- a/src/Appwrite/Models/PolicyDenyAliasedEmail.php +++ b/src/Appwrite/Models/PolicyDenyAliasedEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyCorporateEmail.php b/src/Appwrite/Models/PolicyDenyCorporateEmail.php index 9a48fbf3..e756f82c 100644 --- a/src/Appwrite/Models/PolicyDenyCorporateEmail.php +++ b/src/Appwrite/Models/PolicyDenyCorporateEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyDisposableEmail.php b/src/Appwrite/Models/PolicyDenyDisposableEmail.php index 877bdab8..6fdb54ee 100644 --- a/src/Appwrite/Models/PolicyDenyDisposableEmail.php +++ b/src/Appwrite/Models/PolicyDenyDisposableEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyFreeEmail.php b/src/Appwrite/Models/PolicyDenyFreeEmail.php index 3894d62c..3db8231e 100644 --- a/src/Appwrite/Models/PolicyDenyFreeEmail.php +++ b/src/Appwrite/Models/PolicyDenyFreeEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyList.php b/src/Appwrite/Models/PolicyList.php index 5258e808..f05ed52f 100644 --- a/src/Appwrite/Models/PolicyList.php +++ b/src/Appwrite/Models/PolicyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'policies' => static::serializeValue($this->policies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyMembershipPrivacy.php b/src/Appwrite/Models/PolicyMembershipPrivacy.php index 5c3423d1..db8ec85d 100644 --- a/src/Appwrite/Models/PolicyMembershipPrivacy.php +++ b/src/Appwrite/Models/PolicyMembershipPrivacy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'userId' => static::serializeValue($this->userId), 'userEmail' => static::serializeValue($this->userEmail), @@ -83,7 +87,5 @@ public function toArray(): array 'userMFA' => static::serializeValue($this->userMFA), 'userAccessedAt' => static::serializeValue($this->userAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyMfaFactors.php b/src/Appwrite/Models/PolicyMfaFactors.php index 89b49271..e6eecd63 100644 --- a/src/Appwrite/Models/PolicyMfaFactors.php +++ b/src/Appwrite/Models/PolicyMfaFactors.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'totp' => static::serializeValue($this->totp), 'email' => static::serializeValue($this->email), 'phone' => static::serializeValue($this->phone), 'custom' => static::serializeValue($this->custom) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordDictionary.php b/src/Appwrite/Models/PolicyPasswordDictionary.php index e640be87..4b1c34c4 100644 --- a/src/Appwrite/Models/PolicyPasswordDictionary.php +++ b/src/Appwrite/Models/PolicyPasswordDictionary.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordHistory.php b/src/Appwrite/Models/PolicyPasswordHistory.php index 7192807a..d59a9f9e 100644 --- a/src/Appwrite/Models/PolicyPasswordHistory.php +++ b/src/Appwrite/Models/PolicyPasswordHistory.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordPersonalData.php b/src/Appwrite/Models/PolicyPasswordPersonalData.php index 4637c56e..aad948c0 100644 --- a/src/Appwrite/Models/PolicyPasswordPersonalData.php +++ b/src/Appwrite/Models/PolicyPasswordPersonalData.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordStrength.php b/src/Appwrite/Models/PolicyPasswordStrength.php index 16a13f4a..4974fafd 100644 --- a/src/Appwrite/Models/PolicyPasswordStrength.php +++ b/src/Appwrite/Models/PolicyPasswordStrength.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'min' => static::serializeValue($this->min), 'uppercase' => static::serializeValue($this->uppercase), @@ -76,7 +80,5 @@ public function toArray(): array 'number' => static::serializeValue($this->number), 'symbols' => static::serializeValue($this->symbols) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionAlert.php b/src/Appwrite/Models/PolicySessionAlert.php index 74939839..0b4126f1 100644 --- a/src/Appwrite/Models/PolicySessionAlert.php +++ b/src/Appwrite/Models/PolicySessionAlert.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionDuration.php b/src/Appwrite/Models/PolicySessionDuration.php index a3f60b7b..d37938b3 100644 --- a/src/Appwrite/Models/PolicySessionDuration.php +++ b/src/Appwrite/Models/PolicySessionDuration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'duration' => static::serializeValue($this->duration) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionInvalidation.php b/src/Appwrite/Models/PolicySessionInvalidation.php index 9b6e1630..27ab89aa 100644 --- a/src/Appwrite/Models/PolicySessionInvalidation.php +++ b/src/Appwrite/Models/PolicySessionInvalidation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionLimit.php b/src/Appwrite/Models/PolicySessionLimit.php index 9055b3bc..94d8775a 100644 --- a/src/Appwrite/Models/PolicySessionLimit.php +++ b/src/Appwrite/Models/PolicySessionLimit.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyUserLimit.php b/src/Appwrite/Models/PolicyUserLimit.php index c3866462..abc120e7 100644 --- a/src/Appwrite/Models/PolicyUserLimit.php +++ b/src/Appwrite/Models/PolicyUserLimit.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Preferences.php b/src/Appwrite/Models/Preferences.php index f52607cf..36dd26fa 100644 --- a/src/Appwrite/Models/Preferences.php +++ b/src/Appwrite/Models/Preferences.php @@ -1,16 +1,18 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -88,7 +92,5 @@ public function toArray(): array 'expiresAt' => static::serializeValue($this->expiresAt), 'metadata' => static::serializeValue($this->metadata) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PresenceList.php b/src/Appwrite/Models/PresenceList.php index ef673505..7f35fe93 100644 --- a/src/Appwrite/Models/PresenceList.php +++ b/src/Appwrite/Models/PresenceList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'presences' => static::serializeValue($this->presences) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Program.php b/src/Appwrite/Models/Program.php index a6bdcd53..a2e8f6ff 100644 --- a/src/Appwrite/Models/Program.php +++ b/src/Appwrite/Models/Program.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'title' => static::serializeValue($this->title), 'description' => static::serializeValue($this->description), @@ -97,7 +101,5 @@ public function toArray(): array 'external' => static::serializeValue($this->external), 'billingPlanId' => static::serializeValue($this->billingPlanId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index c63ab5bb..d8f551ab 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -1,9 +1,13 @@ $protocols list of protocols. * @param list $blocks project blocks information * @param string $consoleAccessedAt last time the project was accessed via console. used with plan's projectinactivitydays to determine if project is paused. - * @param bool $wafEnabled whether waf enforcement is enabled for the project. + * @param bool|null $wafEnabled whether waf enforcement is enabled for the project. * @param BillingLimits|null $billingLimits billing limits reached * @param bool|null $oAuth2ServerEnabled oauth2 server status * @param string|null $oAuth2ServerAuthorizationUrl oauth2 server authorization url @@ -87,7 +91,7 @@ public function __construct( public array $protocols, public array $blocks, public string $consoleAccessedAt, - public bool $wafEnabled, + public ?bool $wafEnabled = null, public ?BillingLimits $billingLimits = null, public ?bool $oAuth2ServerEnabled = null, public ?string $oAuth2ServerAuthorizationUrl = null, @@ -195,9 +199,6 @@ public static function from(array $data): static if (!array_key_exists('consoleAccessedAt', $data)) { throw new \InvalidArgumentException('Missing required field "consoleAccessedAt" for ' . static::class . '.'); } - if (!array_key_exists('wafEnabled', $data)) { - throw new \InvalidArgumentException('Missing required field "wafEnabled" for ' . static::class . '.'); - } return new static( id: $data['$id'], @@ -252,25 +253,25 @@ public static function from(array $data): static ) : $data['blocks'], consoleAccessedAt: $data['consoleAccessedAt'], - wafEnabled: $data['wafEnabled'], + wafEnabled: $data['wafEnabled'] ?? null, billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null, - oAuth2ServerEnabled: array_key_exists('oAuth2ServerEnabled', $data) ? $data['oAuth2ServerEnabled'] : null, - oAuth2ServerAuthorizationUrl: array_key_exists('oAuth2ServerAuthorizationUrl', $data) ? $data['oAuth2ServerAuthorizationUrl'] : null, - oAuth2ServerScopes: array_key_exists('oAuth2ServerScopes', $data) ? $data['oAuth2ServerScopes'] : null, - oAuth2ServerDefaultScopes: array_key_exists('oAuth2ServerDefaultScopes', $data) ? $data['oAuth2ServerDefaultScopes'] : null, - oAuth2ServerInstallationScopes: array_key_exists('oAuth2ServerInstallationScopes', $data) ? $data['oAuth2ServerInstallationScopes'] : null, - oAuth2ServerAuthorizationDetailsTypes: array_key_exists('oAuth2ServerAuthorizationDetailsTypes', $data) ? $data['oAuth2ServerAuthorizationDetailsTypes'] : null, - oAuth2ServerAccessTokenDuration: array_key_exists('oAuth2ServerAccessTokenDuration', $data) ? $data['oAuth2ServerAccessTokenDuration'] : null, - oAuth2ServerRefreshTokenDuration: array_key_exists('oAuth2ServerRefreshTokenDuration', $data) ? $data['oAuth2ServerRefreshTokenDuration'] : null, - oAuth2ServerPublicAccessTokenDuration: array_key_exists('oAuth2ServerPublicAccessTokenDuration', $data) ? $data['oAuth2ServerPublicAccessTokenDuration'] : null, - oAuth2ServerPublicRefreshTokenDuration: array_key_exists('oAuth2ServerPublicRefreshTokenDuration', $data) ? $data['oAuth2ServerPublicRefreshTokenDuration'] : null, - oAuth2ServerInstallationAccessTokenDuration: array_key_exists('oAuth2ServerInstallationAccessTokenDuration', $data) ? $data['oAuth2ServerInstallationAccessTokenDuration'] : null, - oAuth2ServerConfidentialPkce: array_key_exists('oAuth2ServerConfidentialPkce', $data) ? $data['oAuth2ServerConfidentialPkce'] : null, - oAuth2ServerVerificationUrl: array_key_exists('oAuth2ServerVerificationUrl', $data) ? $data['oAuth2ServerVerificationUrl'] : null, - oAuth2ServerUserCodeLength: array_key_exists('oAuth2ServerUserCodeLength', $data) ? $data['oAuth2ServerUserCodeLength'] : null, - oAuth2ServerUserCodeFormat: array_key_exists('oAuth2ServerUserCodeFormat', $data) ? $data['oAuth2ServerUserCodeFormat'] : null, - oAuth2ServerDeviceCodeDuration: array_key_exists('oAuth2ServerDeviceCodeDuration', $data) ? $data['oAuth2ServerDeviceCodeDuration'] : null, - oAuth2ServerDiscoveryUrl: array_key_exists('oAuth2ServerDiscoveryUrl', $data) ? $data['oAuth2ServerDiscoveryUrl'] : null + oAuth2ServerEnabled: $data['oAuth2ServerEnabled'] ?? null, + oAuth2ServerAuthorizationUrl: $data['oAuth2ServerAuthorizationUrl'] ?? null, + oAuth2ServerScopes: $data['oAuth2ServerScopes'] ?? null, + oAuth2ServerDefaultScopes: $data['oAuth2ServerDefaultScopes'] ?? null, + oAuth2ServerInstallationScopes: $data['oAuth2ServerInstallationScopes'] ?? null, + oAuth2ServerAuthorizationDetailsTypes: $data['oAuth2ServerAuthorizationDetailsTypes'] ?? null, + oAuth2ServerAccessTokenDuration: $data['oAuth2ServerAccessTokenDuration'] ?? null, + oAuth2ServerRefreshTokenDuration: $data['oAuth2ServerRefreshTokenDuration'] ?? null, + oAuth2ServerPublicAccessTokenDuration: $data['oAuth2ServerPublicAccessTokenDuration'] ?? null, + oAuth2ServerPublicRefreshTokenDuration: $data['oAuth2ServerPublicRefreshTokenDuration'] ?? null, + oAuth2ServerInstallationAccessTokenDuration: $data['oAuth2ServerInstallationAccessTokenDuration'] ?? null, + oAuth2ServerConfidentialPkce: $data['oAuth2ServerConfidentialPkce'] ?? null, + oAuth2ServerVerificationUrl: $data['oAuth2ServerVerificationUrl'] ?? null, + oAuth2ServerUserCodeLength: $data['oAuth2ServerUserCodeLength'] ?? null, + oAuth2ServerUserCodeFormat: $data['oAuth2ServerUserCodeFormat'] ?? null, + oAuth2ServerDeviceCodeDuration: $data['oAuth2ServerDeviceCodeDuration'] ?? null, + oAuth2ServerDiscoveryUrl: $data['oAuth2ServerDiscoveryUrl'] ?? null ); } @@ -279,7 +280,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -327,7 +328,5 @@ public function toArray(): array 'oAuth2ServerDeviceCodeDuration' => static::serializeValue($this->oAuth2ServerDeviceCodeDuration), 'oAuth2ServerDiscoveryUrl' => static::serializeValue($this->oAuth2ServerDiscoveryUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectAuthMethod.php b/src/Appwrite/Models/ProjectAuthMethod.php index 2f5903c3..28759de9 100644 --- a/src/Appwrite/Models/ProjectAuthMethod.php +++ b/src/Appwrite/Models/ProjectAuthMethod.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectList.php b/src/Appwrite/Models/ProjectList.php index 1084c0eb..ec34ea00 100644 --- a/src/Appwrite/Models/ProjectList.php +++ b/src/Appwrite/Models/ProjectList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectProtocol.php b/src/Appwrite/Models/ProjectProtocol.php index c5f7bd1f..285292b1 100644 --- a/src/Appwrite/Models/ProjectProtocol.php +++ b/src/Appwrite/Models/ProjectProtocol.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectService.php b/src/Appwrite/Models/ProjectService.php index 357ad854..e1fd286e 100644 --- a/src/Appwrite/Models/ProjectService.php +++ b/src/Appwrite/Models/ProjectService.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Provider.php b/src/Appwrite/Models/Provider.php index 0d40ad77..a0bd6113 100644 --- a/src/Appwrite/Models/Provider.php +++ b/src/Appwrite/Models/Provider.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'credentials' => static::serializeValue($this->credentials), 'options' => static::serializeValue($this->options) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProviderList.php b/src/Appwrite/Models/ProviderList.php index 0d71729c..6a13de52 100644 --- a/src/Appwrite/Models/ProviderList.php +++ b/src/Appwrite/Models/ProviderList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'providers' => static::serializeValue($this->providers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyInvalidation.php b/src/Appwrite/Models/ProxyInvalidation.php index 6b35dfeb..d40cde52 100644 --- a/src/Appwrite/Models/ProxyInvalidation.php +++ b/src/Appwrite/Models/ProxyInvalidation.php @@ -1,9 +1,13 @@ static::serializeValue($this->domain), 'type' => static::serializeValue($this->type), 'reference' => static::serializeValue($this->reference), 'status' => static::serializeValue($this->status) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyRule.php b/src/Appwrite/Models/ProxyRule.php index 7c2ae6dc..948ec1d7 100644 --- a/src/Appwrite/Models/ProxyRule.php +++ b/src/Appwrite/Models/ProxyRule.php @@ -1,5 +1,7 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,7 +143,5 @@ public function toArray(): array 'logs' => static::serializeValue($this->logs), 'renewAt' => static::serializeValue($this->renewAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyRuleList.php b/src/Appwrite/Models/ProxyRuleList.php index 5c5377ca..c86f84a6 100644 --- a/src/Appwrite/Models/ProxyRuleList.php +++ b/src/Appwrite/Models/ProxyRuleList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'rules' => static::serializeValue($this->rules) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Report.php b/src/Appwrite/Models/Report.php index d0301ab1..3b09e61a 100644 --- a/src/Appwrite/Models/Report.php +++ b/src/Appwrite/Models/Report.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -120,7 +124,5 @@ public function toArray(): array 'insights' => static::serializeValue($this->insights), 'analyzedAt' => static::serializeValue($this->analyzedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ReportList.php b/src/Appwrite/Models/ReportList.php index caf999e3..839cea7a 100644 --- a/src/Appwrite/Models/ReportList.php +++ b/src/Appwrite/Models/ReportList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'reports' => static::serializeValue($this->reports) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ResourceToken.php b/src/Appwrite/Models/ResourceToken.php index 5938f2e5..76b380de 100644 --- a/src/Appwrite/Models/ResourceToken.php +++ b/src/Appwrite/Models/ResourceToken.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'resourceId' => static::serializeValue($this->resourceId), @@ -83,7 +87,5 @@ public function toArray(): array 'secret' => static::serializeValue($this->secret), 'accessedAt' => static::serializeValue($this->accessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ResourceTokenList.php b/src/Appwrite/Models/ResourceTokenList.php index 9b43db3f..be6b50e6 100644 --- a/src/Appwrite/Models/ResourceTokenList.php +++ b/src/Appwrite/Models/ResourceTokenList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tokens' => static::serializeValue($this->tokens) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Row.php b/src/Appwrite/Models/Row.php index 4a1749f4..45aaf8a9 100644 --- a/src/Appwrite/Models/Row.php +++ b/src/Appwrite/Models/Row.php @@ -1,16 +1,18 @@ static::serializeValue($this->total), 'rows' => static::serializeValue($this->rows) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Runtime.php b/src/Appwrite/Models/Runtime.php index fd311d20..349f5ead 100644 --- a/src/Appwrite/Models/Runtime.php +++ b/src/Appwrite/Models/Runtime.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'key' => static::serializeValue($this->key), 'name' => static::serializeValue($this->name), @@ -90,7 +94,5 @@ public function toArray(): array 'logo' => static::serializeValue($this->logo), 'supports' => static::serializeValue($this->supports) ]; - - return $result; } } diff --git a/src/Appwrite/Models/RuntimeList.php b/src/Appwrite/Models/RuntimeList.php index 183567b3..071c8dfe 100644 --- a/src/Appwrite/Models/RuntimeList.php +++ b/src/Appwrite/Models/RuntimeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'runtimes' => static::serializeValue($this->runtimes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Session.php b/src/Appwrite/Models/Session.php index 0713ee5e..c4eba764 100644 --- a/src/Appwrite/Models/Session.php +++ b/src/Appwrite/Models/Session.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -237,7 +241,5 @@ public function toArray(): array 'secret' => static::serializeValue($this->secret), 'mfaUpdatedAt' => static::serializeValue($this->mfaUpdatedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SessionList.php b/src/Appwrite/Models/SessionList.php index 4acd0772..c006f1a5 100644 --- a/src/Appwrite/Models/SessionList.php +++ b/src/Appwrite/Models/SessionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'sessions' => static::serializeValue($this->sessions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Site.php b/src/Appwrite/Models/Site.php index 19fd5ecf..5adb2086 100644 --- a/src/Appwrite/Models/Site.php +++ b/src/Appwrite/Models/Site.php @@ -1,9 +1,13 @@ $vars site variables. * @param int $timeout site request timeout in seconds. * @param string $installCommand the install command used to install the site dependencies. @@ -64,6 +69,7 @@ public function __construct( public string $latestDeploymentId, public string $latestDeploymentCreatedAt, public string $latestDeploymentStatus, + public array $scopes, public array $vars, public int $timeout, public string $installCommand, @@ -138,6 +144,9 @@ public static function from(array $data): static if (!array_key_exists('latestDeploymentStatus', $data)) { throw new \InvalidArgumentException('Missing required field "latestDeploymentStatus" for ' . static::class . '.'); } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } if (!array_key_exists('vars', $data)) { throw new \InvalidArgumentException('Missing required field "vars" for ' . static::class . '.'); } @@ -210,6 +219,7 @@ public static function from(array $data): static latestDeploymentId: $data['latestDeploymentId'], latestDeploymentCreatedAt: $data['latestDeploymentCreatedAt'], latestDeploymentStatus: $data['latestDeploymentStatus'], + scopes: $data['scopes'], vars: is_array($data['vars']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(Variable::class, $item), @@ -241,7 +251,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -258,6 +268,7 @@ public function toArray(): array 'latestDeploymentId' => static::serializeValue($this->latestDeploymentId), 'latestDeploymentCreatedAt' => static::serializeValue($this->latestDeploymentCreatedAt), 'latestDeploymentStatus' => static::serializeValue($this->latestDeploymentStatus), + 'scopes' => static::serializeValue($this->scopes), 'vars' => static::serializeValue($this->vars), 'timeout' => static::serializeValue($this->timeout), 'installCommand' => static::serializeValue($this->installCommand), @@ -277,7 +288,5 @@ public function toArray(): array 'adapter' => static::serializeValue($this->adapter), 'fallbackFile' => static::serializeValue($this->fallbackFile) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SiteList.php b/src/Appwrite/Models/SiteList.php index 93eac7b2..371d171c 100644 --- a/src/Appwrite/Models/SiteList.php +++ b/src/Appwrite/Models/SiteList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'sites' => static::serializeValue($this->sites) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Specification.php b/src/Appwrite/Models/Specification.php index d2b7d058..0790b192 100644 --- a/src/Appwrite/Models/Specification.php +++ b/src/Appwrite/Models/Specification.php @@ -1,9 +1,13 @@ static::serializeValue($this->memory), 'cpus' => static::serializeValue($this->cpus), 'enabled' => static::serializeValue($this->enabled), 'slug' => static::serializeValue($this->slug) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SpecificationList.php b/src/Appwrite/Models/SpecificationList.php index ac2442d7..d699c842 100644 --- a/src/Appwrite/Models/SpecificationList.php +++ b/src/Appwrite/Models/SpecificationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'specifications' => static::serializeValue($this->specifications) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Subscriber.php b/src/Appwrite/Models/Subscriber.php index 15793254..7efd6f0c 100644 --- a/src/Appwrite/Models/Subscriber.php +++ b/src/Appwrite/Models/Subscriber.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'topicId' => static::serializeValue($this->topicId), 'providerType' => static::serializeValue($this->providerType) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SubscriberList.php b/src/Appwrite/Models/SubscriberList.php index 458f5798..03b3c32f 100644 --- a/src/Appwrite/Models/SubscriberList.php +++ b/src/Appwrite/Models/SubscriberList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'subscribers' => static::serializeValue($this->subscribers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Table.php b/src/Appwrite/Models/Table.php index c8b6a60f..dce6d3a5 100644 --- a/src/Appwrite/Models/Table.php +++ b/src/Appwrite/Models/Table.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -123,7 +127,5 @@ public function toArray(): array 'bytesMax' => static::serializeValue($this->bytesMax), 'bytesUsed' => static::serializeValue($this->bytesUsed) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TableList.php b/src/Appwrite/Models/TableList.php index 587fbfae..994c11e1 100644 --- a/src/Appwrite/Models/TableList.php +++ b/src/Appwrite/Models/TableList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tables' => static::serializeValue($this->tables) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Target.php b/src/Appwrite/Models/Target.php index b00b2298..00a4decb 100644 --- a/src/Appwrite/Models/Target.php +++ b/src/Appwrite/Models/Target.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'identifier' => static::serializeValue($this->identifier), 'expired' => static::serializeValue($this->expired) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TargetList.php b/src/Appwrite/Models/TargetList.php index d4db0a5f..fe5c10ac 100644 --- a/src/Appwrite/Models/TargetList.php +++ b/src/Appwrite/Models/TargetList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'targets' => static::serializeValue($this->targets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Team.php b/src/Appwrite/Models/Team.php index 73e1c130..463418cf 100644 --- a/src/Appwrite/Models/Team.php +++ b/src/Appwrite/Models/Team.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -76,7 +80,5 @@ public function toArray(): array 'total' => static::serializeValue($this->total), 'prefs' => static::serializeValue($this->prefs) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TeamList.php b/src/Appwrite/Models/TeamList.php index 61db8d1c..02e2b53b 100644 --- a/src/Appwrite/Models/TeamList.php +++ b/src/Appwrite/Models/TeamList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'teams' => static::serializeValue($this->teams) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Token.php b/src/Appwrite/Models/Token.php index 55288933..2056faa6 100644 --- a/src/Appwrite/Models/Token.php +++ b/src/Appwrite/Models/Token.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), @@ -76,7 +80,5 @@ public function toArray(): array 'expire' => static::serializeValue($this->expire), 'phrase' => static::serializeValue($this->phrase) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Topic.php b/src/Appwrite/Models/Topic.php index d10df72b..caa2fcff 100644 --- a/src/Appwrite/Models/Topic.php +++ b/src/Appwrite/Models/Topic.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'pushTotal' => static::serializeValue($this->pushTotal), 'subscribe' => static::serializeValue($this->subscribe) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TopicList.php b/src/Appwrite/Models/TopicList.php index e8c184e5..9cfdc2ec 100644 --- a/src/Appwrite/Models/TopicList.php +++ b/src/Appwrite/Models/TopicList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'topics' => static::serializeValue($this->topics) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Transaction.php b/src/Appwrite/Models/Transaction.php index 010651f7..ff65aa52 100644 --- a/src/Appwrite/Models/Transaction.php +++ b/src/Appwrite/Models/Transaction.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -76,7 +80,5 @@ public function toArray(): array 'operations' => static::serializeValue($this->operations), 'expiresAt' => static::serializeValue($this->expiresAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TransactionList.php b/src/Appwrite/Models/TransactionList.php index 9ee090e5..539e4357 100644 --- a/src/Appwrite/Models/TransactionList.php +++ b/src/Appwrite/Models/TransactionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'transactions' => static::serializeValue($this->transactions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/UsageBillingPlan.php b/src/Appwrite/Models/UsageBillingPlan.php index 827e4d60..eb9cab99 100644 --- a/src/Appwrite/Models/UsageBillingPlan.php +++ b/src/Appwrite/Models/UsageBillingPlan.php @@ -1,9 +1,13 @@ static::serializeValue($this->bandwidth), 'executions' => static::serializeValue($this->executions), 'member' => static::serializeValue($this->member), @@ -102,7 +106,5 @@ public function toArray(): array 'imageTransformations' => static::serializeValue($this->imageTransformations), 'credits' => static::serializeValue($this->credits) ]; - - return $result; } } diff --git a/src/Appwrite/Models/User.php b/src/Appwrite/Models/User.php index a7decdcc..da0157ca 100644 --- a/src/Appwrite/Models/User.php +++ b/src/Appwrite/Models/User.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -191,7 +195,5 @@ public function toArray(): array 'impersonator' => static::serializeValue($this->impersonator), 'impersonatorUserId' => static::serializeValue($this->impersonatorUserId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/UserList.php b/src/Appwrite/Models/UserList.php index 89ba62de..fb77b479 100644 --- a/src/Appwrite/Models/UserList.php +++ b/src/Appwrite/Models/UserList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'users' => static::serializeValue($this->users) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Variable.php b/src/Appwrite/Models/Variable.php index c6d097b7..8fe97fab 100644 --- a/src/Appwrite/Models/Variable.php +++ b/src/Appwrite/Models/Variable.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/VariableList.php b/src/Appwrite/Models/VariableList.php index c56ae8d7..9522d7c8 100644 --- a/src/Appwrite/Models/VariableList.php +++ b/src/Appwrite/Models/VariableList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'variables' => static::serializeValue($this->variables) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Webhook.php b/src/Appwrite/Models/Webhook.php index 9a1f089e..0c8c585c 100644 --- a/src/Appwrite/Models/Webhook.php +++ b/src/Appwrite/Models/Webhook.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -125,7 +129,5 @@ public function toArray(): array 'logs' => static::serializeValue($this->logs), 'attempts' => static::serializeValue($this->attempts) ]; - - return $result; } } diff --git a/src/Appwrite/Models/WebhookList.php b/src/Appwrite/Models/WebhookList.php index a15aa5cf..c402119f 100644 --- a/src/Appwrite/Models/WebhookList.php +++ b/src/Appwrite/Models/WebhookList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'webhooks' => static::serializeValue($this->webhooks) ]; - - return $result; } } diff --git a/src/Appwrite/Operator.php b/src/Appwrite/Operator.php index ad3c961c..8a296677 100644 --- a/src/Appwrite/Operator.php +++ b/src/Appwrite/Operator.php @@ -1,5 +1,7 @@ method = $method; if (is_null($values) || is_array($values)) { $this->values = $values; @@ -33,7 +33,7 @@ public function __construct(string $method, $values = null) public function __toString(): string { - return json_encode($this); + return (string) json_encode($this); } public function jsonSerialize(): mixed @@ -47,9 +47,6 @@ public function jsonSerialize(): mixed /** * Increment * - * @param int|float $value - * @param int|float|null $max - * @return string */ public static function increment(int|float $value = 1, int|float|null $max = null): string { @@ -63,15 +60,12 @@ public static function increment(int|float $value = 1, int|float|null $max = nul if ($max !== null) { $values[] = $max; } - return (new Operator('increment', $values))->__toString(); + return new Operator('increment', $values)->__toString(); } /** * Decrement * - * @param int|float $value - * @param int|float|null $min - * @return string */ public static function decrement(int|float $value = 1, int|float|null $min = null): string { @@ -85,15 +79,12 @@ public static function decrement(int|float $value = 1, int|float|null $min = nul if ($min !== null) { $values[] = $min; } - return (new Operator('decrement', $values))->__toString(); + return new Operator('decrement', $values)->__toString(); } /** * Multiply * - * @param int|float $factor - * @param int|float|null $max - * @return string */ public static function multiply(int|float $factor, int|float|null $max = null): string { @@ -107,15 +98,12 @@ public static function multiply(int|float $factor, int|float|null $max = null): if ($max !== null) { $values[] = $max; } - return (new Operator('multiply', $values))->__toString(); + return new Operator('multiply', $values)->__toString(); } /** * Divide * - * @param int|float $divisor - * @param int|float|null $min - * @return string */ public static function divide(int|float $divisor, int|float|null $min = null): string { @@ -132,14 +120,12 @@ public static function divide(int|float $divisor, int|float|null $min = null): s if ($min !== null) { $values[] = $min; } - return (new Operator('divide', $values))->__toString(); + return new Operator('divide', $values)->__toString(); } /** * Modulo * - * @param int|float $divisor - * @return string */ public static function modulo(int|float $divisor): string { @@ -149,15 +135,12 @@ public static function modulo(int|float $divisor): string if ($divisor === 0 || $divisor === 0.0) { throw new \InvalidArgumentException('Divisor cannot be zero'); } - return (new Operator('modulo', [$divisor]))->__toString(); + return new Operator('modulo', [$divisor])->__toString(); } /** * Power * - * @param int|float $exponent - * @param int|float|null $max - * @return string */ public static function power(int|float $exponent, int|float|null $max = null): string { @@ -171,161 +154,133 @@ public static function power(int|float $exponent, int|float|null $max = null): s if ($max !== null) { $values[] = $max; } - return (new Operator('power', $values))->__toString(); + return new Operator('power', $values)->__toString(); } /** * Array Append * - * @param array $values - * @return string */ public static function arrayAppend(array $values): string { - return (new Operator('arrayAppend', $values))->__toString(); + return new Operator('arrayAppend', $values)->__toString(); } /** * Array Prepend * - * @param array $values - * @return string */ public static function arrayPrepend(array $values): string { - return (new Operator('arrayPrepend', $values))->__toString(); + return new Operator('arrayPrepend', $values)->__toString(); } /** * Array Insert * - * @param int $index - * @param mixed $value - * @return string */ public static function arrayInsert(int $index, mixed $value): string { - return (new Operator('arrayInsert', [$index, $value]))->__toString(); + return new Operator('arrayInsert', [$index, $value])->__toString(); } /** * Array Remove * - * @param mixed $value - * @return string */ public static function arrayRemove(mixed $value): string { - return (new Operator('arrayRemove', [$value]))->__toString(); + return new Operator('arrayRemove', [$value])->__toString(); } /** * Array Unique * - * @return string */ public static function arrayUnique(): string { - return (new Operator('arrayUnique', []))->__toString(); + return new Operator('arrayUnique', [])->__toString(); } /** * Array Intersect * - * @param array $values - * @return string */ public static function arrayIntersect(array $values): string { - return (new Operator('arrayIntersect', $values))->__toString(); + return new Operator('arrayIntersect', $values)->__toString(); } /** * Array Diff * - * @param array $values - * @return string */ public static function arrayDiff(array $values): string { - return (new Operator('arrayDiff', $values))->__toString(); + return new Operator('arrayDiff', $values)->__toString(); } /** * Array Filter * - * @param string $condition - * @param mixed $value - * @return string */ public static function arrayFilter(string $condition, mixed $value = null): string { $values = [$condition, $value]; - return (new Operator('arrayFilter', $values))->__toString(); + return new Operator('arrayFilter', $values)->__toString(); } /** * Concat * - * @param mixed $value - * @return string */ public static function stringConcat(mixed $value): string { - return (new Operator('stringConcat', [$value]))->__toString(); + return new Operator('stringConcat', [$value])->__toString(); } /** * Replace * - * @param string $search - * @param string $replace - * @return string */ public static function stringReplace(string $search, string $replace): string { - return (new Operator('stringReplace', [$search, $replace]))->__toString(); + return new Operator('stringReplace', [$search, $replace])->__toString(); } /** * Toggle * - * @return string */ public static function toggle(): string { - return (new Operator('toggle', []))->__toString(); + return new Operator('toggle', [])->__toString(); } /** * Date Add Days * - * @param int $days - * @return string */ public static function dateAddDays(int $days): string { - return (new Operator('dateAddDays', [$days]))->__toString(); + return new Operator('dateAddDays', [$days])->__toString(); } /** * Date Subtract Days * - * @param int $days - * @return string */ public static function dateSubDays(int $days): string { - return (new Operator('dateSubDays', [$days]))->__toString(); + return new Operator('dateSubDays', [$days])->__toString(); } /** * Date Set Now * - * @return string */ public static function dateSetNow(): string { - return (new Operator('dateSetNow', []))->__toString(); + return new Operator('dateSetNow', [])->__toString(); } } diff --git a/src/Appwrite/Permission.php b/src/Appwrite/Permission.php index 8c250e32..837ac164 100644 --- a/src/Appwrite/Permission.php +++ b/src/Appwrite/Permission.php @@ -1,5 +1,7 @@ method = $method; - $this->attribute = $attribute; - + if (is_null($values) || is_array($values)) { $this->values = $values; } else { $this->values = [$values]; } - } public function __toString(): string { - return json_encode($this); + return (string) json_encode($this); } public function jsonSerialize(): mixed @@ -38,231 +35,181 @@ public function jsonSerialize(): mixed /** * Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function equal(string $attribute, mixed $value): string { - return (new Query('equal', $attribute, $value))->__toString(); + return new Query('equal', $attribute, $value)->__toString(); } /** * Not Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function notEqual(string $attribute, mixed $value): string { - return (new Query('notEqual', $attribute, $value))->__toString(); + return new Query('notEqual', $attribute, $value)->__toString(); } /** * Less Than * - * @param string $attribute - * @param mixed $value - * @return string */ public static function lessThan(string $attribute, mixed $value): string { - return (new Query('lessThan', $attribute, $value))->__toString(); + return new Query('lessThan', $attribute, $value)->__toString(); } /** * Less Than or Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function lessThanEqual(string $attribute, mixed $value): string { - return (new Query('lessThanEqual', $attribute, $value))->__toString(); + return new Query('lessThanEqual', $attribute, $value)->__toString(); } /** * Greater Than * - * @param string $attribute - * @param mixed $value - * @return string */ public static function greaterThan(string $attribute, mixed $value): string { - return (new Query('greaterThan', $attribute, $value))->__toString(); + return new Query('greaterThan', $attribute, $value)->__toString(); } /** * Greater Than or Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function greaterThanEqual(string $attribute, mixed $value): string { - return (new Query('greaterThanEqual', $attribute, $value))->__toString(); + return new Query('greaterThanEqual', $attribute, $value)->__toString(); } /** * Search * - * @param string $attribute - * @param string $value - * @return string */ public static function search(string $attribute, string $value): string { - return (new Query('search', $attribute, $value))->__toString(); + return new Query('search', $attribute, $value)->__toString(); } /** * Is Null * - * @param string $attribute - * @return string */ public static function isNull(string $attribute): string { - return (new Query('isNull', $attribute, null))->__toString(); + return new Query('isNull', $attribute)->__toString(); } /** * Is Not Null * - * @param string $attribute - * @return string */ public static function isNotNull(string $attribute): string { - return (new Query('isNotNull', $attribute, null))->__toString(); + return new Query('isNotNull', $attribute)->__toString(); } /** * Between * - * @param string $attribute - * @param string|int|float $start - * @param string|int|float $end - * @return string */ public static function between(string $attribute, mixed $start, mixed $end): string { - return (new Query('between', $attribute, [$start, $end]))->__toString(); + return new Query('between', $attribute, [$start, $end])->__toString(); } /** * Starts With * - * @param string $attribute - * @param string $value - * @return string */ public static function startsWith(string $attribute, string $value): string { - return (new Query('startsWith', $attribute, $value))->__toString(); + return new Query('startsWith', $attribute, $value)->__toString(); } /** * Ends With * - * @param string $attribute - * @param string $value - * @return string */ public static function endsWith(string $attribute, string $value): string { - return (new Query('endsWith', $attribute, $value))->__toString(); + return new Query('endsWith', $attribute, $value)->__toString(); } /** * Select * - * @param array $attributes - * @return string */ public static function select(array $attributes): string { - return (new Query('select', null, $attributes))->__toString(); + return new Query('select', null, $attributes)->__toString(); } /** * Cursor After * - * @param string $documentId - * @return string */ public static function cursorAfter(string $documentId): string { - return (new Query('cursorAfter', null, $documentId))->__toString(); + return new Query('cursorAfter', null, $documentId)->__toString(); } /** * Cursor Before * - * @param string $documentId - * @return string */ public static function cursorBefore(string $documentId): string { - return (new Query('cursorBefore', null, $documentId))->__toString(); + return new Query('cursorBefore', null, $documentId)->__toString(); } /** * Order Asc * - * @param string $attribute - * @return string */ public static function orderAsc(string $attribute): string { - return (new Query('orderAsc', $attribute, null))->__toString(); + return new Query('orderAsc', $attribute)->__toString(); } /** * Order Desc * - * @param string $attribute - * @return string */ public static function orderDesc(string $attribute): string { - return (new Query('orderDesc', $attribute, null))->__toString(); + return new Query('orderDesc', $attribute)->__toString(); } /** * Order Random * - * @return string */ public static function orderRandom(): string { - return (new Query('orderRandom', null, null))->__toString(); + return new Query('orderRandom')->__toString(); } /** * Limit * - * @param int $limit - * @return string */ public static function limit(int $limit): string { - return (new Query('limit', null, $limit))->__toString(); + return new Query('limit', null, $limit)->__toString(); } /** * Offset * - * @param int $offset - * @return string */ public static function offset(int $offset): string { - return (new Query('offset', null, $offset))->__toString(); + return new Query('offset', null, $offset)->__toString(); } /** @@ -272,13 +219,10 @@ public static function offset(int $offset): string * For string attributes, checks if the string contains the substring. * * Note: For array attributes, use containsAny() or containsAll() instead. - * @param string $attribute - * @param mixed $value - * @return string */ public static function contains(string $attribute, $value): string { - return (new Query('contains', $attribute, $value))->__toString(); + return new Query('contains', $attribute, $value)->__toString(); } /** @@ -288,13 +232,10 @@ public static function contains(string $attribute, $value): string * For array and relationship attributes, matches documents where the attribute * contains at least one of the given values. * - * @param string $attribute - * @param array $value - * @return string */ public static function containsAny(string $attribute, array $value): string { - return (new Query('containsAny', $attribute, $value))->__toString(); + return new Query('containsAny', $attribute, $value)->__toString(); } /** @@ -304,115 +245,87 @@ public static function containsAny(string $attribute, array $value): string * For array and relationship attributes, matches documents where the attribute * contains every one of the given values. * - * @param string $attribute - * @param array $value - * @return string */ public static function containsAll(string $attribute, array $value): string { - return (new Query('containsAll', $attribute, $value))->__toString(); + return new Query('containsAll', $attribute, $value)->__toString(); } /** * Not Contains * - * @param string $attribute - * @param mixed $value - * @return string */ public static function notContains(string $attribute, $value): string { - return (new Query('notContains', $attribute, $value))->__toString(); + return new Query('notContains', $attribute, $value)->__toString(); } /** * Not Search * - * @param string $attribute - * @param string $value - * @return string */ public static function notSearch(string $attribute, string $value): string { - return (new Query('notSearch', $attribute, $value))->__toString(); + return new Query('notSearch', $attribute, $value)->__toString(); } /** * Not Between * - * @param string $attribute - * @param string|int|float $start - * @param string|int|float $end - * @return string */ public static function notBetween(string $attribute, mixed $start, mixed $end): string { - return (new Query('notBetween', $attribute, [$start, $end]))->__toString(); + return new Query('notBetween', $attribute, [$start, $end])->__toString(); } /** * Not Starts With * - * @param string $attribute - * @param string $value - * @return string */ public static function notStartsWith(string $attribute, string $value): string { - return (new Query('notStartsWith', $attribute, $value))->__toString(); + return new Query('notStartsWith', $attribute, $value)->__toString(); } /** * Not Ends With * - * @param string $attribute - * @param string $value - * @return string */ public static function notEndsWith(string $attribute, string $value): string { - return (new Query('notEndsWith', $attribute, $value))->__toString(); + return new Query('notEndsWith', $attribute, $value)->__toString(); } /** * Filter resources where attribute matches a regular expression pattern. * - * @param string $attribute The attribute to filter on. - * @param string $pattern The regular expression pattern to match. - * @return string */ public static function regex(string $attribute, string $pattern): string { - return (new Query('regex', $attribute, $pattern))->__toString(); + return new Query('regex', $attribute, $pattern)->__toString(); } /** * Filter resources where the specified attributes exist. * - * @param array $attributes The list of attributes that must exist. - * @return string */ public static function exists(array $attributes): string { - return (new Query('exists', null, $attributes))->__toString(); + return new Query('exists', null, $attributes)->__toString(); } /** * Filter resources where the specified attributes do not exist. * - * @param array $attributes The list of attributes that must not exist. - * @return string */ public static function notExists(array $attributes): string { - return (new Query('notExists', null, $attributes))->__toString(); + return new Query('notExists', null, $attributes)->__toString(); } /** * Created Before * - * @param string $value - * @return string */ public static function createdBefore(string $value): string { @@ -422,8 +335,6 @@ public static function createdBefore(string $value): string /** * Created After * - * @param string $value - * @return string */ public static function createdAfter(string $value): string { @@ -433,9 +344,6 @@ public static function createdAfter(string $value): string /** * Created Between * - * @param string $start - * @param string $end - * @return string */ public static function createdBetween(string $start, string $end): string { @@ -445,8 +353,6 @@ public static function createdBetween(string $start, string $end): string /** * Updated Before * - * @param string $value - * @return string */ public static function updatedBefore(string $value): string { @@ -456,8 +362,6 @@ public static function updatedBefore(string $value): string /** * Updated After * - * @param string $value - * @return string */ public static function updatedAfter(string $value): string { @@ -467,9 +371,6 @@ public static function updatedAfter(string $value): string /** * Updated Between * - * @param string $start - * @param string $end - * @return string */ public static function updatedBetween(string $start, string $end): string { @@ -479,37 +380,30 @@ public static function updatedBetween(string $start, string $end): string /** * Or * - * @param array $queries - * @return string */ public static function or(array $queries): string { foreach ($queries as &$query) { $query = \json_decode($query, true); } - return (new Query('or', null, $queries))->__toString(); + return new Query('or', null, $queries)->__toString(); } /** * And * - * @param array $queries - * @return string */ public static function and(array $queries): string { foreach ($queries as &$query) { $query = \json_decode($query, true); } - return (new Query('and', null, $queries))->__toString(); + return new Query('and', null, $queries)->__toString(); } /** * Filter array elements where at least one element matches all the specified queries. * - * @param string $attribute The attribute containing the array to filter on. - * @param array $queries The list of query strings to match against array elements. - * @return string */ public static function elemMatch(string $attribute, array $queries): string { @@ -517,191 +411,141 @@ public static function elemMatch(string $attribute, array $queries): string $query = \json_decode($query, true); } - return (new Query('elemMatch', $attribute, $queries))->__toString(); + return new Query('elemMatch', $attribute, $queries)->__toString(); } /** * Distance Equal * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceEqual(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceEqual', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceEqual', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Not Equal * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceNotEqual(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceNotEqual', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceNotEqual', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Greater Than * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceGreaterThan(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceGreaterThan', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceGreaterThan', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Less Than * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @param bool $meters - * @return string */ public static function distanceLessThan(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceLessThan', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceLessThan', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Vector Dot * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorDot(string $attribute, array $vector): string { - return (new Query('vectorDot', $attribute, [$vector]))->__toString(); + return new Query('vectorDot', $attribute, [$vector])->__toString(); } /** * Vector Cosine * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorCosine(string $attribute, array $vector): string { - return (new Query('vectorCosine', $attribute, [$vector]))->__toString(); + return new Query('vectorCosine', $attribute, [$vector])->__toString(); } /** * Vector Euclidean * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorEuclidean(string $attribute, array $vector): string { - return (new Query('vectorEuclidean', $attribute, [$vector]))->__toString(); + return new Query('vectorEuclidean', $attribute, [$vector])->__toString(); } /** * Intersects * - * @param string $attribute - * @param array $values - * @return string */ public static function intersects(string $attribute, array $values): string { - return (new Query('intersects', $attribute, [$values]))->__toString(); + return new Query('intersects', $attribute, [$values])->__toString(); } /** * Not Intersects * - * @param string $attribute - * @param array $values - * @return string */ public static function notIntersects(string $attribute, array $values): string { - return (new Query('notIntersects', $attribute, [$values]))->__toString(); + return new Query('notIntersects', $attribute, [$values])->__toString(); } /** * Crosses * - * @param string $attribute - * @param array $values - * @return string */ public static function crosses(string $attribute, array $values): string { - return (new Query('crosses', $attribute, [$values]))->__toString(); + return new Query('crosses', $attribute, [$values])->__toString(); } /** * Not Crosses * - * @param string $attribute - * @param array $values - * @return string */ public static function notCrosses(string $attribute, array $values): string { - return (new Query('notCrosses', $attribute, [$values]))->__toString(); + return new Query('notCrosses', $attribute, [$values])->__toString(); } /** * Overlaps * - * @param string $attribute - * @param array $values - * @return string */ public static function overlaps(string $attribute, array $values): string { - return (new Query('overlaps', $attribute, [$values]))->__toString(); + return new Query('overlaps', $attribute, [$values])->__toString(); } /** * Not Overlaps * - * @param string $attribute - * @param array $values - * @return string */ public static function notOverlaps(string $attribute, array $values): string { - return (new Query('notOverlaps', $attribute, [$values]))->__toString(); + return new Query('notOverlaps', $attribute, [$values])->__toString(); } /** * Touches * - * @param string $attribute - * @param array $values - * @return string */ public static function touches(string $attribute, array $values): string { - return (new Query('touches', $attribute, [$values]))->__toString(); + return new Query('touches', $attribute, [$values])->__toString(); } /** * Not Touches * - * @param string $attribute - * @param array $values - * @return string */ public static function notTouches(string $attribute, array $values): string { - return (new Query('notTouches', $attribute, [$values]))->__toString(); + return new Query('notTouches', $attribute, [$values])->__toString(); } } diff --git a/src/Appwrite/Role.php b/src/Appwrite/Role.php index 2cc3ffb2..1b772274 100644 --- a/src/Appwrite/Role.php +++ b/src/Appwrite/Role.php @@ -1,5 +1,7 @@ client = $client; } } diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index fb80d415..793474f6 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -1,27 +1,22 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -230,11 +206,7 @@ public function deleteConsent(string $consentId): string * represents one authorized device or session; the token secrets themselves * are never returned. * - * @param string $consentId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\Oauth2ConsentTokenList */ public function listConsentTokens(string $consentId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\Oauth2ConsentTokenList { @@ -271,17 +243,13 @@ public function listConsentTokens(string $consentId, ?array $queries = null, ?bo } return \Appwrite\Models\Oauth2ConsentTokenList::from($response); - } /** * Get a token family issued under an OAuth2 consent by its unique ID. The * token secrets themselves are never returned. * - * @param string $consentId - * @param string $tokenId * @throws AppwriteException - * @return \Appwrite\Models\Oauth2ConsentToken */ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\Models\Oauth2ConsentToken { @@ -311,7 +279,6 @@ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\M } return \Appwrite\Models\Oauth2ConsentToken::from($response); - } /** @@ -319,10 +286,7 @@ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\M * access and refresh tokens of the family stop working immediately; other * token families and the consent itself are unaffected. * - * @param string $consentId - * @param string $tokenId * @throws AppwriteException - * @return string */ public function deleteConsentToken(string $consentId, string $tokenId): string { @@ -341,15 +305,12 @@ public function deleteConsentToken(string $consentId, string $tokenId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -360,12 +321,8 @@ public function deleteConsentToken(string $consentId, string $tokenId): string * user password is required to complete this request. * This endpoint can also be used to convert an anonymous account to a normal * one, by passing an email address and a new password. - * * - * @param string $email - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmail(string $email, string $password): \Appwrite\Models\User { @@ -396,16 +353,12 @@ public function updateEmail(string $email, string $password): \Appwrite\Models\U } return \Appwrite\Models\User::from($response); - } /** * Get the list of identities for the currently logged in user. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\IdentityList */ public function listIdentities(?array $queries = null, ?bool $total = null): \Appwrite\Models\IdentityList { @@ -441,15 +394,12 @@ public function listIdentities(?array $queries = null, ?bool $total = null): \Ap } return \Appwrite\Models\IdentityList::from($response); - } /** * Delete an identity by its unique ID. * - * @param string $identityId * @throws AppwriteException - * @return string */ public function deleteIdentity(string $identityId): string { @@ -466,25 +416,19 @@ public function deleteIdentity(string $identityId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get the list of latest security activity logs for the currently logged in * user. Each log returns user IP address, location and date and time of log. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\LogList */ public function listLogs(?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList { @@ -520,15 +464,12 @@ public function listLogs(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\LogList::from($response); - } /** * Enable or disable MFA on an account. * - * @param bool $mfa * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFA(bool $mfa): \Appwrite\Models\User { @@ -558,7 +499,6 @@ public function updateMFA(bool $mfa): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -567,15 +507,13 @@ public function updateMFA(bool $mfa): \Appwrite\Models\User * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) * method. * - * @param AuthenticatorType $type * @throws AppwriteException - * @return \Appwrite\Models\MfaType */ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Models\MfaType { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -599,7 +537,6 @@ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Model } return \Appwrite\Models\MfaType::from($response); - } /** @@ -607,16 +544,13 @@ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Model * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) * method. * - * @param AuthenticatorType $type - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFAAuthenticator(AuthenticatorType $type, string $otp): \Appwrite\Models\User { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -641,21 +575,18 @@ public function updateMFAAuthenticator(AuthenticatorType $type, string $otp): \A } return \Appwrite\Models\User::from($response); - } /** * Delete an authenticator for a user by ID. * - * @param AuthenticatorType $type * @throws AppwriteException - * @return string */ public function deleteMFAAuthenticator(AuthenticatorType $type): string { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -666,15 +597,12 @@ public function deleteMFAAuthenticator(AuthenticatorType $type): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -682,9 +610,7 @@ public function deleteMFAAuthenticator(AuthenticatorType $type): string * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) * method. * - * @param AuthenticationFactor $factor * @throws AppwriteException - * @return \Appwrite\Models\MfaChallenge */ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Models\MfaChallenge { @@ -714,7 +640,6 @@ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Mode } return \Appwrite\Models\MfaChallenge::from($response); - } /** @@ -724,10 +649,7 @@ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Mode * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) * method. * - * @param string $challengeId - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function updateMFAChallenge(string $challengeId, string $otp): \Appwrite\Models\Session { @@ -758,14 +680,12 @@ public function updateMFAChallenge(string $challengeId, string $otp): \Appwrite\ } return \Appwrite\Models\Session::from($response); - } /** * List the factors available on the account to be used as a MFA challange. * * @throws AppwriteException - * @return \Appwrite\Models\MfaFactors */ public function listMFAFactors(): \Appwrite\Models\MfaFactors { @@ -793,7 +713,6 @@ public function listMFAFactors(): \Appwrite\Models\MfaFactors } return \Appwrite\Models\MfaFactors::from($response); - } /** @@ -803,7 +722,6 @@ public function listMFAFactors(): \Appwrite\Models\MfaFactors * method. An OTP challenge is required to read recovery codes. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -831,18 +749,16 @@ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** - * Generate recovery codes as backup for MFA flow. It's recommended to + * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their * authehticator. Recovery codes can be used as a MFA verification type in * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) * method. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -871,7 +787,6 @@ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -881,7 +796,6 @@ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes * method. An OTP challenge is required to regenreate recovery codes. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function updateMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -910,15 +824,12 @@ public function updateMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** * Update currently logged in user account name. * - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateName(string $name): \Appwrite\Models\User { @@ -948,7 +859,6 @@ public function updateName(string $name): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -956,10 +866,7 @@ public function updateName(string $name): \Appwrite\Models\User * to pass in the new password, and the old password. For users created with * OAuth, Team Invites and Magic URL, oldPassword is optional. * - * @param string $password - * @param ?string $oldPassword * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePassword(string $password, ?string $oldPassword = null): \Appwrite\Models\User { @@ -993,20 +900,16 @@ public function updatePassword(string $password, ?string $oldPassword = null): \ } return \Appwrite\Models\User::from($response); - } /** - * Update the currently logged in user's phone number. After updating the + * Update the currently logged in user's phone number. After updating the * phone number, the phone verification status will be reset. A confirmation * SMS is not sent automatically, however you can use the [POST * /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) * endpoint to send a confirmation SMS. * - * @param string $phone - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhone(string $phone, string $password): \Appwrite\Models\User { @@ -1037,14 +940,12 @@ public function updatePhone(string $phone, string $password): \Appwrite\Models\U } return \Appwrite\Models\User::from($response); - } /** * Get the preferences as a key-value object for the currently logged in user. * * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(): \Appwrite\Models\Preferences { @@ -1072,7 +973,6 @@ public function getPrefs(): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** @@ -1080,9 +980,7 @@ public function getPrefs(): \Appwrite\Models\Preferences * stored as is, and replaces any previous value. The maximum allowed prefs * size is 64kB and throws error if exceeded. * - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePrefs(array $prefs): \Appwrite\Models\User { @@ -1112,7 +1010,6 @@ public function updatePrefs(array $prefs): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -1122,13 +1019,10 @@ public function updatePrefs(array $prefs): \Appwrite\Models\User * attached to the URL query string. Use the query string params to submit a * request to the [PUT * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) - * endpoint to complete the process. The verification link sent to the user's + * endpoint to complete the process. The verification link sent to the user's * email address is valid for 1 hour. * - * @param string $email - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createRecovery(string $email, string $url): \Appwrite\Models\Token { @@ -1159,7 +1053,6 @@ public function createRecovery(string $email, string $url): \Appwrite\Models\Tok } return \Appwrite\Models\Token::from($response); - } /** @@ -1168,17 +1061,13 @@ public function createRecovery(string $email, string $url): \Appwrite\Models\Tok * the redirect URL you have provided when sending your request to the [POST * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) * endpoint. - * + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. * - * @param string $userId - * @param string $secret - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updateRecovery(string $userId, string $secret, string $password): \Appwrite\Models\Token { @@ -1210,7 +1099,6 @@ public function updateRecovery(string $userId, string $secret, string $password) } return \Appwrite\Models\Token::from($response); - } /** @@ -1218,7 +1106,6 @@ public function updateRecovery(string $userId, string $secret, string $password) * logged in user. * * @throws AppwriteException - * @return \Appwrite\Models\SessionList */ public function listSessions(): \Appwrite\Models\SessionList { @@ -1246,7 +1133,6 @@ public function listSessions(): \Appwrite\Models\SessionList } return \Appwrite\Models\SessionList::from($response); - } /** @@ -1254,7 +1140,6 @@ public function listSessions(): \Appwrite\Models\SessionList * from the end client. * * @throws AppwriteException - * @return string */ public function deleteSessions(): string { @@ -1270,15 +1155,12 @@ public function deleteSessions(): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1291,7 +1173,6 @@ public function deleteSessions(): string * session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). * * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createAnonymousSession(): \Appwrite\Models\Session { @@ -1320,21 +1201,17 @@ public function createAnonymousSession(): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** * Allow the user to login into their account by providing a valid email and * password combination. This route will create a new session for the user. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param string $email - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createEmailPasswordSession(string $email, string $password): \Appwrite\Models\Session { @@ -1365,7 +1242,6 @@ public function createEmailPasswordSession(string $email, string $password): \Ap } return \Appwrite\Models\Session::from($response); - } /** @@ -1373,10 +1249,7 @@ public function createEmailPasswordSession(string $email, string $password): \Ap * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session * * @deprecated This API has been deprecated since 1.6.0. Please use `createSession` instead. * @see Account::createSession @@ -1410,7 +1283,6 @@ public function updateMagicURLSession(string $userId, string $secret): \Appwrite } return \Appwrite\Models\Session::from($response); - } /** @@ -1418,10 +1290,7 @@ public function updateMagicURLSession(string $userId, string $secret): \Appwrite * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session * * @deprecated This API has been deprecated since 1.6.0. Please use `createSession` instead. * @see Account::createSession @@ -1455,7 +1324,6 @@ public function updatePhoneSession(string $userId, string $secret): \Appwrite\Mo } return \Appwrite\Models\Session::from($response); - } /** @@ -1463,10 +1331,7 @@ public function updatePhoneSession(string $userId, string $secret): \Appwrite\Mo * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createSession(string $userId, string $secret): \Appwrite\Models\Session { @@ -1497,16 +1362,13 @@ public function createSession(string $userId, string $secret): \Appwrite\Models\ } return \Appwrite\Models\Session::from($response); - } /** - * Use this endpoint to get a logged in user's session using a Session ID. - * Inputting 'current' will return the current session being used. + * Use this endpoint to get a logged in user's session using a Session ID. + * Inputting 'current' will return the current session being used. * - * @param string $sessionId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function getSession(string $sessionId): \Appwrite\Models\Session { @@ -1535,17 +1397,14 @@ public function getSession(string $sessionId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** - * Use this endpoint to extend a session's length. Extending a session is + * Use this endpoint to extend a session's length. Extending a session is * useful when session expiry is short. If the session was created using an * OAuth provider, this endpoint refreshes the access token from the provider. * - * @param string $sessionId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function updateSession(string $sessionId): \Appwrite\Models\Session { @@ -1575,19 +1434,16 @@ public function updateSession(string $sessionId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** - * Logout the user. Use 'current' as the session ID to logout on this device, - * use a session ID to logout on another device. If you're looking to logout + * Logout the user. Use 'current' as the session ID to logout on this device, + * use a session ID to logout on another device. If you're looking to logout * the user on all devices, use [Delete * Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) * instead. * - * @param string $sessionId * @throws AppwriteException - * @return string */ public function deleteSession(string $sessionId): string { @@ -1604,15 +1460,12 @@ public function deleteSession(string $sessionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1621,7 +1474,6 @@ public function deleteSession(string $sessionId): string * completely delete a user, use the Users API instead. * * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateStatus(): \Appwrite\Models\User { @@ -1650,7 +1502,6 @@ public function updateStatus(): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -1661,19 +1512,14 @@ public function updateStatus(): \Appwrite\Models\User * email with the one-time password. Use the returned user ID and secret and * submit a request to the [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's email + * endpoint to complete the login process. The secret sent to the user's email * is valid for 15 minutes. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). - * * - * @param string $userId - * @param string $email - * @param ?bool $phrase * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createEmailToken(string $userId, string $email, ?bool $phrase = null): \Appwrite\Models\Token { @@ -1708,7 +1554,6 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = } return \Appwrite\Models\Token::from($response); - } /** @@ -1719,20 +1564,14 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = * query string. Use the query string parameters to submit a request to the * [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The link sent to the user's email + * endpoint to complete the login process. The link sent to the user's email * address is valid for 1 hour. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). - * * - * @param string $userId - * @param string $email - * @param ?string $url - * @param ?bool $phrase * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createMagicURLToken(string $userId, string $email, ?string $url = null, ?bool $phrase = null): \Appwrite\Models\Token { @@ -1771,37 +1610,31 @@ public function createMagicURLToken(string $userId, string $email, ?string $url } return \Appwrite\Models\Token::from($response); - } /** * Allow the user to login to their account using the OAuth2 provider of their * choice. Each OAuth2 provider should be enabled from the Appwrite console - * first. Use the success and failure arguments to provide a redirect URL's - * back to your app when login is completed. - * + * first. Use the success and failure arguments to provide a redirect URL's + * back to your app when login is completed. + * * If authentication succeeds, `userId` and `secret` of a token will be * appended to the success URL as query parameters. These can be used to * create a new session using the [Create * session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param OAuthProvider $provider - * @param ?string $success - * @param ?string $failure - * @param ?array $scopes * @throws AppwriteException - * @return string */ public function createOAuth2Token(OAuthProvider $provider, ?string $success = null, ?string $failure = null, ?array $scopes = null): string { $apiPath = str_replace( ['{provider}'], - [$provider], + [(string) $provider], '/account/tokens/oauth2/{provider}' ); @@ -1824,15 +1657,13 @@ public function createOAuth2Token(OAuthProvider $provider, ?string $success = nu $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'text/html'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, - $apiParams, 'location' + $apiParams, + 'location' ); - - return $response; - } /** @@ -1840,17 +1671,14 @@ public function createOAuth2Token(OAuthProvider $provider, ?string $success = nu * provided user ID has not be registered, a new user will be created. Use the * returned user ID and secret and submit a request to the [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's phone + * endpoint to complete the login process. The secret sent to the user's phone * is valid for 15 minutes. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param string $userId - * @param string $phone * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createPhoneToken(string $userId, string $phone): \Appwrite\Models\Token { @@ -1881,7 +1709,6 @@ public function createPhoneToken(string $userId, string $phone): \Appwrite\Model } return \Appwrite\Models\Token::from($response); - } /** @@ -1893,17 +1720,14 @@ public function createPhoneToken(string $userId, string $phone): \Appwrite\Model * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). - * The verification link sent to the user's email address is valid for 7 days. - * + * The verification link sent to the user's email address is valid for 7 days. + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. - * * - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createEmailVerification(string $url): \Appwrite\Models\Token { @@ -1933,7 +1757,6 @@ public function createEmailVerification(string $url): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** @@ -1945,17 +1768,14 @@ public function createEmailVerification(string $url): \Appwrite\Models\Token * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). - * The verification link sent to the user's email address is valid for 7 days. - * + * The verification link sent to the user's email address is valid for 7 days. + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. - * * - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token * * @deprecated This API has been deprecated since 1.8.0. Please use `createEmailVerification` instead. * @see Account::createEmailVerification @@ -1988,7 +1808,6 @@ public function createVerification(string $url): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** @@ -1997,10 +1816,7 @@ public function createVerification(string $url): \Appwrite\Models\Token * to verify the user email ownership. If confirmed this route will return a * 200 status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updateEmailVerification(string $userId, string $secret): \Appwrite\Models\Token { @@ -2031,7 +1847,6 @@ public function updateEmailVerification(string $userId, string $secret): \Appwri } return \Appwrite\Models\Token::from($response); - } /** @@ -2040,10 +1855,7 @@ public function updateEmailVerification(string $userId, string $secret): \Appwri * to verify the user email ownership. If confirmed this route will return a * 200 status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEmailVerification` instead. * @see Account::updateEmailVerification @@ -2077,21 +1889,19 @@ public function updateVerification(string $userId, string $secret): \Appwrite\Mo } return \Appwrite\Models\Token::from($response); - } /** * Use this endpoint to send a verification SMS to the currently logged in - * user. This endpoint is meant for use after updating a user's phone number + * user. This endpoint is meant for use after updating a user's phone number * using the * [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) * endpoint. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). - * The verification code sent to the user's phone number is valid for 15 + * The verification code sent to the user's phone number is valid for 15 * minutes. * * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createPhoneVerification(): \Appwrite\Models\Token { @@ -2120,19 +1930,15 @@ public function createPhoneVerification(): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** * Use this endpoint to complete the user phone verification process. Use the - * **userId** and **secret** that were sent to your user's phone number to + * **userId** and **secret** that were sent to your user's phone number to * verify the user email ownership. If confirmed this route will return a 200 * status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updatePhoneVerification(string $userId, string $secret): \Appwrite\Models\Token { @@ -2163,6 +1969,5 @@ public function updatePhoneVerification(string $userId, string $secret): \Appwri } return \Appwrite\Models\Token::from($response); - } } diff --git a/src/Appwrite/Services/Activities.php b/src/Appwrite/Services/Activities.php index 925c4c23..4cb0ebb3 100644 --- a/src/Appwrite/Services/Activities.php +++ b/src/Appwrite/Services/Activities.php @@ -1,25 +1,19 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List the insights produced under a single analyzer report. You can use the * query params to filter your results further. - * * - * @param string $reportId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\InsightList */ public function listInsights(string $reportId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\InsightList { @@ -181,17 +157,12 @@ public function listInsights(string $reportId, ?array $queries = null, ?bool $to } return \Appwrite\Models\InsightList::from($response); - } /** * Get an insight by its unique ID, scoped to its parent report. - * * - * @param string $reportId - * @param string $insightId * @throws AppwriteException - * @return \Appwrite\Models\Insight */ public function getInsight(string $reportId, string $insightId): \Appwrite\Models\Insight { @@ -221,6 +192,5 @@ public function getInsight(string $reportId, string $insightId): \Appwrite\Model } return \Appwrite\Models\Insight::from($response); - } } diff --git a/src/Appwrite/Services/Apps.php b/src/Appwrite/Services/Apps.php index 69b47975..8f9405dd 100644 --- a/src/Appwrite/Services/Apps.php +++ b/src/Appwrite/Services/Apps.php @@ -1,26 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -457,11 +394,7 @@ public function delete(string $appId): string * `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller * with update access to the app. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -498,7 +431,6 @@ public function listInstallations(string $appId, ?array $queries = null, ?bool $ } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -506,10 +438,7 @@ public function listInstallations(string $appId, ?array $queries = null, ?bool $ * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, * or a caller with update access to the app. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $appId, string $installationId): \Appwrite\Models\AppInstallation { @@ -539,7 +468,6 @@ public function getInstallation(string $appId, string $installationId): \Appwrit } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -547,10 +475,7 @@ public function getInstallation(string $appId, string $installationId): \Appwrit * caller with update access to the app. Previously issued installation access * tokens are revoked. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $appId, string $installationId): string { @@ -569,15 +494,12 @@ public function deleteInstallation(string $appId, string $installationId): strin $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -590,10 +512,7 @@ public function deleteInstallation(string $appId, string $installationId): strin * once; each token stays valid until it expires or the installation is * updated or deleted. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\Oauth2Token */ public function createInstallationToken(string $appId, string $installationId): \Appwrite\Models\Oauth2Token { @@ -624,17 +543,12 @@ public function createInstallationToken(string $appId, string $installationId): } return \Appwrite\Models\Oauth2Token::from($response); - } /** * List app keys for an application. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppKeyList */ public function listKeys(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppKeyList { @@ -671,17 +585,14 @@ public function listKeys(string $appId, ?array $queries = null, ?bool $total = n } return \Appwrite\Models\AppKeyList::from($response); - } /** * 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. + * list the application's installations and create installation access tokens. * - * @param string $appId * @throws AppwriteException - * @return \Appwrite\Models\AppKey */ public function createKey(string $appId): \Appwrite\Models\AppKey { @@ -711,16 +622,12 @@ public function createKey(string $appId): \Appwrite\Models\AppKey } return \Appwrite\Models\AppKey::from($response); - } /** * Get an app key by its unique ID. * - * @param string $appId - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\AppKey */ public function getKey(string $appId, string $keyId): \Appwrite\Models\AppKey { @@ -750,16 +657,12 @@ public function getKey(string $appId, string $keyId): \Appwrite\Models\AppKey } return \Appwrite\Models\AppKey::from($response); - } /** * Delete an app key by its unique ID. * - * @param string $appId - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $appId, string $keyId): string { @@ -778,15 +681,12 @@ public function deleteKey(string $appId, string $keyId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -794,10 +694,7 @@ public function deleteKey(string $appId, string $keyId): string * a server SDK using a project API key can set them. Replaces the previous * labels. * - * @param string $appId - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\App */ public function updateLabels(string $appId, array $labels): \Appwrite\Models\App { @@ -828,17 +725,12 @@ public function updateLabels(string $appId, array $labels): \Appwrite\Models\App } return \Appwrite\Models\App::from($response); - } /** * List client secrets for an application. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppSecretList */ public function listSecrets(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppSecretList { @@ -875,15 +767,12 @@ public function listSecrets(string $appId, ?array $queries = null, ?bool $total } return \Appwrite\Models\AppSecretList::from($response); - } /** * Create a new client secret for an application. * - * @param string $appId * @throws AppwriteException - * @return \Appwrite\Models\AppSecretPlaintext */ public function createSecret(string $appId): \Appwrite\Models\AppSecretPlaintext { @@ -913,16 +802,12 @@ public function createSecret(string $appId): \Appwrite\Models\AppSecretPlaintext } return \Appwrite\Models\AppSecretPlaintext::from($response); - } /** * Get an application client secret by its unique ID. * - * @param string $appId - * @param string $secretId * @throws AppwriteException - * @return \Appwrite\Models\AppSecret */ public function getSecret(string $appId, string $secretId): \Appwrite\Models\AppSecret { @@ -952,16 +837,12 @@ public function getSecret(string $appId, string $secretId): \Appwrite\Models\App } return \Appwrite\Models\AppSecret::from($response); - } /** * Delete an application client secret by its unique ID. * - * @param string $appId - * @param string $secretId * @throws AppwriteException - * @return string */ public function deleteSecret(string $appId, string $secretId): string { @@ -980,24 +861,18 @@ public function deleteSecret(string $appId, string $secretId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Transfer an application to another team by its unique ID. * - * @param string $appId - * @param string $teamId * @throws AppwriteException - * @return \Appwrite\Models\App */ public function updateTeam(string $appId, string $teamId): \Appwrite\Models\App { @@ -1028,15 +903,12 @@ public function updateTeam(string $appId, string $teamId): \Appwrite\Models\App } return \Appwrite\Models\App::from($response); - } /** * Revoke all tokens for an application by its unique ID. * - * @param string $appId * @throws AppwriteException - * @return string */ public function deleteTokens(string $appId): string { @@ -1054,14 +926,11 @@ public function deleteTokens(string $appId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index 3417a6d0..13a6ac23 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -1,50 +1,40 @@ client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * The credit card endpoint will return you the icon of the credit card * provider you need. Use width, height and quality arguments to change the * output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param CreditCard $code - * @param ?int $width - * @param ?int $height - * @param ?int $quality * @throws AppwriteException - * @return string */ public function getCreditCard(CreditCard $code, ?int $width = null, ?int $height = null, ?int $quality = null): string { $apiPath = str_replace( ['{code}'], - [$code], + [(string) $code], '/avatars/credit-cards/{code}' ); @@ -123,26 +104,21 @@ public function getCreditCard(CreditCard $code, ?int $width = null, ?int $height $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote * website URL. - * + * * This endpoint does not follow HTTP redirects. * - * @param string $url * @throws AppwriteException - * @return string */ public function getFavicon(string $url): string { @@ -159,15 +135,12 @@ public function getFavicon(string $url): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -175,25 +148,19 @@ public function getFavicon(string $url): string * users. The code argument receives the 2 letter country code. Use width, * height and quality arguments to change the output settings. Country codes * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param Flag $code - * @param ?int $width - * @param ?int $height - * @param ?int $quality * @throws AppwriteException - * @return string */ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?int $quality = null): string { $apiPath = str_replace( ['{code}'], - [$code], + [(string) $code], '/avatars/flags/{code}' ); @@ -216,15 +183,12 @@ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?in $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -232,19 +196,15 @@ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?in * you want. This endpoint is very useful if you need to crop and display * remote images in your app or in case you want to make sure a 3rd party * image is properly served using a TLS protocol. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 400x400px. - * + * * This endpoint does not follow HTTP redirects. * - * @param string $url - * @param ?int $width - * @param ?int $height * @throws AppwriteException - * @return string */ public function getImage(string $url, ?int $width = null, ?int $height = null): string { @@ -269,41 +229,32 @@ public function getImage(string $url, ?int $width = null, ?int $height = null): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to show your user initials avatar icon on your website or * app. By default, this route will try to print your logged-in user name or - * email initials. You can also overwrite the user name if you pass the 'name' + * email initials. You can also overwrite the user name if you pass the 'name' * parameter. If no name is given and no user is logged, an empty avatar will * be returned. - * + * * You can use the color and background params to change the avatar colors. By * default, a random theme will be selected. The random theme will persist for - * the user's initials when reloading the same theme will always return for + * the user's initials when reloading the same theme will always return for * the same initials. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param ?string $name - * @param ?int $width - * @param ?int $height - * @param ?string $background * @throws AppwriteException - * @return string */ public function getInitials(?string $name = null, ?int $width = null, ?int $height = null, ?string $background = null): string { @@ -335,28 +286,69 @@ public function getInitials(?string $name = null, ?int $width = null, ?int $heig $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); + } - return $response; + /** + * Returns the best available profile photo for the currently authenticated + * user. The endpoint tries each source in priority order and returns the + * first successful result: OAuth2 identity photo, Gravatar, Libravatar, + * Appwrite Initials, built-in static fallback. + * + * @throws AppwriteException + */ + public function getPhoto(?int $width = null, ?int $height = null, ?int $quality = null, ?string $output = null, ?string $rating = null): string + { + $apiPath = str_replace( + [], + [], + '/avatars/photo' + ); + + $apiParams = []; + if (!is_null($width)) { + $apiParams['width'] = $width; + } + + if (!is_null($height)) { + $apiParams['height'] = $height; + } + + if (!is_null($quality)) { + $apiParams['quality'] = $quality; + } + + if (!is_null($output)) { + $apiParams['output'] = $output; + } + + if (!is_null($rating)) { + $apiParams['rating'] = $rating; + } + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'image/*'; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); } /** * Converts a given plain text to a QR code image. You can use the query * parameters to change the size and style of the resulting image. - * * - * @param string $text - * @param ?int $size - * @param ?int $margin - * @param ?bool $download * @throws AppwriteException - * @return string */ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?bool $download = null): string { @@ -385,51 +377,27 @@ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?boo $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to capture a screenshot of any website URL. This endpoint * uses a headless browser to render the webpage and capture it as an image. - * + * * You can configure the browser viewport size, theme, user agent, * geolocation, permissions, and more. Capture either just the viewport or the * full page scroll. - * + * * When width and height are specified, the image is resized accordingly. If * both dimensions are 0, the API provides an image at original size. If * dimensions are not specified, the default viewport size is 1280x720px. * - * @param string $url - * @param ?array $headers - * @param ?int $viewportWidth - * @param ?int $viewportHeight - * @param ?float $scale - * @param ?BrowserTheme $theme - * @param ?string $userAgent - * @param ?bool $fullpage - * @param ?string $locale - * @param ?Timezone $timezone - * @param ?float $latitude - * @param ?float $longitude - * @param ?float $accuracy - * @param ?bool $touch - * @param ?array $permissions - * @param ?int $sleep - * @param ?int $width - * @param ?int $height - * @param ?int $quality - * @param ?ImageFormat $output * @throws AppwriteException - * @return string */ public function getScreenshot(string $url, ?array $headers = null, ?int $viewportWidth = null, ?int $viewportHeight = null, ?float $scale = null, ?BrowserTheme $theme = null, ?string $userAgent = null, ?bool $fullpage = null, ?string $locale = null, ?Timezone $timezone = null, ?float $latitude = null, ?float $longitude = null, ?float $accuracy = null, ?bool $touch = null, ?array $permissions = null, ?int $sleep = null, ?int $width = null, ?int $height = null, ?int $quality = null, ?ImageFormat $output = null): string { @@ -522,14 +490,11 @@ public function getScreenshot(string $url, ?array $headers = null, ?int $viewpor $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index ce513ff4..abdfecc1 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -1,26 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List all policies for a project. * - * @param ?array $queries * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicyList */ public function listPolicies(?array $queries = null): \Appwrite\Models\BackupPolicyList { @@ -203,21 +181,12 @@ public function listPolicies(?array $queries = null): \Appwrite\Models\BackupPol } return \Appwrite\Models\BackupPolicyList::from($response); - } /** * Create a new backup policy. * - * @param string $policyId - * @param array $services - * @param int $retention - * @param string $schedule - * @param ?string $name - * @param ?string $resourceId - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function createPolicy(string $policyId, array $services, int $retention, string $schedule, ?string $name = null, ?string $resourceId = null, ?bool $enabled = null): \Appwrite\Models\BackupPolicy { @@ -259,15 +228,12 @@ public function createPolicy(string $policyId, array $services, int $retention, } return \Appwrite\Models\BackupPolicy::from($response); - } /** - * Get a backup policy using it's ID. + * Get a backup policy using it's ID. * - * @param string $policyId * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function getPolicy(string $policyId): \Appwrite\Models\BackupPolicy { @@ -296,19 +262,12 @@ public function getPolicy(string $policyId): \Appwrite\Models\BackupPolicy } return \Appwrite\Models\BackupPolicy::from($response); - } /** - * Update an existing policy using it's ID. + * Update an existing policy using it's ID. * - * @param string $policyId - * @param ?string $name - * @param ?int $retention - * @param ?string $schedule - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function updatePolicy(string $policyId, ?string $name = null, ?int $retention = null, ?string $schedule = null, ?bool $enabled = null): \Appwrite\Models\BackupPolicy { @@ -345,15 +304,12 @@ public function updatePolicy(string $policyId, ?string $name = null, ?int $reten } return \Appwrite\Models\BackupPolicy::from($response); - } /** - * Delete a policy using it's ID. + * Delete a policy using it's ID. * - * @param string $policyId * @throws AppwriteException - * @return string */ public function deletePolicy(string $policyId): string { @@ -371,33 +327,30 @@ public function deletePolicy(string $policyId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create and trigger a new restoration for a backup on a project. - * + * * For a backup of one database, the restoration resolves its destination * before it is queued. When `newResourceId` is omitted, the archived database * is restored in place and its own ID is returned in `options`. Pass a * different `newResourceId` to restore alongside it as a new database * instead. - * + * * The restoration migration records the archived database in `resourceId` and * `resourceType`, and the resolved database in `destinationResourceId` and * `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)`, @@ -405,23 +358,17 @@ public function deletePolicy(string $policyId): string * 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 from a dedicated source, * the restore provisions a fresh dedicated backing database at the source - * database's own specification and lands the data there. An in-place restore + * database's own specification and lands the data there. An in-place restore * swaps the database onto that backing only once the restore has succeeded, * and retires the backing it displaced only once that swap is confirmed, so * the source keeps serving its own data until the restored data is in place * and any failure leaves it untouched. A serverless source has no dedicated * backing to clone and restores onto the archived database instead. - * * - * @param string $archiveId - * @param array $services - * @param ?string $newResourceId - * @param ?string $newResourceName * @throws AppwriteException - * @return \Appwrite\Models\BackupRestoration */ public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null): \Appwrite\Models\BackupRestoration { @@ -460,15 +407,12 @@ public function createRestoration(string $archiveId, array $services, ?string $n } return \Appwrite\Models\BackupRestoration::from($response); - } /** * List all backup restorations for a project. * - * @param ?array $queries * @throws AppwriteException - * @return \Appwrite\Models\BackupRestorationList */ public function listRestorations(?array $queries = null): \Appwrite\Models\BackupRestorationList { @@ -500,15 +444,12 @@ public function listRestorations(?array $queries = null): \Appwrite\Models\Backu } return \Appwrite\Models\BackupRestorationList::from($response); - } /** * Get the current status of a backup restoration. * - * @param string $restorationId * @throws AppwriteException - * @return \Appwrite\Models\BackupRestoration */ public function getRestoration(string $restorationId): \Appwrite\Models\BackupRestoration { @@ -537,6 +478,5 @@ public function getRestoration(string $restorationId): \Appwrite\Models\BackupRe } return \Appwrite\Models\BackupRestoration::from($response); - } } diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index 8c7d3a33..496da695 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -1,32 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create multiple operations in a single transaction. * - * @param string $transactionId - * @param ?array $operations * @throws AppwriteException - * @return \Appwrite\Models\Transaction * * @deprecated This API has been deprecated since 1.8.0. Please use `createOperations` instead. * @see TablesDB::createOperations @@ -378,16 +340,13 @@ public function createOperations(string $transactionId, ?array $operations = nul } return \Appwrite\Models\Transaction::from($response); - } /** * Get a database by its unique ID. This endpoint response returns a JSON * object with the database metadata. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\Database * * @deprecated This API has been deprecated since 1.8.0. Please use `get` instead. * @see TablesDB::get @@ -419,17 +378,12 @@ public function get(string $databaseId): \Appwrite\Models\Database } return \Appwrite\Models\Database::from($response); - } /** * Update a database by its unique ID. * - * @param string $databaseId - * @param ?string $name - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Database * * @deprecated This API has been deprecated since 1.8.0. Please use `update` instead. * @see TablesDB::update @@ -470,16 +424,13 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled } return \Appwrite\Models\Database::from($response); - } /** * Delete a database by its unique ID. Only API keys with with databases.write * scope can delete a database. * - * @param string $databaseId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `delete` instead. * @see TablesDB::delete @@ -499,27 +450,19 @@ public function delete(string $databaseId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all collections that belong to the provided databaseId. You * can use the search parameter to filter your results. * - * @param string $databaseId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\CollectionList * * @deprecated This API has been deprecated since 1.8.0. Please use `listTables` instead. * @see TablesDB::listTables @@ -563,7 +506,6 @@ public function listCollections(string $databaseId, ?array $queries = null, ?str } return \Appwrite\Models\CollectionList::from($response); - } /** @@ -572,16 +514,7 @@ public function listCollections(string $databaseId, ?array $queries = null, ?str * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $name - * @param ?array $permissions - * @param ?bool $documentSecurity - * @param ?bool $enabled - * @param ?array $attributes - * @param ?array $indexes * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `createTable` instead. * @see TablesDB::createTable @@ -633,17 +566,13 @@ public function createCollection(string $databaseId, string $collectionId, strin } return \Appwrite\Models\Collection::from($response); - } /** * Get a collection by its unique ID. This endpoint response returns a JSON * object with the collection metadata. * - * @param string $databaseId - * @param string $collectionId * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `getTable` instead. * @see TablesDB::getTable @@ -676,21 +605,12 @@ public function getCollection(string $databaseId, string $collectionId): \Appwri } return \Appwrite\Models\Collection::from($response); - } /** * Update a collection by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param ?string $name - * @param ?array $permissions - * @param ?bool $documentSecurity - * @param ?bool $enabled - * @param ?bool $purge * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTable` instead. * @see TablesDB::updateTable @@ -741,17 +661,13 @@ public function updateCollection(string $databaseId, string $collectionId, ?stri } return \Appwrite\Models\Collection::from($response); - } /** * Delete a collection by its unique ID. Only users with write permissions * have access to delete this resource. * - * @param string $databaseId - * @param string $collectionId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteTable` instead. * @see TablesDB::deleteTable @@ -772,26 +688,18 @@ public function deleteCollection(string $databaseId, string $collectionId): stri $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List attributes in the collection. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AttributeList * * @deprecated This API has been deprecated since 1.8.0. Please use `listColumns` instead. * @see TablesDB::listColumns @@ -832,24 +740,13 @@ public function listAttributes(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\AttributeList::from($response); - } /** * Create a bigint attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeBigint * * @deprecated This API has been deprecated since 1.8.0. Please use `createBigIntColumn` instead. * @see TablesDB::createBigIntColumn @@ -892,24 +789,13 @@ public function createBigIntAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBigint::from($response); - } /** * Update a bigint attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeBigint * * @deprecated This API has been deprecated since 1.8.0. Please use `updateBigIntColumn` instead. * @see TablesDB::updateBigIntColumn @@ -949,21 +835,12 @@ public function updateBigIntAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBigint::from($response); - } /** * Create a boolean attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean * * @deprecated This API has been deprecated since 1.8.0. Please use `createBooleanColumn` instead. * @see TablesDB::createBooleanColumn @@ -1004,21 +881,13 @@ public function createBooleanAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBoolean::from($response); - } /** * Update a boolean attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean * * @deprecated This API has been deprecated since 1.8.0. Please use `updateBooleanColumn` instead. * @see TablesDB::updateBooleanColumn @@ -1056,20 +925,12 @@ public function updateBooleanAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBoolean::from($response); - } /** * Create a date time attribute according to the ISO 8601 standard. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeDatetime * * @deprecated This API has been deprecated since 1.8.0. Please use `createDatetimeColumn` instead. * @see TablesDB::createDatetimeColumn @@ -1110,21 +971,13 @@ public function createDatetimeAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeDatetime::from($response); - } /** * Update a date time attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeDatetime * * @deprecated This API has been deprecated since 1.8.0. Please use `updateDatetimeColumn` instead. * @see TablesDB::updateDatetimeColumn @@ -1162,21 +1015,12 @@ public function updateDatetimeAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeDatetime::from($response); - } /** * Create an email attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeEmail * * @deprecated This API has been deprecated since 1.8.0. Please use `createEmailColumn` instead. * @see TablesDB::createEmailColumn @@ -1217,22 +1061,13 @@ public function createEmailAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeEmail::from($response); - } /** * Update an email attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeEmail * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEmailColumn` instead. * @see TablesDB::updateEmailColumn @@ -1270,23 +1105,13 @@ public function updateEmailAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeEmail::from($response); - } /** * Create an enum attribute. The `elements` param acts as a white-list of - * accepted values for this attribute. - * + * accepted values for this attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeEnum * * @deprecated This API has been deprecated since 1.8.0. Please use `createEnumColumn` instead. * @see TablesDB::createEnumColumn @@ -1328,23 +1153,13 @@ public function createEnumAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeEnum::from($response); - } /** * Update an enum attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeEnum * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEnumColumn` instead. * @see TablesDB::updateEnumColumn @@ -1383,24 +1198,13 @@ public function updateEnumAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeEnum::from($response); - } /** * Create a float attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?float $min - * @param ?float $max - * @param ?float $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeFloat * * @deprecated This API has been deprecated since 1.8.0. Please use `createFloatColumn` instead. * @see TablesDB::createFloatColumn @@ -1443,24 +1247,13 @@ public function createFloatAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeFloat::from($response); - } /** * Update a float attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?float $xdefault - * @param ?float $min - * @param ?float $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeFloat * * @deprecated This API has been deprecated since 1.8.0. Please use `updateFloatColumn` instead. * @see TablesDB::updateFloatColumn @@ -1500,24 +1293,13 @@ public function updateFloatAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeFloat::from($response); - } /** * Create an integer attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeInteger * * @deprecated This API has been deprecated since 1.8.0. Please use `createIntegerColumn` instead. * @see TablesDB::createIntegerColumn @@ -1560,24 +1342,13 @@ public function createIntegerAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeInteger::from($response); - } /** * Update an integer attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeInteger * * @deprecated This API has been deprecated since 1.8.0. Please use `updateIntegerColumn` instead. * @see TablesDB::updateIntegerColumn @@ -1617,21 +1388,12 @@ public function updateIntegerAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeInteger::from($response); - } /** * Create IP address attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeIp * * @deprecated This API has been deprecated since 1.8.0. Please use `createIpColumn` instead. * @see TablesDB::createIpColumn @@ -1672,22 +1434,13 @@ public function createIpAttribute(string $databaseId, string $collectionId, stri } return \Appwrite\Models\AttributeIp::from($response); - } /** * Update an ip attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeIp * * @deprecated This API has been deprecated since 1.8.0. Please use `updateIpColumn` instead. * @see TablesDB::updateIpColumn @@ -1725,19 +1478,12 @@ public function updateIpAttribute(string $databaseId, string $collectionId, stri } return \Appwrite\Models\AttributeIp::from($response); - } /** * Create a geometric line attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributeLine * * @deprecated This API has been deprecated since 1.8.0. Please use `createLineColumn` instead. * @see TablesDB::createLineColumn @@ -1774,21 +1520,13 @@ public function createLineAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeLine::from($response); - } /** * Update a line attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeLine * * @deprecated This API has been deprecated since 1.8.0. Please use `updateLineColumn` instead. * @see TablesDB::updateLineColumn @@ -1826,22 +1564,12 @@ public function updateLineAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeLine::from($response); - } /** * Create a longtext attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeLongtext * * @deprecated This API has been deprecated since 1.8.0. Please use `createLongtextColumn` instead. * @see TablesDB::createLongtextColumn @@ -1886,22 +1614,13 @@ public function createLongtextAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeLongtext::from($response); - } /** * Update a longtext attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeLongtext * * @deprecated This API has been deprecated since 1.8.0. Please use `updateLongtextColumn` instead. * @see TablesDB::updateLongtextColumn @@ -1939,22 +1658,12 @@ public function updateLongtextAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeLongtext::from($response); - } /** * Create a mediumtext attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeMediumtext * * @deprecated This API has been deprecated since 1.8.0. Please use `createMediumtextColumn` instead. * @see TablesDB::createMediumtextColumn @@ -1999,22 +1708,13 @@ public function createMediumtextAttribute(string $databaseId, string $collection } return \Appwrite\Models\AttributeMediumtext::from($response); - } /** * Update a mediumtext attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeMediumtext * * @deprecated This API has been deprecated since 1.8.0. Please use `updateMediumtextColumn` instead. * @see TablesDB::updateMediumtextColumn @@ -2052,19 +1752,12 @@ public function updateMediumtextAttribute(string $databaseId, string $collection } return \Appwrite\Models\AttributeMediumtext::from($response); - } /** * Create a geometric point attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributePoint * * @deprecated This API has been deprecated since 1.8.0. Please use `createPointColumn` instead. * @see TablesDB::createPointColumn @@ -2101,21 +1794,13 @@ public function createPointAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributePoint::from($response); - } /** * Update a point attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributePoint * * @deprecated This API has been deprecated since 1.8.0. Please use `updatePointColumn` instead. * @see TablesDB::updatePointColumn @@ -2153,19 +1838,12 @@ public function updatePointAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributePoint::from($response); - } /** * Create a geometric polygon attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributePolygon * * @deprecated This API has been deprecated since 1.8.0. Please use `createPolygonColumn` instead. * @see TablesDB::createPolygonColumn @@ -2202,21 +1880,13 @@ public function createPolygonAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributePolygon::from($response); - } /** * Update a polygon attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributePolygon * * @deprecated This API has been deprecated since 1.8.0. Please use `updatePolygonColumn` instead. * @see TablesDB::updatePolygonColumn @@ -2254,24 +1924,13 @@ public function updatePolygonAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributePolygon::from($response); - } /** * Create relationship attribute. [Learn more about relationship * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * * - * @param string $databaseId - * @param string $collectionId - * @param string $relatedCollectionId - * @param RelationshipType $type - * @param ?bool $twoWay - * @param ?string $key - * @param ?string $twoWayKey - * @param ?RelationMutate $onDelete * @throws AppwriteException - * @return \Appwrite\Models\AttributeRelationship * * @deprecated This API has been deprecated since 1.8.0. Please use `createRelationshipColumn` instead. * @see TablesDB::createRelationshipColumn @@ -2317,21 +1976,13 @@ public function createRelationshipAttribute(string $databaseId, string $collecti } return \Appwrite\Models\AttributeRelationship::from($response); - } /** * Update relationship attribute. [Learn more about relationship * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param ?RelationMutate $onDelete - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeRelationship * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRelationshipColumn` instead. * @see TablesDB::updateRelationshipColumn @@ -2371,23 +2022,12 @@ public function updateRelationshipAttribute(string $databaseId, string $collecti } return \Appwrite\Models\AttributeRelationship::from($response); - } /** * Create a string attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `createStringColumn` instead. * @see TablesDB::createStringColumn @@ -2433,23 +2073,13 @@ public function createStringAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeString::from($response); - } /** * Update a string attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `updateStringColumn` instead. * @see TablesDB::updateStringColumn @@ -2488,22 +2118,12 @@ public function updateStringAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeString::from($response); - } /** * Create a text attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeText * * @deprecated This API has been deprecated since 1.8.0. Please use `createTextColumn` instead. * @see TablesDB::createTextColumn @@ -2548,22 +2168,13 @@ public function createTextAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeText::from($response); - } /** * Update a text attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeText * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTextColumn` instead. * @see TablesDB::updateTextColumn @@ -2601,21 +2212,12 @@ public function updateTextAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeText::from($response); - } /** * Create a URL attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeUrl * * @deprecated This API has been deprecated since 1.8.0. Please use `createUrlColumn` instead. * @see TablesDB::createUrlColumn @@ -2656,22 +2258,13 @@ public function createUrlAttribute(string $databaseId, string $collectionId, str } return \Appwrite\Models\AttributeUrl::from($response); - } /** * Update an url attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeUrl * * @deprecated This API has been deprecated since 1.8.0. Please use `updateUrlColumn` instead. * @see TablesDB::updateUrlColumn @@ -2709,23 +2302,12 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str } return \Appwrite\Models\AttributeUrl::from($response); - } /** * Create a varchar attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeVarchar * * @deprecated This API has been deprecated since 1.8.0. Please use `createVarcharColumn` instead. * @see TablesDB::createVarcharColumn @@ -2771,23 +2353,13 @@ public function createVarcharAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeVarchar::from($response); - } /** * Update a varchar attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeVarchar * * @deprecated This API has been deprecated since 1.8.0. Please use `updateVarcharColumn` instead. * @see TablesDB::updateVarcharColumn @@ -2826,17 +2398,12 @@ public function updateVarcharAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeVarchar::from($response); - } /** * Get attribute by ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean|\Appwrite\Models\AttributeInteger|\Appwrite\Models\AttributeFloat|\Appwrite\Models\AttributeEmail|\Appwrite\Models\AttributeEnum|\Appwrite\Models\AttributeUrl|\Appwrite\Models\AttributeIp|\Appwrite\Models\AttributeDatetime|\Appwrite\Models\AttributeRelationship|\Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `getColumn` instead. * @see TablesDB::getColumn @@ -2910,17 +2477,12 @@ public function getAttribute(string $databaseId, string $collectionId, string $k } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Deletes an attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteColumn` instead. * @see TablesDB::deleteColumn @@ -2942,29 +2504,19 @@ public function deleteAttribute(string $databaseId, string $collectionId, string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** - * Get a list of all the user's documents in a given collection. You can use + * Get a list of all the user's documents in a given collection. You can use * the query params to filter your results. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?string $transactionId - * @param ?bool $total - * @param ?int $ttl * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `listRows` instead. * @see TablesDB::listRows @@ -3013,7 +2565,6 @@ public function listDocuments(string $databaseId, string $collectionId, ?array $ } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3022,14 +2573,7 @@ public function listDocuments(string $databaseId, string $collectionId, ?array $ * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `createRow` instead. * @see TablesDB::createRow @@ -3067,7 +2611,6 @@ public function createDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** @@ -3076,12 +2619,7 @@ public function createDocument(string $databaseId, string $collectionId, string * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param array $documents - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `createRows` instead. * @see TablesDB::createRows @@ -3117,7 +2655,6 @@ public function createDocuments(string $databaseId, string $collectionId, array } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3125,14 +2662,8 @@ public function createDocuments(string $databaseId, string $collectionId, array * new collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. - * * - * @param string $databaseId - * @param string $collectionId - * @param array $documents - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `upsertRows` instead. * @see TablesDB::upsertRows @@ -3168,7 +2699,6 @@ public function upsertDocuments(string $databaseId, string $collectionId, array } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3176,13 +2706,7 @@ public function upsertDocuments(string $databaseId, string $collectionId, array * then all documents are updated. You can pass only specific fields to be * updated. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $data - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRows` instead. * @see TablesDB::updateRows @@ -3225,19 +2749,13 @@ public function updateDocuments(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\DocumentList::from($response); - } /** * Bulk delete documents using queries, if no queries are passed then all * documents are deleted. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteRows` instead. * @see TablesDB::deleteRows @@ -3279,20 +2797,13 @@ public function deleteDocuments(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\DocumentList::from($response); - } /** * Get a document by its unique ID. This endpoint response returns a JSON * object with the document data. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `getRow` instead. * @see TablesDB::getRow @@ -3334,7 +2845,6 @@ public function getDocument(string $databaseId, string $collectionId, string $do } return \Appwrite\Models\Document::from($response); - } /** @@ -3343,14 +2853,7 @@ public function getDocument(string $databaseId, string $collectionId, string $do * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `upsertRow` instead. * @see TablesDB::upsertRow @@ -3391,21 +2894,13 @@ public function upsertDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** * Update a document by its unique ID. Using the patch method you can pass * only specific fields that will get updated. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRow` instead. * @see TablesDB::updateRow @@ -3446,18 +2941,12 @@ public function updateDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** * Delete a document by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?string $transactionId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteRow` instead. * @see TablesDB::deleteRow @@ -3483,29 +2972,18 @@ public function deleteDocument(string $databaseId, string $collectionId, string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Decrement a specific attribute of a document by a given value. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param string $attribute - * @param ?float $value - * @param ?float $min - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `decrementRowColumn` instead. * @see TablesDB::decrementRowColumn @@ -3547,21 +3025,12 @@ public function decrementDocumentAttribute(string $databaseId, string $collectio } return \Appwrite\Models\Document::from($response); - } /** * Increment a specific attribute of a document by a given value. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param string $attribute - * @param ?float $value - * @param ?float $max - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `incrementRowColumn` instead. * @see TablesDB::incrementRowColumn @@ -3603,18 +3072,12 @@ public function incrementDocumentAttribute(string $databaseId, string $collectio } return \Appwrite\Models\Document::from($response); - } /** * List indexes in the collection. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\IndexList * * @deprecated This API has been deprecated since 1.8.0. Please use `listIndexes` instead. * @see TablesDB::listIndexes @@ -3655,7 +3118,6 @@ public function listIndexes(string $databaseId, string $collectionId, ?array $qu } return \Appwrite\Models\IndexList::from($response); - } /** @@ -3663,15 +3125,7 @@ public function listIndexes(string $databaseId, string $collectionId, ?array $qu * the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param DatabasesIndexType $type - * @param array $attributes - * @param ?array $orders - * @param ?array $lengths * @throws AppwriteException - * @return \Appwrite\Models\Index * * @deprecated This API has been deprecated since 1.8.0. Please use `createIndex` instead. * @see TablesDB::createIndex @@ -3716,17 +3170,12 @@ public function createIndex(string $databaseId, string $collectionId, string $ke } return \Appwrite\Models\Index::from($response); - } /** * Get an index by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\Index * * @deprecated This API has been deprecated since 1.8.0. Please use `getIndex` instead. * @see TablesDB::getIndex @@ -3760,17 +3209,12 @@ public function getIndex(string $databaseId, string $collectionId, string $key): } return \Appwrite\Models\Index::from($response); - } /** * Delete an index. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteIndex` instead. * @see TablesDB::deleteIndex @@ -3792,14 +3236,11 @@ public function deleteIndex(string $databaseId, string $collectionId, string $ke $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Embeddings.php b/src/Appwrite/Services/Embeddings.php index f1f65d2c..10932d8a 100644 --- a/src/Appwrite/Services/Embeddings.php +++ b/src/Appwrite/Services/Embeddings.php @@ -1,30 +1,22 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the function active deployment. Use this endpoint to switch the code * deployment that should be used when visitor opens your function. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\FunctionModel */ public function updateFunctionDeployment(string $functionId, string $deploymentId): \Appwrite\Models\FunctionModel { @@ -519,19 +447,13 @@ public function updateFunctionDeployment(string $functionId, string $deploymentI } return \Appwrite\Models\FunctionModel::from($response); - } /** - * Get a list of all the function's code deployments. You can use the query + * Get a list of all the function's code deployments. You can use the query * params to filter your results. * - * @param string $functionId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\DeploymentList */ public function listDeployments(string $functionId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\DeploymentList { @@ -572,28 +494,21 @@ public function listDeployments(string $functionId, ?array $queries = null, ?str } return \Appwrite\Models\DeploymentList::from($response); - } /** * Create a new function code deployment. Use this endpoint to upload a new - * version of your code function. To execute your newly uploaded code, you'll - * need to update the function's deployment to use your new deployment UID. - * + * version of your code function. To execute your newly uploaded code, you'll + * need to update the function's deployment to use your new deployment UID. + * * This endpoint accepts a tar.gz file compressed with your code. Make sure to * include any dependencies your code has within the compressed file. You can * learn more about code packaging in the [Appwrite Cloud Functions * tutorial](https://appwrite.io/docs/functions). - * - * Use the "command" param to set the entrypoint used to execute your code. * - * @param string $functionId - * @param InputFile $code - * @param bool $activate - * @param ?string $entrypoint - * @param ?string $commands + * Use the "command" param to set the entrypoint used to execute your code. + * * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDeployment(string $functionId, InputFile $code, bool $activate, ?string $entrypoint = null, ?string $commands = null, ?callable $onProgress = null): \Appwrite\Models\Deployment { @@ -623,12 +538,12 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $size = 0; $mimeType = null; $postedName = null; - if(empty($code->getPath() ?? null)) { + if (empty($code->getPath() ?? null)) { $size = strlen($code->getData()); $mimeType = $code->getMimeType(); $postedName = $code->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + $apiParams['code'] = Part::body('code', $code->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -645,7 +560,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $postedName = $code->getFilename() ?? basename($code->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + $apiParams['code'] = Part::file('code', $code->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -658,7 +573,6 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } } - $id = ''; $counter = 0; @@ -669,12 +583,12 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti ]; $handle = null; - if(!empty($code->getPath())) { + if (!empty($code->getPath())) { $handle = @fopen($code->getPath(), "rb"); } $uploadId = ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -687,8 +601,8 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $code) { - if(!empty($handle)) { + $readChunk = function (int $start, int $end) use ($handle, $code): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -696,173 +610,67 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti return substr($code->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['code'] = Part::body('code', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $uploadId = $response['$id']; + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -870,7 +678,6 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } return \Appwrite\Models\Deployment::from($response); - } /** @@ -878,13 +685,9 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti * allows you to rebuild a deployment with the updated function configuration, * including its entrypoint and build commands if they have been modified. The * build process will be queued and executed asynchronously. The original - * deployment's code will be preserved and used for the new build. + * deployment's code will be preserved and used for the new build. * - * @param string $functionId - * @param string $deploymentId - * @param ?string $buildId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDuplicateDeployment(string $functionId, string $deploymentId, ?string $buildId = null): \Appwrite\Models\Deployment { @@ -919,25 +722,16 @@ public function createDuplicateDeployment(string $functionId, string $deployment } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment based on a template. - * + * * Use this endpoint with combination of * [listTemplates](https://appwrite.io/docs/products/functions/templates) to * find the template details. * - * @param string $functionId - * @param string $repository - * @param string $owner - * @param string $rootDirectory - * @param TemplateReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createTemplateDeployment(string $functionId, string $repository, string $owner, string $rootDirectory, TemplateReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -976,20 +770,14 @@ public function createTemplateDeployment(string $functionId, string $repository, } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment when a function is connected to VCS. - * + * * This endpoint lets you create deployment from a branch, commit, or a tag. * - * @param string $functionId - * @param VCSReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createVcsDeployment(string $functionId, VCSReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -1025,16 +813,12 @@ public function createVcsDeployment(string $functionId, VCSReferenceType $type, } return \Appwrite\Models\Deployment::from($response); - } /** * Get a function deployment by its unique ID. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function getDeployment(string $functionId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1064,16 +848,12 @@ public function getDeployment(string $functionId, string $deploymentId): \Appwri } return \Appwrite\Models\Deployment::from($response); - } /** * Delete a code deployment by its unique ID. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return string */ public function deleteDeployment(string $functionId, string $deploymentId): string { @@ -1091,28 +871,20 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a function deployment content by its unique ID. The endpoint response - * return with a 'Content-Disposition: attachment' header that tells the + * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * - * @param string $functionId - * @param string $deploymentId - * @param ?DeploymentDownloadType $type - * @param ?string $token * @throws AppwriteException - * @return string */ public function getDeploymentDownload(string $functionId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { @@ -1138,28 +910,22 @@ public function getDeploymentDownload(string $functionId, string $deploymentId, $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Cancel an ongoing function deployment build. If the build is already in - * progress, it will be stopped and marked as canceled. If the build hasn't + * progress, it will be stopped and marked as canceled. If the build hasn't * started yet, it will be marked as canceled without executing. You cannot - * cancel builds that have already completed (status 'ready') or failed. The + * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function updateDeploymentStatus(string $functionId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1190,18 +956,13 @@ public function updateDeploymentStatus(string $functionId, string $deploymentId) } return \Appwrite\Models\Deployment::from($response); - } /** * Get a list of all the current user function execution logs. You can use the * query params to filter your results. * - * @param string $functionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ExecutionList */ public function listExecutions(string $functionId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ExecutionList { @@ -1238,7 +999,6 @@ public function listExecutions(string $functionId, ?array $queries = null, ?bool } return \Appwrite\Models\ExecutionList::from($response); - } /** @@ -1247,15 +1007,7 @@ public function listExecutions(string $functionId, ?array $queries = null, ?bool * updates on the current execution status. Once this endpoint is called, your * function execution process will start asynchronously. * - * @param string $functionId - * @param ?string $body - * @param ?bool $async - * @param ?string $xpath - * @param ?ExecutionMethod $method - * @param ?array $headers - * @param ?string $scheduledAt * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function createExecution(string $functionId, ?string $body = null, ?bool $async = null, ?string $xpath = null, ?ExecutionMethod $method = null, ?array $headers = null, ?string $scheduledAt = null): \Appwrite\Models\Execution { @@ -1306,16 +1058,12 @@ public function createExecution(string $functionId, ?string $body = null, ?bool } return \Appwrite\Models\Execution::from($response); - } /** * Get a function execution log by its unique ID. * - * @param string $functionId - * @param string $executionId * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function getExecution(string $functionId, string $executionId): \Appwrite\Models\Execution { @@ -1345,16 +1093,12 @@ public function getExecution(string $functionId, string $executionId): \Appwrite } return \Appwrite\Models\Execution::from($response); - } /** * Delete a function execution by its unique ID. * - * @param string $functionId - * @param string $executionId * @throws AppwriteException - * @return string */ public function deleteExecution(string $functionId, string $executionId): string { @@ -1372,25 +1116,18 @@ public function deleteExecution(string $functionId, string $executionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all variables of a specific function. * - * @param string $functionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(string $functionId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -1427,20 +1164,13 @@ public function listVariables(string $functionId, ?array $queries = null, ?bool } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new function environment variable. These variables can be accessed * in the function at runtime as environment variables. * - * @param string $functionId - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $functionId, string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1477,16 +1207,12 @@ public function createVariable(string $functionId, string $variableId, string $k } return \Appwrite\Models\Variable::from($response); - } /** * Get a variable by its unique ID. * - * @param string $functionId - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $functionId, string $variableId): \Appwrite\Models\Variable { @@ -1516,19 +1242,12 @@ public function getVariable(string $functionId, string $variableId): \Appwrite\M } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $functionId - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $functionId, string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1562,16 +1281,12 @@ public function updateVariable(string $functionId, string $variableId, ?string $ } return \Appwrite\Models\Variable::from($response); - } /** * Delete a variable by its unique ID. * - * @param string $functionId - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $functionId, string $variableId): string { @@ -1589,14 +1304,11 @@ public function deleteVariable(string $functionId, string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Graphql.php b/src/Appwrite/Services/Graphql.php index 7be9c5c6..2bd16eae 100644 --- a/src/Appwrite/Services/Graphql.php +++ b/src/Appwrite/Services/Graphql.php @@ -1,25 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Execute a GraphQL mutation. * - * @param array $query * @throws AppwriteException - * @return array */ public function mutation(array $query): array { @@ -73,14 +62,11 @@ public function mutation(array $query): array $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Locale.php b/src/Appwrite/Services/Locale.php index a84457f7..6d0f10d5 100644 --- a/src/Appwrite/Services/Locale.php +++ b/src/Appwrite/Services/Locale.php @@ -1,29 +1,24 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of the targets associated with a message. * - * @param string $messageId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TargetList */ public function listTargets(string $messageId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\TargetList { @@ -643,17 +530,12 @@ public function listTargets(string $messageId, ?array $queries = null, ?bool $to } return \Appwrite\Models\TargetList::from($response); - } /** * Get a list of all providers from the current Appwrite project. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ProviderList */ public function listProviders(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\ProviderList { @@ -693,22 +575,12 @@ public function listProviders(?array $queries = null, ?string $search = null, ?b } return \Appwrite\Models\ProviderList::from($response); - } /** * Create a new Apple Push Notification service provider. * - * @param string $providerId - * @param string $name - * @param ?string $authKey - * @param ?string $authKeyId - * @param ?string $teamId - * @param ?string $bundleId - * @param ?bool $sandbox - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createAPNSProvider(string $providerId, string $name, ?string $authKey = null, ?string $authKeyId = null, ?string $teamId = null, ?string $bundleId = null, ?bool $sandbox = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -760,22 +632,12 @@ public function createAPNSProvider(string $providerId, string $name, ?string $au } return \Appwrite\Models\Provider::from($response); - } /** * Update a Apple Push Notification service provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $authKey - * @param ?string $authKeyId - * @param ?string $teamId - * @param ?string $bundleId - * @param ?bool $sandbox * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateAPNSProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $authKey = null, ?string $authKeyId = null, ?string $teamId = null, ?string $bundleId = null, ?bool $sandbox = null): \Appwrite\Models\Provider { @@ -827,18 +689,12 @@ public function updateAPNSProvider(string $providerId, ?string $name = null, ?bo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Firebase Cloud Messaging provider. * - * @param string $providerId - * @param string $name - * @param ?array $serviceAccountJSON - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createFCMProvider(string $providerId, string $name, ?array $serviceAccountJSON = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -871,18 +727,12 @@ public function createFCMProvider(string $providerId, string $name, ?array $serv } return \Appwrite\Models\Provider::from($response); - } /** * Update a Firebase Cloud Messaging provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?array $serviceAccountJSON * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateFCMProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?array $serviceAccountJSON = null): \Appwrite\Models\Provider { @@ -918,24 +768,12 @@ public function updateFCMProvider(string $providerId, ?string $name = null, ?boo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Mailgun provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $domain - * @param ?bool $isEuRegion - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createMailgunProvider(string $providerId, string $name, ?string $apiKey = null, ?string $domain = null, ?bool $isEuRegion = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -992,24 +830,12 @@ public function createMailgunProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Mailgun provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?string $apiKey - * @param ?string $domain - * @param ?bool $isEuRegion - * @param ?bool $enabled - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateMailgunProvider(string $providerId, ?string $name = null, ?string $apiKey = null, ?string $domain = null, ?bool $isEuRegion = null, ?bool $enabled = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1069,20 +895,12 @@ public function updateMailgunProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new MSG91 provider. * - * @param string $providerId - * @param string $name - * @param ?string $templateId - * @param ?string $senderId - * @param ?string $authKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createMsg91Provider(string $providerId, string $name, ?string $templateId = null, ?string $senderId = null, ?string $authKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1126,20 +944,12 @@ public function createMsg91Provider(string $providerId, string $name, ?string $t } return \Appwrite\Models\Provider::from($response); - } /** * Update a MSG91 provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $templateId - * @param ?string $senderId - * @param ?string $authKey * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateMsg91Provider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $templateId = null, ?string $senderId = null, ?string $authKey = null): \Appwrite\Models\Provider { @@ -1186,22 +996,12 @@ public function updateMsg91Provider(string $providerId, ?string $name = null, ?b } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Resend provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createResendProvider(string $providerId, string $name, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1253,22 +1053,12 @@ public function createResendProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Resend provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateResendProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1323,22 +1113,12 @@ public function updateResendProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Sendgrid provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSendgridProvider(string $providerId, string $name, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1390,22 +1170,12 @@ public function createSendgridProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Sendgrid provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSendgridProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1460,24 +1230,12 @@ public function updateSendgridProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Amazon SES provider. * - * @param string $providerId - * @param string $name - * @param ?string $accessKey - * @param ?string $secretKey - * @param ?string $region - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSesProvider(string $providerId, string $name, ?string $accessKey = null, ?string $secretKey = null, ?string $region = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1537,24 +1295,12 @@ public function createSesProvider(string $providerId, string $name, ?string $acc } return \Appwrite\Models\Provider::from($response); - } /** * Update an Amazon SES provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $accessKey - * @param ?string $secretKey - * @param ?string $region - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSesProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $accessKey = null, ?string $secretKey = null, ?string $region = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1617,28 +1363,12 @@ public function updateSesProvider(string $providerId, ?string $name = null, ?boo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new SMTP provider. * - * @param string $providerId - * @param string $name - * @param string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?SmtpEncryption $encryption - * @param ?bool $autoTLS - * @param ?string $mailer - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSMTPProvider(string $providerId, string $name, string $host, ?int $port = null, ?string $username = null, ?string $password = null, ?SmtpEncryption $encryption = null, ?bool $autoTLS = null, ?string $mailer = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1711,28 +1441,12 @@ public function createSMTPProvider(string $providerId, string $name, string $hos } return \Appwrite\Models\Provider::from($response); - } /** * Update a SMTP provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?SmtpEncryption $encryption - * @param ?bool $autoTLS - * @param ?string $mailer - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSMTPProvider(string $providerId, ?string $name = null, ?string $host = null, ?int $port = null, ?string $username = null, ?string $password = null, ?SmtpEncryption $encryption = null, ?bool $autoTLS = null, ?string $mailer = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1805,20 +1519,12 @@ public function updateSMTPProvider(string $providerId, ?string $name = null, ?st } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Telesign provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $customerId - * @param ?string $apiKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTelesignProvider(string $providerId, string $name, ?string $from = null, ?string $customerId = null, ?string $apiKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1862,20 +1568,12 @@ public function createTelesignProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Telesign provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $customerId - * @param ?string $apiKey - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTelesignProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $customerId = null, ?string $apiKey = null, ?string $from = null): \Appwrite\Models\Provider { @@ -1922,20 +1620,12 @@ public function updateTelesignProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Textmagic provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $username - * @param ?string $apiKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTextmagicProvider(string $providerId, string $name, ?string $from = null, ?string $username = null, ?string $apiKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1979,20 +1669,12 @@ public function createTextmagicProvider(string $providerId, string $name, ?strin } return \Appwrite\Models\Provider::from($response); - } /** * Update a Textmagic provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $username - * @param ?string $apiKey - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTextmagicProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $username = null, ?string $apiKey = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2039,20 +1721,12 @@ public function updateTextmagicProvider(string $providerId, ?string $name = null } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Twilio provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $accountSid - * @param ?string $authToken - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTwilioProvider(string $providerId, string $name, ?string $from = null, ?string $accountSid = null, ?string $authToken = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -2096,20 +1770,12 @@ public function createTwilioProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Twilio provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $accountSid - * @param ?string $authToken - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTwilioProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $accountSid = null, ?string $authToken = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2156,20 +1822,12 @@ public function updateTwilioProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Vonage provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createVonageProvider(string $providerId, string $name, ?string $from = null, ?string $apiKey = null, ?string $apiSecret = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -2213,20 +1871,12 @@ public function createVonageProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Vonage provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateVonageProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $apiSecret = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2273,16 +1923,12 @@ public function updateVonageProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Get a provider by its unique ID. - * * - * @param string $providerId * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function getProvider(string $providerId): \Appwrite\Models\Provider { @@ -2311,15 +1957,12 @@ public function getProvider(string $providerId): \Appwrite\Models\Provider } return \Appwrite\Models\Provider::from($response); - } /** * Delete a provider by its unique ID. * - * @param string $providerId * @throws AppwriteException - * @return string */ public function deleteProvider(string $providerId): string { @@ -2336,25 +1979,18 @@ public function deleteProvider(string $providerId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all topics from the current Appwrite project. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TopicList */ public function listTopics(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\TopicList { @@ -2394,17 +2030,12 @@ public function listTopics(?array $queries = null, ?string $search = null, ?bool } return \Appwrite\Models\TopicList::from($response); - } /** * Create a new topic. * - * @param string $topicId - * @param string $name - * @param ?array $subscribe * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function createTopic(string $topicId, string $name, ?array $subscribe = null): \Appwrite\Models\Topic { @@ -2439,16 +2070,12 @@ public function createTopic(string $topicId, string $name, ?array $subscribe = n } return \Appwrite\Models\Topic::from($response); - } /** * Get a topic by its unique ID. - * * - * @param string $topicId * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function getTopic(string $topicId): \Appwrite\Models\Topic { @@ -2477,18 +2104,12 @@ public function getTopic(string $topicId): \Appwrite\Models\Topic } return \Appwrite\Models\Topic::from($response); - } /** * Update a topic by its unique ID. - * * - * @param string $topicId - * @param ?string $name - * @param ?array $subscribe * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function updateTopic(string $topicId, ?string $name = null, ?array $subscribe = null): \Appwrite\Models\Topic { @@ -2520,15 +2141,12 @@ public function updateTopic(string $topicId, ?string $name = null, ?array $subsc } return \Appwrite\Models\Topic::from($response); - } /** * Delete a topic by its unique ID. * - * @param string $topicId * @throws AppwriteException - * @return string */ public function deleteTopic(string $topicId): string { @@ -2545,26 +2163,18 @@ public function deleteTopic(string $topicId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all subscribers from the current Appwrite project. * - * @param string $topicId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\SubscriberList */ public function listSubscribers(string $topicId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\SubscriberList { @@ -2605,17 +2215,12 @@ public function listSubscribers(string $topicId, ?array $queries = null, ?string } return \Appwrite\Models\SubscriberList::from($response); - } /** * Create a new subscriber. * - * @param string $topicId - * @param string $subscriberId - * @param string $targetId * @throws AppwriteException - * @return \Appwrite\Models\Subscriber */ public function createSubscriber(string $topicId, string $subscriberId, string $targetId): \Appwrite\Models\Subscriber { @@ -2647,17 +2252,12 @@ public function createSubscriber(string $topicId, string $subscriberId, string $ } return \Appwrite\Models\Subscriber::from($response); - } /** * Get a subscriber by its unique ID. - * * - * @param string $topicId - * @param string $subscriberId * @throws AppwriteException - * @return \Appwrite\Models\Subscriber */ public function getSubscriber(string $topicId, string $subscriberId): \Appwrite\Models\Subscriber { @@ -2687,16 +2287,12 @@ public function getSubscriber(string $topicId, string $subscriberId): \Appwrite\ } return \Appwrite\Models\Subscriber::from($response); - } /** * Delete a subscriber by its unique ID. * - * @param string $topicId - * @param string $subscriberId * @throws AppwriteException - * @return string */ public function deleteSubscriber(string $topicId, string $subscriberId): string { @@ -2714,14 +2310,11 @@ public function deleteSubscriber(string $topicId, string $subscriberId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Oauth2.php b/src/Appwrite/Services/Oauth2.php index bc4d8614..4942a872 100644 --- a/src/Appwrite/Services/Oauth2.php +++ b/src/Appwrite/Services/Oauth2.php @@ -1,19 +1,15 @@ client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Exchange an OAuth2 authorization code, refresh token, or device code for * access and refresh tokens. * - * @param string $grantType - * @param ?string $code - * @param ?string $refreshToken - * @param ?string $deviceCode - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $codeVerifier - * @param ?string $redirectUri - * @param ?string $resource - * @param ?string $audience * @throws AppwriteException - * @return \Appwrite\Models\Oauth2Token */ public function 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): \Appwrite\Models\Oauth2Token { @@ -777,6 +676,5 @@ public function createToken(string $grantType, ?string $code = null, ?string $re } return \Appwrite\Models\Oauth2Token::from($response); - } } diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php index 7c189a8f..933c1f6c 100644 --- a/src/Appwrite/Services/Organization.php +++ b/src/Appwrite/Services/Organization.php @@ -1,26 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List app installations on the organization. Any organization member can * read installations. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -164,7 +147,6 @@ public function listInstallations(?array $queries = null, ?bool $total = null): } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -172,10 +154,7 @@ public function listInstallations(?array $queries = null, ?bool $total = null): * owner role can install apps. The installation is granted the scopes the app * currently requests. * - * @param string $appId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function createInstallation(string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -209,16 +188,13 @@ public function createInstallation(string $appId, ?string $authorizationDetails } return \Appwrite\Models\AppInstallation::from($response); - } /** * Get an app installation on the organization by its unique ID. Any * organization member can read installations. * - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $installationId): \Appwrite\Models\AppInstallation { @@ -247,19 +223,15 @@ public function getInstallation(string $installationId): \Appwrite\Models\AppIns } return \Appwrite\Models\AppInstallation::from($response); - } /** * Update an app installation on the organization. Only organization members - * with the owner role can update installations. The installation's granted + * 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. * - * @param string $installationId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function updateInstallation(string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -290,7 +262,6 @@ public function updateInstallation(string $installationId, ?string $authorizatio } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -298,9 +269,7 @@ public function updateInstallation(string $installationId, ?string $authorizatio * organization members with the owner role can remove installations. * Previously issued installation access tokens are revoked. * - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $installationId): string { @@ -318,24 +287,18 @@ public function deleteInstallation(string $installationId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all API keys from the current organization. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\KeyList */ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite\Models\KeyList { @@ -371,18 +334,12 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\KeyList::from($response); - } /** * Create a new organization API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function createKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -415,16 +372,13 @@ public function createKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Get a key by its unique ID. This endpoint returns details about a specific * API key in your organization including its scopes. * - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function getKey(string $keyId): \Appwrite\Models\Key { @@ -453,19 +407,13 @@ public function getKey(string $keyId): \Appwrite\Models\Key } return \Appwrite\Models\Key::from($response); - } /** * Update a key by its unique ID. Use this endpoint to update the name, * scopes, or expiration time of an API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function updateKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -498,16 +446,13 @@ public function updateKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Delete a key by its unique ID. Once deleted, the key can no longer be used * to authenticate API calls. * - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $keyId): string { @@ -524,25 +469,18 @@ public function deleteKey(string $keyId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all memberships from the current organization. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -582,22 +520,14 @@ public function listMemberships(?array $queries = null, ?string $search = null, } return \Appwrite\Models\MembershipList::from($response); - } /** * 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. + * 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. * - * @param array $roles - * @param ?string $email - * @param ?string $userId - * @param ?string $phone - * @param ?string $url - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function createMembership(array $roles, ?string $email = null, ?string $userId = null, ?string $phone = null, ?string $url = null, ?string $name = null): \Appwrite\Models\Membership { @@ -647,15 +577,12 @@ public function createMembership(array $roles, ?string $email = null, ?string $u } return \Appwrite\Models\Membership::from($response); - } /** * Get a membership from the current organization by its unique ID. * - * @param string $membershipId * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function getMembership(string $membershipId): \Appwrite\Models\Membership { @@ -684,16 +611,12 @@ public function getMembership(string $membershipId): \Appwrite\Models\Membership } return \Appwrite\Models\Membership::from($response); - } /** * Modify the roles of a member in the current organization. * - * @param string $membershipId - * @param array $roles * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembership(string $membershipId, array $roles): \Appwrite\Models\Membership { @@ -724,7 +647,6 @@ public function updateMembership(string $membershipId, array $roles): \Appwrite\ } return \Appwrite\Models\Membership::from($response); - } /** @@ -732,9 +654,7 @@ public function updateMembership(string $membershipId, array $roles): \Appwrite\ * whether they accepted the invitation or not; a pending invitation is * revoked. * - * @param string $membershipId * @throws AppwriteException - * @return string */ public function deleteMembership(string $membershipId): string { @@ -751,26 +671,19 @@ public function deleteMembership(string $membershipId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all projects. You can use the query params to filter your * results. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ProjectList */ public function listProjects(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\ProjectList { @@ -810,17 +723,12 @@ public function listProjects(?array $queries = null, ?string $search = null, ?bo } return \Appwrite\Models\ProjectList::from($response); - } /** * Create a new project. * - * @param string $projectId - * @param string $name - * @param ?Region $region * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function createProject(string $projectId, string $name, ?Region $region = null): \Appwrite\Models\Project { @@ -855,15 +763,12 @@ public function createProject(string $projectId, string $name, ?Region $region = } return \Appwrite\Models\Project::from($response); - } /** * Get a project. * - * @param string $projectId * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function getProject(string $projectId): \Appwrite\Models\Project { @@ -891,16 +796,12 @@ public function getProject(string $projectId): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Update a project by its unique ID. * - * @param string $projectId - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateProject(string $projectId, string $name): \Appwrite\Models\Project { @@ -931,15 +832,12 @@ public function updateProject(string $projectId, string $name): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Delete a project by its unique ID. * - * @param string $projectId * @throws AppwriteException - * @return string */ public function deleteProject(string $projectId): string { @@ -956,14 +854,11 @@ public function deleteProject(string $projectId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Presences.php b/src/Appwrite/Services/Presences.php index f4f09e42..80f429c9 100644 --- a/src/Appwrite/Services/Presences.php +++ b/src/Appwrite/Services/Presences.php @@ -1,28 +1,19 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index e398c92e..d8f60020 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -1,15 +1,13 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update properties of a specific auth method. Use this endpoint to enable or - * disable a method in your project. + * disable a method in your project. * - * @param ProjectAuthMethodId $methodId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateAuthMethod(ProjectAuthMethodId $methodId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{methodId}'], - [$methodId], + [(string) $methodId], '/project/auth-methods/{methodId}' ); @@ -128,16 +112,12 @@ public function updateAuthMethod(ProjectAuthMethodId $methodId, bool $enabled): } return \Appwrite\Models\Project::from($response); - } /** * Get a list of all API keys from the current project. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\KeyList */ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite\Models\KeyList { @@ -173,20 +153,16 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\KeyList::from($response); - } /** - * Create a new ephemeral API key. It's recommended to have multiple API keys + * Create a new ephemeral API key. It's recommended to have multiple API keys * with strict scopes for separate functions within your project. - * + * * You can also create a standard API key if you need a longer-lived key * instead. * - * @param array $scopes - * @param int $duration * @throws AppwriteException - * @return \Appwrite\Models\EphemeralKey */ public function createEphemeralKey(array $scopes, int $duration): \Appwrite\Models\EphemeralKey { @@ -217,15 +193,12 @@ public function createEphemeralKey(array $scopes, int $duration): \Appwrite\Mode } return \Appwrite\Models\EphemeralKey::from($response); - } /** - * Get a key by its unique ID. + * Get a key by its unique ID. * - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function getKey(string $keyId): \Appwrite\Models\Key { @@ -254,19 +227,13 @@ public function getKey(string $keyId): \Appwrite\Models\Key } return \Appwrite\Models\Key::from($response); - } /** * Update a key by its unique ID. Use this endpoint to update the name, * scopes, or expiration time of an API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function updateKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -299,16 +266,13 @@ public function updateKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Delete a key by its unique ID. Once deleted, the key can no longer be used * to authenticate API calls. * - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $keyId): string { @@ -325,24 +289,19 @@ public function deleteKey(string $keyId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the project labels. Labels can be used to easily filter projects in * an organization. * - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateLabels(array $labels): \Appwrite\Models\Project { @@ -372,17 +331,13 @@ public function updateLabels(array $labels): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Get a list of all mock phones in the project. This endpoint returns an * array of all mock phones and their OTPs. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MockNumberList */ public function listMockPhones(?array $queries = null, ?bool $total = null): \Appwrite\Models\MockNumberList { @@ -418,17 +373,13 @@ public function listMockPhones(?array $queries = null, ?bool $total = null): \Ap } return \Appwrite\Models\MockNumberList::from($response); - } /** * Create a new mock phone for your project. Use this endpoint to register a * mock phone number and its sign-in OTP for your testers. * - * @param string $number - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function createMockPhone(string $number, string $otp): \Appwrite\Models\MockNumber { @@ -459,16 +410,13 @@ public function createMockPhone(string $number, string $otp): \Appwrite\Models\M } return \Appwrite\Models\MockNumber::from($response); - } /** * Get a mock phone by its unique number. This endpoint returns the mock - * phone's OTP. + * phone's OTP. * - * @param string $number * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function getMockPhone(string $number): \Appwrite\Models\MockNumber { @@ -497,17 +445,13 @@ public function getMockPhone(string $number): \Appwrite\Models\MockNumber } return \Appwrite\Models\MockNumber::from($response); - } /** * Update a mock phone by its unique number. Use this endpoint to update the - * mock phone's OTP. + * mock phone's OTP. * - * @param string $number - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function updateMockPhone(string $number, string $otp): \Appwrite\Models\MockNumber { @@ -538,16 +482,13 @@ public function updateMockPhone(string $number, string $otp): \Appwrite\Models\M } return \Appwrite\Models\MockNumber::from($response); - } /** * Delete a mock phone by its unique number. This endpoint removes the mock * phone and its OTP configuration from the project. * - * @param string $number * @throws AppwriteException - * @return string */ public function deleteMockPhone(string $number): string { @@ -564,26 +505,20 @@ public function deleteMockPhone(string $number): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all OAuth2 providers supported by the server, along with the - * project's configuration for each. Credential fields are write-only and + * project's configuration for each. Credential fields are write-only and * always returned empty. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\OAuth2ProviderList */ public function listOAuth2Providers(?array $queries = null, ?bool $total = null): \Appwrite\Models\OAuth2ProviderList { @@ -619,30 +554,12 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) } return \Appwrite\Models\OAuth2ProviderList::from($response); - } /** * Update the OAuth2 server (OIDC provider) configuration. * - * @param bool $enabled - * @param string $authorizationUrl - * @param ?array $scopes - * @param ?array $authorizationDetailsTypes - * @param ?int $accessTokenDuration - * @param ?int $refreshTokenDuration - * @param ?int $publicAccessTokenDuration - * @param ?int $publicRefreshTokenDuration - * @param ?int $installationAccessTokenDuration - * @param ?bool $confidentialPkce - * @param ?string $verificationUrl - * @param ?int $userCodeLength - * @param ?string $userCodeFormat - * @param ?int $deviceCodeDuration - * @param ?array $defaultScopes - * @param ?array $installationScopes * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?int $installationAccessTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null, ?array $installationScopes = null): \Appwrite\Models\Project { @@ -705,17 +622,12 @@ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?arr } return \Appwrite\Models\Project::from($response); - } /** * Update the project OAuth2 Amazon configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Amazon */ public function updateOAuth2Amazon(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Amazon { @@ -747,19 +659,12 @@ public function updateOAuth2Amazon(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Amazon::from($response); - } /** * Update the project OAuth2 Apple configuration. * - * @param ?string $serviceId - * @param ?string $keyId - * @param ?string $teamId - * @param ?string $p8File - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Apple */ public function updateOAuth2Apple(?string $serviceId = null, ?string $keyId = null, ?string $teamId = null, ?string $p8File = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Apple { @@ -793,17 +698,12 @@ public function updateOAuth2Apple(?string $serviceId = null, ?string $keyId = nu } return \Appwrite\Models\OAuth2Apple::from($response); - } /** * Update the project OAuth2 Appwrite configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Appwrite */ public function updateOAuth2Appwrite(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Appwrite { @@ -835,18 +735,12 @@ public function updateOAuth2Appwrite(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Appwrite::from($response); - } /** * Update the project OAuth2 Auth0 configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Auth0 */ public function updateOAuth2Auth0(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Auth0 { @@ -879,18 +773,12 @@ public function updateOAuth2Auth0(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Auth0::from($response); - } /** * Update the project OAuth2 Authentik configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Authentik */ public function updateOAuth2Authentik(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Authentik { @@ -923,17 +811,12 @@ public function updateOAuth2Authentik(?string $clientId = null, ?string $clientS } return \Appwrite\Models\OAuth2Authentik::from($response); - } /** * Update the project OAuth2 Autodesk configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Autodesk */ public function updateOAuth2Autodesk(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Autodesk { @@ -965,17 +848,12 @@ public function updateOAuth2Autodesk(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Autodesk::from($response); - } /** * Update the project OAuth2 Bitbucket configuration. * - * @param ?string $key - * @param ?string $secret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Bitbucket */ public function updateOAuth2Bitbucket(?string $key = null, ?string $secret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Bitbucket { @@ -1007,17 +885,12 @@ public function updateOAuth2Bitbucket(?string $key = null, ?string $secret = nul } return \Appwrite\Models\OAuth2Bitbucket::from($response); - } /** * Update the project OAuth2 Bitly configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Bitly */ public function updateOAuth2Bitly(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Bitly { @@ -1049,17 +922,12 @@ public function updateOAuth2Bitly(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Bitly::from($response); - } /** * Update the project OAuth2 Box configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Box */ public function updateOAuth2Box(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Box { @@ -1091,17 +959,12 @@ public function updateOAuth2Box(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Box::from($response); - } /** * Update the project OAuth2 Dailymotion configuration. * - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Dailymotion */ public function updateOAuth2Dailymotion(?string $apiKey = null, ?string $apiSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Dailymotion { @@ -1133,17 +996,12 @@ public function updateOAuth2Dailymotion(?string $apiKey = null, ?string $apiSecr } return \Appwrite\Models\OAuth2Dailymotion::from($response); - } /** * Update the project OAuth2 Discord configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Discord */ public function updateOAuth2Discord(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Discord { @@ -1175,17 +1033,12 @@ public function updateOAuth2Discord(?string $clientId = null, ?string $clientSec } return \Appwrite\Models\OAuth2Discord::from($response); - } /** * Update the project OAuth2 Disqus configuration. * - * @param ?string $publicKey - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Disqus */ public function updateOAuth2Disqus(?string $publicKey = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Disqus { @@ -1217,17 +1070,12 @@ public function updateOAuth2Disqus(?string $publicKey = null, ?string $secretKey } return \Appwrite\Models\OAuth2Disqus::from($response); - } /** * Update the project OAuth2 Dropbox configuration. * - * @param ?string $appKey - * @param ?string $appSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Dropbox */ public function updateOAuth2Dropbox(?string $appKey = null, ?string $appSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Dropbox { @@ -1259,17 +1107,12 @@ public function updateOAuth2Dropbox(?string $appKey = null, ?string $appSecret = } return \Appwrite\Models\OAuth2Dropbox::from($response); - } /** * Update the project OAuth2 Etsy configuration. * - * @param ?string $keyString - * @param ?string $sharedSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Etsy */ public function updateOAuth2Etsy(?string $keyString = null, ?string $sharedSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Etsy { @@ -1301,17 +1144,12 @@ public function updateOAuth2Etsy(?string $keyString = null, ?string $sharedSecre } return \Appwrite\Models\OAuth2Etsy::from($response); - } /** * Update the project OAuth2 Facebook configuration. * - * @param ?string $appId - * @param ?string $appSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Facebook */ public function updateOAuth2Facebook(?string $appId = null, ?string $appSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Facebook { @@ -1343,17 +1181,12 @@ public function updateOAuth2Facebook(?string $appId = null, ?string $appSecret = } return \Appwrite\Models\OAuth2Facebook::from($response); - } /** * Update the project OAuth2 Figma configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Figma */ public function updateOAuth2Figma(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Figma { @@ -1385,18 +1218,12 @@ public function updateOAuth2Figma(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Figma::from($response); - } /** * Update the project OAuth2 FusionAuth configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2FusionAuth */ public function updateOAuth2FusionAuth(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2FusionAuth { @@ -1429,17 +1256,12 @@ public function updateOAuth2FusionAuth(?string $clientId = null, ?string $client } return \Appwrite\Models\OAuth2FusionAuth::from($response); - } /** * Update the project OAuth2 GitHub configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Github */ public function updateOAuth2GitHub(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Github { @@ -1471,18 +1293,12 @@ public function updateOAuth2GitHub(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Github::from($response); - } /** * Update the project OAuth2 Gitlab configuration. * - * @param ?string $applicationId - * @param ?string $secret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Gitlab */ public function updateOAuth2Gitlab(?string $applicationId = null, ?string $secret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Gitlab { @@ -1515,18 +1331,12 @@ public function updateOAuth2Gitlab(?string $applicationId = null, ?string $secre } return \Appwrite\Models\OAuth2Gitlab::from($response); - } /** * Update the project OAuth2 Google configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?array $prompt - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Google */ public function updateOAuth2Google(?string $clientId = null, ?string $clientSecret = null, ?array $prompt = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Google { @@ -1559,19 +1369,49 @@ public function updateOAuth2Google(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Google::from($response); + } + + /** + * Update the project OAuth2 Hugging Face configuration. + * + * @throws AppwriteException + */ + public function updateOAuth2HuggingFace(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2HuggingFace + { + $apiPath = str_replace( + [], + [], + '/project/oauth2/huggingface' + ); + + $apiParams = []; + $apiParams['clientId'] = $clientId; + $apiParams['clientSecret'] = $clientSecret; + $apiParams['enabled'] = $enabled; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\OAuth2HuggingFace::from($response); } /** * Update the project OAuth2 Keycloak configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?string $realmName - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Keycloak */ public function updateOAuth2Keycloak(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?string $realmName = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Keycloak { @@ -1605,17 +1445,12 @@ public function updateOAuth2Keycloak(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Keycloak::from($response); - } /** * Update the project OAuth2 Kick configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Kick */ public function updateOAuth2Kick(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Kick { @@ -1647,17 +1482,12 @@ public function updateOAuth2Kick(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Kick::from($response); - } /** * Update the project OAuth2 Linkedin configuration. * - * @param ?string $clientId - * @param ?string $primaryClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Linkedin */ public function updateOAuth2Linkedin(?string $clientId = null, ?string $primaryClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Linkedin { @@ -1689,18 +1519,12 @@ public function updateOAuth2Linkedin(?string $clientId = null, ?string $primaryC } return \Appwrite\Models\OAuth2Linkedin::from($response); - } /** * Update the project OAuth2 Microsoft configuration. * - * @param ?string $applicationId - * @param ?string $applicationSecret - * @param ?string $tenant - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Microsoft */ public function updateOAuth2Microsoft(?string $applicationId = null, ?string $applicationSecret = null, ?string $tenant = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Microsoft { @@ -1733,17 +1557,12 @@ public function updateOAuth2Microsoft(?string $applicationId = null, ?string $ap } return \Appwrite\Models\OAuth2Microsoft::from($response); - } /** * Update the project OAuth2 Notion configuration. * - * @param ?string $oauthClientId - * @param ?string $oauthClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Notion */ public function updateOAuth2Notion(?string $oauthClientId = null, ?string $oauthClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Notion { @@ -1775,23 +1594,12 @@ public function updateOAuth2Notion(?string $oauthClientId = null, ?string $oauth } return \Appwrite\Models\OAuth2Notion::from($response); - } /** * Update the project OAuth2 Oidc configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $wellKnownURL - * @param ?string $authorizationURL - * @param ?string $tokenURL - * @param ?string $userInfoURL - * @param ?array $prompt - * @param ?int $maxAge - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Oidc */ public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret = null, ?string $wellKnownURL = null, ?string $authorizationURL = null, ?string $tokenURL = null, ?string $userInfoURL = null, ?array $prompt = null, ?int $maxAge = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Oidc { @@ -1829,19 +1637,12 @@ public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Oidc::from($response); - } /** * Update the project OAuth2 Okta configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $domain - * @param ?string $authorizationServerId - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Okta */ public function updateOAuth2Okta(?string $clientId = null, ?string $clientSecret = null, ?string $domain = null, ?string $authorizationServerId = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Okta { @@ -1875,17 +1676,12 @@ public function updateOAuth2Okta(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Okta::from($response); - } /** * Update the project OAuth2 Paypal configuration. * - * @param ?string $clientId - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Paypal */ public function updateOAuth2Paypal(?string $clientId = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Paypal { @@ -1917,17 +1713,12 @@ public function updateOAuth2Paypal(?string $clientId = null, ?string $secretKey } return \Appwrite\Models\OAuth2Paypal::from($response); - } /** * Update the project OAuth2 PaypalSandbox configuration. * - * @param ?string $clientId - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Paypal */ public function updateOAuth2PaypalSandbox(?string $clientId = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Paypal { @@ -1959,17 +1750,12 @@ public function updateOAuth2PaypalSandbox(?string $clientId = null, ?string $sec } return \Appwrite\Models\OAuth2Paypal::from($response); - } /** * Update the project OAuth2 Podio configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Podio */ public function updateOAuth2Podio(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Podio { @@ -2001,17 +1787,12 @@ public function updateOAuth2Podio(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Podio::from($response); - } /** * Update the project OAuth2 Salesforce configuration. * - * @param ?string $customerKey - * @param ?string $customerSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Salesforce */ public function updateOAuth2Salesforce(?string $customerKey = null, ?string $customerSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Salesforce { @@ -2043,17 +1824,12 @@ public function updateOAuth2Salesforce(?string $customerKey = null, ?string $cus } return \Appwrite\Models\OAuth2Salesforce::from($response); - } /** * Update the project OAuth2 Slack configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Slack */ public function updateOAuth2Slack(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Slack { @@ -2085,17 +1861,12 @@ public function updateOAuth2Slack(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Slack::from($response); - } /** * Update the project OAuth2 Spotify configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Spotify */ public function updateOAuth2Spotify(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Spotify { @@ -2127,17 +1898,12 @@ public function updateOAuth2Spotify(?string $clientId = null, ?string $clientSec } return \Appwrite\Models\OAuth2Spotify::from($response); - } /** * Update the project OAuth2 Stripe configuration. * - * @param ?string $clientId - * @param ?string $apiSecretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Stripe */ public function updateOAuth2Stripe(?string $clientId = null, ?string $apiSecretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Stripe { @@ -2169,17 +1935,12 @@ public function updateOAuth2Stripe(?string $clientId = null, ?string $apiSecretK } return \Appwrite\Models\OAuth2Stripe::from($response); - } /** * Update the project OAuth2 Tradeshift configuration. * - * @param ?string $oauth2ClientId - * @param ?string $oauth2ClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Tradeshift */ public function updateOAuth2Tradeshift(?string $oauth2ClientId = null, ?string $oauth2ClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Tradeshift { @@ -2211,17 +1972,12 @@ public function updateOAuth2Tradeshift(?string $oauth2ClientId = null, ?string $ } return \Appwrite\Models\OAuth2Tradeshift::from($response); - } /** * Update the project OAuth2 Tradeshift Sandbox configuration. * - * @param ?string $oauth2ClientId - * @param ?string $oauth2ClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Tradeshift */ public function updateOAuth2TradeshiftSandbox(?string $oauth2ClientId = null, ?string $oauth2ClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Tradeshift { @@ -2253,17 +2009,12 @@ public function updateOAuth2TradeshiftSandbox(?string $oauth2ClientId = null, ?s } return \Appwrite\Models\OAuth2Tradeshift::from($response); - } /** * Update the project OAuth2 Twitch configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Twitch */ public function updateOAuth2Twitch(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Twitch { @@ -2295,17 +2046,12 @@ public function updateOAuth2Twitch(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Twitch::from($response); - } /** * Update the project OAuth2 WordPress configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2WordPress */ public function updateOAuth2WordPress(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2WordPress { @@ -2337,17 +2083,12 @@ public function updateOAuth2WordPress(?string $clientId = null, ?string $clientS } return \Appwrite\Models\OAuth2WordPress::from($response); - } /** * Update the project OAuth2 X configuration. * - * @param ?string $customerKey - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2X */ public function updateOAuth2X(?string $customerKey = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2X { @@ -2379,17 +2120,12 @@ public function updateOAuth2X(?string $customerKey = null, ?string $secretKey = } return \Appwrite\Models\OAuth2X::from($response); - } /** * Update the project OAuth2 Yahoo configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Yahoo */ public function updateOAuth2Yahoo(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Yahoo { @@ -2421,17 +2157,12 @@ public function updateOAuth2Yahoo(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Yahoo::from($response); - } /** * Update the project OAuth2 Yandex configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Yandex */ public function updateOAuth2Yandex(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Yandex { @@ -2463,17 +2194,12 @@ public function updateOAuth2Yandex(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Yandex::from($response); - } /** * Update the project OAuth2 Zoho configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Zoho */ public function updateOAuth2Zoho(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Zoho { @@ -2505,17 +2231,12 @@ public function updateOAuth2Zoho(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Zoho::from($response); - } /** * Update the project OAuth2 Zoom configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Zoom */ public function updateOAuth2Zoom(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Zoom { @@ -2547,22 +2268,19 @@ public function updateOAuth2Zoom(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Zoom::from($response); - } /** * Get a single OAuth2 provider configuration. Credential fields (client * secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param ProjectOAuthProviderId $providerId * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft */ - public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft + public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2HuggingFace|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft { $apiPath = str_replace( ['{providerId}'], - [$providerId], + [(string) $providerId], '/project/oauth2/{providerId}' ); @@ -2676,6 +2394,10 @@ public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite return \Appwrite\Models\OAuth2Yahoo::from($response); } + if (($response['$id'] ?? null) === 'huggingface') { + return \Appwrite\Models\OAuth2HuggingFace::from($response); + } + if (($response['$id'] ?? null) === 'linkedin') { return \Appwrite\Models\OAuth2Linkedin::from($response); } @@ -2745,17 +2467,13 @@ public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Get a list of all platforms in the project. This endpoint returns an array * of all platforms and their configurations. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\PlatformList */ public function listPlatforms(?array $queries = null, ?bool $total = null): \Appwrite\Models\PlatformList { @@ -2791,7 +2509,6 @@ public function listPlatforms(?array $queries = null, ?bool $total = null): \App } return \Appwrite\Models\PlatformList::from($response); - } /** @@ -2799,11 +2516,7 @@ public function listPlatforms(?array $queries = null, ?bool $total = null): \App * register a new Android platform where your users will run your application * which will interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $applicationId * @throws AppwriteException - * @return \Appwrite\Models\PlatformAndroid */ public function createAndroidPlatform(string $platformId, string $name, string $applicationId): \Appwrite\Models\PlatformAndroid { @@ -2835,18 +2548,13 @@ public function createAndroidPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformAndroid::from($response); - } /** * Update an Android platform by its unique ID. Use this endpoint to update - * the platform's name or application ID. + * the platform's name or application ID. * - * @param string $platformId - * @param string $name - * @param string $applicationId * @throws AppwriteException - * @return \Appwrite\Models\PlatformAndroid */ public function updateAndroidPlatform(string $platformId, string $name, string $applicationId): \Appwrite\Models\PlatformAndroid { @@ -2878,7 +2586,6 @@ public function updateAndroidPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformAndroid::from($response); - } /** @@ -2886,11 +2593,7 @@ public function updateAndroidPlatform(string $platformId, string $name, string $ * a new Apple platform where your users will run your application which will * interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $bundleIdentifier * @throws AppwriteException - * @return \Appwrite\Models\PlatformApple */ public function createApplePlatform(string $platformId, string $name, string $bundleIdentifier): \Appwrite\Models\PlatformApple { @@ -2922,18 +2625,13 @@ public function createApplePlatform(string $platformId, string $name, string $bu } return \Appwrite\Models\PlatformApple::from($response); - } /** * Update an Apple platform by its unique ID. Use this endpoint to update the - * platform's name or bundle identifier. + * platform's name or bundle identifier. * - * @param string $platformId - * @param string $name - * @param string $bundleIdentifier * @throws AppwriteException - * @return \Appwrite\Models\PlatformApple */ public function updateApplePlatform(string $platformId, string $name, string $bundleIdentifier): \Appwrite\Models\PlatformApple { @@ -2965,7 +2663,6 @@ public function updateApplePlatform(string $platformId, string $name, string $bu } return \Appwrite\Models\PlatformApple::from($response); - } /** @@ -2973,11 +2670,7 @@ public function updateApplePlatform(string $platformId, string $name, string $bu * a new Linux platform where your users will run your application which will * interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $packageName * @throws AppwriteException - * @return \Appwrite\Models\PlatformLinux */ public function createLinuxPlatform(string $platformId, string $name, string $packageName): \Appwrite\Models\PlatformLinux { @@ -3009,18 +2702,13 @@ public function createLinuxPlatform(string $platformId, string $name, string $pa } return \Appwrite\Models\PlatformLinux::from($response); - } /** * Update a Linux platform by its unique ID. Use this endpoint to update the - * platform's name or package name. + * platform's name or package name. * - * @param string $platformId - * @param string $name - * @param string $packageName * @throws AppwriteException - * @return \Appwrite\Models\PlatformLinux */ public function updateLinuxPlatform(string $platformId, string $name, string $packageName): \Appwrite\Models\PlatformLinux { @@ -3052,7 +2740,6 @@ public function updateLinuxPlatform(string $platformId, string $name, string $pa } return \Appwrite\Models\PlatformLinux::from($response); - } /** @@ -3060,11 +2747,7 @@ public function updateLinuxPlatform(string $platformId, string $name, string $pa * new platform where your users will run your application which will interact * with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $hostname * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb */ public function createWebPlatform(string $platformId, string $name, string $hostname): \Appwrite\Models\PlatformWeb { @@ -3096,18 +2779,13 @@ public function createWebPlatform(string $platformId, string $name, string $host } return \Appwrite\Models\PlatformWeb::from($response); - } /** * Update a web platform by its unique ID. Use this endpoint to update the - * platform's name or hostname. + * platform's name or hostname. * - * @param string $platformId - * @param string $name - * @param string $hostname * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb */ public function updateWebPlatform(string $platformId, string $name, string $hostname): \Appwrite\Models\PlatformWeb { @@ -3139,7 +2817,6 @@ public function updateWebPlatform(string $platformId, string $name, string $host } return \Appwrite\Models\PlatformWeb::from($response); - } /** @@ -3147,11 +2824,7 @@ public function updateWebPlatform(string $platformId, string $name, string $host * register a new Windows platform where your users will run your application * which will interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $packageIdentifierName * @throws AppwriteException - * @return \Appwrite\Models\PlatformWindows */ public function createWindowsPlatform(string $platformId, string $name, string $packageIdentifierName): \Appwrite\Models\PlatformWindows { @@ -3183,18 +2856,13 @@ public function createWindowsPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformWindows::from($response); - } /** * Update a Windows platform by its unique ID. Use this endpoint to update the - * platform's name or package identifier name. + * platform's name or package identifier name. * - * @param string $platformId - * @param string $name - * @param string $packageIdentifierName * @throws AppwriteException - * @return \Appwrite\Models\PlatformWindows */ public function updateWindowsPlatform(string $platformId, string $name, string $packageIdentifierName): \Appwrite\Models\PlatformWindows { @@ -3226,16 +2894,13 @@ public function updateWindowsPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformWindows::from($response); - } /** - * Get a platform by its unique ID. This endpoint returns the platform's + * Get a platform by its unique ID. This endpoint returns the platform's * details, including its name, type, and key configurations. * - * @param string $platformId * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb|\Appwrite\Models\PlatformApple|\Appwrite\Models\PlatformAndroid|\Appwrite\Models\PlatformWindows|\Appwrite\Models\PlatformLinux */ public function getPlatform(string $platformId): \Appwrite\Models\PlatformWeb|\Appwrite\Models\PlatformApple|\Appwrite\Models\PlatformAndroid|\Appwrite\Models\PlatformWindows|\Appwrite\Models\PlatformLinux { @@ -3284,16 +2949,13 @@ public function getPlatform(string $platformId): \Appwrite\Models\PlatformWeb|\A } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Delete a platform by its unique ID. This endpoint removes the platform and * all its configurations from the project. * - * @param string $platformId * @throws AppwriteException - * @return string */ public function deletePlatform(string $platformId): string { @@ -3310,24 +2972,18 @@ public function deletePlatform(string $platformId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all project policies and their current configuration. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\PolicyList */ public function listPolicies(?array $queries = null, ?bool $total = null): \Appwrite\Models\PolicyList { @@ -3363,16 +3019,13 @@ public function listPolicies(?array $queries = null, ?bool $total = null): \Appw } return \Appwrite\Models\PolicyList::from($response); - } /** * Configures if aliased emails such as subaddresses and emails with suffixes * are denied during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyAliasedEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3402,16 +3055,13 @@ public function updateDenyAliasedEmailPolicy(bool $enabled): \Appwrite\Models\Pr } return \Appwrite\Models\Project::from($response); - } /** * Configures if only corporate email addresses (non-free and non-disposable * domains) are allowed during new user sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyCorporateEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3441,16 +3091,13 @@ public function updateDenyCorporateEmailPolicy(bool $enabled): \Appwrite\Models\ } return \Appwrite\Models\Project::from($response); - } /** * Configures if disposable emails from known temporary domains are denied * during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyDisposableEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3480,16 +3127,13 @@ public function updateDenyDisposableEmailPolicy(bool $enabled): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Configures if emails from free providers such as Gmail or Yahoo are denied * during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3519,7 +3163,6 @@ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Proje } return \Appwrite\Models\Project::from($response); - } /** @@ -3527,14 +3170,7 @@ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Proje * members information. When enabled, all team members can see ID, name, * email, phone number, and MFA status of other members.. * - * @param ?bool $userId - * @param ?bool $userEmail - * @param ?bool $userPhone - * @param ?bool $userName - * @param ?bool $userMFA - * @param ?bool $userAccessedAt * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userEmail = null, ?bool $userPhone = null, ?bool $userName = null, ?bool $userMFA = null, ?bool $userAccessedAt = null): \Appwrite\Models\Project { @@ -3587,7 +3223,6 @@ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userE } return \Appwrite\Models\Project::from($response); - } /** @@ -3597,12 +3232,7 @@ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userE * factor is disabled by default; enable it to deliver challenge codes through * your own channel. Recovery codes always remain available as a fallback. * - * @param ?bool $totp - * @param ?bool $email - * @param ?bool $phone - * @param ?bool $custom * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, ?bool $phone = null, ?bool $custom = null): \Appwrite\Models\Project { @@ -3647,7 +3277,6 @@ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, } return \Appwrite\Models\Project::from($response); - } /** @@ -3655,9 +3284,7 @@ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, * against most common passwords dictionary. When enabled, and user changes * their password, password must not be contained in the dictionary. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3687,7 +3314,6 @@ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\ } return \Appwrite\Models\Project::from($response); - } /** @@ -3695,15 +3321,13 @@ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\ * configured, previous password hashes are stored, and users cannot choose a * new password that is already stored in the passwird history list, when * updating an user password, or setting new one through password recovery. - * + * * Keep in mind, while password history policy is disabled, the history is not * being stored. Enabling the policy will not have any history on existing * users, and it will only start to collect and enforce the policy on password * changes since the policy is enabled. * - * @param ?int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Project { @@ -3733,7 +3357,6 @@ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Proje } return \Appwrite\Models\Project::from($response); - } /** @@ -3742,9 +3365,7 @@ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Proje * password, the password must not contain user ID, name, email or phone * number. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordPersonalDataPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3774,19 +3395,12 @@ public function updatePasswordPersonalDataPolicy(bool $enabled): \Appwrite\Model } return \Appwrite\Models\Project::from($response); - } /** * Update the password strength requirements for users in the project. * - * @param ?int $min - * @param ?bool $uppercase - * @param ?bool $lowercase - * @param ?bool $number - * @param ?bool $symbols * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordStrength */ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase = null, ?bool $lowercase = null, ?bool $number = null, ?bool $symbols = null): \Appwrite\Models\PolicyPasswordStrength { @@ -3835,7 +3449,6 @@ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase } return \Appwrite\Models\PolicyPasswordStrength::from($response); - } /** @@ -3845,9 +3458,7 @@ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase * session after a new sign up does not trigger an alert, even if the policy * is enabled. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionAlertPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3877,16 +3488,13 @@ public function updateSessionAlertPolicy(bool $enabled): \Appwrite\Models\Projec } return \Appwrite\Models\Project::from($response); - } /** * Update maximum duration how long sessions created within a project should * stay active for. * - * @param int $duration * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Project { @@ -3916,7 +3524,6 @@ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Pro } return \Appwrite\Models\Project::from($response); - } /** @@ -3924,9 +3531,7 @@ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Pro * invalidated when a password of a user is changed. When enabled, and user * changes their password, they will be logged out of all their devices. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionInvalidationPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3956,16 +3561,13 @@ public function updateSessionInvalidationPolicy(bool $enabled): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Update the maximum number of sessions allowed per user. When the limit is * hit, the oldest session will be deleted to make room for new one. * - * @param int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project { @@ -3995,7 +3597,6 @@ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** @@ -4003,9 +3604,7 @@ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project * amount of existing users already exceeded the limit, all users remain * active, but new user sign up will be prohibited. * - * @param ?int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project { @@ -4035,22 +3634,19 @@ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Get a policy by its unique ID. This endpoint returns the current * configuration for the requested project policy. * - * @param ProjectPolicyId $policyId * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail */ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail { $apiPath = str_replace( ['{policyId}'], - [$policyId], + [(string) $policyId], '/project/policies/{policyId}' ); @@ -4133,23 +3729,19 @@ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPas } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Update properties of a specific protocol. Use this endpoint to enable or - * disable a protocol in your project. + * disable a protocol in your project. * - * @param ProjectProtocolId $protocolId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateProtocol(ProjectProtocolId $protocolId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{protocolId}'], - [$protocolId], + [(string) $protocolId], '/project/protocols/{protocolId}' ); @@ -4174,23 +3766,19 @@ public function updateProtocol(ProjectProtocolId $protocolId, bool $enabled): \A } return \Appwrite\Models\Project::from($response); - } /** * Update properties of a specific service. Use this endpoint to enable or - * disable a service in your project. + * disable a service in your project. * - * @param ProjectServiceId $serviceId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{serviceId}'], - [$serviceId], + [(string) $serviceId], '/project/services/{serviceId}' ); @@ -4215,26 +3803,14 @@ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appw } return \Appwrite\Models\Project::from($response); - } /** * Update the SMTP configuration for your project. Use this endpoint to - * configure your project's SMTP provider with your custom settings for + * configure your project's SMTP provider with your custom settings for * sending transactional emails. * - * @param ?string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?string $senderEmail - * @param ?string $senderName - * @param ?string $replyToEmail - * @param ?string $replyToName - * @param ?ProjectSMTPSecure $secure - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSMTP(?string $host = null, ?int $port = null, ?string $username = null, ?string $password = null, ?string $senderEmail = null, ?string $senderName = null, ?string $replyToEmail = null, ?string $replyToName = null, ?ProjectSMTPSecure $secure = null, ?bool $enabled = null): \Appwrite\Models\Project { @@ -4273,15 +3849,12 @@ public function updateSMTP(?string $host = null, ?int $port = null, ?string $use } return \Appwrite\Models\Project::from($response); - } /** - * Send a test email to verify SMTP configuration. + * Send a test email to verify SMTP configuration. * - * @param array $emails * @throws AppwriteException - * @return string */ public function createSMTPTest(array $emails): string { @@ -4298,15 +3871,12 @@ public function createSMTPTest(array $emails): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -4314,10 +3884,7 @@ public function createSMTPTest(array $emails): string * endpoint returns an array of all configured email templates and their * locales. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplateList */ public function listEmailTemplates(?array $queries = null, ?bool $total = null): \Appwrite\Models\EmailTemplateList { @@ -4353,23 +3920,13 @@ public function listEmailTemplates(?array $queries = null, ?bool $total = null): } return \Appwrite\Models\EmailTemplateList::from($response); - } /** * Update a custom email template for the specified locale and type. Use this * endpoint to modify the content of your email templates. * - * @param ProjectEmailTemplateId $templateId - * @param ?ProjectEmailTemplateLocale $locale - * @param ?string $subject - * @param ?string $message - * @param ?string $senderName - * @param ?string $senderEmail - * @param ?string $replyToEmail - * @param ?string $replyToName * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplate */ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEmailTemplateLocale $locale = null, ?string $subject = null, ?string $message = null, ?string $senderName = null, ?string $senderEmail = null, ?string $replyToEmail = null, ?string $replyToName = null): \Appwrite\Models\EmailTemplate { @@ -4409,7 +3966,6 @@ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?Project } return \Appwrite\Models\EmailTemplate::from($response); - } /** @@ -4417,16 +3973,13 @@ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?Project * endpoint returns the template content, subject, and other configuration * details. * - * @param ProjectEmailTemplateId $templateId - * @param ?ProjectEmailTemplateLocale $locale * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplate */ public function getEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEmailTemplateLocale $locale = null): \Appwrite\Models\EmailTemplate { $apiPath = str_replace( ['{templateId}'], - [$templateId], + [(string) $templateId], '/project/templates/email/{templateId}' ); @@ -4453,16 +4006,12 @@ public function getEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEma } return \Appwrite\Models\EmailTemplate::from($response); - } /** * Get a list of all project environment variables. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -4498,19 +4047,13 @@ public function listVariables(?array $queries = null, ?bool $total = null): \App } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new project environment variable. These variables can be accessed * by all functions and sites in the project. * - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -4546,15 +4089,12 @@ public function createVariable(string $variableId, string $key, string $value, ? } return \Appwrite\Models\Variable::from($response); - } /** - * Get a variable by its unique ID. + * Get a variable by its unique ID. * - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $variableId): \Appwrite\Models\Variable { @@ -4583,18 +4123,12 @@ public function getVariable(string $variableId): \Appwrite\Models\Variable } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -4627,15 +4161,12 @@ public function updateVariable(string $variableId, ?string $key = null, ?string } return \Appwrite\Models\Variable::from($response); - } /** - * Delete a variable by its unique ID. + * Delete a variable by its unique ID. * - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $variableId): string { @@ -4652,14 +4183,11 @@ public function deleteVariable(string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Proxy.php b/src/Appwrite/Services/Proxy.php index 691efb29..d77ecdde 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -1,34 +1,26 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -375,9 +334,7 @@ public function deleteRule(string $ruleId): string * verification is successful, a TLS certificate will be automatically * provisioned for the domain asynchronously in the background. * - * @param string $ruleId * @throws AppwriteException - * @return \Appwrite\Models\ProxyRule */ public function updateRuleStatus(string $ruleId): \Appwrite\Models\ProxyRule { @@ -407,6 +364,5 @@ public function updateRuleStatus(string $ruleId): \Appwrite\Models\ProxyRule } return \Appwrite\Models\ProxyRule::from($response); - } } diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index 0b373273..92211fb9 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -1,34 +1,28 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; @@ -207,7 +180,6 @@ public function create(string $siteId, string $name, Framework $framework, Build } return \Appwrite\Models\Site::from($response); - } /** @@ -215,7 +187,6 @@ public function create(string $siteId, string $name, Framework $framework, Build * instance. * * @throws AppwriteException - * @return \Appwrite\Models\FrameworkList */ public function listFrameworks(): \Appwrite\Models\FrameworkList { @@ -243,15 +214,12 @@ public function listFrameworks(): \Appwrite\Models\FrameworkList } return \Appwrite\Models\FrameworkList::from($response); - } /** * List allowed site specifications for this instance. * - * @param ?string $type * @throws AppwriteException - * @return \Appwrite\Models\SpecificationList */ public function listSpecifications(?string $type = null): \Appwrite\Models\SpecificationList { @@ -283,15 +251,12 @@ public function listSpecifications(?string $type = null): \Appwrite\Models\Speci } return \Appwrite\Models\SpecificationList::from($response); - } /** * Get a site by its unique ID. * - * @param string $siteId * @throws AppwriteException - * @return \Appwrite\Models\Site */ public function get(string $siteId): \Appwrite\Models\Site { @@ -320,39 +285,14 @@ public function get(string $siteId): \Appwrite\Models\Site } return \Appwrite\Models\Site::from($response); - } /** * Update site by its unique ID. * - * @param string $siteId - * @param string $name - * @param Framework $framework - * @param ?bool $enabled - * @param ?bool $logging - * @param ?int $timeout - * @param ?string $installCommand - * @param ?string $buildCommand - * @param ?string $startCommand - * @param ?string $outputDirectory - * @param ?BuildRuntime $buildRuntime - * @param ?Adapter $adapter - * @param ?string $fallbackFile - * @param ?string $installationId - * @param ?string $providerRepositoryId - * @param ?string $providerBranch - * @param ?bool $providerSilentMode - * @param ?string $providerRootDirectory - * @param ?array $providerBranches - * @param ?array $providerPaths - * @param ?string $buildSpecification - * @param ?string $runtimeSpecification - * @param ?int $deploymentRetention * @throws AppwriteException - * @return \Appwrite\Models\Site */ - public function update(string $siteId, string $name, Framework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?BuildRuntime $buildRuntime = null, ?Adapter $adapter = null, ?string $fallbackFile = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?array $providerBranches = null, ?array $providerPaths = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\Site + public function update(string $siteId, string $name, Framework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?BuildRuntime $buildRuntime = null, ?Adapter $adapter = null, ?string $fallbackFile = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?array $providerBranches = null, ?array $providerPaths = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null, ?array $scopes = null): \Appwrite\Models\Site { $apiPath = str_replace( ['{siteId}'], @@ -435,6 +375,7 @@ public function update(string $siteId, string $name, Framework $framework, ?bool if (!is_null($deploymentRetention)) { $apiParams['deploymentRetention'] = $deploymentRetention; } + $apiParams['scopes'] = $scopes; $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); @@ -453,15 +394,12 @@ public function update(string $siteId, string $name, Framework $framework, ?bool } return \Appwrite\Models\Site::from($response); - } /** * Delete a site by its unique ID. * - * @param string $siteId * @throws AppwriteException - * @return string */ public function delete(string $siteId): string { @@ -478,25 +416,19 @@ public function delete(string $siteId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the site active deployment. Use this endpoint to switch the code * deployment that should be used when visitor opens your site. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Site */ public function updateSiteDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Site { @@ -527,19 +459,13 @@ public function updateSiteDeployment(string $siteId, string $deploymentId): \App } return \Appwrite\Models\Site::from($response); - } /** - * Get a list of all the site's code deployments. You can use the query params + * Get a list of all the site's code deployments. You can use the query params * to filter your results. * - * @param string $siteId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\DeploymentList */ public function listDeployments(string $siteId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\DeploymentList { @@ -580,22 +506,14 @@ public function listDeployments(string $siteId, ?array $queries = null, ?string } return \Appwrite\Models\DeploymentList::from($response); - } /** * Create a new site code deployment. Use this endpoint to upload a new - * version of your site code. To activate your newly uploaded code, you'll - * need to update the site's deployment to use your new deployment ID. + * version of your site code. To activate your newly uploaded code, you'll + * need to update the site's deployment to use your new deployment ID. * - * @param string $siteId - * @param InputFile $code - * @param ?string $installCommand - * @param ?string $buildCommand - * @param ?string $outputDirectory - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDeployment(string $siteId, InputFile $code, ?string $installCommand = null, ?string $buildCommand = null, ?string $outputDirectory = null, ?bool $activate = null, ?callable $onProgress = null): \Appwrite\Models\Deployment { @@ -632,12 +550,12 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $size = 0; $mimeType = null; $postedName = null; - if(empty($code->getPath() ?? null)) { + if (empty($code->getPath() ?? null)) { $size = strlen($code->getData()); $mimeType = $code->getMimeType(); $postedName = $code->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + $apiParams['code'] = Part::body('code', $code->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -654,7 +572,7 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $postedName = $code->getFilename() ?? basename($code->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + $apiParams['code'] = Part::file('code', $code->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -667,7 +585,6 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta } } - $id = ''; $counter = 0; @@ -678,12 +595,12 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta ]; $handle = null; - if(!empty($code->getPath())) { + if (!empty($code->getPath())) { $handle = @fopen($code->getPath(), "rb"); } $uploadId = ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -696,8 +613,8 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $code) { - if(!empty($handle)) { + $readChunk = function (int $start, int $end) use ($handle, $code): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -705,173 +622,67 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta return substr($code->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['code'] = Part::body('code', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $uploadId = $response['$id']; + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -879,7 +690,6 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta } return \Appwrite\Models\Deployment::from($response); - } /** @@ -887,12 +697,9 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta * you to rebuild a deployment with the updated site configuration, including * its commands and output directory if they have been modified. The build * process will be queued and executed asynchronously. The original - * deployment's code will be preserved and used for the new build. + * deployment's code will be preserved and used for the new build. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDuplicateDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -923,25 +730,16 @@ public function createDuplicateDeployment(string $siteId, string $deploymentId): } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment based on a template. - * + * * Use this endpoint with combination of * [listTemplates](https://appwrite.io/docs/products/sites/templates) to find * the template details. * - * @param string $siteId - * @param string $repository - * @param string $owner - * @param string $rootDirectory - * @param TemplateReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createTemplateDeployment(string $siteId, string $repository, string $owner, string $rootDirectory, TemplateReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -980,20 +778,14 @@ public function createTemplateDeployment(string $siteId, string $repository, str } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment when a site is connected to VCS. - * + * * This endpoint lets you create deployment from a branch, commit, or a tag. * - * @param string $siteId - * @param VCSReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createVcsDeployment(string $siteId, VCSReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -1029,16 +821,12 @@ public function createVcsDeployment(string $siteId, VCSReferenceType $type, stri } return \Appwrite\Models\Deployment::from($response); - } /** * Get a site deployment by its unique ID. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function getDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1068,16 +856,12 @@ public function getDeployment(string $siteId, string $deploymentId): \Appwrite\M } return \Appwrite\Models\Deployment::from($response); - } /** * Delete a site deployment by its unique ID. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return string */ public function deleteDeployment(string $siteId, string $deploymentId): string { @@ -1095,28 +879,20 @@ public function deleteDeployment(string $siteId, string $deploymentId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a site deployment content by its unique ID. The endpoint response - * return with a 'Content-Disposition: attachment' header that tells the + * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * - * @param string $siteId - * @param string $deploymentId - * @param ?DeploymentDownloadType $type - * @param ?string $token * @throws AppwriteException - * @return string */ public function getDeploymentDownload(string $siteId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { @@ -1142,28 +918,22 @@ public function getDeploymentDownload(string $siteId, string $deploymentId, ?Dep $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Cancel an ongoing site deployment build. If the build is already in - * progress, it will be stopped and marked as canceled. If the build hasn't + * progress, it will be stopped and marked as canceled. If the build hasn't * started yet, it will be marked as canceled without executing. You cannot - * cancel builds that have already completed (status 'ready') or failed. The + * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function updateDeploymentStatus(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1194,18 +964,13 @@ public function updateDeploymentStatus(string $siteId, string $deploymentId): \A } return \Appwrite\Models\Deployment::from($response); - } /** * Get a list of all site logs. You can use the query params to filter your * results. * - * @param string $siteId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ExecutionList */ public function listLogs(string $siteId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ExecutionList { @@ -1242,16 +1007,12 @@ public function listLogs(string $siteId, ?array $queries = null, ?bool $total = } return \Appwrite\Models\ExecutionList::from($response); - } /** * Get a site request log by its unique ID. * - * @param string $siteId - * @param string $logId * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function getLog(string $siteId, string $logId): \Appwrite\Models\Execution { @@ -1281,16 +1042,12 @@ public function getLog(string $siteId, string $logId): \Appwrite\Models\Executio } return \Appwrite\Models\Execution::from($response); - } /** * Delete a site log by its unique ID. * - * @param string $siteId - * @param string $logId * @throws AppwriteException - * @return string */ public function deleteLog(string $siteId, string $logId): string { @@ -1309,25 +1066,18 @@ public function deleteLog(string $siteId, string $logId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all variables of a specific site. * - * @param string $siteId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(string $siteId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -1364,20 +1114,13 @@ public function listVariables(string $siteId, ?array $queries = null, ?bool $tot } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new site variable. These variables can be accessed during build * and runtime (server-side rendering) as environment variables. * - * @param string $siteId - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $siteId, string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1414,16 +1157,12 @@ public function createVariable(string $siteId, string $variableId, string $key, } return \Appwrite\Models\Variable::from($response); - } /** * Get a variable by its unique ID. * - * @param string $siteId - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $siteId, string $variableId): \Appwrite\Models\Variable { @@ -1453,19 +1192,12 @@ public function getVariable(string $siteId, string $variableId): \Appwrite\Model } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $siteId - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $siteId, string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1499,16 +1231,12 @@ public function updateVariable(string $siteId, string $variableId, ?string $key } return \Appwrite\Models\Variable::from($response); - } /** * Delete a variable by its unique ID. * - * @param string $siteId - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $siteId, string $variableId): string { @@ -1526,14 +1254,11 @@ public function deleteVariable(string $siteId, string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index 1c273971..afd5e497 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -1,31 +1,25 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all the user files. You can use the query params to filter * your results. * - * @param string $bucketId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\FileList */ public function listFiles(string $bucketId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\FileList { @@ -353,7 +307,6 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea } return \Appwrite\Models\FileList::from($response); - } /** @@ -361,28 +314,21 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea * resource using either a [server * integration](https://appwrite.io/docs/server/storage#storageCreateBucket) * API or directly from your Appwrite console. - * + * * Larger files should be uploaded using multiple requests with the * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) * header to send a partial request with a maximum supported chunk of `5MB`. * The `content-range` header values should always be in bytes. - * + * * When the first request is sent, the server will return the **File** object, - * and the subsequent part request must include the file's **id** in + * and the subsequent part request must include the file's **id** in * `x-appwrite-id` header to allow the server to know that the partial upload * is for the existing file and not for a new one. - * - * If you're creating a new file using one of the Appwrite SDKs, all the + * + * If you're creating a new file using one of the Appwrite SDKs, all the * chunking logic will be managed by the SDK internally. - * * - * @param string $bucketId - * @param string $fileId - * @param InputFile $file - * @param ?array $permissions - * @param ?string $folder * @throws AppwriteException - * @return \Appwrite\Models\File */ public function createFile(string $bucketId, string $fileId, InputFile $file, ?array $permissions = null, ?string $folder = null, ?callable $onProgress = null): \Appwrite\Models\File { @@ -412,12 +358,12 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $size = 0; $mimeType = null; $postedName = null; - if(empty($file->getPath() ?? null)) { + if (empty($file->getPath() ?? null)) { $size = strlen($file->getData()); $mimeType = $file->getMimeType(); $postedName = $file->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($file->getData()), $mimeType, $postedName); + $apiParams['file'] = Part::body('file', $file->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -434,7 +380,7 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $postedName = $file->getFilename() ?? basename($file->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['file'] = new \CURLFile($file->getPath(), $mimeType, $postedName); + $apiParams['file'] = Part::file('file', $file->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -447,13 +393,13 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a } } - $id = ''; $counter = 0; + $response = null; try { $response = $this->client->call(Client::METHOD_GET, $apiPath . '/' . $fileId); $counter = $response['chunksUploaded'] ?? 0; - } catch(\Exception $e) { + } catch (\Exception) { } $apiHeaders = [ @@ -463,13 +409,12 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a ]; $handle = null; - if(!empty($file->getPath())) { + if (!empty($file->getPath())) { $handle = @fopen($file->getPath(), "rb"); } - $uploadId = ''; - $uploadId = $fileId ?? ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $uploadId = $fileId; + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -482,8 +427,16 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $file) { - if(!empty($handle)) { + if ($chunks === []) { + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\File::from($response); + } + + $readChunk = function (int $start, int $end) use ($handle, $file): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -491,173 +444,66 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a return substr($file->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['file'] = Part::body('file', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -665,17 +511,13 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a } return \Appwrite\Models\File::from($response); - } /** * Get a file by its unique ID. This endpoint response returns a JSON object * with the file metadata. * - * @param string $bucketId - * @param string $fileId * @throws AppwriteException - * @return \Appwrite\Models\File */ public function getFile(string $bucketId, string $fileId): \Appwrite\Models\File { @@ -705,19 +547,13 @@ public function getFile(string $bucketId, string $fileId): \Appwrite\Models\File } return \Appwrite\Models\File::from($response); - } /** * Update a file by its unique ID. Only users with write permissions have * access to update this resource. * - * @param string $bucketId - * @param string $fileId - * @param ?string $name - * @param ?array $permissions * @throws AppwriteException - * @return \Appwrite\Models\File */ public function updateFile(string $bucketId, string $fileId, ?string $name = null, ?array $permissions = null): \Appwrite\Models\File { @@ -753,17 +589,13 @@ public function updateFile(string $bucketId, string $fileId, ?string $name = nul } return \Appwrite\Models\File::from($response); - } /** * Delete a file by its unique ID. Only users with write permissions have * access to delete this resource. * - * @param string $bucketId - * @param string $fileId * @throws AppwriteException - * @return string */ public function deleteFile(string $bucketId, string $fileId): string { @@ -781,27 +613,20 @@ public function deleteFile(string $bucketId, string $fileId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start + * 'Content-Disposition: attachment' header that tells the browser to start * downloading the file to user downloads directory. * - * @param string $bucketId - * @param string $fileId - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFileDownload(string $bucketId, string $fileId, ?string $token = null): string { @@ -823,15 +648,12 @@ public function getFileDownload(string $bucketId, string $fileId, ?string $token $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -841,22 +663,7 @@ public function getFileDownload(string $bucketId, string $fileId, ?string $token * string arguments for cutting and resizing your preview image. Preview is * supported only for image files smaller than 10MB. * - * @param string $bucketId - * @param string $fileId - * @param ?int $width - * @param ?int $height - * @param ?ImageGravity $gravity - * @param ?int $quality - * @param ?int $borderWidth - * @param ?string $borderColor - * @param ?int $borderRadius - * @param ?float $opacity - * @param ?int $rotation - * @param ?string $background - * @param ?ImageFormat $output - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFilePreview(string $bucketId, string $fileId, ?int $width = null, ?int $height = null, ?ImageGravity $gravity = null, ?int $quality = null, ?int $borderWidth = null, ?string $borderColor = null, ?int $borderRadius = null, ?float $opacity = null, ?int $rotation = null, ?string $background = null, ?ImageFormat $output = null, ?string $token = null): string { @@ -922,27 +729,20 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a file content by its unique ID. This endpoint is similar to the - * download method but returns with no 'Content-Disposition: attachment' + * download method but returns with no 'Content-Disposition: attachment' * header. * - * @param string $bucketId - * @param string $fileId - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFileView(string $bucketId, string $fileId, ?string $token = null): string { @@ -964,14 +764,11 @@ public function getFileView(string $bucketId, string $fileId, ?string $token = n $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index c8a8d30e..29379052 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -1,32 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create multiple operations in a single transaction. * - * @param string $transactionId - * @param ?array $operations * @throws AppwriteException - * @return \Appwrite\Models\Transaction */ public function createOperations(string $transactionId, ?array $operations = null): \Appwrite\Models\Transaction { @@ -403,16 +360,13 @@ public function createOperations(string $transactionId, ?array $operations = nul } return \Appwrite\Models\Transaction::from($response); - } /** * Get a database by its unique ID. This endpoint response returns a JSON * object with the database metadata. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\Database */ public function get(string $databaseId): \Appwrite\Models\Database { @@ -441,20 +395,12 @@ public function get(string $databaseId): \Appwrite\Models\Database } return \Appwrite\Models\Database::from($response); - } /** * Update a database by its unique ID. * - * @param string $databaseId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $specification - * @param ?int $replicas - * @param ?string $syncMode * @throws AppwriteException - * @return \Appwrite\Models\Database */ public function update(string $databaseId, ?string $name = null, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null, ?string $syncMode = null): \Appwrite\Models\Database { @@ -495,16 +441,13 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled } return \Appwrite\Models\Database::from($response); - } /** * Delete a database by its unique ID. Only API keys with with databases.write * scope can delete a database. * - * @param string $databaseId * @throws AppwriteException - * @return string */ public function delete(string $databaseId): string { @@ -521,28 +464,26 @@ public function delete(string $databaseId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Trigger a manual failover for a dedicated database with high availability * enabled. Promotes a replica to primary. The failover runs asynchronously; * poll the database document for status updates. A database left - * mid-operation by a failover that did not finish also accepts this call as a - * repair, provided `targetReplicaId` names the member to promote. + * mid-operation also accepts this call as a repair once nothing is driving + * the operation it is stuck in. Repairing a failover that did not finish, a + * `failed` database, a stranded upgrade or migrate, or a stranded compute + * resize additionally requires `targetReplicaId` to name the member to + * promote, because the default target may be the member that operation + * already promoted. * - * @param string $databaseId - * @param ?string $targetReplicaId * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabase */ public function createFailover(string $databaseId, ?string $targetReplicaId = null): \Appwrite\Models\DedicatedDatabase { @@ -573,16 +514,13 @@ public function createFailover(string $databaseId, ?string $targetReplicaId = nu } return \Appwrite\Models\DedicatedDatabase::from($response); - } /** * List the dedicated migrations for a TablesDB database. A database has at * most one in-flight migration. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigrationList */ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMigrationList { @@ -611,7 +549,6 @@ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMig } return \Appwrite\Models\DatabaseMigrationList::from($response); - } /** @@ -619,11 +556,7 @@ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMig * compute. Data is copied to the target while the source stays live, with a * brief read-only window during cutover. * - * @param string $databaseId - * @param string $specification - * @param ?bool $autoCutover * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function createMigration(string $databaseId, string $specification, ?bool $autoCutover = null): \Appwrite\Models\DatabaseMigration { @@ -658,16 +591,12 @@ public function createMigration(string $databaseId, string $specification, ?bool } return \Appwrite\Models\DatabaseMigration::from($response); - } /** * Get a single dedicated migration for a TablesDB database by its ID. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function getMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration { @@ -697,17 +626,13 @@ public function getMigration(string $databaseId, string $migrationId): \Appwrite } return \Appwrite\Models\DatabaseMigration::from($response); - } /** * Abort an in-flight TablesDB dedicated migration. Only allowed before * cutover; once the migration has cut over it cannot be aborted. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return string */ public function deleteMigration(string $databaseId, string $migrationId): string { @@ -726,15 +651,12 @@ public function deleteMigration(string $databaseId, string $migrationId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -745,10 +667,7 @@ public function deleteMigration(string $databaseId, string $migrationId): string * attempt: a cutover that fails a check returns the migration to `verifying` * and parks it again, so call this once more to retry. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function cutoverMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration { @@ -779,7 +698,6 @@ public function cutoverMigration(string $databaseId, string $migrationId): \Appw } return \Appwrite\Models\DatabaseMigration::from($response); - } /** @@ -788,12 +706,7 @@ public function cutoverMigration(string $databaseId, string $migrationId): \Appw * recorded here with its outcome, including an attempt that was abandoned * because another worker took over the database. * - * @param string $databaseId - * @param ?string $status - * @param ?int $limit - * @param ?int $offset * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabaseOperationList */ public function listOperations(string $databaseId, ?string $status = null, ?int $limit = null, ?int $offset = null): \Appwrite\Models\DedicatedDatabaseOperationList { @@ -834,16 +747,13 @@ public function listOperations(string $databaseId, ?string $status = null, ?int } return \Appwrite\Models\DedicatedDatabaseOperationList::from($response); - } /** * Get high availability status for a dedicated database. Returns replica * statuses, replication lag, and sync mode. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabaseReplicas */ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatabaseReplicas { @@ -872,7 +782,6 @@ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatab } return \Appwrite\Models\DedicatedDatabaseReplicas::from($response); - } /** @@ -880,9 +789,7 @@ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatab * Returns health status, readiness, uptime, connection info, replica status, * and volume information. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseStatus */ public function getStatus(string $databaseId): \Appwrite\Models\DatabaseStatus { @@ -911,19 +818,13 @@ public function getStatus(string $databaseId): \Appwrite\Models\DatabaseStatus } return \Appwrite\Models\DatabaseStatus::from($response); - } /** * Get a list of all tables that belong to the provided databaseId. You can * use the search parameter to filter your results. * - * @param string $databaseId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TableList */ public function listTables(string $databaseId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\TableList { @@ -964,7 +865,6 @@ public function listTables(string $databaseId, ?array $queries = null, ?string $ } return \Appwrite\Models\TableList::from($response); - } /** @@ -973,16 +873,7 @@ public function listTables(string $databaseId, ?array $queries = null, ?string $ * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $name - * @param ?array $permissions - * @param ?bool $rowSecurity - * @param ?bool $enabled - * @param ?array $columns - * @param ?array $indexes * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function createTable(string $databaseId, string $tableId, string $name, ?array $permissions = null, ?bool $rowSecurity = null, ?bool $enabled = null, ?array $columns = null, ?array $indexes = null): \Appwrite\Models\Table { @@ -1031,17 +922,13 @@ public function createTable(string $databaseId, string $tableId, string $name, ? } return \Appwrite\Models\Table::from($response); - } /** * Get a table by its unique ID. This endpoint response returns a JSON object * with the table metadata. * - * @param string $databaseId - * @param string $tableId * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function getTable(string $databaseId, string $tableId): \Appwrite\Models\Table { @@ -1071,21 +958,12 @@ public function getTable(string $databaseId, string $tableId): \Appwrite\Models\ } return \Appwrite\Models\Table::from($response); - } /** * Update a table by its unique ID. * - * @param string $databaseId - * @param string $tableId - * @param ?string $name - * @param ?array $permissions - * @param ?bool $rowSecurity - * @param ?bool $enabled - * @param ?bool $purge * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function updateTable(string $databaseId, string $tableId, ?string $name = null, ?array $permissions = null, ?bool $rowSecurity = null, ?bool $enabled = null, ?bool $purge = null): \Appwrite\Models\Table { @@ -1133,17 +1011,13 @@ public function updateTable(string $databaseId, string $tableId, ?string $name = } return \Appwrite\Models\Table::from($response); - } /** * Delete a table by its unique ID. Only users with write permissions have * access to delete this resource. * - * @param string $databaseId - * @param string $tableId * @throws AppwriteException - * @return string */ public function deleteTable(string $databaseId, string $tableId): string { @@ -1161,26 +1035,18 @@ public function deleteTable(string $databaseId, string $tableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List columns in the table. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ColumnList */ public function listColumns(string $databaseId, string $tableId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ColumnList { @@ -1218,24 +1084,13 @@ public function listColumns(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\ColumnList::from($response); - } /** * Create a bigint column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnBigint */ public function createBigIntColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $min = null, ?int $max = null, ?int $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnBigint { @@ -1275,24 +1130,13 @@ public function createBigIntColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnBigint::from($response); - } /** * Update a bigint column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnBigint */ public function updateBigIntColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $xdefault, ?int $min = null, ?int $max = null, ?string $newKey = null): \Appwrite\Models\ColumnBigint { @@ -1329,21 +1173,12 @@ public function updateBigIntColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnBigint::from($response); - } /** * Create a boolean column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean */ public function createBooleanColumn(string $databaseId, string $tableId, string $key, bool $required, ?bool $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnBoolean { @@ -1381,21 +1216,13 @@ public function createBooleanColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnBoolean::from($response); - } /** * Update a boolean column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean */ public function updateBooleanColumn(string $databaseId, string $tableId, string $key, bool $required, ?bool $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnBoolean { @@ -1430,20 +1257,12 @@ public function updateBooleanColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnBoolean::from($response); - } /** * Create a date time column according to the ISO 8601 standard. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnDatetime */ public function createDatetimeColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnDatetime { @@ -1481,21 +1300,13 @@ public function createDatetimeColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnDatetime::from($response); - } /** * Update a date time column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnDatetime */ public function updateDatetimeColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnDatetime { @@ -1530,21 +1341,12 @@ public function updateDatetimeColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnDatetime::from($response); - } /** * Create an email column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnEmail */ public function createEmailColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnEmail { @@ -1582,22 +1384,13 @@ public function createEmailColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnEmail::from($response); - } /** * Update an email column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnEmail */ public function updateEmailColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnEmail { @@ -1632,22 +1425,13 @@ public function updateEmailColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnEmail::from($response); - } /** * Create an enumeration column. The `elements` param acts as a white-list of * accepted values for this column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnEnum */ public function createEnumColumn(string $databaseId, string $tableId, string $key, array $elements, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnEnum { @@ -1686,23 +1470,13 @@ public function createEnumColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnEnum::from($response); - } /** * Update an enum column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnEnum */ public function updateEnumColumn(string $databaseId, string $tableId, string $key, array $elements, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnEnum { @@ -1738,24 +1512,13 @@ public function updateEnumColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnEnum::from($response); - } /** * Create a float column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?float $min - * @param ?float $max - * @param ?float $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnFloat */ public function createFloatColumn(string $databaseId, string $tableId, string $key, bool $required, ?float $min = null, ?float $max = null, ?float $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnFloat { @@ -1795,24 +1558,13 @@ public function createFloatColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnFloat::from($response); - } /** * Update a float column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?float $xdefault - * @param ?float $min - * @param ?float $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnFloat */ public function updateFloatColumn(string $databaseId, string $tableId, string $key, bool $required, ?float $xdefault, ?float $min = null, ?float $max = null, ?string $newKey = null): \Appwrite\Models\ColumnFloat { @@ -1849,24 +1601,13 @@ public function updateFloatColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnFloat::from($response); - } /** * Create an integer column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnInteger */ public function createIntegerColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $min = null, ?int $max = null, ?int $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnInteger { @@ -1906,24 +1647,13 @@ public function createIntegerColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnInteger::from($response); - } /** * Update an integer column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnInteger */ public function updateIntegerColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $xdefault, ?int $min = null, ?int $max = null, ?string $newKey = null): \Appwrite\Models\ColumnInteger { @@ -1960,21 +1690,12 @@ public function updateIntegerColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnInteger::from($response); - } /** * Create IP address column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnIp */ public function createIpColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnIp { @@ -2012,22 +1733,13 @@ public function createIpColumn(string $databaseId, string $tableId, string $key, } return \Appwrite\Models\ColumnIp::from($response); - } /** * Update an ip column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnIp */ public function updateIpColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnIp { @@ -2062,19 +1774,12 @@ public function updateIpColumn(string $databaseId, string $tableId, string $key, } return \Appwrite\Models\ColumnIp::from($response); - } /** * Create a geometric line column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnLine */ public function createLineColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnLine { @@ -2108,21 +1813,13 @@ public function createLineColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnLine::from($response); - } /** * Update a line column. Changing the `default` value will not update already * existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnLine */ public function updateLineColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnLine { @@ -2157,22 +1854,12 @@ public function updateLineColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnLine::from($response); - } /** * Create a longtext column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnLongtext */ public function createLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnLongtext { @@ -2214,22 +1901,13 @@ public function createLongtextColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnLongtext::from($response); - } /** * Update a longtext column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnLongtext */ public function updateLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnLongtext { @@ -2264,22 +1942,12 @@ public function updateLongtextColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnLongtext::from($response); - } /** * Create a mediumtext column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnMediumtext */ public function createMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnMediumtext { @@ -2321,22 +1989,13 @@ public function createMediumtextColumn(string $databaseId, string $tableId, stri } return \Appwrite\Models\ColumnMediumtext::from($response); - } /** * Update a mediumtext column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnMediumtext */ public function updateMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnMediumtext { @@ -2371,19 +2030,12 @@ public function updateMediumtextColumn(string $databaseId, string $tableId, stri } return \Appwrite\Models\ColumnMediumtext::from($response); - } /** * Create a geometric point column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnPoint */ public function createPointColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnPoint { @@ -2417,21 +2069,13 @@ public function createPointColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnPoint::from($response); - } /** * Update a point column. Changing the `default` value will not update already * existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnPoint */ public function updatePointColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnPoint { @@ -2466,19 +2110,12 @@ public function updatePointColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnPoint::from($response); - } /** * Create a geometric polygon column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnPolygon */ public function createPolygonColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnPolygon { @@ -2512,21 +2149,13 @@ public function createPolygonColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnPolygon::from($response); - } /** * Update a polygon column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnPolygon */ public function updatePolygonColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnPolygon { @@ -2561,24 +2190,13 @@ public function updatePolygonColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnPolygon::from($response); - } /** * Create relationship column. [Learn more about relationship * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * * - * @param string $databaseId - * @param string $tableId - * @param string $relatedTableId - * @param RelationshipType $type - * @param ?bool $twoWay - * @param ?string $key - * @param ?string $twoWayKey - * @param ?RelationMutate $onDelete * @throws AppwriteException - * @return \Appwrite\Models\ColumnRelationship */ public function createRelationshipColumn(string $databaseId, string $tableId, string $relatedTableId, RelationshipType $type, ?bool $twoWay = null, ?string $key = null, ?string $twoWayKey = null, ?RelationMutate $onDelete = null): \Appwrite\Models\ColumnRelationship { @@ -2621,23 +2239,12 @@ public function createRelationshipColumn(string $databaseId, string $tableId, st } return \Appwrite\Models\ColumnRelationship::from($response); - } /** * Create a string column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnString * * @deprecated This API has been deprecated since 1.9.0. Please use `createTextColumn` instead. * @see TablesDB::createTextColumn @@ -2683,23 +2290,13 @@ public function createStringColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnString::from($response); - } /** * Update a string column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnString * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTextColumn` instead. * @see TablesDB::updateTextColumn @@ -2738,22 +2335,12 @@ public function updateStringColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnString::from($response); - } /** * Create a text column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnText */ public function createTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnText { @@ -2795,22 +2382,13 @@ public function createTextColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnText::from($response); - } /** * Update a text column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnText */ public function updateTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnText { @@ -2845,21 +2423,12 @@ public function updateTextColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnText::from($response); - } /** * Create a URL column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnUrl */ public function createUrlColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnUrl { @@ -2897,22 +2466,13 @@ public function createUrlColumn(string $databaseId, string $tableId, string $key } return \Appwrite\Models\ColumnUrl::from($response); - } /** * Update an url column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnUrl */ public function updateUrlColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnUrl { @@ -2947,23 +2507,12 @@ public function updateUrlColumn(string $databaseId, string $tableId, string $key } return \Appwrite\Models\ColumnUrl::from($response); - } /** * Create a varchar column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnVarchar */ public function createVarcharColumn(string $databaseId, string $tableId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnVarchar { @@ -3006,23 +2555,13 @@ public function createVarcharColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnVarchar::from($response); - } /** * Update a varchar column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnVarchar */ public function updateVarcharColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?int $size = null, ?string $newKey = null): \Appwrite\Models\ColumnVarchar { @@ -3058,17 +2597,12 @@ public function updateVarcharColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnVarchar::from($response); - } /** * Get column by ID. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean|\Appwrite\Models\ColumnInteger|\Appwrite\Models\ColumnFloat|\Appwrite\Models\ColumnEmail|\Appwrite\Models\ColumnEnum|\Appwrite\Models\ColumnUrl|\Appwrite\Models\ColumnIp|\Appwrite\Models\ColumnDatetime|\Appwrite\Models\ColumnRelationship|\Appwrite\Models\ColumnString */ public function getColumn(string $databaseId, string $tableId, string $key): \Appwrite\Models\ColumnBoolean|\Appwrite\Models\ColumnInteger|\Appwrite\Models\ColumnFloat|\Appwrite\Models\ColumnEmail|\Appwrite\Models\ColumnEnum|\Appwrite\Models\ColumnUrl|\Appwrite\Models\ColumnIp|\Appwrite\Models\ColumnDatetime|\Appwrite\Models\ColumnRelationship|\Appwrite\Models\ColumnString { @@ -3139,17 +2673,12 @@ public function getColumn(string $databaseId, string $tableId, string $key): \Ap } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Deletes a column. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return string */ public function deleteColumn(string $databaseId, string $tableId, string $key): string { @@ -3168,29 +2697,19 @@ public function deleteColumn(string $databaseId, string $tableId, string $key): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update relationship column. [Learn more about relationship * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param ?RelationMutate $onDelete - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnRelationship */ public function updateRelationshipColumn(string $databaseId, string $tableId, string $key, ?RelationMutate $onDelete = null, ?string $newKey = null): \Appwrite\Models\ColumnRelationship { @@ -3224,18 +2743,12 @@ public function updateRelationshipColumn(string $databaseId, string $tableId, st } return \Appwrite\Models\ColumnRelationship::from($response); - } /** * List indexes on the table. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndexList */ public function listIndexes(string $databaseId, string $tableId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ColumnIndexList { @@ -3273,7 +2786,6 @@ public function listIndexes(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\ColumnIndexList::from($response); - } /** @@ -3281,15 +2793,7 @@ public function listIndexes(string $databaseId, string $tableId, ?array $queries * columns you will query in a single request. * Type can be `key`, `fulltext`, or `unique`. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param TablesDBIndexType $type - * @param array $columns - * @param ?array $orders - * @param ?array $lengths * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndex */ public function createIndex(string $databaseId, string $tableId, string $key, TablesDBIndexType $type, array $columns, ?array $orders = null, ?array $lengths = null): \Appwrite\Models\ColumnIndex { @@ -3331,17 +2835,12 @@ public function createIndex(string $databaseId, string $tableId, string $key, Ta } return \Appwrite\Models\ColumnIndex::from($response); - } /** * Get index by ID. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndex */ public function getIndex(string $databaseId, string $tableId, string $key): \Appwrite\Models\ColumnIndex { @@ -3372,17 +2871,12 @@ public function getIndex(string $databaseId, string $tableId, string $key): \App } return \Appwrite\Models\ColumnIndex::from($response); - } /** * Delete an index. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return string */ public function deleteIndex(string $databaseId, string $tableId, string $key): string { @@ -3401,29 +2895,19 @@ public function deleteIndex(string $databaseId, string $tableId, string $key): s $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** - * Get a list of all the user's rows in a given table. You can use the query + * Get a list of all the user's rows in a given table. You can use the query * params to filter your results. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?string $transactionId - * @param ?bool $total - * @param ?int $ttl * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function listRows(string $databaseId, string $tableId, ?array $queries = null, ?string $transactionId = null, ?bool $total = null, ?int $ttl = null): \Appwrite\Models\RowList { @@ -3469,7 +2953,6 @@ public function listRows(string $databaseId, string $tableId, ?array $queries = } return \Appwrite\Models\RowList::from($response); - } /** @@ -3478,14 +2961,7 @@ public function listRows(string $databaseId, string $tableId, ?array $queries = * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function createRow(string $databaseId, string $tableId, string $rowId, array $data, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3520,7 +2996,6 @@ public function createRow(string $databaseId, string $tableId, string $rowId, ar } return \Appwrite\Models\Row::from($response); - } /** @@ -3529,12 +3004,7 @@ public function createRow(string $databaseId, string $tableId, string $rowId, ar * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param array $rows - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function createRows(string $databaseId, string $tableId, array $rows, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3567,7 +3037,6 @@ public function createRows(string $databaseId, string $tableId, array $rows, ?st } return \Appwrite\Models\RowList::from($response); - } /** @@ -3575,14 +3044,8 @@ public function createRows(string $databaseId, string $tableId, array $rows, ?st * table resource using either a [server * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. - * * - * @param string $databaseId - * @param string $tableId - * @param array $rows - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function upsertRows(string $databaseId, string $tableId, array $rows, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3615,20 +3078,13 @@ public function upsertRows(string $databaseId, string $tableId, array $rows, ?st } return \Appwrite\Models\RowList::from($response); - } /** * Update all rows that match your queries, if no queries are submitted then * all rows are updated. You can pass only specific fields to be updated. * - * @param string $databaseId - * @param string $tableId - * @param ?array $data - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function updateRows(string $databaseId, string $tableId, ?array $data = null, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3668,19 +3124,13 @@ public function updateRows(string $databaseId, string $tableId, ?array $data = n } return \Appwrite\Models\RowList::from($response); - } /** * Bulk delete rows using queries, if no queries are passed then all rows are * deleted. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function deleteRows(string $databaseId, string $tableId, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3719,20 +3169,13 @@ public function deleteRows(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\RowList::from($response); - } /** * Get a row by its unique ID. This endpoint response returns a JSON object * with the row data. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function getRow(string $databaseId, string $tableId, string $rowId, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3771,7 +3214,6 @@ public function getRow(string $databaseId, string $tableId, string $rowId, ?arra } return \Appwrite\Models\Row::from($response); - } /** @@ -3780,14 +3222,7 @@ public function getRow(string $databaseId, string $tableId, string $rowId, ?arra * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function upsertRow(string $databaseId, string $tableId, string $rowId, ?array $data = null, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3825,21 +3260,13 @@ public function upsertRow(string $databaseId, string $tableId, string $rowId, ?a } return \Appwrite\Models\Row::from($response); - } /** * Update a row by its unique ID. Using the patch method you can pass only * specific fields that will get updated. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function updateRow(string $databaseId, string $tableId, string $rowId, ?array $data = null, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3877,18 +3304,12 @@ public function updateRow(string $databaseId, string $tableId, string $rowId, ?a } return \Appwrite\Models\Row::from($response); - } /** * Delete a row by its unique ID. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?string $transactionId * @throws AppwriteException - * @return string */ public function deleteRow(string $databaseId, string $tableId, string $rowId, ?string $transactionId = null): string { @@ -3911,29 +3332,18 @@ public function deleteRow(string $databaseId, string $tableId, string $rowId, ?s $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Decrement a specific column of a row by a given value. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param string $column - * @param ?float $value - * @param ?float $min - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function decrementRowColumn(string $databaseId, string $tableId, string $rowId, string $column, ?float $value = null, ?float $min = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3972,21 +3382,12 @@ public function decrementRowColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\Row::from($response); - } /** * Increment a specific column of a row by a given value. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param string $column - * @param ?float $value - * @param ?float $max - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function incrementRowColumn(string $databaseId, string $tableId, string $rowId, string $column, ?float $value = null, ?float $max = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -4025,6 +3426,5 @@ public function incrementRowColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\Row::from($response); - } } diff --git a/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index 53b32bcb..8b0b3f42 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -1,28 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List app installations on a team. Any team member can read installations. * - * @param string $teamId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(string $teamId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -267,7 +237,6 @@ public function listInstallations(string $teamId, ?array $queries = null, ?bool } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -276,11 +245,7 @@ public function listInstallations(string $teamId, ?array $queries = null, ?bool * mode can install apps on any team. The installation is granted the scopes * the app currently requests. * - * @param string $teamId - * @param string $appId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function createInstallation(string $teamId, string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -315,17 +280,13 @@ public function createInstallation(string $teamId, string $appId, ?string $autho } return \Appwrite\Models\AppInstallation::from($response); - } /** * Get an app installation on a team by its unique ID. Any team member can * read installations. * - * @param string $teamId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $teamId, string $installationId): \Appwrite\Models\AppInstallation { @@ -355,20 +316,15 @@ public function getInstallation(string $teamId, string $installationId): \Appwri } return \Appwrite\Models\AppInstallation::from($response); - } /** * Update an app installation on a team. Only team members with the owner role - * can update installations. The installation's granted scopes are refreshed + * can update installations. The installation's granted scopes are refreshed * to the scopes the app currently requests; previously issued installation * access tokens are revoked. * - * @param string $teamId - * @param string $installationId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function updateInstallation(string $teamId, string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -400,7 +356,6 @@ public function updateInstallation(string $teamId, string $installationId, ?stri } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -408,10 +363,7 @@ public function updateInstallation(string $teamId, string $installationId, ?stri * the owner role can remove installations. Previously issued installation * access tokens are revoked. * - * @param string $teamId - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $teamId, string $installationId): string { @@ -430,28 +382,20 @@ public function deleteInstallation(string $teamId, string $installationId): stri $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** - * Use this endpoint to list a team's members using the team's ID. All team + * Use this endpoint to list a team's members using the team's ID. All team * members have read access to this endpoint. Hide sensitive attributes from * the response by toggling membership privacy in the Console. * - * @param string $teamId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(string $teamId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -492,7 +436,6 @@ public function listMemberships(string $teamId, ?array $queries = null, ?string } return \Appwrite\Models\MembershipList::from($response); - } /** @@ -500,33 +443,24 @@ public function listMemberships(string $teamId, ?array $queries = null, ?string * invite unregistered users using an email or phone number. If initiated from * a Client SDK, Appwrite will send an email or sms with a link to join the * team to the invited user, and an account will be created for them if one - * doesn't exist. If initiated from a Server SDK, the new member will be added + * doesn't exist. If initiated from a Server SDK, the new member will be added * automatically to the team. - * + * * You only need to provide one of a user ID, email, or phone number. Appwrite - * will prioritize accepting the user ID > email > phone number if you provide + * will prioritize accepting the user ID > email > phone number if you provide * more than one of these parameters. - * + * * Use the `url` parameter to redirect the user from the invitation email to * your app. After the user is redirected, use the [Update Team Membership * Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) - * endpoint to allow the user to accept the invitation to the team. - * + * endpoint to allow the user to accept the invitation to the team. + * * Please note that to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) * Appwrite will accept the only redirect URLs under the domains you have * added as a platform on the Appwrite Console. - * * - * @param string $teamId - * @param array $roles - * @param ?string $email - * @param ?string $userId - * @param ?string $phone - * @param ?string $url - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function createMembership(string $teamId, array $roles, ?string $email = null, ?string $userId = null, ?string $phone = null, ?string $url = null, ?string $name = null): \Appwrite\Models\Membership { @@ -577,7 +511,6 @@ public function createMembership(string $teamId, array $roles, ?string $email = } return \Appwrite\Models\Membership::from($response); - } /** @@ -585,10 +518,7 @@ public function createMembership(string $teamId, array $roles, ?string $email = * access for this resource. Hide sensitive attributes from the response by * toggling membership privacy in the Console. * - * @param string $teamId - * @param string $membershipId * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function getMembership(string $teamId, string $membershipId): \Appwrite\Models\Membership { @@ -618,20 +548,14 @@ public function getMembership(string $teamId, string $membershipId): \Appwrite\M } return \Appwrite\Models\Membership::from($response); - } /** * Modify the roles of a team member. Only team members with the owner role * have access to this endpoint. Learn more about [roles and * permissions](https://appwrite.io/docs/permissions). - * * - * @param string $teamId - * @param string $membershipId - * @param array $roles * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembership(string $teamId, string $membershipId, array $roles): \Appwrite\Models\Membership { @@ -663,7 +587,6 @@ public function updateMembership(string $teamId, string $membershipId, array $ro } return \Appwrite\Models\Membership::from($response); - } /** @@ -671,10 +594,7 @@ public function updateMembership(string $teamId, string $membershipId, array $ro * the membership of any other team member. You can also use this endpoint to * delete a user membership even if it is not accepted. * - * @param string $teamId - * @param string $membershipId * @throws AppwriteException - * @return string */ public function deleteMembership(string $teamId, string $membershipId): string { @@ -692,32 +612,23 @@ public function deleteMembership(string $teamId, string $membershipId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to allow a user to accept an invitation to join a team * after being redirected back to your app from the invitation email received * by the user. - * + * * If the request is successful, a session for the user is automatically * created. - * * - * @param string $teamId - * @param string $membershipId - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembershipStatus(string $teamId, string $membershipId, string $userId, string $secret): \Appwrite\Models\Membership { @@ -750,17 +661,14 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str } return \Appwrite\Models\Membership::from($response); - } /** - * Get the team's shared preferences by its unique ID. If a preference doesn't + * Get the team's shared preferences by its unique ID. If a preference doesn't * need to be shared by all team members, prefer storing them in [user * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * - * @param string $teamId * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(string $teamId): \Appwrite\Models\Preferences { @@ -789,18 +697,14 @@ public function getPrefs(string $teamId): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** - * Update the team's preferences by its unique ID. The object you pass is + * Update the team's preferences by its unique ID. The object you pass is * stored as is and replaces any previous value. The maximum allowed prefs * size is 64kB and throws an error if exceeded. * - * @param string $teamId - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function updatePrefs(string $teamId, array $prefs): \Appwrite\Models\Preferences { @@ -831,6 +735,5 @@ public function updatePrefs(string $teamId, array $prefs): \Appwrite\Models\Pref } return \Appwrite\Models\Preferences::from($response); - } } diff --git a/src/Appwrite/Services/Tokens.php b/src/Appwrite/Services/Tokens.php index 54066ff4..9743df6c 100644 --- a/src/Appwrite/Services/Tokens.php +++ b/src/Appwrite/Services/Tokens.php @@ -1,29 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index a7ee2eda..2b6ae467 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -1,31 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -309,12 +271,7 @@ public function deleteIdentity(string $identityId): string * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createMD5User(string $userId, string $email, string $password, ?string $name = null): \Appwrite\Models\User { @@ -350,7 +307,6 @@ public function createMD5User(string $userId, string $email, string $password, ? } return \Appwrite\Models\User::from($response); - } /** @@ -359,12 +315,7 @@ public function createMD5User(string $userId, string $email, string $password, ? * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createPHPassUser(string $userId, string $email, string $password, ?string $name = null): \Appwrite\Models\User { @@ -400,7 +351,6 @@ public function createPHPassUser(string $userId, string $email, string $password } return \Appwrite\Models\User::from($response); - } /** @@ -409,17 +359,7 @@ public function createPHPassUser(string $userId, string $email, string $password * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param string $passwordSalt - * @param int $passwordCpu - * @param int $passwordMemory - * @param int $passwordParallel - * @param int $passwordLength - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createScryptUser(string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, ?string $name = null): \Appwrite\Models\User { @@ -460,7 +400,6 @@ public function createScryptUser(string $userId, string $email, string $password } return \Appwrite\Models\User::from($response); - } /** @@ -470,15 +409,7 @@ public function createScryptUser(string $userId, string $email, string $password * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param string $passwordSalt - * @param string $passwordSaltSeparator - * @param string $passwordSignerKey - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createScryptModifiedUser(string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, ?string $name = null): \Appwrite\Models\User { @@ -517,7 +448,6 @@ public function createScryptModifiedUser(string $userId, string $email, string $ } return \Appwrite\Models\User::from($response); - } /** @@ -526,13 +456,7 @@ public function createScryptModifiedUser(string $userId, string $email, string $ * the [POST /users](https://appwrite.io/docs/server/users#usersCreate) * endpoint to create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?PasswordHash $passwordVersion - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createSHAUser(string $userId, string $email, string $password, ?PasswordHash $passwordVersion = null, ?string $name = null): \Appwrite\Models\User { @@ -572,15 +496,12 @@ public function createSHAUser(string $userId, string $email, string $password, ? } return \Appwrite\Models\User::from($response); - } /** * Get a user by its unique ID. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\User */ public function get(string $userId): \Appwrite\Models\User { @@ -609,20 +530,17 @@ public function get(string $userId): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** - * Delete a user by its unique ID, thereby releasing it's ID. Since ID is + * Delete a user by its unique ID, thereby releasing it's ID. Since ID is * released and can be reused, all user-related resources like documents or * storage files should be deleted before user deletion. If you want to keep * ID reserved, use the * [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) * endpoint instead. * - * @param string $userId * @throws AppwriteException - * @return string */ public function delete(string $userId): string { @@ -639,24 +557,18 @@ public function delete(string $userId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the user email by its unique ID. * - * @param string $userId - * @param string $email * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmail(string $userId, string $email): \Appwrite\Models\User { @@ -687,7 +599,6 @@ public function updateEmail(string $userId, string $email): \Appwrite\Models\Use } return \Appwrite\Models\User::from($response); - } /** @@ -696,12 +607,8 @@ public function updateEmail(string $userId, string $email): \Appwrite\Models\Use * behavior, while internal audit logs still attribute the action to the * original impersonator and store the impersonated target details only in * internal audit payload data. - * * - * @param string $userId - * @param bool $impersonator * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateImpersonator(string $userId, bool $impersonator): \Appwrite\Models\User { @@ -732,7 +639,6 @@ public function updateImpersonator(string $userId, bool $impersonator): \Appwrit } return \Appwrite\Models\User::from($response); - } /** @@ -740,11 +646,7 @@ public function updateImpersonator(string $userId, bool $impersonator): \Appwrit * can use the resulting JWT to authenticate on behalf of the user. The JWT * secret will become invalid if the session it uses gets deleted. * - * @param string $userId - * @param ?string $sessionId - * @param ?int $duration * @throws AppwriteException - * @return \Appwrite\Models\Jwt */ public function createJWT(string $userId, ?string $sessionId = null, ?int $duration = null): \Appwrite\Models\Jwt { @@ -782,21 +684,17 @@ public function createJWT(string $userId, ?string $sessionId = null, ?int $durat } return \Appwrite\Models\Jwt::from($response); - } /** - * Update the user labels by its unique ID. - * + * Update the user labels by its unique ID. + * * Labels can be used to grant access to resources. While teams are a way for - * user's to share access to a resource, labels can be defined by the + * user's to share access to a resource, labels can be defined by the * developer to grant access without an invitation. See the [Permissions * docs](https://appwrite.io/docs/permissions) for more info. * - * @param string $userId - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateLabels(string $userId, array $labels): \Appwrite\Models\User { @@ -827,17 +725,12 @@ public function updateLabels(string $userId, array $labels): \Appwrite\Models\Us } return \Appwrite\Models\User::from($response); - } /** * Get the user activity logs list by its unique ID. * - * @param string $userId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\LogList */ public function listLogs(string $userId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList { @@ -874,18 +767,12 @@ public function listLogs(string $userId, ?array $queries = null, ?bool $total = } return \Appwrite\Models\LogList::from($response); - } /** * Get the user membership list by its unique ID. * - * @param string $userId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(string $userId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -926,16 +813,12 @@ public function listMemberships(string $userId, ?array $queries = null, ?string } return \Appwrite\Models\MembershipList::from($response); - } /** * Enable or disable MFA on a user account. * - * @param string $userId - * @param bool $mfa * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFA(string $userId, bool $mfa): \Appwrite\Models\User { @@ -966,22 +849,18 @@ public function updateMFA(string $userId, bool $mfa): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** * Delete an authenticator app. * - * @param string $userId - * @param AuthenticatorType $type * @throws AppwriteException - * @return string */ public function deleteMFAAuthenticator(string $userId, AuthenticatorType $type): string { $apiPath = str_replace( ['{userId}', '{type}'], - [$userId, $type], + [$userId, (string) $type], '/users/{userId}/mfa/authenticators/{type}' ); @@ -993,25 +872,19 @@ public function deleteMFAAuthenticator(string $userId, AuthenticatorType $type): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a custom MFA challenge for a user, including the code to be delivered * through your own channel. * - * @param string $userId - * @param string $challengeId * @throws AppwriteException - * @return \Appwrite\Models\MfaChallengeSecret */ public function getMFAChallenge(string $userId, string $challengeId): \Appwrite\Models\MfaChallengeSecret { @@ -1041,15 +914,12 @@ public function getMFAChallenge(string $userId, string $challengeId): \Appwrite\ } return \Appwrite\Models\MfaChallengeSecret::from($response); - } /** * List the factors available on the account to be used as a MFA challange. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaFactors */ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors { @@ -1078,7 +948,6 @@ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors } return \Appwrite\Models\MfaFactors::from($response); - } /** @@ -1087,9 +956,7 @@ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) * method. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1118,7 +985,6 @@ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecover } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -1127,9 +993,7 @@ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecover * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) * method. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1159,7 +1023,6 @@ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -1168,9 +1031,7 @@ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) * method by client SDK. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function createMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1200,16 +1061,12 @@ public function createMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** * Update the user name by its unique ID. * - * @param string $userId - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateName(string $userId, string $name): \Appwrite\Models\User { @@ -1240,16 +1097,12 @@ public function updateName(string $userId, string $name): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** * Update the user password by its unique ID. * - * @param string $userId - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePassword(string $userId, string $password): \Appwrite\Models\User { @@ -1280,16 +1133,12 @@ public function updatePassword(string $userId, string $password): \Appwrite\Mode } return \Appwrite\Models\User::from($response); - } /** * Update the user phone by its unique ID. * - * @param string $userId - * @param string $number * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhone(string $userId, string $number): \Appwrite\Models\User { @@ -1320,15 +1169,12 @@ public function updatePhone(string $userId, string $number): \Appwrite\Models\Us } return \Appwrite\Models\User::from($response); - } /** * Get the user preferences by its unique ID. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(string $userId): \Appwrite\Models\Preferences { @@ -1357,7 +1203,6 @@ public function getPrefs(string $userId): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** @@ -1365,10 +1210,7 @@ public function getPrefs(string $userId): \Appwrite\Models\Preferences * as is, and replaces any previous value. The maximum allowed prefs size is * 64kB and throws error if exceeded. * - * @param string $userId - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function updatePrefs(string $userId, array $prefs): \Appwrite\Models\Preferences { @@ -1399,16 +1241,12 @@ public function updatePrefs(string $userId, array $prefs): \Appwrite\Models\Pref } return \Appwrite\Models\Preferences::from($response); - } /** * Get the user sessions list by its unique ID. * - * @param string $userId - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\SessionList */ public function listSessions(string $userId, ?bool $total = null): \Appwrite\Models\SessionList { @@ -1441,20 +1279,17 @@ public function listSessions(string $userId, ?bool $total = null): \Appwrite\Mod } return \Appwrite\Models\SessionList::from($response); - } /** * Creates a session for a user. Returns an immediately usable session object. - * + * * If you want to generate a token for a custom authentication flow, use the * [POST * /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) * endpoint. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createSession(string $userId): \Appwrite\Models\Session { @@ -1484,15 +1319,12 @@ public function createSession(string $userId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** - * Delete all user's sessions by using the user's unique ID. + * Delete all user's sessions by using the user's unique ID. * - * @param string $userId * @throws AppwriteException - * @return string */ public function deleteSessions(string $userId): string { @@ -1509,24 +1341,18 @@ public function deleteSessions(string $userId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Delete a user sessions by its unique ID. * - * @param string $userId - * @param string $sessionId * @throws AppwriteException - * @return string */ public function deleteSession(string $userId, string $sessionId): string { @@ -1544,25 +1370,19 @@ public function deleteSession(string $userId, string $sessionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the user status by its unique ID. Use this endpoint as an - * alternative to deleting a user if you want to keep user's ID reserved. + * alternative to deleting a user if you want to keep user's ID reserved. * - * @param string $userId - * @param bool $status * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateStatus(string $userId, bool $status): \Appwrite\Models\User { @@ -1593,17 +1413,12 @@ public function updateStatus(string $userId, bool $status): \Appwrite\Models\Use } return \Appwrite\Models\User::from($response); - } /** * List the messaging targets that are associated with a user. * - * @param string $userId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TargetList */ public function listTargets(string $userId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\TargetList { @@ -1640,20 +1455,12 @@ public function listTargets(string $userId, ?array $queries = null, ?bool $total } return \Appwrite\Models\TargetList::from($response); - } /** * Create a messaging target. * - * @param string $userId - * @param string $targetId - * @param MessagingProviderType $providerType - * @param string $identifier - * @param ?string $providerId - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function createTarget(string $userId, string $targetId, MessagingProviderType $providerType, string $identifier, ?string $providerId = null, ?string $name = null): \Appwrite\Models\Target { @@ -1694,16 +1501,12 @@ public function createTarget(string $userId, string $targetId, MessagingProvider } return \Appwrite\Models\Target::from($response); - } /** - * Get a user's push notification target by ID. + * Get a user's push notification target by ID. * - * @param string $userId - * @param string $targetId * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function getTarget(string $userId, string $targetId): \Appwrite\Models\Target { @@ -1733,19 +1536,12 @@ public function getTarget(string $userId, string $targetId): \Appwrite\Models\Ta } return \Appwrite\Models\Target::from($response); - } /** * Update a messaging target. * - * @param string $userId - * @param string $targetId - * @param ?string $identifier - * @param ?string $providerId - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function updateTarget(string $userId, string $targetId, ?string $identifier = null, ?string $providerId = null, ?string $name = null): \Appwrite\Models\Target { @@ -1788,16 +1584,12 @@ public function updateTarget(string $userId, string $targetId, ?string $identifi } return \Appwrite\Models\Target::from($response); - } /** * Delete a messaging target. * - * @param string $userId - * @param string $targetId * @throws AppwriteException - * @return string */ public function deleteTarget(string $userId, string $targetId): string { @@ -1815,15 +1607,12 @@ public function deleteTarget(string $userId, string $targetId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1831,13 +1620,8 @@ public function deleteTarget(string $userId, string $targetId): string * and secret and submit a request to the [PUT * /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. - * * - * @param string $userId - * @param ?int $length - * @param ?int $expire * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createToken(string $userId, ?int $length = null, ?int $expire = null): \Appwrite\Models\Token { @@ -1875,16 +1659,12 @@ public function createToken(string $userId, ?int $length = null, ?int $expire = } return \Appwrite\Models\Token::from($response); - } /** * Update the user email verification status by its unique ID. * - * @param string $userId - * @param bool $emailVerification * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmailVerification(string $userId, bool $emailVerification): \Appwrite\Models\User { @@ -1915,16 +1695,12 @@ public function updateEmailVerification(string $userId, bool $emailVerification) } return \Appwrite\Models\User::from($response); - } /** * Update the user phone verification status by its unique ID. * - * @param string $userId - * @param bool $phoneVerification * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhoneVerification(string $userId, bool $phoneVerification): \Appwrite\Models\User { @@ -1955,6 +1731,5 @@ public function updatePhoneVerification(string $userId, bool $phoneVerification) } return \Appwrite\Models\User::from($response); - } } diff --git a/src/Appwrite/Services/Webhooks.php b/src/Appwrite/Services/Webhooks.php index 65e6fd18..2694980a 100644 --- a/src/Appwrite/Services/Webhooks.php +++ b/src/Appwrite/Services/Webhooks.php @@ -1,27 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -269,10 +232,7 @@ public function delete(string $webhookId): string * signing key used to sign and validate payload deliveries for a specific * webhook. * - * @param string $webhookId - * @param ?string $secret * @throws AppwriteException - * @return \Appwrite\Models\Webhook */ public function updateSecret(string $webhookId, ?string $secret = null): \Appwrite\Models\Webhook { @@ -303,6 +263,5 @@ public function updateSecret(string $webhookId, ?string $secret = null): \Appwri } return \Appwrite\Models\Webhook::from($response); - } } diff --git a/tests/Appwrite/ClientTest.php b/tests/Appwrite/ClientTest.php new file mode 100644 index 00000000..69896e7c --- /dev/null +++ b/tests/Appwrite/ClientTest.php @@ -0,0 +1,194 @@ +expectException(AppwriteException::class); + $this->expectExceptionMessage('Invalid endpoint URL: invalid-endpoint'); + + $client = new Client(); + $client->setEndpoint('invalid-endpoint'); + } + + public function testSetEndpointWithoutProtocolThrowsException(): void + { + $this->expectException(AppwriteException::class); + $this->expectExceptionMessage('Invalid endpoint URL: example.com'); + + $client = new Client(); + $client->setEndpoint('example.com'); + } + + public function testChaining(): void + { + $client = new Client(); + $result = $client + ->setEndpoint('https://example.com') + ->setSelfSigned(true) + ->addHeader('X-Test', 'test'); + + $this->assertInstanceOf(Client::class, $result); + } + + public function testSetEndpointReturnsClient(): void + { + $client = new Client(); + $result = $client->setEndpoint('https://example.com'); + $this->assertSame($client, $result); + } + + public function testSetSelfSignedReturnsClient(): void + { + $client = new Client(); + $result = $client->setSelfSigned(true); + $this->assertSame($client, $result); + } + + public function testAddHeaderReturnsClient(): void + { + $client = new Client(); + $result = $client->addHeader('X-Custom', 'value'); + $this->assertSame($client, $result); + } + + public function testSetProjectReturnsClient(): void + { + $client = new Client(); + $result = $client->setProject('test-value'); + $this->assertSame($client, $result); + } + + public function testSetKeyReturnsClient(): void + { + $client = new Client(); + $result = $client->setKey('test-value'); + $this->assertSame($client, $result); + } + + public function testSetOrganizationReturnsClient(): void + { + $client = new Client(); + $result = $client->setOrganization('test-value'); + $this->assertSame($client, $result); + } + + public function testSetJWTReturnsClient(): void + { + $client = new Client(); + $result = $client->setJWT('test-value'); + $this->assertSame($client, $result); + } + + public function testSetBearerReturnsClient(): void + { + $client = new Client(); + $result = $client->setBearer('test-value'); + $this->assertSame($client, $result); + } + + public function testSetLocaleReturnsClient(): void + { + $client = new Client(); + $result = $client->setLocale('test-value'); + $this->assertSame($client, $result); + } + + public function testSetSessionReturnsClient(): void + { + $client = new Client(); + $result = $client->setSession('test-value'); + $this->assertSame($client, $result); + } + + public function testSetForwardedUserAgentReturnsClient(): void + { + $client = new Client(); + $result = $client->setForwardedUserAgent('test-value'); + $this->assertSame($client, $result); + } + + public function testSetDevKeyReturnsClient(): void + { + $client = new Client(); + $result = $client->setDevKey('test-value'); + $this->assertSame($client, $result); + } + + public function testSetCookieReturnsClient(): void + { + $client = new Client(); + $result = $client->setCookie('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserIdReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserId('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserEmailReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserEmail('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserPhoneReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserPhone('test-value'); + $this->assertSame($client, $result); + } + + public function testHttpClientIsReusedUntilTransportOptionsChange(): void + { + $client = new Client(); + $client->setEndpoint('https://example.com/v1'); + + $first = $this->httpClient($client, true); + $this->assertInstanceOf(HttpClient::class, $first); + $this->assertSame($first, $this->httpClient($client, true)); + + $noRedirect = $this->httpClient($client, false); + $this->assertInstanceOf(HttpClient::class, $noRedirect); + $this->assertNotSame($first, $noRedirect); + + $client->setTimeout(5); + $this->assertNull(new ReflectionProperty(Client::class, 'httpClient')->getValue($client)); + $rebuilt = $this->httpClient($client, true); + $this->assertInstanceOf(HttpClient::class, $rebuilt); + $this->assertNotSame($first, $rebuilt); + } + + public function testSelfSignedAndConnectTimeoutResetHttpClient(): void + { + $client = new Client(); + $original = $this->httpClient($client, true); + + $client->setSelfSigned(true); + $this->assertNotSame($original, $this->httpClient($client, true)); + + $afterSelfSigned = $this->httpClient($client, true); + $client->setConnectTimeout(2); + $this->assertNotSame($afterSelfSigned, $this->httpClient($client, true)); + } + + private function httpClient(Client $client, bool $followRedirects): HttpClient + { + $method = new ReflectionMethod(Client::class, 'getHttpClient'); + + return $method->invoke($client, $followRedirects); + } +} diff --git a/tests/Appwrite/IDTest.php b/tests/Appwrite/IDTest.php index b12e8170..79694dfb 100644 --- a/tests/Appwrite/IDTest.php +++ b/tests/Appwrite/IDTest.php @@ -1,16 +1,21 @@ assertSame(20, strlen($id)); } - public function testCustom(): void { + public function testCustom(): void + { $this->assertSame('custom', ID::custom('custom')); } } diff --git a/tests/Appwrite/OperatorTest.php b/tests/Appwrite/OperatorTest.php index d1533483..b0bbb38f 100644 --- a/tests/Appwrite/OperatorTest.php +++ b/tests/Appwrite/OperatorTest.php @@ -1,92 +1,115 @@ assertSame('{"method":"increment","values":[1]}', Operator::increment()); $this->assertSame('{"method":"increment","values":[5,100]}', Operator::increment(5, 100)); } - public function testDecrement(): void { + public function testDecrement(): void + { $this->assertSame('{"method":"decrement","values":[1]}', Operator::decrement()); $this->assertSame('{"method":"decrement","values":[3,0]}', Operator::decrement(3, 0)); } - public function testMultiply(): void { + public function testMultiply(): void + { $this->assertSame('{"method":"multiply","values":[2]}', Operator::multiply(2)); $this->assertSame('{"method":"multiply","values":[3,1000]}', Operator::multiply(3, 1000)); } - public function testDivide(): void { + public function testDivide(): void + { $this->assertSame('{"method":"divide","values":[2]}', Operator::divide(2)); $this->assertSame('{"method":"divide","values":[4,1]}', Operator::divide(4, 1)); } - public function testModulo(): void { + public function testModulo(): void + { $this->assertSame('{"method":"modulo","values":[5]}', Operator::modulo(5)); } - public function testPower(): void { + public function testPower(): void + { $this->assertSame('{"method":"power","values":[2]}', Operator::power(2)); $this->assertSame('{"method":"power","values":[3,100]}', Operator::power(3, 100)); } - public function testArrayAppend(): void { + public function testArrayAppend(): void + { $this->assertSame('{"method":"arrayAppend","values":["item1","item2"]}', Operator::arrayAppend(['item1', 'item2'])); } - public function testArrayPrepend(): void { + public function testArrayPrepend(): void + { $this->assertSame('{"method":"arrayPrepend","values":["first","second"]}', Operator::arrayPrepend(['first', 'second'])); } - public function testArrayInsert(): void { + public function testArrayInsert(): void + { $this->assertSame('{"method":"arrayInsert","values":[0,"newItem"]}', Operator::arrayInsert(0, 'newItem')); } - public function testArrayRemove(): void { + public function testArrayRemove(): void + { $this->assertSame('{"method":"arrayRemove","values":["oldItem"]}', Operator::arrayRemove('oldItem')); } - public function testArrayUnique(): void { + public function testArrayUnique(): void + { $this->assertSame('{"method":"arrayUnique","values":[]}', Operator::arrayUnique()); } - public function testArrayIntersect(): void { + public function testArrayIntersect(): void + { $this->assertSame('{"method":"arrayIntersect","values":["a","b","c"]}', Operator::arrayIntersect(['a', 'b', 'c'])); } - public function testArrayDiff(): void { + public function testArrayDiff(): void + { $this->assertSame('{"method":"arrayDiff","values":["x","y"]}', Operator::arrayDiff(['x', 'y'])); } - public function testArrayFilter(): void { + public function testArrayFilter(): void + { $this->assertSame('{"method":"arrayFilter","values":["equal","test"]}', Operator::arrayFilter(Condition::Equal, 'test')); } - public function testStringConcat(): void { + public function testStringConcat(): void + { $this->assertSame('{"method":"stringConcat","values":["suffix"]}', Operator::stringConcat('suffix')); } - public function testStringReplace(): void { + public function testStringReplace(): void + { $this->assertSame('{"method":"stringReplace","values":["old","new"]}', Operator::stringReplace('old', 'new')); } - public function testToggle(): void { + public function testToggle(): void + { $this->assertSame('{"method":"toggle","values":[]}', Operator::toggle()); } - public function testDateAddDays(): void { + public function testDateAddDays(): void + { $this->assertSame('{"method":"dateAddDays","values":[7]}', Operator::dateAddDays(7)); } - public function testDateSubDays(): void { + public function testDateSubDays(): void + { $this->assertSame('{"method":"dateSubDays","values":[3]}', Operator::dateSubDays(3)); } - public function testDateSetNow(): void { + public function testDateSetNow(): void + { $this->assertSame('{"method":"dateSetNow","values":[]}', Operator::dateSetNow()); } } diff --git a/tests/Appwrite/PermissionTest.php b/tests/Appwrite/PermissionTest.php index b17958df..26af2fae 100644 --- a/tests/Appwrite/PermissionTest.php +++ b/tests/Appwrite/PermissionTest.php @@ -1,27 +1,35 @@ assertSame('read("any")', Permission::read(Role::any())); } - public function testWrite(): void { + public function testWrite(): void + { $this->assertSame('write("any")', Permission::write(Role::any())); } - public function testCreate(): void { + public function testCreate(): void + { $this->assertSame('create("any")', Permission::create(Role::any())); } - public function testUpdate(): void { + public function testUpdate(): void + { $this->assertSame('update("any")', Permission::update(Role::any())); } - public function testDelete(): void { + public function testDelete(): void + { $this->assertSame('delete("any")', Permission::delete(Role::any())); } } diff --git a/tests/Appwrite/QueryTest.php b/tests/Appwrite/QueryTest.php index bd7de62a..d25e1910 100644 --- a/tests/Appwrite/QueryTest.php +++ b/tests/Appwrite/QueryTest.php @@ -1,42 +1,44 @@ description = $description; - $this->value = $value; - $this->expectedValues = $expectedValues; +final class BasicFilterQueryTest +{ + public function __construct( + public string $description, + public mixed $value, + public string $expectedValues, + ) { } } -final class QueryTest extends TestCase { +final class QueryTest extends TestCase +{ /** * @var BasicFilterQueryTest[] $tests */ - private $tests; + private array $tests; protected function setUp(): void { parent::setUp(); - $this->tests = array( + $this->tests = [ new BasicFilterQueryTest('with a string', 's', '["s"]'), new BasicFilterQueryTest('with a integer', 1, '[1]'), new BasicFilterQueryTest('with a double', 1.2, '[1.2]'), new BasicFilterQueryTest('with a whole number double', 1.0, '[1]'), new BasicFilterQueryTest('with a bool', false, '[false]'), new BasicFilterQueryTest('with a list', ['a', 'b', 'c'], '["a","b","c"]'), - ); + ]; } - public function testBasicFilterEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::equal('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -45,8 +47,9 @@ public function testBasicFilterEqual(): void { } } - public function testBasicFilterNotEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterNotEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::notEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -55,8 +58,9 @@ public function testBasicFilterNotEqual(): void { } } - public function testBasicFilterLessThan(): void { - foreach($this->tests as $test) { + public function testBasicFilterLessThan(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::lessThan('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -65,8 +69,9 @@ public function testBasicFilterLessThan(): void { } } - public function testBasicFilterLessThanEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterLessThanEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::lessThanEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -75,8 +80,9 @@ public function testBasicFilterLessThanEqual(): void { } } - public function testBasicFilterGreaterThan(): void { - foreach($this->tests as $test) { + public function testBasicFilterGreaterThan(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::greaterThan('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -85,8 +91,9 @@ public function testBasicFilterGreaterThan(): void { } } - public function testBasicFilterGreaterThanEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterGreaterThanEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::greaterThanEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -95,175 +102,200 @@ public function testBasicFilterGreaterThanEqual(): void { } } - public function testSearch(): void { + public function testSearch(): void + { $query = json_decode(Query::search('attr', 'keyword1 keyword2'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['keyword1 keyword2'], $query['values']); $this->assertSame('search', $query['method']); } - public function testIsNull(): void { + public function testIsNull(): void + { $query = json_decode(Query::isNull('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('isNull', $query['method']); } - public function testIsNotNull(): void { + public function testIsNotNull(): void + { $query = json_decode(Query::isNotNull('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('isNotNull', $query['method']); } - public function testBetweenWithIntegers(): void { + public function testBetweenWithIntegers(): void + { $query = json_decode(Query::between('attr', 1, 2), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('between', $query['method']); } - public function testBetweenWithDoubles(): void { + public function testBetweenWithDoubles(): void + { $query = json_decode(Query::between('attr', 1.0, 2.0), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('between', $query['method']); } - public function testBetweenWithStrings(): void { + public function testBetweenWithStrings(): void + { $query = json_decode(Query::between('attr', 'a', 'z'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['a', 'z'], $query['values']); $this->assertSame('between', $query['method']); } - public function testSelect(): void { + public function testSelect(): void + { $query = json_decode(Query::select(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('select', $query['method']); } - public function testOrderAsc(): void { + public function testOrderAsc(): void + { $query = json_decode(Query::orderAsc('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('orderAsc', $query['method']); } - public function testOrderDesc(): void { + public function testOrderDesc(): void + { $query = json_decode(Query::orderDesc('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('orderDesc', $query['method']); } - public function testOrderRandom(): void { + public function testOrderRandom(): void + { $query = json_decode(Query::orderRandom(), true); $this->assertNull($query['attribute'] ?? null); $this->assertNull($query['values'] ?? null); $this->assertSame('orderRandom', $query['method']); } - public function testCursorBefore(): void { + public function testCursorBefore(): void + { $query = json_decode(Query::cursorBefore('attr'), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr'], $query['values']); $this->assertSame('cursorBefore', $query['method']); } - public function testCursorAfter(): void { + public function testCursorAfter(): void + { $query = json_decode(Query::cursorAfter('attr'), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr'], $query['values']); $this->assertSame('cursorAfter', $query['method']); } - public function testLimit(): void { + public function testLimit(): void + { $query = json_decode(Query::limit(1), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame([1], $query['values']); $this->assertSame('limit', $query['method']); } - public function testOffset(): void { + public function testOffset(): void + { $query = json_decode(Query::offset(1), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame([1], $query['values']); $this->assertSame('offset', $query['method']); } - public function testNotContains(): void { + public function testNotContains(): void + { $query = json_decode(Query::notContains('attr', 'value'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['value'], $query['values']); $this->assertSame('notContains', $query['method']); } - public function testNotSearch(): void { + public function testNotSearch(): void + { $query = json_decode(Query::notSearch('attr', 'keyword1 keyword2'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['keyword1 keyword2'], $query['values']); $this->assertSame('notSearch', $query['method']); } - public function testNotBetweenWithIntegers(): void { + public function testNotBetweenWithIntegers(): void + { $query = json_decode(Query::notBetween('attr', 1, 2), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotBetweenWithDoubles(): void { + public function testNotBetweenWithDoubles(): void + { $query = json_decode(Query::notBetween('attr', 1.0, 2.0), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotBetweenWithStrings(): void { + public function testNotBetweenWithStrings(): void + { $query = json_decode(Query::notBetween('attr', 'a', 'z'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['a', 'z'], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotStartsWith(): void { + public function testNotStartsWith(): void + { $query = json_decode(Query::notStartsWith('attr', 'prefix'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['prefix'], $query['values']); $this->assertSame('notStartsWith', $query['method']); } - public function testNotEndsWith(): void { + public function testNotEndsWith(): void + { $query = json_decode(Query::notEndsWith('attr', 'suffix'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['suffix'], $query['values']); $this->assertSame('notEndsWith', $query['method']); } - public function testRegex(): void { + public function testRegex(): void + { $query = json_decode(Query::regex('attr', 'pattern.*'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['pattern.*'], $query['values']); $this->assertSame('regex', $query['method']); } - public function testExists(): void { + public function testExists(): void + { $query = json_decode(Query::exists(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('exists', $query['method']); } - public function testNotExists(): void { + public function testNotExists(): void + { $query = json_decode(Query::notExists(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('notExists', $query['method']); } - public function testElemMatch(): void { + public function testElemMatch(): void + { $inner1 = Query::equal('name', 'Alice'); $inner2 = Query::greaterThan('age', 18); @@ -282,42 +314,48 @@ public function testElemMatch(): void { $this->assertSame([18], $query['values'][1]['values']); } - public function testCreatedBefore(): void { + public function testCreatedBefore(): void + { $query = json_decode(Query::createdBefore('2023-01-01'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('lessThan', $query['method']); } - public function testCreatedAfter(): void { + public function testCreatedAfter(): void + { $query = json_decode(Query::createdAfter('2023-01-01'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('greaterThan', $query['method']); } - public function testCreatedBetween(): void { + public function testCreatedBetween(): void + { $query = json_decode(Query::createdBetween('2023-01-01', '2023-12-31'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01', '2023-12-31'], $query['values']); $this->assertSame('between', $query['method']); } - public function testUpdatedBefore(): void { + public function testUpdatedBefore(): void + { $query = json_decode(Query::updatedBefore('2023-01-01'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('lessThan', $query['method']); } - public function testUpdatedAfter(): void { + public function testUpdatedAfter(): void + { $query = json_decode(Query::updatedAfter('2023-01-01'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('greaterThan', $query['method']); } - public function testUpdatedBetween(): void { + public function testUpdatedBetween(): void + { $query = json_decode(Query::updatedBetween('2023-01-01', '2023-12-31'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01', '2023-12-31'], $query['values']); diff --git a/tests/Appwrite/RoleTest.php b/tests/Appwrite/RoleTest.php index f6e0be1c..3fb95048 100644 --- a/tests/Appwrite/RoleTest.php +++ b/tests/Appwrite/RoleTest.php @@ -1,47 +1,60 @@ assertSame('any', Role::any()); } - public function testUserWithoutStatus(): void { + public function testUserWithoutStatus(): void + { $this->assertSame('user:custom', Role::user('custom')); } - public function testUserWithStatus(): void { + public function testUserWithStatus(): void + { $this->assertSame('user:custom/verified', Role::user('custom', 'verified')); } - public function testUsersWithoutStatus(): void { + public function testUsersWithoutStatus(): void + { $this->assertSame('users', Role::users()); } - public function testUsersWithStatus(): void { + public function testUsersWithStatus(): void + { $this->assertSame('users/verified', Role::users('verified')); } - public function testGuests(): void { + public function testGuests(): void + { $this->assertSame('guests', Role::guests()); } - public function testTeamWithoutRole(): void { + public function testTeamWithoutRole(): void + { $this->assertSame('team:custom', Role::team('custom')); } - public function testTeamWithRole(): void { + public function testTeamWithRole(): void + { $this->assertSame('team:custom/owner', Role::team('custom', 'owner')); } - public function testMember(): void { + public function testMember(): void + { $this->assertSame('member:custom', Role::member('custom')); } - public function testLabel(): void { + public function testLabel(): void + { $this->assertSame('label:admin', Role::label('admin')); } } diff --git a/tests/Appwrite/Services/AccountTest.php b/tests/Appwrite/Services/AccountTest.php index 28c9db86..1e4565d9 100644 --- a/tests/Appwrite/Services/AccountTest.php +++ b/tests/Appwrite/Services/AccountTest.php @@ -1,10 +1,12 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -48,10 +50,10 @@ public function testMethodGet(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -64,26 +66,25 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -92,10 +93,10 @@ public function testMethodCreate(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -112,26 +113,25 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListConsents(): void { - $data = array( + $data = [ "total" => 5, - "consents" => array( - array( + "consents" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -144,21 +144,20 @@ public function testMethodListConsents(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentList::class, $response); } - public function testMethodGetConsent(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -173,7 +172,6 @@ public function testMethodGetConsent(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Consent::class, $response); } - public function testMethodDeleteConsent(): void { $data = ''; @@ -191,13 +189,12 @@ public function testMethodDeleteConsent(): void $this->assertSame($data, $response); } - public function testMethodListConsentTokens(): void { - $data = array( + $data = [ "total" => 5, - "tokens" => array( - array( + "tokens" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -205,13 +202,13 @@ public function testMethodListConsentTokens(): void "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -226,10 +223,9 @@ public function testMethodListConsentTokens(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentTokenList::class, $response); } - public function testMethodGetConsentToken(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -237,11 +233,11 @@ public function testMethodGetConsentToken(): void "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -257,7 +253,6 @@ public function testMethodGetConsentToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentToken::class, $response); } - public function testMethodDeleteConsentToken(): void { $data = ''; @@ -276,26 +271,25 @@ public function testMethodDeleteConsentToken(): void $this->assertSame($data, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -304,10 +298,10 @@ public function testMethodUpdateEmail(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -323,13 +317,12 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListIdentities(): void { - $data = array( + $data = [ "total" => 5, - "identities" => array( - array( + "identities" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -340,9 +333,9 @@ public function testMethodListIdentities(): void "providerAccessToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "providerAccessTokenExpiry" => "2020-10-15T06:38:00.000+00:00", "providerRefreshToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -355,7 +348,6 @@ public function testMethodListIdentities(): void $this->assertInstanceOf(\Appwrite\Models\IdentityList::class, $response); } - public function testMethodDeleteIdentity(): void { $data = ''; @@ -373,13 +365,12 @@ public function testMethodDeleteIdentity(): void $this->assertSame($data, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "logs" => array( - array( + "logs" => [ + [ "event" => "account.sessions.create", "userId" => "610fc2f985ee0", "userEmail" => "john@appwrite.io", @@ -402,9 +393,9 @@ public function testMethodListLogs(): void "deviceModel" => "Nexus 5", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -417,26 +408,25 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); } - public function testMethodUpdateMFA(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -445,10 +435,10 @@ public function testMethodUpdateMFA(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -463,13 +453,12 @@ public function testMethodUpdateMFA(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateMFAAuthenticator(): void { - $data = array( + $data = [ "secret" => "[SHARED_SECRET]", "uri" => "otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,26 +473,25 @@ public function testMethodCreateMFAAuthenticator(): void $this->assertInstanceOf(\Appwrite\Models\MfaType::class, $response); } - public function testMethodUpdateMFAAuthenticator(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -512,10 +500,10 @@ public function testMethodUpdateMFAAuthenticator(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -531,7 +519,6 @@ public function testMethodUpdateMFAAuthenticator(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDeleteMFAAuthenticator(): void { $data = ''; @@ -549,15 +536,14 @@ public function testMethodDeleteMFAAuthenticator(): void $this->assertSame($data, $response); } - public function testMethodCreateMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -572,10 +558,9 @@ public function testMethodCreateMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\MfaChallenge::class, $response); } - public function testMethodUpdateMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -602,10 +587,10 @@ public function testMethodUpdateMFAChallenge(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -621,16 +606,15 @@ public function testMethodUpdateMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodListMFAFactors(): void { - $data = array( + $data = [ "totp" => true, "phone" => true, "email" => true, "recoveryCode" => true, "custom" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -643,12 +627,11 @@ public function testMethodListMFAFactors(): void $this->assertInstanceOf(\Appwrite\Models\MfaFactors::class, $response); } - public function testMethodGetMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -661,12 +644,11 @@ public function testMethodGetMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodCreateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -679,12 +661,11 @@ public function testMethodCreateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -697,26 +678,25 @@ public function testMethodUpdateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -725,10 +705,10 @@ public function testMethodUpdateName(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -743,26 +723,25 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePassword(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -771,10 +750,10 @@ public function testMethodUpdatePassword(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -789,26 +768,25 @@ public function testMethodUpdatePassword(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhone(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -817,10 +795,10 @@ public function testMethodUpdatePhone(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -836,10 +814,9 @@ public function testMethodUpdatePhone(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -852,26 +829,25 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -880,10 +856,10 @@ public function testMethodUpdatePrefs(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -893,22 +869,21 @@ public function testMethodUpdatePrefs(): void ->andReturn(''); $response = $this->account->updatePrefs( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateRecovery(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -924,17 +899,16 @@ public function testMethodCreateRecovery(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateRecovery(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -951,13 +925,12 @@ public function testMethodUpdateRecovery(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodListSessions(): void { - $data = array( + $data = [ "total" => 5, - "sessions" => array( - array( + "sessions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -984,12 +957,12 @@ public function testMethodListSessions(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1002,7 +975,6 @@ public function testMethodListSessions(): void $this->assertInstanceOf(\Appwrite\Models\SessionList::class, $response); } - public function testMethodDeleteSessions(): void { $data = ''; @@ -1018,10 +990,9 @@ public function testMethodDeleteSessions(): void $this->assertSame($data, $response); } - public function testMethodCreateAnonymousSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1048,10 +1019,10 @@ public function testMethodCreateAnonymousSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1064,10 +1035,9 @@ public function testMethodCreateAnonymousSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodCreateEmailPasswordSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1094,10 +1064,10 @@ public function testMethodCreateEmailPasswordSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1113,10 +1083,9 @@ public function testMethodCreateEmailPasswordSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdateMagicURLSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1143,10 +1112,10 @@ public function testMethodUpdateMagicURLSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1162,10 +1131,9 @@ public function testMethodUpdateMagicURLSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdatePhoneSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1192,10 +1160,10 @@ public function testMethodUpdatePhoneSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1211,10 +1179,9 @@ public function testMethodUpdatePhoneSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodCreateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1241,10 +1208,10 @@ public function testMethodCreateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1260,10 +1227,9 @@ public function testMethodCreateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodGetSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1290,10 +1256,10 @@ public function testMethodGetSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1308,10 +1274,9 @@ public function testMethodGetSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1338,10 +1303,10 @@ public function testMethodUpdateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1356,7 +1321,6 @@ public function testMethodUpdateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodDeleteSession(): void { $data = ''; @@ -1374,26 +1338,25 @@ public function testMethodDeleteSession(): void $this->assertSame($data, $response); } - public function testMethodUpdateStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1402,10 +1365,10 @@ public function testMethodUpdateStatus(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1418,17 +1381,16 @@ public function testMethodUpdateStatus(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateEmailToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1444,17 +1406,16 @@ public function testMethodCreateEmailToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateMagicURLToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1470,7 +1431,6 @@ public function testMethodCreateMagicURLToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateOAuth2Token(): void { $data = ''; @@ -1488,17 +1448,16 @@ public function testMethodCreateOAuth2Token(): void $this->assertSame($data, $response); } - public function testMethodCreatePhoneToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1514,17 +1473,16 @@ public function testMethodCreatePhoneToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1539,17 +1497,16 @@ public function testMethodCreateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1564,17 +1521,16 @@ public function testMethodCreateVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1590,17 +1546,16 @@ public function testMethodUpdateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1616,17 +1571,16 @@ public function testMethodUpdateVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1639,17 +1593,16 @@ public function testMethodCreatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1665,5 +1618,4 @@ public function testMethodUpdatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - } diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php index b1d16072..9c7a7045 100644 --- a/tests/Appwrite/Services/ActivitiesTest.php +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -1,16 +1,18 @@ 5, - "events" => array( - array( + "events" => [ + [ "\$id" => "5e5ea5c16897e", "actorType" => "user", "actorId" => "610fc2f985ee0", @@ -53,9 +55,9 @@ public function testMethodListEvents(): void "hostname" => "appwrite.io", "sdk" => "web", "sdkVersion" => "14.0.0" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -68,10 +70,9 @@ public function testMethodListEvents(): void $this->assertInstanceOf(\Appwrite\Models\ActivityEventList::class, $response); } - public function testMethodGetEvent(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "actorType" => "user", "actorId" => "610fc2f985ee0", @@ -101,7 +102,7 @@ public function testMethodGetEvent(): void "hostname" => "appwrite.io", "sdk" => "web", "sdkVersion" => "14.0.0" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -116,5 +117,4 @@ public function testMethodGetEvent(): void $this->assertInstanceOf(\Appwrite\Models\ActivityEvent::class, $response); } - } diff --git a/tests/Appwrite/Services/AdvisorTest.php b/tests/Appwrite/Services/AdvisorTest.php index 1c4f54f9..7d3b5857 100644 --- a/tests/Appwrite/Services/AdvisorTest.php +++ b/tests/Appwrite/Services/AdvisorTest.php @@ -1,16 +1,18 @@ 5, - "reports" => array( - array( + "reports" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,9 +35,9 @@ public function testMethodListReports(): void "summary" => "Performance score 78. 4 opportunities found.", "targetType" => "urls", "target" => "https://appwrite.io/", - "categories" => array(), - "insights" => array( - array( + "categories" => [], + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -49,19 +51,19 @@ public function testMethodListReports(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -74,10 +76,9 @@ public function testMethodListReports(): void $this->assertInstanceOf(\Appwrite\Models\ReportList::class, $response); } - public function testMethodGetReport(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -87,9 +88,9 @@ public function testMethodGetReport(): void "summary" => "Performance score 78. 4 opportunities found.", "targetType" => "urls", "target" => "https://appwrite.io/", - "categories" => array(), - "insights" => array( - array( + "categories" => [], + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -103,17 +104,17 @@ public function testMethodGetReport(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -128,7 +129,6 @@ public function testMethodGetReport(): void $this->assertInstanceOf(\Appwrite\Models\Report::class, $response); } - public function testMethodDeleteReport(): void { $data = ''; @@ -146,13 +146,12 @@ public function testMethodDeleteReport(): void $this->assertSame($data, $response); } - public function testMethodListInsights(): void { - $data = array( + $data = [ "total" => 5, - "insights" => array( - array( + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -166,17 +165,17 @@ public function testMethodListInsights(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -191,10 +190,9 @@ public function testMethodListInsights(): void $this->assertInstanceOf(\Appwrite\Models\InsightList::class, $response); } - public function testMethodGetInsight(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -208,15 +206,15 @@ public function testMethodGetInsight(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ); + "params" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -232,5 +230,4 @@ public function testMethodGetInsight(): void $this->assertInstanceOf(\Appwrite\Models\Insight::class, $response); } - } diff --git a/tests/Appwrite/Services/AppsTest.php b/tests/Appwrite/Services/AppsTest.php index 2e29a9d9..76da1cb0 100644 --- a/tests/Appwrite/Services/AppsTest.php +++ b/tests/Appwrite/Services/AppsTest.php @@ -1,16 +1,18 @@ 5, - "apps" => array( - array( + "apps" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,24 +35,24 @@ public function testMethodList(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -59,11 +61,11 @@ public function testMethodList(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ) - ) - ); + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -76,10 +78,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\AppsList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -89,24 +90,24 @@ public function testMethodCreate(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -115,9 +116,9 @@ public function testMethodCreate(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -129,26 +130,25 @@ public function testMethodCreate(): void $response = $this->apps->create( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodListInstallationScopes(): void { - $data = array( + $data = [ "total" => 5, - "scopes" => array( - array( + "scopes" => [ + [ "value" => "organization:organization.read", "description" => "Access to read the organization", "type" => "organization", "category" => "Organization", "deprecated" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -161,21 +161,20 @@ public function testMethodListInstallationScopes(): void $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); } - public function testMethodListOAuth2Scopes(): void { - $data = array( + $data = [ "total" => 5, - "scopes" => array( - array( + "scopes" => [ + [ "value" => "organization:organization.read", "description" => "Access to read the organization", "type" => "organization", "category" => "Organization", "deprecated" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -188,10 +187,9 @@ public function testMethodListOAuth2Scopes(): void $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -201,24 +199,24 @@ public function testMethodGet(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -227,9 +225,9 @@ public function testMethodGet(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,10 +242,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -257,24 +254,24 @@ public function testMethodUpdate(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -283,9 +280,9 @@ public function testMethodUpdate(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -301,7 +298,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -319,25 +315,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -352,20 +347,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -381,7 +375,6 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -400,16 +393,15 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodCreateInstallationToken(): void { - $data = array( + $data = [ "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", "token_type" => "Bearer", "expires_in" => 3600, "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "scope" => "openid email profile" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -425,13 +417,12 @@ public function testMethodCreateInstallationToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -440,9 +431,9 @@ public function testMethodListKeys(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -457,10 +448,9 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\AppKeyList::class, $response); } - public function testMethodCreateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -469,7 +459,7 @@ public function testMethodCreateKey(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,10 +474,9 @@ public function testMethodCreateKey(): void $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -496,7 +485,7 @@ public function testMethodGetKey(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -512,7 +501,6 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -531,10 +519,9 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -544,24 +531,24 @@ public function testMethodUpdateLabels(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -570,9 +557,9 @@ public function testMethodUpdateLabels(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -583,18 +570,17 @@ public function testMethodUpdateLabels(): void $response = $this->apps->updateLabels( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodListSecrets(): void { - $data = array( + $data = [ "total" => 5, - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -603,9 +589,9 @@ public function testMethodListSecrets(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -620,10 +606,9 @@ public function testMethodListSecrets(): void $this->assertInstanceOf(\Appwrite\Models\AppSecretList::class, $response); } - public function testMethodCreateSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -632,7 +617,7 @@ public function testMethodCreateSecret(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -647,10 +632,9 @@ public function testMethodCreateSecret(): void $this->assertInstanceOf(\Appwrite\Models\AppSecretPlaintext::class, $response); } - public function testMethodGetSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -659,7 +643,7 @@ public function testMethodGetSecret(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,7 +659,6 @@ public function testMethodGetSecret(): void $this->assertInstanceOf(\Appwrite\Models\AppSecret::class, $response); } - public function testMethodDeleteSecret(): void { $data = ''; @@ -694,10 +677,9 @@ public function testMethodDeleteSecret(): void $this->assertSame($data, $response); } - public function testMethodUpdateTeam(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -707,24 +689,24 @@ public function testMethodUpdateTeam(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -733,9 +715,9 @@ public function testMethodUpdateTeam(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -751,7 +733,6 @@ public function testMethodUpdateTeam(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodDeleteTokens(): void { $data = ''; @@ -769,5 +750,4 @@ public function testMethodDeleteTokens(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/AvatarsTest.php b/tests/Appwrite/Services/AvatarsTest.php index e299e3c6..cfa7469f 100644 --- a/tests/Appwrite/Services/AvatarsTest.php +++ b/tests/Appwrite/Services/AvatarsTest.php @@ -1,23 +1,21 @@ assertSame($data, $response); } - public function testMethodGetCreditCard(): void { $data = ''; @@ -60,7 +57,6 @@ public function testMethodGetCreditCard(): void $this->assertSame($data, $response); } - public function testMethodGetFavicon(): void { $data = ''; @@ -78,7 +74,6 @@ public function testMethodGetFavicon(): void $this->assertSame($data, $response); } - public function testMethodGetFlag(): void { $data = ''; @@ -96,7 +91,6 @@ public function testMethodGetFlag(): void $this->assertSame($data, $response); } - public function testMethodGetImage(): void { $data = ''; @@ -114,7 +108,6 @@ public function testMethodGetImage(): void $this->assertSame($data, $response); } - public function testMethodGetInitials(): void { $data = ''; @@ -130,7 +123,21 @@ public function testMethodGetInitials(): void $this->assertSame($data, $response); } + public function testMethodGetPhoto(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + $response = $this->avatars->getPhoto(); + + $this->assertSame($data, $response); + } public function testMethodGetQR(): void { $data = ''; @@ -148,7 +155,6 @@ public function testMethodGetQR(): void $this->assertSame($data, $response); } - public function testMethodGetScreenshot(): void { $data = ''; @@ -166,5 +172,4 @@ public function testMethodGetScreenshot(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/BackupsTest.php b/tests/Appwrite/Services/BackupsTest.php index ee9d09d4..353bd0d7 100644 --- a/tests/Appwrite/Services/BackupsTest.php +++ b/tests/Appwrite/Services/BackupsTest.php @@ -1,17 +1,19 @@ 5, - "archives" => array( - array( + "archives" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,11 +35,11 @@ public function testMethodListArchives(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) - ); + "services" => [], + "resources" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -50,10 +52,9 @@ public function testMethodListArchives(): void $this->assertInstanceOf(\Appwrite\Models\BackupArchiveList::class, $response); } - public function testMethodCreateArchive(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -62,9 +63,9 @@ public function testMethodCreateArchive(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ); + "services" => [], + "resources" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -74,15 +75,14 @@ public function testMethodCreateArchive(): void ->andReturn(''); $response = $this->backups->createArchive( - array(BackupServices::DATABASES()) + [BackupServices::DATABASES()] ); $this->assertInstanceOf(\Appwrite\Models\BackupArchive::class, $response); } - public function testMethodGetArchive(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -91,9 +91,9 @@ public function testMethodGetArchive(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ); + "services" => [], + "resources" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -108,7 +108,6 @@ public function testMethodGetArchive(): void $this->assertInstanceOf(\Appwrite\Models\BackupArchive::class, $response); } - public function testMethodDeleteArchive(): void { $data = ''; @@ -126,26 +125,25 @@ public function testMethodDeleteArchive(): void $this->assertSame($data, $response); } - public function testMethodListPolicies(): void { - $data = array( + $data = [ "total" => 5, - "policies" => array( - array( + "policies" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -158,21 +156,20 @@ public function testMethodListPolicies(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicyList::class, $response); } - public function testMethodCreatePolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -183,28 +180,27 @@ public function testMethodCreatePolicy(): void $response = $this->backups->createPolicy( "", - array(BackupServices::DATABASES()), + [BackupServices::DATABASES()], 1, "" ); $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodGetPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -219,21 +215,20 @@ public function testMethodGetPolicy(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodUpdatePolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -248,7 +243,6 @@ public function testMethodUpdatePolicy(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodDeletePolicy(): void { $data = ''; @@ -266,10 +260,9 @@ public function testMethodDeletePolicy(): void $this->assertSame($data, $response); } - public function testMethodCreateRestoration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -278,10 +271,10 @@ public function testMethodCreateRestoration(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -292,18 +285,17 @@ public function testMethodCreateRestoration(): void $response = $this->backups->createRestoration( "", - array(BackupServices::DATABASES()) + [BackupServices::DATABASES()] ); $this->assertInstanceOf(\Appwrite\Models\BackupRestoration::class, $response); } - public function testMethodListRestorations(): void { - $data = array( + $data = [ "total" => 5, - "restorations" => array( - array( + "restorations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,12 +304,12 @@ public function testMethodListRestorations(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -330,10 +322,9 @@ public function testMethodListRestorations(): void $this->assertInstanceOf(\Appwrite\Models\BackupRestorationList::class, $response); } - public function testMethodGetRestoration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -342,10 +333,10 @@ public function testMethodGetRestoration(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -360,5 +351,4 @@ public function testMethodGetRestoration(): void $this->assertInstanceOf(\Appwrite\Models\BackupRestoration::class, $response); } - } diff --git a/tests/Appwrite/Services/DatabasesTest.php b/tests/Appwrite/Services/DatabasesTest.php index cacd8583..4c61a66a 100644 --- a/tests/Appwrite/Services/DatabasesTest.php +++ b/tests/Appwrite/Services/DatabasesTest.php @@ -1,20 +1,20 @@ 5, - "databases" => array( - array( + "databases" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,17 +49,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,22 +74,21 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodListTransactions(): void { - $data = array( + $data = [ "total" => 5, - "transactions" => array( - array( + "transactions" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -103,17 +101,16 @@ public function testMethodListTransactions(): void $this->assertInstanceOf(\Appwrite\Models\TransactionList::class, $response); } - public function testMethodCreateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -126,17 +123,16 @@ public function testMethodCreateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGetTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -151,17 +147,16 @@ public function testMethodGetTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodUpdateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -176,7 +171,6 @@ public function testMethodUpdateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodDeleteTransaction(): void { $data = ''; @@ -194,17 +188,16 @@ public function testMethodDeleteTransaction(): void $this->assertSame($data, $response); } - public function testMethodCreateOperations(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -219,17 +212,16 @@ public function testMethodCreateOperations(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,17 +236,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -269,7 +260,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -287,24 +277,23 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListCollections(): void { - $data = array( + $data = [ "total" => 5, - "collections" => array( - array( + "collections" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,15 +301,15 @@ public function testMethodListCollections(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -335,21 +324,20 @@ public function testMethodListCollections(): void $this->assertInstanceOf(\Appwrite\Models\CollectionList::class, $response); } - public function testMethodCreateCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -357,13 +345,13 @@ public function testMethodCreateCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -380,21 +368,20 @@ public function testMethodCreateCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodGetCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -402,13 +389,13 @@ public function testMethodGetCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -424,21 +411,20 @@ public function testMethodGetCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodUpdateCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -446,13 +432,13 @@ public function testMethodUpdateCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -468,7 +454,6 @@ public function testMethodUpdateCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodDeleteCollection(): void { $data = ''; @@ -487,13 +472,12 @@ public function testMethodDeleteCollection(): void $this->assertSame($data, $response); } - public function testMethodListAttributes(): void { - $data = array( + $data = [ "total" => 5, - "attributes" => array() - ); + "attributes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -509,10 +493,9 @@ public function testMethodListAttributes(): void $this->assertInstanceOf(\Appwrite\Models\AttributeList::class, $response); } - public function testMethodCreateBigIntAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -520,7 +503,7 @@ public function testMethodCreateBigIntAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -538,10 +521,9 @@ public function testMethodCreateBigIntAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBigint::class, $response); } - public function testMethodUpdateBigIntAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -549,7 +531,7 @@ public function testMethodUpdateBigIntAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -568,10 +550,9 @@ public function testMethodUpdateBigIntAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBigint::class, $response); } - public function testMethodCreateBooleanAttribute(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -579,7 +560,7 @@ public function testMethodCreateBooleanAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -597,10 +578,9 @@ public function testMethodCreateBooleanAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBoolean::class, $response); } - public function testMethodUpdateBooleanAttribute(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -608,7 +588,7 @@ public function testMethodUpdateBooleanAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -627,10 +607,9 @@ public function testMethodUpdateBooleanAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBoolean::class, $response); } - public function testMethodCreateDatetimeAttribute(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -639,7 +618,7 @@ public function testMethodCreateDatetimeAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -657,10 +636,9 @@ public function testMethodCreateDatetimeAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeDatetime::class, $response); } - public function testMethodUpdateDatetimeAttribute(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -669,7 +647,7 @@ public function testMethodUpdateDatetimeAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -688,10 +666,9 @@ public function testMethodUpdateDatetimeAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeDatetime::class, $response); } - public function testMethodCreateEmailAttribute(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -700,7 +677,7 @@ public function testMethodCreateEmailAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -718,10 +695,9 @@ public function testMethodCreateEmailAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeEmail::class, $response); } - public function testMethodUpdateEmailAttribute(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -730,7 +706,7 @@ public function testMethodUpdateEmailAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -749,10 +725,9 @@ public function testMethodUpdateEmailAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeEmail::class, $response); } - public function testMethodCreateEnumAttribute(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -760,9 +735,9 @@ public function testMethodCreateEnumAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -775,16 +750,15 @@ public function testMethodCreateEnumAttribute(): void "", "", "", - array(), + [], true ); $this->assertInstanceOf(\Appwrite\Models\AttributeEnum::class, $response); } - public function testMethodUpdateEnumAttribute(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -792,9 +766,9 @@ public function testMethodUpdateEnumAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -807,17 +781,16 @@ public function testMethodUpdateEnumAttribute(): void "", "", "", - array(), + [], true, "" ); $this->assertInstanceOf(\Appwrite\Models\AttributeEnum::class, $response); } - public function testMethodCreateFloatAttribute(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -825,7 +798,7 @@ public function testMethodCreateFloatAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -843,10 +816,9 @@ public function testMethodCreateFloatAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeFloat::class, $response); } - public function testMethodUpdateFloatAttribute(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -854,7 +826,7 @@ public function testMethodUpdateFloatAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -873,10 +845,9 @@ public function testMethodUpdateFloatAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeFloat::class, $response); } - public function testMethodCreateIntegerAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -884,7 +855,7 @@ public function testMethodCreateIntegerAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -902,10 +873,9 @@ public function testMethodCreateIntegerAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeInteger::class, $response); } - public function testMethodUpdateIntegerAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -913,7 +883,7 @@ public function testMethodUpdateIntegerAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -932,10 +902,9 @@ public function testMethodUpdateIntegerAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeInteger::class, $response); } - public function testMethodCreateIpAttribute(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -944,7 +913,7 @@ public function testMethodCreateIpAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -962,10 +931,9 @@ public function testMethodCreateIpAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeIp::class, $response); } - public function testMethodUpdateIpAttribute(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -974,7 +942,7 @@ public function testMethodUpdateIpAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -993,10 +961,9 @@ public function testMethodUpdateIpAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeIp::class, $response); } - public function testMethodCreateLineAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1004,7 +971,7 @@ public function testMethodCreateLineAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1022,10 +989,9 @@ public function testMethodCreateLineAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLine::class, $response); } - public function testMethodUpdateLineAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1033,7 +999,7 @@ public function testMethodUpdateLineAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1051,10 +1017,9 @@ public function testMethodUpdateLineAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLine::class, $response); } - public function testMethodCreateLongtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1062,7 +1027,7 @@ public function testMethodCreateLongtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1080,10 +1045,9 @@ public function testMethodCreateLongtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLongtext::class, $response); } - public function testMethodUpdateLongtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1091,7 +1055,7 @@ public function testMethodUpdateLongtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1110,10 +1074,9 @@ public function testMethodUpdateLongtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLongtext::class, $response); } - public function testMethodCreateMediumtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1121,7 +1084,7 @@ public function testMethodCreateMediumtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1139,10 +1102,9 @@ public function testMethodCreateMediumtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeMediumtext::class, $response); } - public function testMethodUpdateMediumtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1150,7 +1112,7 @@ public function testMethodUpdateMediumtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1169,10 +1131,9 @@ public function testMethodUpdateMediumtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeMediumtext::class, $response); } - public function testMethodCreatePointAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1180,7 +1141,7 @@ public function testMethodCreatePointAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1198,10 +1159,9 @@ public function testMethodCreatePointAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePoint::class, $response); } - public function testMethodUpdatePointAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1209,7 +1169,7 @@ public function testMethodUpdatePointAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1227,10 +1187,9 @@ public function testMethodUpdatePointAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePoint::class, $response); } - public function testMethodCreatePolygonAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1238,7 +1197,7 @@ public function testMethodCreatePolygonAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1256,10 +1215,9 @@ public function testMethodCreatePolygonAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePolygon::class, $response); } - public function testMethodUpdatePolygonAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1267,7 +1225,7 @@ public function testMethodUpdatePolygonAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1285,10 +1243,9 @@ public function testMethodUpdatePolygonAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePolygon::class, $response); } - public function testMethodCreateRelationshipAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1302,7 +1259,7 @@ public function testMethodCreateRelationshipAttribute(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1320,10 +1277,9 @@ public function testMethodCreateRelationshipAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeRelationship::class, $response); } - public function testMethodUpdateRelationshipAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1337,7 +1293,7 @@ public function testMethodUpdateRelationshipAttribute(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1354,10 +1310,9 @@ public function testMethodUpdateRelationshipAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeRelationship::class, $response); } - public function testMethodCreateStringAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1366,7 +1321,7 @@ public function testMethodCreateStringAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1385,10 +1340,9 @@ public function testMethodCreateStringAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodUpdateStringAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1397,7 +1351,7 @@ public function testMethodUpdateStringAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1416,10 +1370,9 @@ public function testMethodUpdateStringAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodCreateTextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1427,7 +1380,7 @@ public function testMethodCreateTextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1445,10 +1398,9 @@ public function testMethodCreateTextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeText::class, $response); } - public function testMethodUpdateTextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1456,7 +1408,7 @@ public function testMethodUpdateTextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1475,10 +1427,9 @@ public function testMethodUpdateTextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeText::class, $response); } - public function testMethodCreateUrlAttribute(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1487,7 +1438,7 @@ public function testMethodCreateUrlAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1505,10 +1456,9 @@ public function testMethodCreateUrlAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeUrl::class, $response); } - public function testMethodUpdateUrlAttribute(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1517,7 +1467,7 @@ public function testMethodUpdateUrlAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1536,10 +1486,9 @@ public function testMethodUpdateUrlAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeUrl::class, $response); } - public function testMethodCreateVarcharAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1548,7 +1497,7 @@ public function testMethodCreateVarcharAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1567,10 +1516,9 @@ public function testMethodCreateVarcharAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeVarchar::class, $response); } - public function testMethodUpdateVarcharAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1579,7 +1527,7 @@ public function testMethodUpdateVarcharAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1598,11 +1546,10 @@ public function testMethodUpdateVarcharAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeVarchar::class, $response); } - public function testMethodGetAttribute(): void { $data = array_replace( - array( + [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1611,10 +1558,10 @@ public function testMethodGetAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ), - array( + ], + [ "type" => "string" - ) + ] ); $this->client @@ -1632,7 +1579,6 @@ public function testMethodGetAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodDeleteAttribute(): void { $data = ''; @@ -1652,23 +1598,22 @@ public function testMethodDeleteAttribute(): void $this->assertSame($data, $response); } - public function testMethodListDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1684,18 +1629,17 @@ public function testMethodListDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodCreateDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1708,28 +1652,27 @@ public function testMethodCreateDocument(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodCreateDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1741,28 +1684,27 @@ public function testMethodCreateDocuments(): void $response = $this->databases->createDocuments( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodUpsertDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1774,28 +1716,27 @@ public function testMethodUpsertDocuments(): void $response = $this->databases->upsertDocuments( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodUpdateDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1811,23 +1752,22 @@ public function testMethodUpdateDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodDeleteDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1843,18 +1783,17 @@ public function testMethodDeleteDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodGetDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1871,18 +1810,17 @@ public function testMethodGetDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodUpsertDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1899,18 +1837,17 @@ public function testMethodUpsertDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodUpdateDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1927,7 +1864,6 @@ public function testMethodUpdateDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodDeleteDocument(): void { $data = ''; @@ -1947,18 +1883,17 @@ public function testMethodDeleteDocument(): void $this->assertSame($data, $response); } - public function testMethodDecrementDocumentAttribute(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1976,18 +1911,17 @@ public function testMethodDecrementDocumentAttribute(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodIncrementDocumentAttribute(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2005,13 +1939,12 @@ public function testMethodIncrementDocumentAttribute(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodListIndexes(): void { - $data = array( + $data = [ "total" => 5, - "indexes" => array( - array( + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2019,11 +1952,11 @@ public function testMethodListIndexes(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ) - ); + "attributes" => [], + "lengths" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2039,10 +1972,9 @@ public function testMethodListIndexes(): void $this->assertInstanceOf(\Appwrite\Models\IndexList::class, $response); } - public function testMethodCreateIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2050,9 +1982,9 @@ public function testMethodCreateIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ); + "attributes" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2066,15 +1998,14 @@ public function testMethodCreateIndex(): void "", "", DatabasesIndexType::KEY(), - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Index::class, $response); } - public function testMethodGetIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2082,9 +2013,9 @@ public function testMethodGetIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ); + "attributes" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2101,7 +2032,6 @@ public function testMethodGetIndex(): void $this->assertInstanceOf(\Appwrite\Models\Index::class, $response); } - public function testMethodDeleteIndex(): void { $data = ''; @@ -2121,5 +2051,4 @@ public function testMethodDeleteIndex(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/EmbeddingsTest.php b/tests/Appwrite/Services/EmbeddingsTest.php index e7717667..b6595dae 100644 --- a/tests/Appwrite/Services/EmbeddingsTest.php +++ b/tests/Appwrite/Services/EmbeddingsTest.php @@ -1,17 +1,18 @@ 5, - "embeddings" => array( - array( + "embeddings" => [ + [ "model" => "nomic-embed-text", "dimension" => 768, - "embedding" => array(), + "embedding" => [], "error" => "Error message" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -41,10 +42,9 @@ public function testMethodCreateTextEmbeddings(): void ->andReturn(''); $response = $this->embeddings->createTextEmbeddings( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\EmbeddingList::class, $response); } - } diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 680d897c..0e950d3a 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -1,22 +1,22 @@ 5, - "functions" => array( - array( + "functions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -45,9 +45,9 @@ public function testMethodList(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -56,9 +56,9 @@ public function testMethodList(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -69,13 +69,13 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -88,14 +88,13 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\FunctionList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -107,9 +106,9 @@ public function testMethodCreate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -118,9 +117,9 @@ public function testMethodCreate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -131,11 +130,11 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -152,13 +151,12 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodListRuntimes(): void { - $data = array( + $data = [ "total" => 5, - "runtimes" => array( - array( + "runtimes" => [ + [ "\$id" => "python-3.8", "key" => "python", "name" => "Python", @@ -166,10 +164,10 @@ public function testMethodListRuntimes(): void "base" => "python:3.8-alpine", "image" => "appwrite\\/runtime-for-python:3.8", "logo" => "python.png", - "supports" => array() - ) - ) - ); + "supports" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -182,20 +180,19 @@ public function testMethodListRuntimes(): void $this->assertInstanceOf(\Appwrite\Models\RuntimeList::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( + $data = [ "total" => 5, - "specifications" => array( - array( + "specifications" => [ + [ "memory" => 512, "cpus" => 1, "enabled" => true, "slug" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -208,14 +205,13 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\SpecificationList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -227,9 +223,9 @@ public function testMethodGet(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -238,9 +234,9 @@ public function testMethodGet(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -251,11 +247,11 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -270,14 +266,13 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -289,9 +284,9 @@ public function testMethodUpdate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -300,9 +295,9 @@ public function testMethodUpdate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -313,11 +308,11 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -333,7 +328,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -351,14 +345,13 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateFunctionDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -370,9 +363,9 @@ public function testMethodUpdateFunctionDeployment(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -381,9 +374,9 @@ public function testMethodUpdateFunctionDeployment(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -394,11 +387,11 @@ public function testMethodUpdateFunctionDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -414,13 +407,12 @@ public function testMethodUpdateFunctionDeployment(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodListDeployments(): void { - $data = array( + $data = [ "total" => 5, - "deployments" => array( - array( + "deployments" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -448,9 +440,9 @@ public function testMethodListDeployments(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -465,10 +457,9 @@ public function testMethodListDeployments(): void $this->assertInstanceOf(\Appwrite\Models\DeploymentList::class, $response); } - public function testMethodCreateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -496,7 +487,7 @@ public function testMethodCreateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -513,10 +504,9 @@ public function testMethodCreateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateDuplicateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -544,7 +534,7 @@ public function testMethodCreateDuplicateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -560,10 +550,9 @@ public function testMethodCreateDuplicateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateTemplateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -591,7 +580,7 @@ public function testMethodCreateTemplateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -611,10 +600,9 @@ public function testMethodCreateTemplateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateVcsDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -642,7 +630,7 @@ public function testMethodCreateVcsDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -659,10 +647,9 @@ public function testMethodCreateVcsDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodGetDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -690,7 +677,7 @@ public function testMethodGetDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -706,7 +693,6 @@ public function testMethodGetDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodDeleteDeployment(): void { $data = ''; @@ -725,7 +711,6 @@ public function testMethodDeleteDeployment(): void $this->assertSame($data, $response); } - public function testMethodGetDeploymentDownload(): void { $data = ''; @@ -744,10 +729,9 @@ public function testMethodGetDeploymentDownload(): void $this->assertSame($data, $response); } - public function testMethodUpdateDeploymentStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -775,7 +759,7 @@ public function testMethodUpdateDeploymentStatus(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -791,43 +775,43 @@ public function testMethodUpdateDeploymentStatus(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodListExecutions(): void { - $data = array( + $data = [ "total" => 5, - "executions" => array( - array( + "executions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -842,38 +826,38 @@ public function testMethodListExecutions(): void $this->assertInstanceOf(\Appwrite\Models\ExecutionList::class, $response); } - public function testMethodCreateExecution(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,38 +872,38 @@ public function testMethodCreateExecution(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodGetExecution(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -935,7 +919,6 @@ public function testMethodGetExecution(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodDeleteExecution(): void { $data = ''; @@ -954,13 +937,12 @@ public function testMethodDeleteExecution(): void $this->assertSame($data, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -969,9 +951,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -986,10 +968,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,7 +979,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1016,10 +997,9 @@ public function testMethodCreateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1028,7 +1008,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1044,10 +1024,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1056,7 +1035,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1072,7 +1051,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -1091,5 +1069,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/GraphqlTest.php b/tests/Appwrite/Services/GraphqlTest.php index 19898d95..704a78ac 100644 --- a/tests/Appwrite/Services/GraphqlTest.php +++ b/tests/Appwrite/Services/GraphqlTest.php @@ -1,16 +1,18 @@ client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -30,15 +32,14 @@ public function testMethodQuery(): void ->andReturn(''); $response = $this->graphql->query( - array() + [] ); $this->assertSame($data, $response); } - public function testMethodMutation(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -48,10 +49,9 @@ public function testMethodMutation(): void ->andReturn(''); $response = $this->graphql->mutation( - array() + [] ); $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/LocaleTest.php b/tests/Appwrite/Services/LocaleTest.php index fff451b3..03844de9 100644 --- a/tests/Appwrite/Services/LocaleTest.php +++ b/tests/Appwrite/Services/LocaleTest.php @@ -1,16 +1,18 @@ "127.0.0.1", "countryCode" => "US", "country" => "United States", @@ -28,7 +30,7 @@ public function testMethodGet(): void "continent" => "North America", "eu" => true, "currency" => "USD" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -41,18 +43,17 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Locale::class, $response); } - public function testMethodListCodes(): void { - $data = array( + $data = [ "total" => 5, - "localeCodes" => array( - array( + "localeCodes" => [ + [ "code" => "en-us", "name" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -65,18 +66,17 @@ public function testMethodListCodes(): void $this->assertInstanceOf(\Appwrite\Models\LocaleCodeList::class, $response); } - public function testMethodListContinents(): void { - $data = array( + $data = [ "total" => 5, - "continents" => array( - array( + "continents" => [ + [ "name" => "Europe", "code" => "EU" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -89,18 +89,17 @@ public function testMethodListContinents(): void $this->assertInstanceOf(\Appwrite\Models\ContinentList::class, $response); } - public function testMethodListCountries(): void { - $data = array( + $data = [ "total" => 5, - "countries" => array( - array( + "countries" => [ + [ "name" => "United States", "code" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -113,18 +112,17 @@ public function testMethodListCountries(): void $this->assertInstanceOf(\Appwrite\Models\CountryList::class, $response); } - public function testMethodListCountriesEU(): void { - $data = array( + $data = [ "total" => 5, - "countries" => array( - array( + "countries" => [ + [ "name" => "United States", "code" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -137,19 +135,18 @@ public function testMethodListCountriesEU(): void $this->assertInstanceOf(\Appwrite\Models\CountryList::class, $response); } - public function testMethodListCountriesPhones(): void { - $data = array( + $data = [ "total" => 5, - "phones" => array( - array( + "phones" => [ + [ "code" => "+1", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -162,13 +159,12 @@ public function testMethodListCountriesPhones(): void $this->assertInstanceOf(\Appwrite\Models\PhoneList::class, $response); } - public function testMethodListCurrencies(): void { - $data = array( + $data = [ "total" => 5, - "currencies" => array( - array( + "currencies" => [ + [ "symbol" => "\$", "name" => "US dollar", "symbolNative" => "\$", @@ -176,9 +172,9 @@ public function testMethodListCurrencies(): void "rounding" => 0, "code" => "USD", "namePlural" => "US dollars" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -191,19 +187,18 @@ public function testMethodListCurrencies(): void $this->assertInstanceOf(\Appwrite\Models\CurrencyList::class, $response); } - public function testMethodListLanguages(): void { - $data = array( + $data = [ "total" => 5, - "languages" => array( - array( + "languages" => [ + [ "name" => "Italian", "code" => "it", "nativeName" => "Italiano" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -216,5 +211,4 @@ public function testMethodListLanguages(): void $this->assertInstanceOf(\Appwrite\Models\LanguageList::class, $response); } - } diff --git a/tests/Appwrite/Services/MessagingTest.php b/tests/Appwrite/Services/MessagingTest.php index 2c51919a..3ba423ce 100644 --- a/tests/Appwrite/Services/MessagingTest.php +++ b/tests/Appwrite/Services/MessagingTest.php @@ -1,18 +1,18 @@ 5, - "messages" => array( - array( + "messages" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -51,21 +51,20 @@ public function testMethodListMessages(): void $this->assertInstanceOf(\Appwrite\Models\MessageList::class, $response); } - public function testMethodCreateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -82,21 +81,20 @@ public function testMethodCreateEmail(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -111,21 +109,20 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodCreatePush(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -140,21 +137,20 @@ public function testMethodCreatePush(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdatePush(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -169,21 +165,20 @@ public function testMethodUpdatePush(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodCreateSMS(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -199,21 +194,20 @@ public function testMethodCreateSMS(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdateSMS(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -228,21 +222,20 @@ public function testMethodUpdateSMS(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodGetMessage(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -257,7 +250,6 @@ public function testMethodGetMessage(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -275,13 +267,12 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListTargets(): void { - $data = array( + $data = [ "total" => 5, - "targets" => array( - array( + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -290,9 +281,9 @@ public function testMethodListTargets(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -307,13 +298,12 @@ public function testMethodListTargets(): void $this->assertInstanceOf(\Appwrite\Models\TargetList::class, $response); } - public function testMethodListProviders(): void { - $data = array( + $data = [ "total" => 5, - "providers" => array( - array( + "providers" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -321,10 +311,10 @@ public function testMethodListProviders(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ) - ) - ); + "credentials" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -337,10 +327,9 @@ public function testMethodListProviders(): void $this->assertInstanceOf(\Appwrite\Models\ProviderList::class, $response); } - public function testMethodCreateAPNSProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -348,8 +337,8 @@ public function testMethodCreateAPNSProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -365,10 +354,9 @@ public function testMethodCreateAPNSProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateAPNSProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -376,8 +364,8 @@ public function testMethodUpdateAPNSProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -392,10 +380,9 @@ public function testMethodUpdateAPNSProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateFCMProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -403,8 +390,8 @@ public function testMethodCreateFCMProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -420,10 +407,9 @@ public function testMethodCreateFCMProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateFCMProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -431,8 +417,8 @@ public function testMethodUpdateFCMProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -447,10 +433,9 @@ public function testMethodUpdateFCMProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateMailgunProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -458,8 +443,8 @@ public function testMethodCreateMailgunProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -475,10 +460,9 @@ public function testMethodCreateMailgunProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateMailgunProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -486,8 +470,8 @@ public function testMethodUpdateMailgunProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -502,10 +486,9 @@ public function testMethodUpdateMailgunProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateMsg91Provider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -513,8 +496,8 @@ public function testMethodCreateMsg91Provider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -530,10 +513,9 @@ public function testMethodCreateMsg91Provider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateMsg91Provider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -541,8 +523,8 @@ public function testMethodUpdateMsg91Provider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -557,10 +539,9 @@ public function testMethodUpdateMsg91Provider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateResendProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -568,8 +549,8 @@ public function testMethodCreateResendProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -585,10 +566,9 @@ public function testMethodCreateResendProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateResendProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -596,8 +576,8 @@ public function testMethodUpdateResendProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -612,10 +592,9 @@ public function testMethodUpdateResendProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSendgridProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -623,8 +602,8 @@ public function testMethodCreateSendgridProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -640,10 +619,9 @@ public function testMethodCreateSendgridProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSendgridProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -651,8 +629,8 @@ public function testMethodUpdateSendgridProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -667,10 +645,9 @@ public function testMethodUpdateSendgridProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSesProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -678,8 +655,8 @@ public function testMethodCreateSesProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -695,10 +672,9 @@ public function testMethodCreateSesProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSesProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -706,8 +682,8 @@ public function testMethodUpdateSesProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -722,10 +698,9 @@ public function testMethodUpdateSesProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSMTPProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -733,8 +708,8 @@ public function testMethodCreateSMTPProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -751,10 +726,9 @@ public function testMethodCreateSMTPProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSMTPProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -762,8 +736,8 @@ public function testMethodUpdateSMTPProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -778,10 +752,9 @@ public function testMethodUpdateSMTPProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTelesignProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -789,8 +762,8 @@ public function testMethodCreateTelesignProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -806,10 +779,9 @@ public function testMethodCreateTelesignProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTelesignProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -817,8 +789,8 @@ public function testMethodUpdateTelesignProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -833,10 +805,9 @@ public function testMethodUpdateTelesignProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTextmagicProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -844,8 +815,8 @@ public function testMethodCreateTextmagicProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -861,10 +832,9 @@ public function testMethodCreateTextmagicProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTextmagicProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -872,8 +842,8 @@ public function testMethodUpdateTextmagicProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,10 +858,9 @@ public function testMethodUpdateTextmagicProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTwilioProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -899,8 +868,8 @@ public function testMethodCreateTwilioProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -916,10 +885,9 @@ public function testMethodCreateTwilioProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTwilioProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -927,8 +895,8 @@ public function testMethodUpdateTwilioProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -943,10 +911,9 @@ public function testMethodUpdateTwilioProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateVonageProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -954,8 +921,8 @@ public function testMethodCreateVonageProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -971,10 +938,9 @@ public function testMethodCreateVonageProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateVonageProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -982,8 +948,8 @@ public function testMethodUpdateVonageProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -998,10 +964,9 @@ public function testMethodUpdateVonageProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodGetProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1009,8 +974,8 @@ public function testMethodGetProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1025,7 +990,6 @@ public function testMethodGetProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodDeleteProvider(): void { $data = ''; @@ -1043,13 +1007,12 @@ public function testMethodDeleteProvider(): void $this->assertSame($data, $response); } - public function testMethodListTopics(): void { - $data = array( + $data = [ "total" => 5, - "topics" => array( - array( + "topics" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1057,10 +1020,10 @@ public function testMethodListTopics(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ) - ) - ); + "subscribe" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1073,10 +1036,9 @@ public function testMethodListTopics(): void $this->assertInstanceOf(\Appwrite\Models\TopicList::class, $response); } - public function testMethodCreateTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1084,8 +1046,8 @@ public function testMethodCreateTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1101,10 +1063,9 @@ public function testMethodCreateTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodGetTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1112,8 +1073,8 @@ public function testMethodGetTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1128,10 +1089,9 @@ public function testMethodGetTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodUpdateTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1139,8 +1099,8 @@ public function testMethodUpdateTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1155,7 +1115,6 @@ public function testMethodUpdateTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodDeleteTopic(): void { $data = ''; @@ -1173,18 +1132,17 @@ public function testMethodDeleteTopic(): void $this->assertSame($data, $response); } - public function testMethodListSubscribers(): void { - $data = array( + $data = [ "total" => 5, - "subscribers" => array( - array( + "subscribers" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1193,14 +1151,14 @@ public function testMethodListSubscribers(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1215,15 +1173,14 @@ public function testMethodListSubscribers(): void $this->assertInstanceOf(\Appwrite\Models\SubscriberList::class, $response); } - public function testMethodCreateSubscriber(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1232,12 +1189,12 @@ public function testMethodCreateSubscriber(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1254,15 +1211,14 @@ public function testMethodCreateSubscriber(): void $this->assertInstanceOf(\Appwrite\Models\Subscriber::class, $response); } - public function testMethodGetSubscriber(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1271,12 +1227,12 @@ public function testMethodGetSubscriber(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1292,7 +1248,6 @@ public function testMethodGetSubscriber(): void $this->assertInstanceOf(\Appwrite\Models\Subscriber::class, $response); } - public function testMethodDeleteSubscriber(): void { $data = ''; @@ -1311,5 +1266,4 @@ public function testMethodDeleteSubscriber(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/Oauth2Test.php b/tests/Appwrite/Services/Oauth2Test.php index 3bf122fc..bfff4992 100644 --- a/tests/Appwrite/Services/Oauth2Test.php +++ b/tests/Appwrite/Services/Oauth2Test.php @@ -1,16 +1,18 @@ "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -37,13 +39,12 @@ public function testMethodApprove(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Approve::class, $response); } - public function testMethodAuthorize(): void { - $data = array( + $data = [ "grantId" => "5e5ea5c16897e", "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -56,13 +57,12 @@ public function testMethodAuthorize(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); } - public function testMethodAuthorizePost(): void { - $data = array( + $data = [ "grantId" => "5e5ea5c16897e", "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,17 +75,16 @@ public function testMethodAuthorizePost(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); } - public function testMethodCreateDeviceAuthorization(): void { - $data = array( + $data = [ "device_code" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", "user_code" => "ABCD-EFGH", "verification_uri" => "https://cloud.appwrite.io/console/oauth2/device", "verification_uri_complete" => "https://cloud.appwrite.io/console/oauth2/device?user_code=ABCD-EFGH", "expires_in" => 900, "interval" => 5 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -98,23 +97,22 @@ public function testMethodCreateDeviceAuthorization(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2DeviceAuthorization::class, $response); } - public function testMethodCreateGrant(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "prompt" => "login", "redirectUri" => "https://example.com/callback", "authTime" => 1592981250, "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -129,23 +127,22 @@ public function testMethodCreateGrant(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); } - public function testMethodGetGrant(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "prompt" => "login", "redirectUri" => "https://example.com/callback", "authTime" => 1592981250, "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -160,17 +157,16 @@ public function testMethodGetGrant(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); } - public function testMethodListOrganizations(): void { - $data = array( + $data = [ "total" => 5, - "organizations" => array( - array( + "organizations" => [ + [ "\$id" => "5e5ea5c16897e" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -183,13 +179,12 @@ public function testMethodListOrganizations(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2OrganizationList::class, $response); } - public function testMethodCreatePAR(): void { - $data = array( + $data = [ "request_uri" => "urn:appwrite:oauth2:request:5e5ea5c16897e", "expires_in" => 600 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -206,19 +201,18 @@ public function testMethodCreatePAR(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2PAR::class, $response); } - public function testMethodListProjects(): void { - $data = array( + $data = [ "total" => 5, - "projects" => array( - array( + "projects" => [ + [ "\$id" => "5e5ea5c16897e", "region" => "fra", "endpoint" => "https://fra.cloud.appwrite.io/v1" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -231,12 +225,11 @@ public function testMethodListProjects(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ProjectList::class, $response); } - public function testMethodReject(): void { - $data = array( + $data = [ "redirectUrl" => "https://example.com/callback?error=access_denied&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -251,10 +244,9 @@ public function testMethodReject(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Reject::class, $response); } - public function testMethodRevoke(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -269,16 +261,15 @@ public function testMethodRevoke(): void $this->assertSame($data, $response); } - public function testMethodCreateToken(): void { - $data = array( + $data = [ "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", "token_type" => "Bearer", "expires_in" => 3600, "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "scope" => "openid email profile" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -293,5 +284,4 @@ public function testMethodCreateToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); } - } diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php index 9d24d59c..b60dcc80 100644 --- a/tests/Appwrite/Services/OrganizationTest.php +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -1,18 +1,19 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array(), - "budgetAlerts" => array(), + "prefs" => [], + "budgetAlerts" => [], "billingPlan" => "tier-1", "billingPlanId" => "tier-1", - "billingPlanDetails" => array( + "billingPlanDetails" => [ "\$id" => "tier-0", "name" => "Hobby", "desc" => "Hobby plan", @@ -69,73 +70,73 @@ public function testMethodGet(): void "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, - "usage" => array( - "bandwidth" => array( + "usage" => [ + "bandwidth" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "executions" => array( + ], + "executions" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtime" => array( + ], + "realtime" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtimeMessages" => array( + ], + "realtimeMessages" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "storage" => array( + ], + "storage" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "users" => array( + ], + "users" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "GBHours" => array( + ], + "GBHours" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "imageTransformations" => array( + ], + "imageTransformations" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array(), + ] + ], + "addons" => [], "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -148,22 +149,24 @@ public function testMethodGet(): void "supportsMockNumbers" => true, "supportsOrganizationRoles" => true, "supportsCredits" => true, + "supportsDedicatedDatabases" => true, "supportsDisposableEmailValidation" => true, "supportsCanonicalEmailValidation" => true, "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, "usagePerProject" => true, - "supportedAddons" => array( + "supportedAddons" => [ "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true - ), + ], "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, - "group" => "starter" - ), + "group" => "starter", + "databaseComputeCredit" => 10 + ], "billingEmail" => "billing@org.example", "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", @@ -175,8 +178,8 @@ public function testMethodGet(): void "status" => "active", "markedForDeletion" => true, "platform" => "imagine", - "projects" => array() - ); + "projects" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -189,20 +192,19 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array(), - "budgetAlerts" => array(), + "prefs" => [], + "budgetAlerts" => [], "billingPlan" => "tier-1", "billingPlanId" => "tier-1", - "billingPlanDetails" => array( + "billingPlanDetails" => [ "\$id" => "tier-0", "name" => "Hobby", "desc" => "Hobby plan", @@ -239,73 +241,73 @@ public function testMethodUpdate(): void "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, - "usage" => array( - "bandwidth" => array( + "usage" => [ + "bandwidth" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "executions" => array( + ], + "executions" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtime" => array( + ], + "realtime" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtimeMessages" => array( + ], + "realtimeMessages" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "storage" => array( + ], + "storage" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "users" => array( + ], + "users" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "GBHours" => array( + ], + "GBHours" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "imageTransformations" => array( + ], + "imageTransformations" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array(), + ] + ], + "addons" => [], "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -318,22 +320,24 @@ public function testMethodUpdate(): void "supportsMockNumbers" => true, "supportsOrganizationRoles" => true, "supportsCredits" => true, + "supportsDedicatedDatabases" => true, "supportsDisposableEmailValidation" => true, "supportsCanonicalEmailValidation" => true, "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, "usagePerProject" => true, - "supportedAddons" => array( + "supportedAddons" => [ "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true - ), + ], "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, - "group" => "starter" - ), + "group" => "starter", + "databaseComputeCredit" => 10 + ], "billingEmail" => "billing@org.example", "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", @@ -345,8 +349,8 @@ public function testMethodUpdate(): void "status" => "active", "markedForDeletion" => true, "platform" => "imagine", - "projects" => array() - ); + "projects" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -361,7 +365,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -377,25 +380,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -408,20 +410,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodCreateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -436,20 +437,19 @@ public function testMethodCreateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -464,20 +464,19 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodUpdateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -492,7 +491,6 @@ public function testMethodUpdateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -510,25 +508,24 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ) - ); + "sdks" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -541,20 +538,19 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\KeyList::class, $response); } - public function testMethodCreateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -566,25 +562,24 @@ public function testMethodCreateKey(): void $response = $this->organization->createKey( "", "", - array(OrganizationKeyScopes::PROJECTSREAD()) + [OrganizationKeyScopes::PROJECTSREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -599,20 +594,19 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodUpdateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -624,12 +618,11 @@ public function testMethodUpdateKey(): void $response = $this->organization->updateKey( "", "", - array(OrganizationKeyScopes::PROJECTSREAD()) + [OrganizationKeyScopes::PROJECTSREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -647,13 +640,12 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -668,10 +660,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -684,10 +676,9 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodCreateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -702,8 +693,8 @@ public function testMethodCreateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -713,15 +704,14 @@ public function testMethodCreateMembership(): void ->andReturn(''); $response = $this->organization->createMembership( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -736,8 +726,8 @@ public function testMethodGetMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -752,10 +742,9 @@ public function testMethodGetMembership(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodUpdateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -770,8 +759,8 @@ public function testMethodUpdateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -782,12 +771,11 @@ public function testMethodUpdateMembership(): void $response = $this->organization->updateMembership( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodDeleteMembership(): void { $data = ''; @@ -805,21 +793,20 @@ public function testMethodDeleteMembership(): void $this->assertSame($data, $response); } - public function testMethodListProjects(): void { - $data = array( + $data = [ "total" => 5, - "projects" => array( - array( + "projects" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -827,9 +814,9 @@ public function testMethodListProjects(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -842,29 +829,29 @@ public function testMethodListProjects(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -874,13 +861,12 @@ public function testMethodListProjects(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ) - ) - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -893,18 +879,17 @@ public function testMethodListProjects(): void $this->assertInstanceOf(\Appwrite\Models\ProjectList::class, $response); } - public function testMethodCreateProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -912,9 +897,9 @@ public function testMethodCreateProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -927,29 +912,29 @@ public function testMethodCreateProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -959,11 +944,10 @@ public function testMethodCreateProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -979,18 +963,17 @@ public function testMethodCreateProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodGetProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,9 +981,9 @@ public function testMethodGetProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1013,29 +996,29 @@ public function testMethodGetProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -1045,11 +1028,10 @@ public function testMethodGetProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1064,18 +1046,17 @@ public function testMethodGetProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1083,9 +1064,9 @@ public function testMethodUpdateProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1098,29 +1079,29 @@ public function testMethodUpdateProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -1130,11 +1111,10 @@ public function testMethodUpdateProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1150,7 +1130,6 @@ public function testMethodUpdateProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodDeleteProject(): void { $data = ''; @@ -1168,5 +1147,4 @@ public function testMethodDeleteProject(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/PresencesTest.php b/tests/Appwrite/Services/PresencesTest.php index 60a29691..c8732c90 100644 --- a/tests/Appwrite/Services/PresencesTest.php +++ b/tests/Appwrite/Services/PresencesTest.php @@ -1,16 +1,18 @@ 5, - "presences" => array( - array( + "presences" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -45,17 +47,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\PresenceList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -70,17 +71,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodUpsert(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -97,17 +97,16 @@ public function testMethodUpsert(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -123,7 +122,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -141,5 +139,4 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index deb9bf61..edd1009e 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -1,27 +1,25 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -47,9 +45,9 @@ public function testMethodGet(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -62,29 +60,29 @@ public function testMethodGet(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -94,11 +92,10 @@ public function testMethodGet(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -111,7 +108,6 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -127,18 +123,17 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateAuthMethod(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -146,9 +141,9 @@ public function testMethodUpdateAuthMethod(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -161,29 +156,29 @@ public function testMethodUpdateAuthMethod(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -193,11 +188,10 @@ public function testMethodUpdateAuthMethod(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -213,25 +207,24 @@ public function testMethodUpdateAuthMethod(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ) - ); + "sdks" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,20 +237,19 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\KeyList::class, $response); } - public function testMethodCreateEphemeralKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -267,26 +259,25 @@ public function testMethodCreateEphemeralKey(): void ->andReturn(''); $response = $this->project->createEphemeralKey( - array(ProjectKeyScopes::PROJECTREAD()), + [ProjectKeyScopes::PROJECTREAD()], 1 ); $this->assertInstanceOf(\Appwrite\Models\EphemeralKey::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -301,20 +292,19 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodUpdateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -326,12 +316,11 @@ public function testMethodUpdateKey(): void $response = $this->project->updateKey( "", "", - array(ProjectKeyScopes::PROJECTREAD()) + [ProjectKeyScopes::PROJECTREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -349,18 +338,17 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -368,9 +356,9 @@ public function testMethodUpdateLabels(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -383,29 +371,29 @@ public function testMethodUpdateLabels(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -415,11 +403,10 @@ public function testMethodUpdateLabels(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -429,25 +416,24 @@ public function testMethodUpdateLabels(): void ->andReturn(''); $response = $this->project->updateLabels( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodListMockPhones(): void { - $data = array( + $data = [ "total" => 5, - "mockNumbers" => array( - array( + "mockNumbers" => [ + [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -460,15 +446,14 @@ public function testMethodListMockPhones(): void $this->assertInstanceOf(\Appwrite\Models\MockNumberList::class, $response); } - public function testMethodCreateMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,15 +469,14 @@ public function testMethodCreateMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodGetMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -507,15 +491,14 @@ public function testMethodGetMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodUpdateMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -531,7 +514,6 @@ public function testMethodUpdateMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodDeleteMockPhone(): void { $data = ''; @@ -549,13 +531,12 @@ public function testMethodDeleteMockPhone(): void $this->assertSame($data, $response); } - public function testMethodListOAuth2Providers(): void { - $data = array( + $data = [ "total" => 5, - "providers" => array() - ); + "providers" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -568,18 +549,17 @@ public function testMethodListOAuth2Providers(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2ProviderList::class, $response); } - public function testMethodUpdateOAuth2Server(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -587,9 +567,9 @@ public function testMethodUpdateOAuth2Server(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -602,29 +582,29 @@ public function testMethodUpdateOAuth2Server(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -634,11 +614,10 @@ public function testMethodUpdateOAuth2Server(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -654,15 +633,14 @@ public function testMethodUpdateOAuth2Server(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateOAuth2Amazon(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "amzn1.application-oa2-client.87400c00000000000000000000063d5b2", "clientSecret" => "79ffe4000000000000000000000000000000000000000000000000000002de55" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,17 +653,16 @@ public function testMethodUpdateOAuth2Amazon(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Amazon::class, $response); } - public function testMethodUpdateOAuth2Apple(): void { - $data = array( + $data = [ "\$id" => "apple", "enabled" => true, "serviceId" => "ip.appwrite.app.web", "keyId" => "P4000000N8", "teamId" => "D4000000R6", "p8File" => "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -698,15 +675,14 @@ public function testMethodUpdateOAuth2Apple(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Apple::class, $response); } - public function testMethodUpdateOAuth2Appwrite(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6a42000000000000b5a0", "clientSecret" => "b86afd000000000000000000000000000000000000000000000000000ced5f93" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -719,16 +695,15 @@ public function testMethodUpdateOAuth2Appwrite(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Appwrite::class, $response); } - public function testMethodUpdateOAuth2Auth0(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "OaOkIA000000000000000000005KLSYq", "clientSecret" => "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", "endpoint" => "example.us.auth0.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -741,16 +716,15 @@ public function testMethodUpdateOAuth2Auth0(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Auth0::class, $response); } - public function testMethodUpdateOAuth2Authentik(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "dTKOPa0000000000000000000000000000e7G8hv", "clientSecret" => "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", "endpoint" => "example.authentik.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -763,15 +737,14 @@ public function testMethodUpdateOAuth2Authentik(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Authentik::class, $response); } - public function testMethodUpdateOAuth2Autodesk(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "5zw90v00000000000000000000kVYXN7", "clientSecret" => "7I000000000000MW" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -784,15 +757,14 @@ public function testMethodUpdateOAuth2Autodesk(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Autodesk::class, $response); } - public function testMethodUpdateOAuth2Bitbucket(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "key" => "Knt70000000000ByRc", "secret" => "NMfLZJ00000000000000000000TLQdDx" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -805,15 +777,14 @@ public function testMethodUpdateOAuth2Bitbucket(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Bitbucket::class, $response); } - public function testMethodUpdateOAuth2Bitly(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "d95151000000000000000000000000000067af9b", "clientSecret" => "a13e250000000000000000000000000000d73095" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -826,15 +797,14 @@ public function testMethodUpdateOAuth2Bitly(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Bitly::class, $response); } - public function testMethodUpdateOAuth2Box(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "deglcs00000000000000000000x2og6y", "clientSecret" => "OKM1f100000000000000000000eshEif" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -847,15 +817,14 @@ public function testMethodUpdateOAuth2Box(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Box::class, $response); } - public function testMethodUpdateOAuth2Dailymotion(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "apiKey" => "07a9000000000000067f", "apiSecret" => "a399a90000000000000000000000000000d90639" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -868,15 +837,14 @@ public function testMethodUpdateOAuth2Dailymotion(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Dailymotion::class, $response); } - public function testMethodUpdateOAuth2Discord(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "950722000000343754", "clientSecret" => "YmPXnM000000000000000000002zFg5D" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -889,15 +857,14 @@ public function testMethodUpdateOAuth2Discord(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Discord::class, $response); } - public function testMethodUpdateOAuth2Disqus(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "publicKey" => "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", "secretKey" => "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -910,15 +877,14 @@ public function testMethodUpdateOAuth2Disqus(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Disqus::class, $response); } - public function testMethodUpdateOAuth2Dropbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "appKey" => "jl000000000009t", "appSecret" => "g200000000000vw" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -931,15 +897,14 @@ public function testMethodUpdateOAuth2Dropbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Dropbox::class, $response); } - public function testMethodUpdateOAuth2Etsy(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "keyString" => "nsgzxh0000000000008j85a2", "sharedSecret" => "tp000000ru" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -952,15 +917,14 @@ public function testMethodUpdateOAuth2Etsy(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Etsy::class, $response); } - public function testMethodUpdateOAuth2Facebook(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "appId" => "260600000007694", "appSecret" => "2d0b2800000000000000000000d38af4" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -973,15 +937,14 @@ public function testMethodUpdateOAuth2Facebook(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Facebook::class, $response); } - public function testMethodUpdateOAuth2Figma(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "byay5H0000000000VtiI40", "clientSecret" => "yEpOYn0000000000000000004iIsU5" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -994,16 +957,15 @@ public function testMethodUpdateOAuth2Figma(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Figma::class, $response); } - public function testMethodUpdateOAuth2FusionAuth(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "b2222c00-0000-0000-0000-000000862097", "clientSecret" => "Jx4s0C0000000000000000000000000000000wGqLsc", "endpoint" => "example.fusionauth.io" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1016,15 +978,14 @@ public function testMethodUpdateOAuth2FusionAuth(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2FusionAuth::class, $response); } - public function testMethodUpdateOAuth2GitHub(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "e4d87900000000540733", "clientSecret" => "5e07c00000000000000000000000000000198bcc" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1037,16 +998,15 @@ public function testMethodUpdateOAuth2GitHub(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Github::class, $response); } - public function testMethodUpdateOAuth2Gitlab(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "applicationId" => "d41ffe0000000000000000000000000000000000000000000000000000d5e252", "secret" => "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", "endpoint" => "https://gitlab.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1059,16 +1019,15 @@ public function testMethodUpdateOAuth2Gitlab(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Gitlab::class, $response); } - public function testMethodUpdateOAuth2Google(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", - "prompt" => array() - ); + "prompt" => ["none"] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1081,17 +1040,36 @@ public function testMethodUpdateOAuth2Google(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Google::class, $response); } + public function testMethodUpdateOAuth2HuggingFace(): void + { + $data = [ + "\$id" => "github", + "enabled" => true, + "clientId" => "2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "clientSecret" => "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + ]; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->project->updateOAuth2HuggingFace(); + $this->assertInstanceOf(\Appwrite\Models\OAuth2HuggingFace::class, $response); + } public function testMethodUpdateOAuth2Keycloak(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "appwrite-o0000000st-app", "clientSecret" => "jdjrJd00000000000000000000HUsaZO", "endpoint" => "keycloak.example.com", "realmName" => "appwrite-realm" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1104,15 +1082,14 @@ public function testMethodUpdateOAuth2Keycloak(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Keycloak::class, $response); } - public function testMethodUpdateOAuth2Kick(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "01KQ7C00000000000001MFHS32", "clientSecret" => "34ac5600000000000000000000000000000000000000000000000000e830c8b" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1125,15 +1102,14 @@ public function testMethodUpdateOAuth2Kick(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Kick::class, $response); } - public function testMethodUpdateOAuth2Linkedin(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1146,16 +1122,15 @@ public function testMethodUpdateOAuth2Linkedin(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Linkedin::class, $response); } - public function testMethodUpdateOAuth2Microsoft(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", "tenant" => "common" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1168,15 +1143,14 @@ public function testMethodUpdateOAuth2Microsoft(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Microsoft::class, $response); } - public function testMethodUpdateOAuth2Notion(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauthClientId" => "341d8700-0000-0000-0000-000000446ee3", "oauthClientSecret" => "secret_dLUr4b000000000000000000000000000000lFHAa9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1189,10 +1163,9 @@ public function testMethodUpdateOAuth2Notion(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Notion::class, $response); } - public function testMethodUpdateOAuth2Oidc(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "qibI2x0000000000000000000000000006L2YFoG", @@ -1201,8 +1174,8 @@ public function testMethodUpdateOAuth2Oidc(): void "authorizationURL" => "https://myoauth.com/oauth2/authorize", "tokenURL" => "https://myoauth.com/oauth2/token", "userInfoURL" => "https://myoauth.com/oauth2/userinfo", - "prompt" => array() - ); + "prompt" => ["none"] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1215,17 +1188,16 @@ public function testMethodUpdateOAuth2Oidc(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Oidc::class, $response); } - public function testMethodUpdateOAuth2Okta(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "0oa00000000000000698", "clientSecret" => "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", "domain" => "trial-6400025.okta.com", "authorizationServerId" => "aus000000000000000h7z" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1238,15 +1210,14 @@ public function testMethodUpdateOAuth2Okta(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Okta::class, $response); } - public function testMethodUpdateOAuth2Paypal(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1259,15 +1230,14 @@ public function testMethodUpdateOAuth2Paypal(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Paypal::class, $response); } - public function testMethodUpdateOAuth2PaypalSandbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1280,15 +1250,14 @@ public function testMethodUpdateOAuth2PaypalSandbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Paypal::class, $response); } - public function testMethodUpdateOAuth2Podio(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "appwrite-oauth-test-app", "clientSecret" => "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1301,15 +1270,14 @@ public function testMethodUpdateOAuth2Podio(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Podio::class, $response); } - public function testMethodUpdateOAuth2Salesforce(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "customerKey" => "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", "customerSecret" => "3w000000000000e2" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1322,15 +1290,14 @@ public function testMethodUpdateOAuth2Salesforce(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Salesforce::class, $response); } - public function testMethodUpdateOAuth2Slack(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "23000000089.15000000000023", "clientSecret" => "81656000000000000000000000f3d2fd" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1343,15 +1310,14 @@ public function testMethodUpdateOAuth2Slack(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Slack::class, $response); } - public function testMethodUpdateOAuth2Spotify(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6ec271000000000000000000009beace", "clientSecret" => "db068a000000000000000000008b5b9f" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1364,15 +1330,14 @@ public function testMethodUpdateOAuth2Spotify(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Spotify::class, $response); } - public function testMethodUpdateOAuth2Stripe(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "ca_UKibXX0000000000000000000006byvR", "apiSecretKey" => "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1385,15 +1350,14 @@ public function testMethodUpdateOAuth2Stripe(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Stripe::class, $response); } - public function testMethodUpdateOAuth2Tradeshift(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1406,15 +1370,14 @@ public function testMethodUpdateOAuth2Tradeshift(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Tradeshift::class, $response); } - public function testMethodUpdateOAuth2TradeshiftSandbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1427,15 +1390,14 @@ public function testMethodUpdateOAuth2TradeshiftSandbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Tradeshift::class, $response); } - public function testMethodUpdateOAuth2Twitch(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "vvi0in000000000000000000ikmt9p", "clientSecret" => "pmapue000000000000000000zylw3v" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1448,15 +1410,14 @@ public function testMethodUpdateOAuth2Twitch(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Twitch::class, $response); } - public function testMethodUpdateOAuth2WordPress(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "130005", "clientSecret" => "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1469,15 +1430,14 @@ public function testMethodUpdateOAuth2WordPress(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2WordPress::class, $response); } - public function testMethodUpdateOAuth2X(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "customerKey" => "slzZV0000000000000NFLaWT", "secretKey" => "tkEPkp00000000000000000000000000000000000000FTxbI9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1490,15 +1450,14 @@ public function testMethodUpdateOAuth2X(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2X::class, $response); } - public function testMethodUpdateOAuth2Yahoo(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", "clientSecret" => "cf978f0000000000000000000000000000c5e2e9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1511,15 +1470,14 @@ public function testMethodUpdateOAuth2Yahoo(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Yahoo::class, $response); } - public function testMethodUpdateOAuth2Yandex(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6a8a6a0000000000000000000091483c", "clientSecret" => "bbf98500000000000000000000c75a63" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1532,15 +1490,14 @@ public function testMethodUpdateOAuth2Yandex(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Yandex::class, $response); } - public function testMethodUpdateOAuth2Zoho(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "1000.83C178000000000000000000RPNX0B", "clientSecret" => "fb5cac000000000000000000000000000000a68f6e" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1553,15 +1510,14 @@ public function testMethodUpdateOAuth2Zoho(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Zoho::class, $response); } - public function testMethodUpdateOAuth2Zoom(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "QMAC00000000000000w0AQ", "clientSecret" => "GAWsG4000000000000000000007U01ON" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1574,20 +1530,19 @@ public function testMethodUpdateOAuth2Zoom(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Zoom::class, $response); } - public function testMethodGetOAuth2Provider(): void { $data = array_replace( - array( + [ "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", "tenant" => "common" - ), - array( + ], + [ "\$id" => "microsoft" - ) + ] ); $this->client @@ -1603,13 +1558,12 @@ public function testMethodGetOAuth2Provider(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Microsoft::class, $response); } - public function testMethodListPlatforms(): void { - $data = array( + $data = [ "total" => 5, - "platforms" => array() - ); + "platforms" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1622,17 +1576,16 @@ public function testMethodListPlatforms(): void $this->assertInstanceOf(\Appwrite\Models\PlatformList::class, $response); } - public function testMethodCreateAndroidPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "applicationId" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1649,17 +1602,16 @@ public function testMethodCreateAndroidPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformAndroid::class, $response); } - public function testMethodUpdateAndroidPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "applicationId" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1676,17 +1628,16 @@ public function testMethodUpdateAndroidPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformAndroid::class, $response); } - public function testMethodCreateApplePlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "bundleIdentifier" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1703,17 +1654,16 @@ public function testMethodCreateApplePlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformApple::class, $response); } - public function testMethodUpdateApplePlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "bundleIdentifier" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1730,17 +1680,16 @@ public function testMethodUpdateApplePlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformApple::class, $response); } - public function testMethodCreateLinuxPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1757,17 +1706,16 @@ public function testMethodCreateLinuxPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodUpdateLinuxPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1784,17 +1732,16 @@ public function testMethodUpdateLinuxPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodCreateWebPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "hostname" => "app.example.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1811,17 +1758,16 @@ public function testMethodCreateWebPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWeb::class, $response); } - public function testMethodUpdateWebPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "hostname" => "app.example.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1838,17 +1784,16 @@ public function testMethodUpdateWebPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWeb::class, $response); } - public function testMethodCreateWindowsPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageIdentifierName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1865,17 +1810,16 @@ public function testMethodCreateWindowsPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWindows::class, $response); } - public function testMethodUpdateWindowsPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageIdentifierName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1892,21 +1836,20 @@ public function testMethodUpdateWindowsPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWindows::class, $response); } - public function testMethodGetPlatform(): void { $data = array_replace( - array( + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ), - array( + ], + [ "type" => "linux" - ) + ] ); $this->client @@ -1922,7 +1865,6 @@ public function testMethodGetPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodDeletePlatform(): void { $data = ''; @@ -1940,13 +1882,12 @@ public function testMethodDeletePlatform(): void $this->assertSame($data, $response); } - public function testMethodListPolicies(): void { - $data = array( + $data = [ "total" => 10, - "policies" => array() - ); + "policies" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1959,18 +1900,17 @@ public function testMethodListPolicies(): void $this->assertInstanceOf(\Appwrite\Models\PolicyList::class, $response); } - public function testMethodUpdateDenyAliasedEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1978,9 +1918,9 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1993,29 +1933,29 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2025,11 +1965,10 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2044,18 +1983,17 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyCorporateEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2063,9 +2001,9 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2078,29 +2016,29 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2110,11 +2048,10 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2129,18 +2066,17 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyDisposableEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2148,9 +2084,9 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2163,29 +2099,29 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2195,11 +2131,10 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2214,18 +2149,17 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyFreeEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2233,9 +2167,9 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2248,29 +2182,29 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2280,11 +2214,10 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2299,18 +2232,17 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateMembershipPrivacyPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2318,9 +2250,9 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2333,29 +2265,29 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2365,11 +2297,10 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2382,18 +2313,17 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateMFAFactorsPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2401,9 +2331,9 @@ public function testMethodUpdateMFAFactorsPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2416,29 +2346,29 @@ public function testMethodUpdateMFAFactorsPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2448,11 +2378,10 @@ public function testMethodUpdateMFAFactorsPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2465,18 +2394,17 @@ public function testMethodUpdateMFAFactorsPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordDictionaryPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2484,9 +2412,9 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2499,29 +2427,29 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2531,11 +2459,10 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2550,18 +2477,17 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordHistoryPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2569,9 +2495,9 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2584,29 +2510,29 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2616,11 +2542,10 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2635,18 +2560,17 @@ public function testMethodUpdatePasswordHistoryPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordPersonalDataPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2654,9 +2578,9 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2669,29 +2593,29 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2701,11 +2625,10 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2720,17 +2643,16 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordStrengthPolicy(): void { - $data = array( + $data = [ "\$id" => "password-dictionary", "min" => 12, "uppercase" => true, "lowercase" => true, "number" => true, "symbols" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2743,18 +2665,17 @@ public function testMethodUpdatePasswordStrengthPolicy(): void $this->assertInstanceOf(\Appwrite\Models\PolicyPasswordStrength::class, $response); } - public function testMethodUpdateSessionAlertPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2762,9 +2683,9 @@ public function testMethodUpdateSessionAlertPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2777,29 +2698,29 @@ public function testMethodUpdateSessionAlertPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2809,11 +2730,10 @@ public function testMethodUpdateSessionAlertPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2828,18 +2748,17 @@ public function testMethodUpdateSessionAlertPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionDurationPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2847,9 +2766,9 @@ public function testMethodUpdateSessionDurationPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2862,29 +2781,29 @@ public function testMethodUpdateSessionDurationPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2894,11 +2813,10 @@ public function testMethodUpdateSessionDurationPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2913,18 +2831,17 @@ public function testMethodUpdateSessionDurationPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionInvalidationPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2932,9 +2849,9 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2947,29 +2864,29 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2979,11 +2896,10 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2998,18 +2914,17 @@ public function testMethodUpdateSessionInvalidationPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionLimitPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3017,9 +2932,9 @@ public function testMethodUpdateSessionLimitPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3032,29 +2947,29 @@ public function testMethodUpdateSessionLimitPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3064,11 +2979,10 @@ public function testMethodUpdateSessionLimitPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3083,18 +2997,17 @@ public function testMethodUpdateSessionLimitPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateUserLimitPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3102,9 +3015,9 @@ public function testMethodUpdateUserLimitPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3117,29 +3030,29 @@ public function testMethodUpdateUserLimitPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3149,11 +3062,10 @@ public function testMethodUpdateUserLimitPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3168,17 +3080,16 @@ public function testMethodUpdateUserLimitPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodGetPolicy(): void { $data = array_replace( - array( + [ "\$id" => "password-dictionary", "enabled" => true - ), - array( + ], + [ "\$id" => "deny-corporate-email" - ) + ] ); $this->client @@ -3194,18 +3105,17 @@ public function testMethodGetPolicy(): void $this->assertInstanceOf(\Appwrite\Models\PolicyDenyCorporateEmail::class, $response); } - public function testMethodUpdateProtocol(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3213,9 +3123,9 @@ public function testMethodUpdateProtocol(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3228,29 +3138,29 @@ public function testMethodUpdateProtocol(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3260,11 +3170,10 @@ public function testMethodUpdateProtocol(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3280,18 +3189,17 @@ public function testMethodUpdateProtocol(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateService(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3299,9 +3207,9 @@ public function testMethodUpdateService(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3314,29 +3222,29 @@ public function testMethodUpdateService(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3346,11 +3254,10 @@ public function testMethodUpdateService(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3366,18 +3273,17 @@ public function testMethodUpdateService(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSMTP(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3385,9 +3291,9 @@ public function testMethodUpdateSMTP(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3400,29 +3306,29 @@ public function testMethodUpdateSMTP(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3432,11 +3338,10 @@ public function testMethodUpdateSMTP(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3449,7 +3354,6 @@ public function testMethodUpdateSMTP(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodCreateSMTPTest(): void { $data = ''; @@ -3462,18 +3366,17 @@ public function testMethodCreateSMTPTest(): void ->andReturn(''); $response = $this->project->createSMTPTest( - array() + [] ); $this->assertSame($data, $response); } - public function testMethodListEmailTemplates(): void { - $data = array( + $data = [ "total" => 5, - "templates" => array( - array( + "templates" => [ + [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3482,9 +3385,9 @@ public function testMethodListEmailTemplates(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3497,10 +3400,9 @@ public function testMethodListEmailTemplates(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplateList::class, $response); } - public function testMethodUpdateEmailTemplate(): void { - $data = array( + $data = [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3509,7 +3411,7 @@ public function testMethodUpdateEmailTemplate(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3524,10 +3426,9 @@ public function testMethodUpdateEmailTemplate(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplate::class, $response); } - public function testMethodGetEmailTemplate(): void { - $data = array( + $data = [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3536,7 +3437,7 @@ public function testMethodGetEmailTemplate(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3551,13 +3452,12 @@ public function testMethodGetEmailTemplate(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplate::class, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3566,9 +3466,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3581,10 +3481,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3593,7 +3492,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3610,10 +3509,9 @@ public function testMethodCreateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3622,7 +3520,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3637,10 +3535,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3649,7 +3546,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3664,7 +3561,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -3682,5 +3578,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/ProxyTest.php b/tests/Appwrite/Services/ProxyTest.php index d4b3eab1..89affa1f 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -1,10 +1,12 @@ "appwrite.company.com", "type" => "tag", "reference" => "products", "status" => "success" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -44,13 +46,12 @@ public function testMethodCreateInvalidation(): void $this->assertInstanceOf(\Appwrite\Models\ProxyInvalidation::class, $response); } - public function testMethodListRules(): void { - $data = array( + $data = [ "total" => 5, - "rules" => array( - array( + "rules" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -65,9 +66,9 @@ public function testMethodListRules(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -80,10 +81,9 @@ public function testMethodListRules(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRuleList::class, $response); } - public function testMethodCreateAPIRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -98,7 +98,7 @@ public function testMethodCreateAPIRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -113,10 +113,9 @@ public function testMethodCreateAPIRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateFunctionRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -131,7 +130,7 @@ public function testMethodCreateFunctionRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -147,10 +146,9 @@ public function testMethodCreateFunctionRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateRedirectRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -165,7 +163,7 @@ public function testMethodCreateRedirectRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -184,10 +182,9 @@ public function testMethodCreateRedirectRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateSiteRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -202,7 +199,7 @@ public function testMethodCreateSiteRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -218,10 +215,9 @@ public function testMethodCreateSiteRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodGetRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -236,7 +232,7 @@ public function testMethodGetRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -251,7 +247,6 @@ public function testMethodGetRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodDeleteRule(): void { $data = ''; @@ -269,10 +264,9 @@ public function testMethodDeleteRule(): void $this->assertSame($data, $response); } - public function testMethodUpdateRuleStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -287,7 +281,7 @@ public function testMethodUpdateRuleStatus(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -302,5 +296,4 @@ public function testMethodUpdateRuleStatus(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - } diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index e3297142..b80a5549 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -1,22 +1,23 @@ 5, - "sites" => array( - array( + "sites" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -46,8 +47,9 @@ public function testMethodList(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -56,8 +58,8 @@ public function testMethodList(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -68,16 +70,16 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -90,10 +92,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\SiteList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -110,8 +111,9 @@ public function testMethodCreate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -120,8 +122,8 @@ public function testMethodCreate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -132,14 +134,14 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -157,29 +159,28 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodListFrameworks(): void { - $data = array( + $data = [ "total" => 5, - "frameworks" => array( - array( + "frameworks" => [ + [ "key" => "sveltekit", "name" => "SvelteKit", "buildRuntime" => "node-22", - "runtimes" => array(), - "adapters" => array( - array( + "runtimes" => [], + "adapters" => [ + [ "key" => "static", "installCommand" => "npm install", "buildCommand" => "npm run build", "outputDirectory" => "./dist", "fallbackFile" => "index.html" - ) - ) - ) - ) - ); + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -192,20 +193,19 @@ public function testMethodListFrameworks(): void $this->assertInstanceOf(\Appwrite\Models\FrameworkList::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( + $data = [ "total" => 5, - "specifications" => array( - array( + "specifications" => [ + [ "memory" => 512, "cpus" => 1, "enabled" => true, "slug" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -218,10 +218,9 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\SpecificationList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -238,8 +237,9 @@ public function testMethodGet(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -248,8 +248,8 @@ public function testMethodGet(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -260,14 +260,14 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -282,10 +282,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -302,8 +301,9 @@ public function testMethodUpdate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,8 +312,8 @@ public function testMethodUpdate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -324,14 +324,14 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -348,7 +348,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -366,10 +365,9 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateSiteDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -386,8 +384,9 @@ public function testMethodUpdateSiteDeployment(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -396,8 +395,8 @@ public function testMethodUpdateSiteDeployment(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -408,14 +407,14 @@ public function testMethodUpdateSiteDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -431,13 +430,12 @@ public function testMethodUpdateSiteDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodListDeployments(): void { - $data = array( + $data = [ "total" => 5, - "deployments" => array( - array( + "deployments" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -465,9 +463,9 @@ public function testMethodListDeployments(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -482,10 +480,9 @@ public function testMethodListDeployments(): void $this->assertInstanceOf(\Appwrite\Models\DeploymentList::class, $response); } - public function testMethodCreateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -513,7 +510,7 @@ public function testMethodCreateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -529,10 +526,9 @@ public function testMethodCreateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateDuplicateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -560,7 +556,7 @@ public function testMethodCreateDuplicateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -576,10 +572,9 @@ public function testMethodCreateDuplicateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateTemplateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -607,7 +602,7 @@ public function testMethodCreateTemplateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -627,10 +622,9 @@ public function testMethodCreateTemplateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateVcsDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -658,7 +652,7 @@ public function testMethodCreateVcsDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,10 +669,9 @@ public function testMethodCreateVcsDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodGetDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -706,7 +699,7 @@ public function testMethodGetDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -722,7 +715,6 @@ public function testMethodGetDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodDeleteDeployment(): void { $data = ''; @@ -741,7 +733,6 @@ public function testMethodDeleteDeployment(): void $this->assertSame($data, $response); } - public function testMethodGetDeploymentDownload(): void { $data = ''; @@ -760,10 +751,9 @@ public function testMethodGetDeploymentDownload(): void $this->assertSame($data, $response); } - public function testMethodUpdateDeploymentStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -791,7 +781,7 @@ public function testMethodUpdateDeploymentStatus(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -807,43 +797,43 @@ public function testMethodUpdateDeploymentStatus(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "executions" => array( - array( + "executions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -858,38 +848,38 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\ExecutionList::class, $response); } - public function testMethodGetLog(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -905,7 +895,6 @@ public function testMethodGetLog(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodDeleteLog(): void { $data = ''; @@ -924,13 +913,12 @@ public function testMethodDeleteLog(): void $this->assertSame($data, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -939,9 +927,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -956,10 +944,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -968,7 +955,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -986,10 +973,9 @@ public function testMethodCreateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,7 +984,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1014,10 +1000,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1026,7 +1011,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1042,7 +1027,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -1061,5 +1045,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/StorageTest.php b/tests/Appwrite/Services/StorageTest.php index 3fd5a6f6..fd79ef3c 100644 --- a/tests/Appwrite/Services/StorageTest.php +++ b/tests/Appwrite/Services/StorageTest.php @@ -1,19 +1,19 @@ 5, - "buckets" => array( - array( + "buckets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -56,25 +56,24 @@ public function testMethodListBuckets(): void $this->assertInstanceOf(\Appwrite\Models\BucketList::class, $response); } - public function testMethodCreateBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -90,25 +89,24 @@ public function testMethodCreateBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodGetBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -123,25 +121,24 @@ public function testMethodGetBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodUpdateBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -157,7 +154,6 @@ public function testMethodUpdateBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodDeleteBucket(): void { $data = ''; @@ -175,18 +171,17 @@ public function testMethodDeleteBucket(): void $this->assertSame($data, $response); } - public function testMethodListFiles(): void { - $data = array( + $data = [ "total" => 5, - "files" => array( - array( + "files" => [ + [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -198,9 +193,9 @@ public function testMethodListFiles(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -215,15 +210,14 @@ public function testMethodListFiles(): void $this->assertInstanceOf(\Appwrite\Models\FileList::class, $response); } - public function testMethodCreateFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -235,7 +229,7 @@ public function testMethodCreateFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -252,15 +246,14 @@ public function testMethodCreateFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodGetFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -272,7 +265,7 @@ public function testMethodGetFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -288,15 +281,14 @@ public function testMethodGetFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodUpdateFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -308,7 +300,7 @@ public function testMethodUpdateFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -324,7 +316,6 @@ public function testMethodUpdateFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodDeleteFile(): void { $data = ''; @@ -343,7 +334,6 @@ public function testMethodDeleteFile(): void $this->assertSame($data, $response); } - public function testMethodGetFileDownload(): void { $data = ''; @@ -362,7 +352,6 @@ public function testMethodGetFileDownload(): void $this->assertSame($data, $response); } - public function testMethodGetFilePreview(): void { $data = ''; @@ -381,7 +370,6 @@ public function testMethodGetFilePreview(): void $this->assertSame($data, $response); } - public function testMethodGetFileView(): void { $data = ''; @@ -400,5 +388,4 @@ public function testMethodGetFileView(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/TablesDBTest.php b/tests/Appwrite/Services/TablesDBTest.php index 31b4e262..6a705d13 100644 --- a/tests/Appwrite/Services/TablesDBTest.php +++ b/tests/Appwrite/Services/TablesDBTest.php @@ -1,20 +1,20 @@ 5, - "databases" => array( - array( + "databases" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,17 +49,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,12 +74,11 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( - "specifications" => array( - array( + $data = [ + "specifications" => [ + [ "slug" => "s-2vcpu-2gb", "name" => "Standard", "price" => 20, @@ -90,16 +88,16 @@ public function testMethodListSpecifications(): void "includedStorage" => 25, "includedBandwidth" => 200, "enabled" => true - ) - ), + ] + ], "total" => 9, - "pricing" => array( + "pricing" => [ "storageOverageRate" => 0.125, "bandwidthOverageRate" => 0.08, "replicaRate" => 1, "pitrRate" => 0.2 - ) - ); + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -112,22 +110,21 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseSpecificationList::class, $response); } - public function testMethodListTransactions(): void { - $data = array( + $data = [ "total" => 5, - "transactions" => array( - array( + "transactions" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -140,17 +137,16 @@ public function testMethodListTransactions(): void $this->assertInstanceOf(\Appwrite\Models\TransactionList::class, $response); } - public function testMethodCreateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -163,17 +159,16 @@ public function testMethodCreateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGetTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -188,17 +183,16 @@ public function testMethodGetTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodUpdateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -213,7 +207,6 @@ public function testMethodUpdateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodDeleteTransaction(): void { $data = ''; @@ -231,17 +224,16 @@ public function testMethodDeleteTransaction(): void $this->assertSame($data, $response); } - public function testMethodCreateOperations(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -256,17 +248,16 @@ public function testMethodCreateOperations(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -281,17 +272,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -306,7 +296,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -324,10 +313,9 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodCreateFailover(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -358,7 +346,7 @@ public function testMethodCreateFailover(): void "syncMode" => "async", "networkMaxConnections" => 500, "networkIdleTimeoutSeconds" => 900, - "networkIPAllowlist" => array(), + "networkIPAllowlist" => [], "backupEnabled" => true, "pitr" => true, "pitrRetentionDays" => 14, @@ -369,12 +357,12 @@ public function testMethodCreateFailover(): void "maintenanceWindowHourUtc" => 3, "metricsEnabled" => true, "sqlApiEnabled" => true, - "sqlApiAllowedStatements" => array(), + "sqlApiAllowedStatements" => [], "sqlApiMaxRows" => 10000, "sqlApiMaxBytes" => 10485760, "sqlApiTimeoutSeconds" => 30, "error" => "[ERROR]" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -389,13 +377,12 @@ public function testMethodCreateFailover(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabase::class, $response); } - public function testMethodListMigrations(): void { - $data = array( + $data = [ "total" => 5, - "migrations" => array( - array( + "migrations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -406,15 +393,16 @@ public function testMethodListMigrations(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -429,10 +417,9 @@ public function testMethodListMigrations(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigrationList::class, $response); } - public function testMethodCreateMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -443,13 +430,14 @@ public function testMethodCreateMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -465,10 +453,9 @@ public function testMethodCreateMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodGetMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -479,13 +466,14 @@ public function testMethodGetMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -501,7 +489,6 @@ public function testMethodGetMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodDeleteMigration(): void { $data = ''; @@ -520,10 +507,9 @@ public function testMethodDeleteMigration(): void $this->assertSame($data, $response); } - public function testMethodCutoverMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -534,13 +520,14 @@ public function testMethodCutoverMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -556,13 +543,12 @@ public function testMethodCutoverMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodListOperations(): void { - $data = array( + $data = [ "total" => 5, - "operations" => array( - array( + "operations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "databaseId" => "5e5ea5c16897e", @@ -571,9 +557,9 @@ public function testMethodListOperations(): void "attempts" => 1, "errorCode" => "Interrupted", "errorMessage" => "[ERRORMESSAGE]" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -588,23 +574,22 @@ public function testMethodListOperations(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseOperationList::class, $response); } - public function testMethodGetReplicas(): void { - $data = array( + $data = [ "replicas" => 2, "syncMode" => "async", "syncDegraded" => true, "syncAcknowledgements" => 1, "syncStandbyCount" => 2, - "members" => array( - array( + "members" => [ + [ "\$id" => "1", "role" => "replica", "status" => "active" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -619,39 +604,38 @@ public function testMethodGetReplicas(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseReplicas::class, $response); } - public function testMethodGetStatus(): void { - $data = array( + $data = [ "health" => "healthy", "ready" => true, "engine" => "postgresql", "version" => "17", "uptime" => 86400, - "connections" => array( + "connections" => [ "current" => 12, "max" => 100 - ), + ], "syncMode" => "async", "syncDegraded" => true, "syncAcknowledgements" => 1, "syncStandbyCount" => 2, - "replicas" => array( - array( + "replicas" => [ + [ "index" => 0, "role" => "primary", "healthy" => true - ) - ), - "volumes" => array( - array( + ] + ], + "volumes" => [ + [ "path" => "/var/lib/postgresql/data", "usedPercent" => "45%", "available" => "55GB", "mounted" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -666,24 +650,23 @@ public function testMethodGetStatus(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseStatus::class, $response); } - public function testMethodListTables(): void { - $data = array( + $data = [ "total" => 5, - "tables" => array( - array( + "tables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -691,15 +674,15 @@ public function testMethodListTables(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -714,21 +697,20 @@ public function testMethodListTables(): void $this->assertInstanceOf(\Appwrite\Models\TableList::class, $response); } - public function testMethodCreateTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -736,13 +718,13 @@ public function testMethodCreateTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -759,21 +741,20 @@ public function testMethodCreateTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodGetTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -781,13 +762,13 @@ public function testMethodGetTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -803,21 +784,20 @@ public function testMethodGetTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodUpdateTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -825,13 +805,13 @@ public function testMethodUpdateTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -847,7 +827,6 @@ public function testMethodUpdateTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodDeleteTable(): void { $data = ''; @@ -866,13 +845,12 @@ public function testMethodDeleteTable(): void $this->assertSame($data, $response); } - public function testMethodListColumns(): void { - $data = array( + $data = [ "total" => 5, - "columns" => array() - ); + "columns" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,10 +866,9 @@ public function testMethodListColumns(): void $this->assertInstanceOf(\Appwrite\Models\ColumnList::class, $response); } - public function testMethodCreateBigIntColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -899,7 +876,7 @@ public function testMethodCreateBigIntColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -917,10 +894,9 @@ public function testMethodCreateBigIntColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBigint::class, $response); } - public function testMethodUpdateBigIntColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -928,7 +904,7 @@ public function testMethodUpdateBigIntColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -947,10 +923,9 @@ public function testMethodUpdateBigIntColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBigint::class, $response); } - public function testMethodCreateBooleanColumn(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -958,7 +933,7 @@ public function testMethodCreateBooleanColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -976,10 +951,9 @@ public function testMethodCreateBooleanColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBoolean::class, $response); } - public function testMethodUpdateBooleanColumn(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -987,7 +961,7 @@ public function testMethodUpdateBooleanColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1006,10 +980,9 @@ public function testMethodUpdateBooleanColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBoolean::class, $response); } - public function testMethodCreateDatetimeColumn(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -1018,7 +991,7 @@ public function testMethodCreateDatetimeColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1036,10 +1009,9 @@ public function testMethodCreateDatetimeColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnDatetime::class, $response); } - public function testMethodUpdateDatetimeColumn(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -1048,7 +1020,7 @@ public function testMethodUpdateDatetimeColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1067,10 +1039,9 @@ public function testMethodUpdateDatetimeColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnDatetime::class, $response); } - public function testMethodCreateEmailColumn(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -1079,7 +1050,7 @@ public function testMethodCreateEmailColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1097,10 +1068,9 @@ public function testMethodCreateEmailColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnEmail::class, $response); } - public function testMethodUpdateEmailColumn(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -1109,7 +1079,7 @@ public function testMethodUpdateEmailColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1128,10 +1098,9 @@ public function testMethodUpdateEmailColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnEmail::class, $response); } - public function testMethodCreateEnumColumn(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -1139,9 +1108,9 @@ public function testMethodCreateEnumColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1154,16 +1123,15 @@ public function testMethodCreateEnumColumn(): void "", "", "", - array(), + [], true ); $this->assertInstanceOf(\Appwrite\Models\ColumnEnum::class, $response); } - public function testMethodUpdateEnumColumn(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -1171,9 +1139,9 @@ public function testMethodUpdateEnumColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1186,17 +1154,16 @@ public function testMethodUpdateEnumColumn(): void "", "", "", - array(), + [], true, "" ); $this->assertInstanceOf(\Appwrite\Models\ColumnEnum::class, $response); } - public function testMethodCreateFloatColumn(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -1204,7 +1171,7 @@ public function testMethodCreateFloatColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1222,10 +1189,9 @@ public function testMethodCreateFloatColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnFloat::class, $response); } - public function testMethodUpdateFloatColumn(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -1233,7 +1199,7 @@ public function testMethodUpdateFloatColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1252,10 +1218,9 @@ public function testMethodUpdateFloatColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnFloat::class, $response); } - public function testMethodCreateIntegerColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -1263,7 +1228,7 @@ public function testMethodCreateIntegerColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1281,10 +1246,9 @@ public function testMethodCreateIntegerColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnInteger::class, $response); } - public function testMethodUpdateIntegerColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -1292,7 +1256,7 @@ public function testMethodUpdateIntegerColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1311,10 +1275,9 @@ public function testMethodUpdateIntegerColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnInteger::class, $response); } - public function testMethodCreateIpColumn(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -1323,7 +1286,7 @@ public function testMethodCreateIpColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1341,10 +1304,9 @@ public function testMethodCreateIpColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIp::class, $response); } - public function testMethodUpdateIpColumn(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -1353,7 +1315,7 @@ public function testMethodUpdateIpColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1372,10 +1334,9 @@ public function testMethodUpdateIpColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIp::class, $response); } - public function testMethodCreateLineColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1383,7 +1344,7 @@ public function testMethodCreateLineColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1401,10 +1362,9 @@ public function testMethodCreateLineColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLine::class, $response); } - public function testMethodUpdateLineColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1412,7 +1372,7 @@ public function testMethodUpdateLineColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1430,10 +1390,9 @@ public function testMethodUpdateLineColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLine::class, $response); } - public function testMethodCreateLongtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1441,7 +1400,7 @@ public function testMethodCreateLongtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1459,10 +1418,9 @@ public function testMethodCreateLongtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLongtext::class, $response); } - public function testMethodUpdateLongtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1470,7 +1428,7 @@ public function testMethodUpdateLongtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1489,10 +1447,9 @@ public function testMethodUpdateLongtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLongtext::class, $response); } - public function testMethodCreateMediumtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1500,7 +1457,7 @@ public function testMethodCreateMediumtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1518,10 +1475,9 @@ public function testMethodCreateMediumtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnMediumtext::class, $response); } - public function testMethodUpdateMediumtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1529,7 +1485,7 @@ public function testMethodUpdateMediumtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1548,10 +1504,9 @@ public function testMethodUpdateMediumtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnMediumtext::class, $response); } - public function testMethodCreatePointColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1559,7 +1514,7 @@ public function testMethodCreatePointColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1577,10 +1532,9 @@ public function testMethodCreatePointColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPoint::class, $response); } - public function testMethodUpdatePointColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1588,7 +1542,7 @@ public function testMethodUpdatePointColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1606,10 +1560,9 @@ public function testMethodUpdatePointColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPoint::class, $response); } - public function testMethodCreatePolygonColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1617,7 +1570,7 @@ public function testMethodCreatePolygonColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1635,10 +1588,9 @@ public function testMethodCreatePolygonColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPolygon::class, $response); } - public function testMethodUpdatePolygonColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1646,7 +1598,7 @@ public function testMethodUpdatePolygonColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1664,10 +1616,9 @@ public function testMethodUpdatePolygonColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPolygon::class, $response); } - public function testMethodCreateRelationshipColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1681,7 +1632,7 @@ public function testMethodCreateRelationshipColumn(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1699,10 +1650,9 @@ public function testMethodCreateRelationshipColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnRelationship::class, $response); } - public function testMethodCreateStringColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1711,7 +1661,7 @@ public function testMethodCreateStringColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1730,10 +1680,9 @@ public function testMethodCreateStringColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodUpdateStringColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1742,7 +1691,7 @@ public function testMethodUpdateStringColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1761,10 +1710,9 @@ public function testMethodUpdateStringColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodCreateTextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1772,7 +1720,7 @@ public function testMethodCreateTextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1790,10 +1738,9 @@ public function testMethodCreateTextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnText::class, $response); } - public function testMethodUpdateTextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1801,7 +1748,7 @@ public function testMethodUpdateTextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1820,10 +1767,9 @@ public function testMethodUpdateTextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnText::class, $response); } - public function testMethodCreateUrlColumn(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1832,7 +1778,7 @@ public function testMethodCreateUrlColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1850,10 +1796,9 @@ public function testMethodCreateUrlColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnUrl::class, $response); } - public function testMethodUpdateUrlColumn(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1862,7 +1807,7 @@ public function testMethodUpdateUrlColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1881,10 +1826,9 @@ public function testMethodUpdateUrlColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnUrl::class, $response); } - public function testMethodCreateVarcharColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1893,7 +1837,7 @@ public function testMethodCreateVarcharColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1912,10 +1856,9 @@ public function testMethodCreateVarcharColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnVarchar::class, $response); } - public function testMethodUpdateVarcharColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1924,7 +1867,7 @@ public function testMethodUpdateVarcharColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1943,11 +1886,10 @@ public function testMethodUpdateVarcharColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnVarchar::class, $response); } - public function testMethodGetColumn(): void { $data = array_replace( - array( + [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1956,10 +1898,10 @@ public function testMethodGetColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ), - array( + ], + [ "type" => "string" - ) + ] ); $this->client @@ -1977,7 +1919,6 @@ public function testMethodGetColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodDeleteColumn(): void { $data = ''; @@ -1997,10 +1938,9 @@ public function testMethodDeleteColumn(): void $this->assertSame($data, $response); } - public function testMethodUpdateRelationshipColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -2014,7 +1954,7 @@ public function testMethodUpdateRelationshipColumn(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2031,13 +1971,12 @@ public function testMethodUpdateRelationshipColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnRelationship::class, $response); } - public function testMethodListIndexes(): void { - $data = array( + $data = [ "total" => 5, - "indexes" => array( - array( + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2045,11 +1984,11 @@ public function testMethodListIndexes(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ) - ); + "columns" => [], + "lengths" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2065,10 +2004,9 @@ public function testMethodListIndexes(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIndexList::class, $response); } - public function testMethodCreateIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2076,9 +2014,9 @@ public function testMethodCreateIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ); + "columns" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2092,15 +2030,14 @@ public function testMethodCreateIndex(): void "", "", TablesDBIndexType::KEY(), - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\ColumnIndex::class, $response); } - public function testMethodGetIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2108,9 +2045,9 @@ public function testMethodGetIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ); + "columns" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2127,7 +2064,6 @@ public function testMethodGetIndex(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIndex::class, $response); } - public function testMethodDeleteIndex(): void { $data = ''; @@ -2147,23 +2083,22 @@ public function testMethodDeleteIndex(): void $this->assertSame($data, $response); } - public function testMethodListRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2179,18 +2114,17 @@ public function testMethodListRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodCreateRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2203,28 +2137,27 @@ public function testMethodCreateRow(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodCreateRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2236,28 +2169,27 @@ public function testMethodCreateRows(): void $response = $this->tablesDB->createRows( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodUpsertRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2269,28 +2201,27 @@ public function testMethodUpsertRows(): void $response = $this->tablesDB->upsertRows( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodUpdateRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2306,23 +2237,22 @@ public function testMethodUpdateRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodDeleteRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2338,18 +2268,17 @@ public function testMethodDeleteRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodGetRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2366,18 +2295,17 @@ public function testMethodGetRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodUpsertRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2394,18 +2322,17 @@ public function testMethodUpsertRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodUpdateRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2422,7 +2349,6 @@ public function testMethodUpdateRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodDeleteRow(): void { $data = ''; @@ -2442,18 +2368,17 @@ public function testMethodDeleteRow(): void $this->assertSame($data, $response); } - public function testMethodDecrementRowColumn(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2471,18 +2396,17 @@ public function testMethodDecrementRowColumn(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodIncrementRowColumn(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2500,5 +2424,4 @@ public function testMethodIncrementRowColumn(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - } diff --git a/tests/Appwrite/Services/TeamsTest.php b/tests/Appwrite/Services/TeamsTest.php index 376e81d1..63a1967f 100644 --- a/tests/Appwrite/Services/TeamsTest.php +++ b/tests/Appwrite/Services/TeamsTest.php @@ -1,16 +1,18 @@ 5, - "teams" => array( - array( + "teams" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ) - ) - ); + "prefs" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -45,17 +47,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\TeamList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -71,17 +72,16 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -96,17 +96,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -122,7 +121,6 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -140,25 +138,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -173,20 +170,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodCreateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -202,20 +198,19 @@ public function testMethodCreateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -231,20 +226,19 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodUpdateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -260,7 +254,6 @@ public function testMethodUpdateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -279,13 +272,12 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -300,10 +292,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -318,10 +310,9 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodCreateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -336,8 +327,8 @@ public function testMethodCreateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -348,15 +339,14 @@ public function testMethodCreateMembership(): void $response = $this->teams->createMembership( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -371,8 +361,8 @@ public function testMethodGetMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -388,10 +378,9 @@ public function testMethodGetMembership(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodUpdateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -406,8 +395,8 @@ public function testMethodUpdateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -419,12 +408,11 @@ public function testMethodUpdateMembership(): void $response = $this->teams->updateMembership( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodDeleteMembership(): void { $data = ''; @@ -443,10 +431,9 @@ public function testMethodDeleteMembership(): void $this->assertSame($data, $response); } - public function testMethodUpdateMembershipStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -461,8 +448,8 @@ public function testMethodUpdateMembershipStatus(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -480,10 +467,9 @@ public function testMethodUpdateMembershipStatus(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -498,10 +484,9 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -512,10 +497,9 @@ public function testMethodUpdatePrefs(): void $response = $this->teams->updatePrefs( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - } diff --git a/tests/Appwrite/Services/TokensTest.php b/tests/Appwrite/Services/TokensTest.php index e20f6441..630684d7 100644 --- a/tests/Appwrite/Services/TokensTest.php +++ b/tests/Appwrite/Services/TokensTest.php @@ -1,16 +1,18 @@ 5, - "tokens" => array( - array( + "tokens" => [ + [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -31,9 +33,9 @@ public function testMethodList(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,10 +51,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\ResourceTokenList::class, $response); } - public function testMethodCreateFileToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -60,7 +61,7 @@ public function testMethodCreateFileToken(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -76,10 +77,9 @@ public function testMethodCreateFileToken(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -87,7 +87,7 @@ public function testMethodGet(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -102,10 +102,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -113,7 +112,7 @@ public function testMethodUpdate(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -128,7 +127,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -146,5 +144,4 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/UsersTest.php b/tests/Appwrite/Services/UsersTest.php index 6206a767..ce365d4f 100644 --- a/tests/Appwrite/Services/UsersTest.php +++ b/tests/Appwrite/Services/UsersTest.php @@ -1,19 +1,20 @@ 5, - "users" => array( - array( + "users" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -51,12 +52,12 @@ public function testMethodList(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -69,26 +70,25 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\UserList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -97,10 +97,10 @@ public function testMethodCreate(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -115,26 +115,25 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateArgon2User(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -143,10 +142,10 @@ public function testMethodCreateArgon2User(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -163,26 +162,25 @@ public function testMethodCreateArgon2User(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateBcryptUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -191,10 +189,10 @@ public function testMethodCreateBcryptUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -211,13 +209,12 @@ public function testMethodCreateBcryptUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListIdentities(): void { - $data = array( + $data = [ "total" => 5, - "identities" => array( - array( + "identities" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -228,9 +225,9 @@ public function testMethodListIdentities(): void "providerAccessToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "providerAccessTokenExpiry" => "2020-10-15T06:38:00.000+00:00", "providerRefreshToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -243,7 +240,6 @@ public function testMethodListIdentities(): void $this->assertInstanceOf(\Appwrite\Models\IdentityList::class, $response); } - public function testMethodDeleteIdentity(): void { $data = ''; @@ -261,26 +257,25 @@ public function testMethodDeleteIdentity(): void $this->assertSame($data, $response); } - public function testMethodCreateMD5User(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -289,10 +284,10 @@ public function testMethodCreateMD5User(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -309,26 +304,25 @@ public function testMethodCreateMD5User(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreatePHPassUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -337,10 +331,10 @@ public function testMethodCreatePHPassUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -357,26 +351,25 @@ public function testMethodCreatePHPassUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateScryptUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -385,10 +378,10 @@ public function testMethodCreateScryptUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -410,26 +403,25 @@ public function testMethodCreateScryptUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateScryptModifiedUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -438,10 +430,10 @@ public function testMethodCreateScryptModifiedUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -461,26 +453,25 @@ public function testMethodCreateScryptModifiedUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateSHAUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -489,10 +480,10 @@ public function testMethodCreateSHAUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -509,26 +500,25 @@ public function testMethodCreateSHAUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -537,10 +527,10 @@ public function testMethodGet(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -555,7 +545,6 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -573,26 +562,25 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -601,10 +589,10 @@ public function testMethodUpdateEmail(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -620,26 +608,25 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdateImpersonator(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -648,10 +635,10 @@ public function testMethodUpdateImpersonator(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -667,12 +654,11 @@ public function testMethodUpdateImpersonator(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateJWT(): void { - $data = array( + $data = [ "jwt" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -687,26 +673,25 @@ public function testMethodCreateJWT(): void $this->assertInstanceOf(\Appwrite\Models\Jwt::class, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -715,10 +700,10 @@ public function testMethodUpdateLabels(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -729,18 +714,17 @@ public function testMethodUpdateLabels(): void $response = $this->users->updateLabels( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "logs" => array( - array( + "logs" => [ + [ "event" => "account.sessions.create", "userId" => "610fc2f985ee0", "userEmail" => "john@appwrite.io", @@ -763,9 +747,9 @@ public function testMethodListLogs(): void "deviceModel" => "Nexus 5", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -780,13 +764,12 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -801,10 +784,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -819,26 +802,25 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodUpdateMFA(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -847,10 +829,10 @@ public function testMethodUpdateMFA(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -866,7 +848,6 @@ public function testMethodUpdateMFA(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDeleteMFAAuthenticator(): void { $data = ''; @@ -885,16 +866,15 @@ public function testMethodDeleteMFAAuthenticator(): void $this->assertSame($data, $response); } - public function testMethodGetMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "expire" => "2020-10-15T06:38:00.000+00:00", "code" => "446372" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -910,16 +890,15 @@ public function testMethodGetMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\MfaChallengeSecret::class, $response); } - public function testMethodListMFAFactors(): void { - $data = array( + $data = [ "totp" => true, "phone" => true, "email" => true, "recoveryCode" => true, "custom" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -934,12 +913,11 @@ public function testMethodListMFAFactors(): void $this->assertInstanceOf(\Appwrite\Models\MfaFactors::class, $response); } - public function testMethodGetMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -954,12 +932,11 @@ public function testMethodGetMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -974,12 +951,11 @@ public function testMethodUpdateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodCreateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -994,26 +970,25 @@ public function testMethodCreateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1022,10 +997,10 @@ public function testMethodUpdateName(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1041,26 +1016,25 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePassword(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1069,10 +1043,10 @@ public function testMethodUpdatePassword(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1088,26 +1062,25 @@ public function testMethodUpdatePassword(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhone(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1116,10 +1089,10 @@ public function testMethodUpdatePhone(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1135,10 +1108,9 @@ public function testMethodUpdatePhone(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1153,10 +1125,9 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1167,18 +1138,17 @@ public function testMethodUpdatePrefs(): void $response = $this->users->updatePrefs( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodListSessions(): void { - $data = array( + $data = [ "total" => 5, - "sessions" => array( - array( + "sessions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1205,12 +1175,12 @@ public function testMethodListSessions(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1225,10 +1195,9 @@ public function testMethodListSessions(): void $this->assertInstanceOf(\Appwrite\Models\SessionList::class, $response); } - public function testMethodCreateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1255,10 +1224,10 @@ public function testMethodCreateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1273,7 +1242,6 @@ public function testMethodCreateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodDeleteSessions(): void { $data = ''; @@ -1291,7 +1259,6 @@ public function testMethodDeleteSessions(): void $this->assertSame($data, $response); } - public function testMethodDeleteSession(): void { $data = ''; @@ -1310,26 +1277,25 @@ public function testMethodDeleteSession(): void $this->assertSame($data, $response); } - public function testMethodUpdateStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1338,10 +1304,10 @@ public function testMethodUpdateStatus(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1357,13 +1323,12 @@ public function testMethodUpdateStatus(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListTargets(): void { - $data = array( + $data = [ "total" => 5, - "targets" => array( - array( + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1372,9 +1337,9 @@ public function testMethodListTargets(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1389,10 +1354,9 @@ public function testMethodListTargets(): void $this->assertInstanceOf(\Appwrite\Models\TargetList::class, $response); } - public function testMethodCreateTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1401,7 +1365,7 @@ public function testMethodCreateTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1419,10 +1383,9 @@ public function testMethodCreateTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodGetTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1431,7 +1394,7 @@ public function testMethodGetTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1447,10 +1410,9 @@ public function testMethodGetTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodUpdateTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1459,7 +1421,7 @@ public function testMethodUpdateTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1475,7 +1437,6 @@ public function testMethodUpdateTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodDeleteTarget(): void { $data = ''; @@ -1494,17 +1455,16 @@ public function testMethodDeleteTarget(): void $this->assertSame($data, $response); } - public function testMethodCreateToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1519,26 +1479,25 @@ public function testMethodCreateToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1547,10 +1506,10 @@ public function testMethodUpdateEmailVerification(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1566,26 +1525,25 @@ public function testMethodUpdateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1594,10 +1552,10 @@ public function testMethodUpdatePhoneVerification(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1613,5 +1571,4 @@ public function testMethodUpdatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - } diff --git a/tests/Appwrite/Services/WebhooksTest.php b/tests/Appwrite/Services/WebhooksTest.php index c8513b7c..677b145e 100644 --- a/tests/Appwrite/Services/WebhooksTest.php +++ b/tests/Appwrite/Services/WebhooksTest.php @@ -1,16 +1,18 @@ 5, - "webhooks" => array( - array( + "webhooks" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -37,9 +39,9 @@ public function testMethodList(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -52,16 +54,15 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\WebhookList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -69,7 +70,7 @@ public function testMethodCreate(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -82,21 +83,20 @@ public function testMethodCreate(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -104,7 +104,7 @@ public function testMethodGet(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -119,16 +119,15 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -136,7 +135,7 @@ public function testMethodUpdate(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -149,12 +148,11 @@ public function testMethodUpdate(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -172,16 +170,15 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -189,7 +186,7 @@ public function testMethodUpdateSecret(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -204,5 +201,4 @@ public function testMethodUpdateSecret(): void $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - } From a6e3a799375de24f475f3f830392f2efa12e82f1 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 26 Aug 2026 22:24:38 +0530 Subject: [PATCH 08/10] chore: update PHP SDK to 29.0.0 --- docs/account.md | 30 ++++++++-------- docs/advisor.md | 4 +-- docs/apps.md | 2 +- docs/avatars.md | 4 +-- docs/backups.md | 10 +++--- docs/databases.md | 2 +- .../account/create-anonymous-session.md | 2 -- .../account/create-email-password-session.md | 1 - docs/examples/account/create-email-token.md | 1 - .../account/create-email-verification.md | 1 - .../account/create-magic-url-token.md | 1 - .../account/create-mfa-authenticator.md | 1 - docs/examples/account/create-mfa-challenge.md | 1 - .../account/create-mfa-recovery-codes.md | 2 -- .../examples/account/create-o-auth-2-token.md | 1 - docs/examples/account/create-phone-token.md | 1 - .../account/create-phone-verification.md | 2 -- docs/examples/account/create-recovery.md | 1 - docs/examples/account/create-session.md | 1 - docs/examples/account/create-verification.md | 1 - docs/examples/account/create.md | 1 - docs/examples/account/delete-consent-token.md | 1 - docs/examples/account/delete-consent.md | 1 - docs/examples/account/delete-identity.md | 1 - .../account/delete-mfa-authenticator.md | 1 - docs/examples/account/delete-session.md | 1 - docs/examples/account/delete-sessions.md | 2 -- docs/examples/account/get-consent-token.md | 1 - docs/examples/account/get-consent.md | 1 - .../account/get-mfa-recovery-codes.md | 2 -- docs/examples/account/get-prefs.md | 2 -- docs/examples/account/get-session.md | 1 - docs/examples/account/get.md | 2 -- docs/examples/account/list-consent-tokens.md | 1 - docs/examples/account/list-consents.md | 1 - docs/examples/account/list-identities.md | 1 - docs/examples/account/list-logs.md | 1 - docs/examples/account/list-mfa-factors.md | 2 -- docs/examples/account/list-sessions.md | 2 -- .../account/update-email-verification.md | 1 - docs/examples/account/update-email.md | 1 - .../account/update-magic-url-session.md | 1 - .../account/update-mfa-authenticator.md | 1 - docs/examples/account/update-mfa-challenge.md | 1 - .../account/update-mfa-recovery-codes.md | 2 -- docs/examples/account/update-mfa.md | 1 - docs/examples/account/update-name.md | 1 - docs/examples/account/update-password.md | 1 - docs/examples/account/update-phone-session.md | 1 - .../account/update-phone-verification.md | 1 - docs/examples/account/update-phone.md | 1 - docs/examples/account/update-prefs.md | 1 - docs/examples/account/update-recovery.md | 1 - docs/examples/account/update-session.md | 1 - docs/examples/account/update-status.md | 2 -- docs/examples/account/update-verification.md | 1 - docs/examples/activities/get-event.md | 1 - docs/examples/activities/list-events.md | 1 - docs/examples/advisor/delete-report.md | 1 - docs/examples/advisor/get-insight.md | 1 - docs/examples/advisor/get-report.md | 1 - docs/examples/advisor/list-insights.md | 1 - docs/examples/advisor/list-reports.md | 1 - .../apps/create-installation-token.md | 1 - docs/examples/apps/create-key.md | 1 - docs/examples/apps/create-secret.md | 1 - docs/examples/apps/create.md | 1 - docs/examples/apps/delete-installation.md | 1 - docs/examples/apps/delete-key.md | 1 - docs/examples/apps/delete-secret.md | 1 - docs/examples/apps/delete-tokens.md | 1 - docs/examples/apps/delete.md | 1 - docs/examples/apps/get-installation.md | 1 - docs/examples/apps/get-key.md | 1 - docs/examples/apps/get-secret.md | 1 - docs/examples/apps/get.md | 1 - .../examples/apps/list-installation-scopes.md | 2 -- docs/examples/apps/list-installations.md | 1 - docs/examples/apps/list-keys.md | 1 - docs/examples/apps/list-o-auth-2-scopes.md | 2 -- docs/examples/apps/list-secrets.md | 1 - docs/examples/apps/list.md | 1 - docs/examples/apps/update-labels.md | 1 - docs/examples/apps/update-team.md | 1 - docs/examples/apps/update.md | 1 - docs/examples/avatars/get-browser.md | 1 - docs/examples/avatars/get-credit-card.md | 1 - docs/examples/avatars/get-favicon.md | 1 - docs/examples/avatars/get-flag.md | 1 - docs/examples/avatars/get-image.md | 1 - docs/examples/avatars/get-initials.md | 1 - docs/examples/avatars/get-photo.md | 1 - docs/examples/avatars/get-qr.md | 1 - docs/examples/avatars/get-screenshot.md | 1 - docs/examples/backups/create-archive.md | 1 - docs/examples/backups/create-policy.md | 1 - docs/examples/backups/create-restoration.md | 1 - docs/examples/backups/delete-archive.md | 1 - docs/examples/backups/delete-policy.md | 1 - docs/examples/backups/get-archive.md | 1 - docs/examples/backups/get-policy.md | 1 - docs/examples/backups/get-restoration.md | 1 - docs/examples/backups/list-archives.md | 1 - docs/examples/backups/list-policies.md | 1 - docs/examples/backups/list-restorations.md | 1 - docs/examples/backups/update-policy.md | 1 - .../databases/create-big-int-attribute.md | 1 - .../databases/create-boolean-attribute.md | 1 - docs/examples/databases/create-collection.md | 1 - .../databases/create-datetime-attribute.md | 1 - docs/examples/databases/create-document.md | 1 - docs/examples/databases/create-documents.md | 1 - .../databases/create-email-attribute.md | 1 - .../databases/create-enum-attribute.md | 1 - .../databases/create-float-attribute.md | 1 - docs/examples/databases/create-index.md | 1 - .../databases/create-integer-attribute.md | 1 - .../examples/databases/create-ip-attribute.md | 1 - .../databases/create-line-attribute.md | 1 - .../databases/create-longtext-attribute.md | 1 - .../databases/create-mediumtext-attribute.md | 1 - docs/examples/databases/create-operations.md | 1 - .../databases/create-point-attribute.md | 1 - .../databases/create-polygon-attribute.md | 1 - .../create-relationship-attribute.md | 1 - .../databases/create-string-attribute.md | 1 - .../databases/create-text-attribute.md | 1 - docs/examples/databases/create-transaction.md | 1 - .../databases/create-url-attribute.md | 1 - .../databases/create-varchar-attribute.md | 1 - docs/examples/databases/create.md | 1 - .../databases/decrement-document-attribute.md | 1 - docs/examples/databases/delete-attribute.md | 1 - docs/examples/databases/delete-collection.md | 1 - docs/examples/databases/delete-document.md | 1 - docs/examples/databases/delete-documents.md | 1 - docs/examples/databases/delete-index.md | 1 - docs/examples/databases/delete-transaction.md | 1 - docs/examples/databases/delete.md | 1 - docs/examples/databases/get-attribute.md | 1 - docs/examples/databases/get-collection.md | 1 - docs/examples/databases/get-document.md | 1 - docs/examples/databases/get-index.md | 1 - docs/examples/databases/get-transaction.md | 1 - docs/examples/databases/get.md | 1 - .../databases/increment-document-attribute.md | 1 - docs/examples/databases/list-attributes.md | 1 - docs/examples/databases/list-collections.md | 1 - docs/examples/databases/list-documents.md | 1 - docs/examples/databases/list-indexes.md | 1 - docs/examples/databases/list-transactions.md | 1 - docs/examples/databases/list.md | 1 - .../databases/update-big-int-attribute.md | 1 - .../databases/update-boolean-attribute.md | 1 - docs/examples/databases/update-collection.md | 1 - .../databases/update-datetime-attribute.md | 1 - docs/examples/databases/update-document.md | 1 - docs/examples/databases/update-documents.md | 1 - .../databases/update-email-attribute.md | 1 - .../databases/update-enum-attribute.md | 1 - .../databases/update-float-attribute.md | 1 - .../databases/update-integer-attribute.md | 1 - .../examples/databases/update-ip-attribute.md | 1 - .../databases/update-line-attribute.md | 1 - .../databases/update-longtext-attribute.md | 1 - .../databases/update-mediumtext-attribute.md | 1 - .../databases/update-point-attribute.md | 1 - .../databases/update-polygon-attribute.md | 1 - .../update-relationship-attribute.md | 1 - .../databases/update-string-attribute.md | 1 - .../databases/update-text-attribute.md | 1 - docs/examples/databases/update-transaction.md | 1 - .../databases/update-url-attribute.md | 1 - .../databases/update-varchar-attribute.md | 1 - docs/examples/databases/update.md | 1 - docs/examples/databases/upsert-document.md | 1 - docs/examples/databases/upsert-documents.md | 1 - .../embeddings/create-text-embeddings.md | 1 - docs/examples/functions/create-deployment.md | 1 - .../functions/create-duplicate-deployment.md | 1 - docs/examples/functions/create-execution.md | 1 - .../functions/create-template-deployment.md | 1 - docs/examples/functions/create-variable.md | 1 - .../functions/create-vcs-deployment.md | 1 - docs/examples/functions/create.md | 1 - docs/examples/functions/delete-deployment.md | 1 - docs/examples/functions/delete-execution.md | 1 - docs/examples/functions/delete-variable.md | 1 - docs/examples/functions/delete.md | 1 - .../functions/get-deployment-download.md | 1 - docs/examples/functions/get-deployment.md | 1 - docs/examples/functions/get-execution.md | 1 - docs/examples/functions/get-variable.md | 1 - docs/examples/functions/get.md | 1 - docs/examples/functions/list-deployments.md | 1 - docs/examples/functions/list-executions.md | 1 - docs/examples/functions/list-runtimes.md | 2 -- .../examples/functions/list-specifications.md | 1 - docs/examples/functions/list-variables.md | 1 - docs/examples/functions/list.md | 1 - .../functions/update-deployment-status.md | 1 - .../functions/update-function-deployment.md | 1 - docs/examples/functions/update-variable.md | 1 - docs/examples/functions/update.md | 1 - docs/examples/graphql/mutation.md | 1 - docs/examples/graphql/query.md | 1 - docs/examples/locale/get.md | 2 -- docs/examples/locale/list-codes.md | 2 -- docs/examples/locale/list-continents.md | 2 -- docs/examples/locale/list-countries-eu.md | 2 -- docs/examples/locale/list-countries-phones.md | 2 -- docs/examples/locale/list-countries.md | 2 -- docs/examples/locale/list-currencies.md | 2 -- docs/examples/locale/list-languages.md | 2 -- .../messaging/create-apns-provider.md | 1 - docs/examples/messaging/create-email.md | 1 - .../examples/messaging/create-fcm-provider.md | 1 - .../messaging/create-mailgun-provider.md | 1 - .../messaging/create-msg-91-provider.md | 1 - docs/examples/messaging/create-push.md | 1 - .../messaging/create-resend-provider.md | 1 - .../messaging/create-sendgrid-provider.md | 1 - .../examples/messaging/create-ses-provider.md | 1 - docs/examples/messaging/create-sms.md | 1 - .../messaging/create-smtp-provider.md | 1 - docs/examples/messaging/create-subscriber.md | 1 - .../messaging/create-telesign-provider.md | 1 - .../messaging/create-textmagic-provider.md | 1 - docs/examples/messaging/create-topic.md | 1 - .../messaging/create-twilio-provider.md | 1 - .../messaging/create-vonage-provider.md | 1 - docs/examples/messaging/delete-provider.md | 1 - docs/examples/messaging/delete-subscriber.md | 1 - docs/examples/messaging/delete-topic.md | 1 - docs/examples/messaging/delete.md | 1 - docs/examples/messaging/get-message.md | 1 - docs/examples/messaging/get-provider.md | 1 - docs/examples/messaging/get-subscriber.md | 1 - docs/examples/messaging/get-topic.md | 1 - docs/examples/messaging/list-messages.md | 1 - docs/examples/messaging/list-providers.md | 1 - docs/examples/messaging/list-subscribers.md | 1 - docs/examples/messaging/list-targets.md | 1 - docs/examples/messaging/list-topics.md | 1 - .../messaging/update-apns-provider.md | 1 - docs/examples/messaging/update-email.md | 1 - .../examples/messaging/update-fcm-provider.md | 1 - .../messaging/update-mailgun-provider.md | 1 - .../messaging/update-msg-91-provider.md | 1 - docs/examples/messaging/update-push.md | 1 - .../messaging/update-resend-provider.md | 1 - .../messaging/update-sendgrid-provider.md | 1 - .../examples/messaging/update-ses-provider.md | 1 - docs/examples/messaging/update-sms.md | 1 - .../messaging/update-smtp-provider.md | 1 - .../messaging/update-telesign-provider.md | 1 - .../messaging/update-textmagic-provider.md | 1 - docs/examples/messaging/update-topic.md | 1 - .../messaging/update-twilio-provider.md | 1 - .../messaging/update-vonage-provider.md | 1 - docs/examples/oauth2/approve.md | 1 - docs/examples/oauth2/authorize-post.md | 1 - docs/examples/oauth2/authorize.md | 1 - .../oauth2/create-device-authorization.md | 1 - docs/examples/oauth2/create-grant.md | 1 - docs/examples/oauth2/create-par.md | 1 - docs/examples/oauth2/create-token.md | 1 - docs/examples/oauth2/get-grant.md | 1 - docs/examples/oauth2/list-organizations.md | 1 - docs/examples/oauth2/list-projects.md | 1 - docs/examples/oauth2/reject.md | 1 - docs/examples/oauth2/revoke.md | 1 - .../organization/create-installation.md | 1 - docs/examples/organization/create-key.md | 1 - .../organization/create-membership.md | 1 - docs/examples/organization/create-project.md | 1 - .../organization/delete-installation.md | 1 - docs/examples/organization/delete-key.md | 1 - .../organization/delete-membership.md | 1 - docs/examples/organization/delete-project.md | 1 - docs/examples/organization/delete.md | 2 -- .../examples/organization/get-installation.md | 1 - docs/examples/organization/get-key.md | 1 - docs/examples/organization/get-membership.md | 1 - docs/examples/organization/get-project.md | 1 - docs/examples/organization/get.md | 2 -- .../organization/list-installations.md | 1 - docs/examples/organization/list-keys.md | 1 - .../examples/organization/list-memberships.md | 1 - docs/examples/organization/list-projects.md | 1 - .../organization/update-installation.md | 1 - docs/examples/organization/update-key.md | 1 - .../organization/update-membership.md | 1 - docs/examples/organization/update-project.md | 1 - docs/examples/organization/update.md | 1 - docs/examples/presences/delete.md | 1 - docs/examples/presences/get.md | 1 - docs/examples/presences/list.md | 1 - docs/examples/presences/update.md | 1 - docs/examples/presences/upsert.md | 1 - .../project/create-android-platform.md | 1 - .../examples/project/create-apple-platform.md | 1 - docs/examples/project/create-ephemeral-key.md | 1 - .../examples/project/create-linux-platform.md | 1 - docs/examples/project/create-mock-phone.md | 1 - docs/examples/project/create-smtp-test.md | 1 - docs/examples/project/create-variable.md | 1 - docs/examples/project/create-web-platform.md | 1 - .../project/create-windows-platform.md | 1 - docs/examples/project/delete-key.md | 1 - docs/examples/project/delete-mock-phone.md | 1 - docs/examples/project/delete-platform.md | 1 - docs/examples/project/delete-variable.md | 1 - docs/examples/project/delete.md | 2 -- docs/examples/project/get-email-template.md | 1 - docs/examples/project/get-key.md | 1 - docs/examples/project/get-mock-phone.md | 1 - .../examples/project/get-o-auth-2-provider.md | 1 - docs/examples/project/get-platform.md | 1 - docs/examples/project/get-policy.md | 1 - docs/examples/project/get-variable.md | 1 - docs/examples/project/get.md | 2 -- docs/examples/project/list-email-templates.md | 1 - docs/examples/project/list-keys.md | 1 - docs/examples/project/list-mock-phones.md | 1 - .../project/list-o-auth-2-providers.md | 1 - docs/examples/project/list-platforms.md | 1 - docs/examples/project/list-policies.md | 1 - docs/examples/project/list-variables.md | 1 - .../project/update-android-platform.md | 1 - .../examples/project/update-apple-platform.md | 1 - docs/examples/project/update-auth-method.md | 1 - .../update-deny-aliased-email-policy.md | 1 - .../update-deny-corporate-email-policy.md | 1 - .../update-deny-disposable-email-policy.md | 1 - .../project/update-deny-free-email-policy.md | 1 - .../examples/project/update-email-template.md | 1 - docs/examples/project/update-key.md | 1 - docs/examples/project/update-labels.md | 1 - .../examples/project/update-linux-platform.md | 1 - .../update-membership-privacy-policy.md | 1 - .../project/update-mfa-factors-policy.md | 1 - docs/examples/project/update-mock-phone.md | 1 - .../project/update-o-auth-2-amazon.md | 1 - .../examples/project/update-o-auth-2-apple.md | 1 - .../project/update-o-auth-2-appwrite.md | 1 - .../project/update-o-auth-2-auth-0.md | 1 - .../project/update-o-auth-2-authentik.md | 1 - .../project/update-o-auth-2-autodesk.md | 1 - .../project/update-o-auth-2-bitbucket.md | 1 - .../examples/project/update-o-auth-2-bitly.md | 1 - docs/examples/project/update-o-auth-2-box.md | 1 - .../project/update-o-auth-2-dailymotion.md | 1 - .../project/update-o-auth-2-discord.md | 1 - .../project/update-o-auth-2-disqus.md | 1 - .../project/update-o-auth-2-dropbox.md | 1 - docs/examples/project/update-o-auth-2-etsy.md | 1 - .../project/update-o-auth-2-facebook.md | 1 - .../examples/project/update-o-auth-2-figma.md | 1 - .../project/update-o-auth-2-fusion-auth.md | 1 - .../project/update-o-auth-2-git-hub.md | 1 - .../project/update-o-auth-2-gitlab.md | 1 - .../project/update-o-auth-2-google.md | 1 - .../project/update-o-auth-2-hugging-face.md | 1 - .../project/update-o-auth-2-keycloak.md | 1 - docs/examples/project/update-o-auth-2-kick.md | 1 - .../project/update-o-auth-2-linkedin.md | 1 - .../project/update-o-auth-2-microsoft.md | 1 - .../project/update-o-auth-2-notion.md | 1 - docs/examples/project/update-o-auth-2-oidc.md | 1 - docs/examples/project/update-o-auth-2-okta.md | 1 - .../project/update-o-auth-2-paypal-sandbox.md | 1 - .../project/update-o-auth-2-paypal.md | 1 - .../examples/project/update-o-auth-2-podio.md | 1 - .../project/update-o-auth-2-salesforce.md | 1 - .../project/update-o-auth-2-server.md | 1 - .../examples/project/update-o-auth-2-slack.md | 1 - .../project/update-o-auth-2-spotify.md | 1 - .../project/update-o-auth-2-stripe.md | 1 - .../update-o-auth-2-tradeshift-sandbox.md | 1 - .../project/update-o-auth-2-tradeshift.md | 1 - .../project/update-o-auth-2-twitch.md | 1 - .../project/update-o-auth-2-word-press.md | 1 - .../examples/project/update-o-auth-2-yahoo.md | 1 - .../project/update-o-auth-2-yandex.md | 1 - docs/examples/project/update-o-auth-2-zoho.md | 1 - docs/examples/project/update-o-auth-2-zoom.md | 1 - docs/examples/project/update-o-auth-2x.md | 1 - .../update-password-dictionary-policy.md | 1 - .../project/update-password-history-policy.md | 1 - .../update-password-personal-data-policy.md | 1 - .../update-password-strength-policy.md | 1 - docs/examples/project/update-protocol.md | 1 - docs/examples/project/update-service.md | 1 - .../project/update-session-alert-policy.md | 1 - .../project/update-session-duration-policy.md | 1 - .../update-session-invalidation-policy.md | 1 - .../project/update-session-limit-policy.md | 1 - docs/examples/project/update-smtp.md | 1 - .../project/update-user-limit-policy.md | 1 - docs/examples/project/update-variable.md | 1 - docs/examples/project/update-web-platform.md | 1 - .../project/update-windows-platform.md | 1 - docs/examples/proxy/create-api-rule.md | 1 - docs/examples/proxy/create-function-rule.md | 1 - docs/examples/proxy/create-invalidation.md | 1 - docs/examples/proxy/create-redirect-rule.md | 1 - docs/examples/proxy/create-site-rule.md | 1 - docs/examples/proxy/delete-rule.md | 1 - docs/examples/proxy/get-rule.md | 1 - docs/examples/proxy/list-rules.md | 1 - docs/examples/proxy/update-rule-status.md | 1 - docs/examples/sites/create-deployment.md | 1 - .../sites/create-duplicate-deployment.md | 1 - .../sites/create-template-deployment.md | 1 - docs/examples/sites/create-variable.md | 1 - docs/examples/sites/create-vcs-deployment.md | 1 - docs/examples/sites/create.md | 1 - docs/examples/sites/delete-deployment.md | 1 - docs/examples/sites/delete-log.md | 1 - docs/examples/sites/delete-variable.md | 1 - docs/examples/sites/delete.md | 1 - .../examples/sites/get-deployment-download.md | 1 - docs/examples/sites/get-deployment.md | 1 - docs/examples/sites/get-log.md | 1 - docs/examples/sites/get-variable.md | 1 - docs/examples/sites/get.md | 1 - docs/examples/sites/list-deployments.md | 1 - docs/examples/sites/list-frameworks.md | 2 -- docs/examples/sites/list-logs.md | 1 - docs/examples/sites/list-specifications.md | 1 - docs/examples/sites/list-variables.md | 1 - docs/examples/sites/list.md | 1 - .../sites/update-deployment-status.md | 1 - docs/examples/sites/update-site-deployment.md | 1 - docs/examples/sites/update-variable.md | 1 - docs/examples/sites/update.md | 1 - docs/examples/storage/create-bucket.md | 1 - docs/examples/storage/create-file.md | 1 - docs/examples/storage/delete-bucket.md | 1 - docs/examples/storage/delete-file.md | 1 - docs/examples/storage/get-bucket.md | 1 - docs/examples/storage/get-file-download.md | 1 - docs/examples/storage/get-file-preview.md | 1 - docs/examples/storage/get-file-view.md | 1 - docs/examples/storage/get-file.md | 1 - docs/examples/storage/list-buckets.md | 1 - docs/examples/storage/list-files.md | 1 - docs/examples/storage/update-bucket.md | 1 - docs/examples/storage/update-file.md | 1 - .../tablesdb/create-big-int-column.md | 1 - .../tablesdb/create-boolean-column.md | 1 - .../tablesdb/create-datetime-column.md | 1 - docs/examples/tablesdb/create-email-column.md | 1 - docs/examples/tablesdb/create-enum-column.md | 1 - docs/examples/tablesdb/create-failover.md | 1 - docs/examples/tablesdb/create-float-column.md | 1 - docs/examples/tablesdb/create-index.md | 1 - .../tablesdb/create-integer-column.md | 1 - docs/examples/tablesdb/create-ip-column.md | 1 - docs/examples/tablesdb/create-line-column.md | 1 - .../tablesdb/create-longtext-column.md | 1 - .../tablesdb/create-mediumtext-column.md | 1 - docs/examples/tablesdb/create-migration.md | 1 - docs/examples/tablesdb/create-operations.md | 1 - docs/examples/tablesdb/create-point-column.md | 1 - .../tablesdb/create-polygon-column.md | 1 - .../tablesdb/create-relationship-column.md | 1 - docs/examples/tablesdb/create-row.md | 1 - docs/examples/tablesdb/create-rows.md | 1 - .../examples/tablesdb/create-string-column.md | 1 - docs/examples/tablesdb/create-table.md | 1 - docs/examples/tablesdb/create-text-column.md | 1 - docs/examples/tablesdb/create-transaction.md | 1 - docs/examples/tablesdb/create-url-column.md | 1 - .../tablesdb/create-varchar-column.md | 1 - docs/examples/tablesdb/create.md | 1 - docs/examples/tablesdb/cutover-migration.md | 1 - .../examples/tablesdb/decrement-row-column.md | 1 - docs/examples/tablesdb/delete-column.md | 1 - docs/examples/tablesdb/delete-index.md | 1 - docs/examples/tablesdb/delete-migration.md | 1 - docs/examples/tablesdb/delete-row.md | 1 - docs/examples/tablesdb/delete-rows.md | 1 - docs/examples/tablesdb/delete-table.md | 1 - docs/examples/tablesdb/delete-transaction.md | 1 - docs/examples/tablesdb/delete.md | 1 - docs/examples/tablesdb/get-column.md | 1 - docs/examples/tablesdb/get-index.md | 1 - docs/examples/tablesdb/get-migration.md | 1 - docs/examples/tablesdb/get-replicas.md | 1 - docs/examples/tablesdb/get-row.md | 1 - docs/examples/tablesdb/get-status.md | 1 - docs/examples/tablesdb/get-table.md | 1 - docs/examples/tablesdb/get-transaction.md | 1 - docs/examples/tablesdb/get.md | 1 - .../examples/tablesdb/increment-row-column.md | 1 - docs/examples/tablesdb/list-columns.md | 1 - docs/examples/tablesdb/list-indexes.md | 1 - docs/examples/tablesdb/list-migrations.md | 1 - docs/examples/tablesdb/list-operations.md | 1 - docs/examples/tablesdb/list-rows.md | 1 - docs/examples/tablesdb/list-specifications.md | 2 -- docs/examples/tablesdb/list-tables.md | 1 - docs/examples/tablesdb/list-transactions.md | 1 - docs/examples/tablesdb/list.md | 1 - .../tablesdb/update-big-int-column.md | 1 - .../tablesdb/update-boolean-column.md | 1 - .../tablesdb/update-datetime-column.md | 1 - docs/examples/tablesdb/update-email-column.md | 1 - docs/examples/tablesdb/update-enum-column.md | 1 - docs/examples/tablesdb/update-float-column.md | 1 - .../tablesdb/update-integer-column.md | 1 - docs/examples/tablesdb/update-ip-column.md | 1 - docs/examples/tablesdb/update-line-column.md | 1 - .../tablesdb/update-longtext-column.md | 1 - .../tablesdb/update-mediumtext-column.md | 1 - docs/examples/tablesdb/update-point-column.md | 1 - .../tablesdb/update-polygon-column.md | 1 - .../tablesdb/update-relationship-column.md | 1 - docs/examples/tablesdb/update-row.md | 1 - docs/examples/tablesdb/update-rows.md | 1 - .../examples/tablesdb/update-string-column.md | 1 - docs/examples/tablesdb/update-table.md | 1 - docs/examples/tablesdb/update-text-column.md | 1 - docs/examples/tablesdb/update-transaction.md | 1 - docs/examples/tablesdb/update-url-column.md | 1 - .../tablesdb/update-varchar-column.md | 1 - docs/examples/tablesdb/update.md | 1 - docs/examples/tablesdb/upsert-row.md | 1 - docs/examples/tablesdb/upsert-rows.md | 1 - docs/examples/teams/create-installation.md | 1 - docs/examples/teams/create-membership.md | 1 - docs/examples/teams/create.md | 1 - docs/examples/teams/delete-installation.md | 1 - docs/examples/teams/delete-membership.md | 1 - docs/examples/teams/delete.md | 1 - docs/examples/teams/get-installation.md | 1 - docs/examples/teams/get-membership.md | 1 - docs/examples/teams/get-prefs.md | 1 - docs/examples/teams/get.md | 1 - docs/examples/teams/list-installations.md | 1 - docs/examples/teams/list-memberships.md | 1 - docs/examples/teams/list.md | 1 - docs/examples/teams/update-installation.md | 1 - .../teams/update-membership-status.md | 1 - docs/examples/teams/update-membership.md | 1 - docs/examples/teams/update-name.md | 1 - docs/examples/teams/update-prefs.md | 1 - docs/examples/tokens/create-file-token.md | 1 - docs/examples/tokens/delete.md | 1 - docs/examples/tokens/get.md | 1 - docs/examples/tokens/list.md | 1 - docs/examples/tokens/update.md | 1 - docs/examples/users/create-argon-2-user.md | 1 - docs/examples/users/create-bcrypt-user.md | 1 - docs/examples/users/create-jwt.md | 1 - docs/examples/users/create-md-5-user.md | 1 - .../users/create-mfa-recovery-codes.md | 1 - docs/examples/users/create-ph-pass-user.md | 1 - .../users/create-scrypt-modified-user.md | 1 - docs/examples/users/create-scrypt-user.md | 1 - docs/examples/users/create-session.md | 1 - docs/examples/users/create-sha-user.md | 1 - docs/examples/users/create-target.md | 1 - docs/examples/users/create-token.md | 1 - docs/examples/users/create.md | 1 - docs/examples/users/delete-identity.md | 1 - .../users/delete-mfa-authenticator.md | 1 - docs/examples/users/delete-session.md | 1 - docs/examples/users/delete-sessions.md | 1 - docs/examples/users/delete-target.md | 1 - docs/examples/users/delete.md | 1 - docs/examples/users/get-mfa-challenge.md | 1 - docs/examples/users/get-mfa-recovery-codes.md | 1 - docs/examples/users/get-prefs.md | 1 - docs/examples/users/get-target.md | 1 - docs/examples/users/get.md | 1 - docs/examples/users/list-identities.md | 1 - docs/examples/users/list-logs.md | 1 - docs/examples/users/list-memberships.md | 1 - docs/examples/users/list-mfa-factors.md | 1 - docs/examples/users/list-sessions.md | 1 - docs/examples/users/list-targets.md | 1 - docs/examples/users/list.md | 1 - .../users/update-email-verification.md | 1 - docs/examples/users/update-email.md | 1 - docs/examples/users/update-impersonator.md | 1 - docs/examples/users/update-labels.md | 1 - .../users/update-mfa-recovery-codes.md | 1 - docs/examples/users/update-mfa.md | 1 - docs/examples/users/update-name.md | 1 - docs/examples/users/update-password.md | 1 - .../users/update-phone-verification.md | 1 - docs/examples/users/update-phone.md | 1 - docs/examples/users/update-prefs.md | 1 - docs/examples/users/update-status.md | 1 - docs/examples/users/update-target.md | 1 - docs/examples/webhooks/create.md | 1 - docs/examples/webhooks/delete.md | 1 - docs/examples/webhooks/get.md | 1 - docs/examples/webhooks/list.md | 1 - docs/examples/webhooks/update-secret.md | 1 - docs/examples/webhooks/update.md | 1 - docs/functions.md | 14 ++++---- docs/oauth2.md | 4 +-- docs/organization.md | 6 ++-- docs/project.md | 22 ++++++------ docs/proxy.md | 2 +- docs/sites.md | 12 +++---- docs/storage.md | 8 ++--- docs/tablesdb.md | 2 +- docs/teams.md | 14 ++++---- docs/tokens.md | 2 +- docs/users.md | 12 +++---- src/Appwrite/Services/Account.php | 34 +++++++++---------- src/Appwrite/Services/Advisor.php | 4 +-- src/Appwrite/Services/Apps.php | 2 +- src/Appwrite/Services/Avatars.php | 4 +-- src/Appwrite/Services/Backups.php | 10 +++--- src/Appwrite/Services/Databases.php | 2 +- src/Appwrite/Services/Functions.php | 18 +++++----- src/Appwrite/Services/Oauth2.php | 4 +-- src/Appwrite/Services/Organization.php | 8 ++--- src/Appwrite/Services/Project.php | 22 ++++++------ src/Appwrite/Services/Proxy.php | 2 +- src/Appwrite/Services/Sites.php | 16 ++++----- src/Appwrite/Services/Storage.php | 8 ++--- src/Appwrite/Services/TablesDB.php | 2 +- src/Appwrite/Services/Teams.php | 14 ++++---- src/Appwrite/Services/Tokens.php | 2 +- src/Appwrite/Services/Users.php | 12 +++---- 632 files changed, 157 insertions(+), 783 deletions(-) diff --git a/docs/account.md b/docs/account.md index 933272a4..4ed44759 100644 --- a/docs/account.md +++ b/docs/account.md @@ -343,14 +343,14 @@ GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes ``` -** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** +** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** ```http request POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes ``` -** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** +** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** ```http request @@ -398,7 +398,7 @@ PATCH https://cloud.appwrite.io/v1/account/password PATCH https://cloud.appwrite.io/v1/account/phone ``` -** Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. ** +** Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. ** ### Parameters @@ -432,7 +432,7 @@ PATCH https://cloud.appwrite.io/v1/account/prefs POST https://cloud.appwrite.io/v1/account/recovery ``` -** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. ** +** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. ** ### Parameters @@ -542,7 +542,7 @@ POST https://cloud.appwrite.io/v1/account/sessions/token GET https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. ** +** Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. ** ### Parameters @@ -555,7 +555,7 @@ GET https://cloud.appwrite.io/v1/account/sessions/{sessionId} PATCH https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. ** +** Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. ** ### Parameters @@ -568,7 +568,7 @@ PATCH https://cloud.appwrite.io/v1/account/sessions/{sessionId} DELETE https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. ** +** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. ** ### Parameters @@ -588,7 +588,7 @@ PATCH https://cloud.appwrite.io/v1/account/status POST https://cloud.appwrite.io/v1/account/tokens/email ``` -** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. +** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -606,7 +606,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/tokens/magic-url ``` -** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. +** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -625,7 +625,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about GET https://cloud.appwrite.io/v1/account/tokens/oauth2/{provider} ``` -** Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. +** Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. @@ -645,7 +645,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/tokens/phone ``` -** Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. +** Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -661,7 +661,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/verifications/email ``` -** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. +** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. ** @@ -677,7 +677,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ POST https://cloud.appwrite.io/v1/account/verifications/email ``` -** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. +** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. ** @@ -721,14 +721,14 @@ PUT https://cloud.appwrite.io/v1/account/verifications/email POST https://cloud.appwrite.io/v1/account/verifications/phone ``` -** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. ** +** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. ** ```http request PUT https://cloud.appwrite.io/v1/account/verifications/phone ``` -** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. ** +** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. ** ### Parameters diff --git a/docs/advisor.md b/docs/advisor.md index e292c933..522c25a9 100644 --- a/docs/advisor.md +++ b/docs/advisor.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/reports ``` -** Get a list of all the project's analyzer reports. You can use the query params to filter your results. +** Get a list of all the project's analyzer reports. You can use the query params to filter your results. ** ### Parameters @@ -20,7 +20,7 @@ GET https://cloud.appwrite.io/v1/reports GET https://cloud.appwrite.io/v1/reports/{reportId} ``` -** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced. +** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced. ** ### Parameters diff --git a/docs/apps.md b/docs/apps.md index 436275b2..fde01429 100644 --- a/docs/apps.md +++ b/docs/apps.md @@ -194,7 +194,7 @@ GET https://cloud.appwrite.io/v1/apps/{appId}/keys POST https://cloud.appwrite.io/v1/apps/{appId}/keys ``` -** 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. ** +** 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. ** ### Parameters diff --git a/docs/avatars.md b/docs/avatars.md index ee9beb42..ca8341b2 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -95,9 +95,9 @@ This endpoint does not follow HTTP redirects. ** GET https://cloud.appwrite.io/v1/avatars/initials ``` -** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. +** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. -You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. +You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. ** diff --git a/docs/backups.md b/docs/backups.md index 24727348..67fa160c 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -32,7 +32,7 @@ POST https://cloud.appwrite.io/v1/backups/archives GET https://cloud.appwrite.io/v1/backups/archives/{archiveId} ``` -** Get a backup archive using it's ID. ** +** Get a backup archive using it's ID. ** ### Parameters @@ -90,7 +90,7 @@ POST https://cloud.appwrite.io/v1/backups/policies GET https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Get a backup policy using it's ID. ** +** Get a backup policy using it's ID. ** ### Parameters @@ -103,7 +103,7 @@ GET https://cloud.appwrite.io/v1/backups/policies/{policyId} PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Update an existing policy using it's ID. ** +** Update an existing policy using it's ID. ** ### Parameters @@ -120,7 +120,7 @@ PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId} DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Delete a policy using it's ID. ** +** Delete a policy using it's ID. ** ### Parameters @@ -141,7 +141,7 @@ The restoration migration records the archived database in `resourceId` and `res 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 from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. +When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. ** ### Parameters diff --git a/docs/databases.md b/docs/databases.md index f976fef2..4915ffbc 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -983,7 +983,7 @@ DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collecti GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents ``` -** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. ** +** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. ** ### Parameters diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 1b58f559..90283cf3 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->createAnonymousSession(); - - ``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index dc3f7a8c..b462ef80 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -15,5 +15,4 @@ $result = $account->createEmailPasswordSession( email: 'email@example.com', password: 'password' ); - ``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index e2fbb11b..1494943f 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -16,5 +16,4 @@ $result = $account->createEmailToken( email: 'email@example.com', phrase: false // optional ); - ``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index 5f14a380..de0eab93 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->createEmailVerification( url: 'https://example.com' ); - ``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index 146bacd4..9c31a513 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -17,5 +17,4 @@ $result = $account->createMagicURLToken( url: 'https://example.com', // optional phrase: false // optional ); - ``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 16d7938a..75d848d0 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -15,5 +15,4 @@ $account = new Account($client); $result = $account->createMFAAuthenticator( type: AuthenticatorType::TOTP() ); - ``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index d44ba734..3b370030 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -15,5 +15,4 @@ $account = new Account($client); $result = $account->createMFAChallenge( factor: AuthenticationFactor::EMAIL() ); - ``` diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 9e4ce17b..655663f7 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->createMFARecoveryCodes(); - - ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index aace9c9d..db4dc650 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -18,5 +18,4 @@ $result = $account->createOAuth2Token( failure: 'https://example.com', // optional scopes: [] // optional ); - ``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 49303f2c..bf56212e 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -15,5 +15,4 @@ $result = $account->createPhoneToken( userId: '', phone: '+12065550100' ); - ``` diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index b2158136..4cedfba4 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->createPhoneVerification(); - - ``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e10f8223..24d308c2 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -15,5 +15,4 @@ $result = $account->createRecovery( email: 'email@example.com', url: 'https://example.com' ); - ``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index d99930f3..d40041f7 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -15,5 +15,4 @@ $result = $account->createSession( userId: '', secret: '' ); - ``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 97622d89..72fa5a9a 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->createVerification( url: 'https://example.com' ); - ``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index af087d92..b4f8c1c6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -17,5 +17,4 @@ $result = $account->create( password: 'password', name: '' // optional ); - ``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md index 9c44f52a..8db797b4 100644 --- a/docs/examples/account/delete-consent-token.md +++ b/docs/examples/account/delete-consent-token.md @@ -15,5 +15,4 @@ $result = $account->deleteConsentToken( consentId: '', tokenId: '' ); - ``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md index 242b7e21..e7457d49 100644 --- a/docs/examples/account/delete-consent.md +++ b/docs/examples/account/delete-consent.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->deleteConsent( consentId: '' ); - ``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index c63e9b55..15f7fa5f 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->deleteIdentity( identityId: '' ); - ``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 9b010f80..dd434416 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -15,5 +15,4 @@ $account = new Account($client); $result = $account->deleteMFAAuthenticator( type: AuthenticatorType::TOTP() ); - ``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index e00952bf..498b0c47 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->deleteSession( sessionId: '' ); - ``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 65d3cf92..7886fabf 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->deleteSessions(); - - ``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index fce21689..4667c5c9 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -15,5 +15,4 @@ $result = $account->getConsentToken( consentId: '', tokenId: '' ); - ``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index f65331de..2b22510e 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->getConsent( consentId: '' ); - ``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 1de88d8a..9a99dac2 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->getMFARecoveryCodes(); - - ``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 0787dbb2..e1259176 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->getPrefs(); - - ``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index d441989f..15a99f2b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->getSession( sessionId: '' ); - ``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 89c95043..d1fb255b 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->get(); - - ``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 566379b1..84824947 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -16,5 +16,4 @@ $result = $account->listConsentTokens( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md index 10d3125b..9b2255ef 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -15,5 +15,4 @@ $result = $account->listConsents( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 8a7383d3..69c8bbbb 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -15,5 +15,4 @@ $result = $account->listIdentities( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 1bb6b555..17e51352 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -15,5 +15,4 @@ $result = $account->listLogs( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index d163fa22..96b6021b 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->listMFAFactors(); - - ``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index c74648f7..9c42f8ca 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->listSessions(); - - ``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index 0dde16ee..1c363e97 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -15,5 +15,4 @@ $result = $account->updateEmailVerification( userId: '', secret: '' ); - ``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index b3424766..fb207913 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -15,5 +15,4 @@ $result = $account->updateEmail( email: 'email@example.com', password: 'password' ); - ``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index e5deb208..3fd0179f 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -15,5 +15,4 @@ $result = $account->updateMagicURLSession( userId: '', secret: '' ); - ``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 40347461..d02e79ce 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -16,5 +16,4 @@ $result = $account->updateMFAAuthenticator( type: AuthenticatorType::TOTP(), otp: '' ); - ``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index c91895c6..bc829a6e 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -15,5 +15,4 @@ $result = $account->updateMFAChallenge( challengeId: '', otp: '' ); - ``` diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index f8b417c7..ee16a9c9 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->updateMFARecoveryCodes(); - - ``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index de9d3aa9..2d1f35af 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->updateMFA( mfa: false ); - ``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index e44d0a8e..9ebb4381 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->updateName( name: '' ); - ``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index ac60efe6..c9e0fc55 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -15,5 +15,4 @@ $result = $account->updatePassword( password: 'password', oldPassword: 'password' // optional ); - ``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 44b366b9..f547ca97 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -15,5 +15,4 @@ $result = $account->updatePhoneSession( userId: '', secret: '' ); - ``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 0485eb44..cbc6790c 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -15,5 +15,4 @@ $result = $account->updatePhoneVerification( userId: '', secret: '' ); - ``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index f21c6573..b9fe2bd3 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -15,5 +15,4 @@ $result = $account->updatePhone( phone: '+12065550100', password: 'password' ); - ``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index c792935c..9176756b 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -18,5 +18,4 @@ $result = $account->updatePrefs( 'darkTheme' => true ] ); - ``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 1d2b1c3c..eb540c39 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -16,5 +16,4 @@ $result = $account->updateRecovery( secret: '', password: 'password' ); - ``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 9dcf30d0..b98cb3bd 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -14,5 +14,4 @@ $account = new Account($client); $result = $account->updateSession( sessionId: '' ); - ``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index a4fcef8c..7f0088a6 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -12,6 +12,4 @@ $client = (new Client()) $account = new Account($client); $result = $account->updateStatus(); - - ``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 534d5028..a84126d4 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -15,5 +15,4 @@ $result = $account->updateVerification( userId: '', secret: '' ); - ``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 3375c0e5..d4b7f3f5 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -14,5 +14,4 @@ $activities = new Activities($client); $result = $activities->getEvent( eventId: '' ); - ``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index 977b32f0..3ffec877 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -14,5 +14,4 @@ $activities = new Activities($client); $result = $activities->listEvents( queries: [] // optional ); - ``` diff --git a/docs/examples/advisor/delete-report.md b/docs/examples/advisor/delete-report.md index a7af81df..41d2e336 100644 --- a/docs/examples/advisor/delete-report.md +++ b/docs/examples/advisor/delete-report.md @@ -14,5 +14,4 @@ $advisor = new Advisor($client); $result = $advisor->deleteReport( reportId: '' ); - ``` diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 886a8e11..812ee9bc 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -15,5 +15,4 @@ $result = $advisor->getInsight( reportId: '', insightId: '' ); - ``` diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index c7819700..1379419c 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -14,5 +14,4 @@ $advisor = new Advisor($client); $result = $advisor->getReport( reportId: '' ); - ``` diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 6f569e1c..d475153c 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -16,5 +16,4 @@ $result = $advisor->listInsights( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index 0d41fcd0..9dc55cae 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -15,5 +15,4 @@ $result = $advisor->listReports( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index 9ce6d416..1e8323e1 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -15,5 +15,4 @@ $result = $apps->createInstallationToken( appId: '', installationId: '' ); - ``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index 4307edde..0f7d69b4 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -14,5 +14,4 @@ $apps = new Apps($client); $result = $apps->createKey( appId: '' ); - ``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index 79815d48..59336de4 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -14,5 +14,4 @@ $apps = new Apps($client); $result = $apps->createSecret( appId: '' ); - ``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 6ab07f0e..459786ed 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -32,5 +32,4 @@ $result = $apps->create( deviceFlow: false, // optional teamId: '' // optional ); - ``` diff --git a/docs/examples/apps/delete-installation.md b/docs/examples/apps/delete-installation.md index d2813b5b..e6c89fda 100644 --- a/docs/examples/apps/delete-installation.md +++ b/docs/examples/apps/delete-installation.md @@ -15,5 +15,4 @@ $result = $apps->deleteInstallation( appId: '', installationId: '' ); - ``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md index 555497e2..a178c1d7 100644 --- a/docs/examples/apps/delete-key.md +++ b/docs/examples/apps/delete-key.md @@ -15,5 +15,4 @@ $result = $apps->deleteKey( appId: '', keyId: '' ); - ``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md index 66c2e3e8..947efae1 100644 --- a/docs/examples/apps/delete-secret.md +++ b/docs/examples/apps/delete-secret.md @@ -15,5 +15,4 @@ $result = $apps->deleteSecret( appId: '', secretId: '' ); - ``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md index 3be8290b..bca4ae85 100644 --- a/docs/examples/apps/delete-tokens.md +++ b/docs/examples/apps/delete-tokens.md @@ -14,5 +14,4 @@ $apps = new Apps($client); $result = $apps->deleteTokens( appId: '' ); - ``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md index 68699e5c..b0d4c61e 100644 --- a/docs/examples/apps/delete.md +++ b/docs/examples/apps/delete.md @@ -14,5 +14,4 @@ $apps = new Apps($client); $result = $apps->delete( appId: '' ); - ``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index dd5086fe..75ab80c3 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -15,5 +15,4 @@ $result = $apps->getInstallation( appId: '', installationId: '' ); - ``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index b472e214..a45ee7b7 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -15,5 +15,4 @@ $result = $apps->getKey( appId: '', keyId: '' ); - ``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index 43a5e44f..c55906ac 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -15,5 +15,4 @@ $result = $apps->getSecret( appId: '', secretId: '' ); - ``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index cf478134..1324923d 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -14,5 +14,4 @@ $apps = new Apps($client); $result = $apps->get( appId: '' ); - ``` diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md index 1c9471f0..f60f6c51 100644 --- a/docs/examples/apps/list-installation-scopes.md +++ b/docs/examples/apps/list-installation-scopes.md @@ -12,6 +12,4 @@ $client = (new Client()) $apps = new Apps($client); $result = $apps->listInstallationScopes(); - - ``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 22e21f9a..08dd109f 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -16,5 +16,4 @@ $result = $apps->listInstallations( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md index 08796916..33a9fdf9 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -16,5 +16,4 @@ $result = $apps->listKeys( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md index 77f52082..4bcfa44b 100644 --- a/docs/examples/apps/list-o-auth-2-scopes.md +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -12,6 +12,4 @@ $client = (new Client()) $apps = new Apps($client); $result = $apps->listOAuth2Scopes(); - - ``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index e5db518e..bbfeac40 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -16,5 +16,4 @@ $result = $apps->listSecrets( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md index 0295494c..e92a0fdb 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -15,5 +15,4 @@ $result = $apps->list( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md index acd381a9..8ab41d2b 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -15,5 +15,4 @@ $result = $apps->updateLabels( appId: '', labels: [] ); - ``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md index 9372ee8b..38580979 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -15,5 +15,4 @@ $result = $apps->updateTeam( appId: '', teamId: '' ); - ``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index 6b957310..5d72dc0a 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -33,5 +33,4 @@ $result = $apps->update( installationScopes: [], // optional installationRedirectUrl: 'https://example.com' // optional ); - ``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 11385f1e..ccf98858 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -18,5 +18,4 @@ $result = $avatars->getBrowser( height: 0, // optional quality: -1 // optional ); - ``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index de19fe4c..ff4fd2b3 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -18,5 +18,4 @@ $result = $avatars->getCreditCard( height: 0, // optional quality: -1 // optional ); - ``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 362ff7fa..346f46d1 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -14,5 +14,4 @@ $avatars = new Avatars($client); $result = $avatars->getFavicon( url: 'https://example.com' ); - ``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 8ffc7d72..e2b455b3 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -18,5 +18,4 @@ $result = $avatars->getFlag( height: 0, // optional quality: -1 // optional ); - ``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 62f89e5a..2ca26019 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -16,5 +16,4 @@ $result = $avatars->getImage( width: 0, // optional height: 0 // optional ); - ``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 57abcfb1..88f45c16 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -17,5 +17,4 @@ $result = $avatars->getInitials( height: 0, // optional background: '' // optional ); - ``` diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md index ce8e992a..3483a705 100644 --- a/docs/examples/avatars/get-photo.md +++ b/docs/examples/avatars/get-photo.md @@ -18,5 +18,4 @@ $result = $avatars->getPhoto( output: 'png', // optional rating: 'g' // optional ); - ``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index c26932c2..ec6e3441 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -17,5 +17,4 @@ $result = $avatars->getQR( margin: 0, // optional download: false // optional ); - ``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index fff2b074..59fbd663 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -40,5 +40,4 @@ $result = $avatars->getScreenshot( quality: 85, // optional output: ImageFormat::JPEG() // optional ); - ``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index 17ba5d4e..77d51a46 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -16,5 +16,4 @@ $result = $backups->createArchive( services: [BackupServices::DATABASES()], resourceId: '' // optional ); - ``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md index ffdf7180..301cec37 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -21,5 +21,4 @@ $result = $backups->createPolicy( resourceId: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 6981dd8b..8b7b1e70 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -18,5 +18,4 @@ $result = $backups->createRestoration( newResourceId: '', // optional newResourceName: '' // optional ); - ``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md index 54cff954..444146f2 100644 --- a/docs/examples/backups/delete-archive.md +++ b/docs/examples/backups/delete-archive.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->deleteArchive( archiveId: '' ); - ``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md index 7a7995a8..a8d96498 100644 --- a/docs/examples/backups/delete-policy.md +++ b/docs/examples/backups/delete-policy.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->deletePolicy( policyId: '' ); - ``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md index 51acbecc..7f5f79a4 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->getArchive( archiveId: '' ); - ``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md index 69b9f920..a24d8cf6 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->getPolicy( policyId: '' ); - ``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md index 57c2cf50..9b97e471 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->getRestoration( restorationId: '' ); - ``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index dece661e..af9f412a 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->listArchives( queries: [] // optional ); - ``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index 7ee82d9e..f9775cd4 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->listPolicies( queries: [] // optional ); - ``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index 558e4a36..a02a1cb7 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -14,5 +14,4 @@ $backups = new Backups($client); $result = $backups->listRestorations( queries: [] // optional ); - ``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md index da6310ee..54d8adcb 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -18,5 +18,4 @@ $result = $backups->updatePolicy( schedule: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index 563f7c4e..e746cffb 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -21,5 +21,4 @@ $result = $databases->createBigIntAttribute( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index f1b8056e..1cc6d1a3 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -19,5 +19,4 @@ $result = $databases->createBooleanAttribute( default: false, // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 2e4dd3e3..5adf6f56 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -23,5 +23,4 @@ $result = $databases->createCollection( attributes: [], // optional indexes: [] // optional ); - ``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 0aa01849..788eba63 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -19,5 +19,4 @@ $result = $databases->createDatetimeAttribute( default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index fec6e85a..efd3083f 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -27,5 +27,4 @@ $result = $databases->createDocument( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 7156ce21..1f64387b 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -17,5 +17,4 @@ $result = $databases->createDocuments( documents: [], transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index a2c54196..fb2654a4 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -19,5 +19,4 @@ $result = $databases->createEmailAttribute( default: 'email@example.com', // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index f80a5014..4f77fcd1 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -20,5 +20,4 @@ $result = $databases->createEnumAttribute( default: '', // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 23b4864d..c6946d79 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -21,5 +21,4 @@ $result = $databases->createFloatAttribute( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 3663fbe9..6e5870a6 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -22,5 +22,4 @@ $result = $databases->createIndex( orders: [OrderBy::ASC()], // optional lengths: [] // optional ); - ``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index c224755d..12b5f959 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -21,5 +21,4 @@ $result = $databases->createIntegerAttribute( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index f7a25bff..27a934b6 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -19,5 +19,4 @@ $result = $databases->createIpAttribute( default: '', // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index ccea2700..80c8faa7 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -18,5 +18,4 @@ $result = $databases->createLineAttribute( required: false, default: [[1, 2], [3, 4], [5, 6]] // optional ); - ``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 6cc66b9b..91be4cee 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -20,5 +20,4 @@ $result = $databases->createLongtextAttribute( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 15c26aba..4b369807 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -20,5 +20,4 @@ $result = $databases->createMediumtextAttribute( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 00cf4e24..82172a3f 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -25,5 +25,4 @@ $result = $databases->createOperations( } ] // optional ); - ``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 9f4c913c..94255f86 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -18,5 +18,4 @@ $result = $databases->createPointAttribute( required: false, default: [1, 2] // optional ); - ``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index a0d0bb0e..6cccf534 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -18,5 +18,4 @@ $result = $databases->createPolygonAttribute( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional ); - ``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 251f73a7..3581c89d 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -23,5 +23,4 @@ $result = $databases->createRelationshipAttribute( twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional ); - ``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 8f4e3fc8..34f13110 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -21,5 +21,4 @@ $result = $databases->createStringAttribute( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index b00d8caa..b189babd 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -20,5 +20,4 @@ $result = $databases->createTextAttribute( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index 7f145827..600cda58 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->createTransaction( ttl: 60 // optional ); - ``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 4f077794..c4706118 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -19,5 +19,4 @@ $result = $databases->createUrlAttribute( default: 'https://example.com', // optional array: false // optional ); - ``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 7a02c976..42d69aa2 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -21,5 +21,4 @@ $result = $databases->createVarcharAttribute( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 2cd1b249..95f3cf40 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -16,5 +16,4 @@ $result = $databases->create( name: '', enabled: false // optional ); - ``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 5b541ecc..82981200 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -20,5 +20,4 @@ $result = $databases->decrementDocumentAttribute( min: null, // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 99c4ea5c..84ba9901 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -16,5 +16,4 @@ $result = $databases->deleteAttribute( collectionId: '', key: '' ); - ``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index ca0a5d11..486b9f36 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -15,5 +15,4 @@ $result = $databases->deleteCollection( databaseId: '', collectionId: '' ); - ``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 522d09f9..33f9e179 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -17,5 +17,4 @@ $result = $databases->deleteDocument( documentId: '', transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 52ec3331..f39cbfe0 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -17,5 +17,4 @@ $result = $databases->deleteDocuments( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 665d34cc..b752023d 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -16,5 +16,4 @@ $result = $databases->deleteIndex( collectionId: '', key: '' ); - ``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 723c28ae..09634f29 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->deleteTransaction( transactionId: '' ); - ``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 242c3b14..6f25053a 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->delete( databaseId: '' ); - ``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index cc9c30e7..cd77f506 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -16,5 +16,4 @@ $result = $databases->getAttribute( collectionId: '', key: '' ); - ``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 9d94b681..e8cdada6 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -15,5 +15,4 @@ $result = $databases->getCollection( databaseId: '', collectionId: '' ); - ``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 8919a74d..f0827f6e 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -18,5 +18,4 @@ $result = $databases->getDocument( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index d2ec8022..a8cf9adb 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -16,5 +16,4 @@ $result = $databases->getIndex( collectionId: '', key: '' ); - ``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index fd896382..23581685 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->getTransaction( transactionId: '' ); - ``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index d03605ec..8eb28cbe 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->get( databaseId: '' ); - ``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index d17f4e2c..30450c08 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -20,5 +20,4 @@ $result = $databases->incrementDocumentAttribute( max: null, // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 003af12f..1867283b 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -17,5 +17,4 @@ $result = $databases->listAttributes( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 94478581..29dd5ec2 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -17,5 +17,4 @@ $result = $databases->listCollections( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index d35b48ee..9e4d143f 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -19,5 +19,4 @@ $result = $databases->listDocuments( total: false, // optional ttl: 0 // optional ); - ``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index b784d05d..40b21bbd 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -17,5 +17,4 @@ $result = $databases->listIndexes( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 2456f592..97cb6abd 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -14,5 +14,4 @@ $databases = new Databases($client); $result = $databases->listTransactions( queries: [] // optional ); - ``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 307f9d48..f48d27ff 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -16,5 +16,4 @@ $result = $databases->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index f4548334..44d70a99 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -21,5 +21,4 @@ $result = $databases->updateBigIntAttribute( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 27486c4f..a92a6999 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateBooleanAttribute( default: false, newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index c21d9dfb..dc8e3522 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -22,5 +22,4 @@ $result = $databases->updateCollection( enabled: false, // optional purge: false // optional ); - ``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5931d72d..7158e915 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateDatetimeAttribute( default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 08341e10..1f3b6359 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -27,5 +27,4 @@ $result = $databases->updateDocument( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index 40c85a1d..68c12217 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -24,5 +24,4 @@ $result = $databases->updateDocuments( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 104fd3e0..6dfd6b6e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateEmailAttribute( default: 'email@example.com', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 83892c7a..955e6c1e 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -20,5 +20,4 @@ $result = $databases->updateEnumAttribute( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 10195c69..631a2807 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -21,5 +21,4 @@ $result = $databases->updateFloatAttribute( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 73c4b059..1feaf6ae 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -21,5 +21,4 @@ $result = $databases->updateIntegerAttribute( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 5f9d4368..fe9fb4bf 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateIpAttribute( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index ad82721c..008c041d 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateLineAttribute( default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index 43e7042d..5b21ef0a 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateLongtextAttribute( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index 3523f074..6288fee1 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateMediumtextAttribute( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 7b4b403a..505944d4 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updatePointAttribute( default: [1, 2], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index d91d6b9b..e6a940bb 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updatePolygonAttribute( default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 5bb02f3c..38fc8dc7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateRelationshipAttribute( onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index b60af694..a3256386 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -20,5 +20,4 @@ $result = $databases->updateStringAttribute( size: 1, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 4d68480f..ff4ce5d0 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateTextAttribute( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index f015bb69..354d01bb 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -16,5 +16,4 @@ $result = $databases->updateTransaction( commit: false, // optional rollback: false // optional ); - ``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 91cfbd3c..f03123c1 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -19,5 +19,4 @@ $result = $databases->updateUrlAttribute( default: 'https://example.com', newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 62b84088..03ea4c01 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -20,5 +20,4 @@ $result = $databases->updateVarcharAttribute( size: 1, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 4d97f2ac..bd56abc6 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -16,5 +16,4 @@ $result = $databases->update( name: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 9a04f48d..94aad582 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -27,5 +27,4 @@ $result = $databases->upsertDocument( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index bc526bcc..0049fdc6 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -17,5 +17,4 @@ $result = $databases->upsertDocuments( documents: [], transactionId: '' // optional ); - ``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 81f49595..70f0f7e1 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -16,5 +16,4 @@ $result = $embeddings->createTextEmbeddings( texts: [], model: EmbeddingModel::NOMICEMBEDTEXT() // optional ); - ``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 6dcb781c..673d21b4 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -19,5 +19,4 @@ $result = $functions->createDeployment( entrypoint: '', // optional commands: '' // optional ); - ``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index bad0eb8e..75cfedfc 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -16,5 +16,4 @@ $result = $functions->createDuplicateDeployment( deploymentId: '', buildId: '' // optional ); - ``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index f0496fc5..94427dea 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -21,5 +21,4 @@ $result = $functions->createExecution( headers: [], // optional scheduledAt: '' // optional ); - ``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index d22bf77e..14ec5a73 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -21,5 +21,4 @@ $result = $functions->createTemplateDeployment( reference: '', activate: false // optional ); - ``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 3b0c6a33..206ac80b 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -18,5 +18,4 @@ $result = $functions->createVariable( value: '', secret: false // optional ); - ``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 6fc9102f..ab9d0572 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -18,5 +18,4 @@ $result = $functions->createVcsDeployment( reference: '', activate: false // optional ); - ``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 08a0cf21..83169340 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -37,5 +37,4 @@ $result = $functions->create( runtimeSpecification: '', // optional deploymentRetention: 0 // optional ); - ``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index ec396d15..60e9cff7 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -15,5 +15,4 @@ $result = $functions->deleteDeployment( functionId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index a9c0d5d6..9bf9e5d6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -15,5 +15,4 @@ $result = $functions->deleteExecution( functionId: '', executionId: '' ); - ``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 37636595..25f41540 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -15,5 +15,4 @@ $result = $functions->deleteVariable( functionId: '', variableId: '' ); - ``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index f0a537c5..00431910 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -14,5 +14,4 @@ $functions = new Functions($client); $result = $functions->delete( functionId: '' ); - ``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index cc13f4c7..fb6d3d01 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -18,5 +18,4 @@ $result = $functions->getDeploymentDownload( type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional ); - ``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 22952f40..1e264d85 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -15,5 +15,4 @@ $result = $functions->getDeployment( functionId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index cb220cab..b1be6b23 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -15,5 +15,4 @@ $result = $functions->getExecution( functionId: '', executionId: '' ); - ``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index abb818c4..6b9a802e 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -15,5 +15,4 @@ $result = $functions->getVariable( functionId: '', variableId: '' ); - ``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 76b51372..8821156a 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -14,5 +14,4 @@ $functions = new Functions($client); $result = $functions->get( functionId: '' ); - ``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index d5976496..de89fe38 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -17,5 +17,4 @@ $result = $functions->listDeployments( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 43df2432..9b1fc5b5 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -16,5 +16,4 @@ $result = $functions->listExecutions( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 593e808d..320a9dc6 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -12,6 +12,4 @@ $client = (new Client()) $functions = new Functions($client); $result = $functions->listRuntimes(); - - ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index be4774e5..da2bec2e 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -14,5 +14,4 @@ $functions = new Functions($client); $result = $functions->listSpecifications( type: 'runtimes' // optional ); - ``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index c4484fc6..1cc854cc 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -16,5 +16,4 @@ $result = $functions->listVariables( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 50add8c3..4775e062 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -16,5 +16,4 @@ $result = $functions->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 314e6b8a..c8984428 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -15,5 +15,4 @@ $result = $functions->updateDeploymentStatus( functionId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index fd214aea..5aa5a266 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -15,5 +15,4 @@ $result = $functions->updateFunctionDeployment( functionId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index b6a8a799..a60cea5e 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -18,5 +18,4 @@ $result = $functions->updateVariable( value: '', // optional secret: false // optional ); - ``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 53bfa48e..e857349a 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -37,5 +37,4 @@ $result = $functions->update( runtimeSpecification: '', // optional deploymentRetention: 0 // optional ); - ``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 90aed67c..c2f1b989 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -14,5 +14,4 @@ $graphql = new Graphql($client); $result = $graphql->mutation( query: [] ); - ``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index d3360446..9731e998 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -14,5 +14,4 @@ $graphql = new Graphql($client); $result = $graphql->query( query: [] ); - ``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 6c957ae5..8b204573 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->get(); - - ``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index fcc57aef..5c99bbf2 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCodes(); - - ``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 0fa22fd6..1245b2ec 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listContinents(); - - ``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index 348bbdc9..9744c8ea 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountriesEU(); - - ``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 1d5a4ce5..df66061f 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountriesPhones(); - - ``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 37dab2cf..f4f96262 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCountries(); - - ``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 1b012f5a..f4f1125a 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listCurrencies(); - - ``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 962eb6a1..b25fab64 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -12,6 +12,4 @@ $client = (new Client()) $locale = new Locale($client); $result = $locale->listLanguages(); - - ``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 879ffd5c..2464d9fa 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -21,5 +21,4 @@ $result = $messaging->createAPNSProvider( sandbox: false, // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index c8aa41bf..cd03c685 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -25,5 +25,4 @@ $result = $messaging->createEmail( html: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 4884187f..8ff6b217 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -17,5 +17,4 @@ $result = $messaging->createFCMProvider( serviceAccountJSON: [], // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 17ca677b..9201f31a 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -23,5 +23,4 @@ $result = $messaging->createMailgunProvider( replyToEmail: 'email@example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 874d7342..212f6b23 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -19,5 +19,4 @@ $result = $messaging->createMsg91Provider( authKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index cb1fe78c..82d1e2db 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -33,5 +33,4 @@ $result = $messaging->createPush( critical: false, // optional priority: MessagePriority::NORMAL() // optional ); - ``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index 8b0d4de0..9892a9ce 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -21,5 +21,4 @@ $result = $messaging->createResendProvider( replyToEmail: 'email@example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 9d43b261..30c08aef 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -21,5 +21,4 @@ $result = $messaging->createSendgridProvider( replyToEmail: 'email@example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index 9eb2470f..183b3734 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -23,5 +23,4 @@ $result = $messaging->createSesProvider( replyToEmail: 'email@example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index e01b8db6..945775ba 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -20,5 +20,4 @@ $result = $messaging->createSMS( draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 04b22dc9..0e19cf2e 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -28,5 +28,4 @@ $result = $messaging->createSMTPProvider( replyToEmail: 'email@example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 4b985e0d..f016b862 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -16,5 +16,4 @@ $result = $messaging->createSubscriber( subscriberId: '', targetId: '' ); - ``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 680c4f0f..4f05f898 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -19,5 +19,4 @@ $result = $messaging->createTelesignProvider( apiKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 40a2262c..7c60a96f 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -19,5 +19,4 @@ $result = $messaging->createTextmagicProvider( apiKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 67621985..eca6d541 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -16,5 +16,4 @@ $result = $messaging->createTopic( name: '', subscribe: ["any"] // optional ); - ``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index ee09eced..568d28d9 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -19,5 +19,4 @@ $result = $messaging->createTwilioProvider( authToken: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 5d30c29d..719835de 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -19,5 +19,4 @@ $result = $messaging->createVonageProvider( apiSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 95666ab1..c6849300 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->deleteProvider( providerId: '' ); - ``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index d816d971..bef4fad1 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -15,5 +15,4 @@ $result = $messaging->deleteSubscriber( topicId: '', subscriberId: '' ); - ``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 2841dbd2..353ae213 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->deleteTopic( topicId: '' ); - ``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 31126585..d1e07dd4 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->delete( messageId: '' ); - ``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 02d2859c..19e98cab 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->getMessage( messageId: '' ); - ``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index cc4fb950..c0b834ee 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->getProvider( providerId: '' ); - ``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 88d3ee34..9f6265bb 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -15,5 +15,4 @@ $result = $messaging->getSubscriber( topicId: '', subscriberId: '' ); - ``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index c6cee360..d048acb4 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -14,5 +14,4 @@ $messaging = new Messaging($client); $result = $messaging->getTopic( topicId: '' ); - ``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index cb4242b0..9bab16ef 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -16,5 +16,4 @@ $result = $messaging->listMessages( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index c683dfb2..1a2640f6 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -16,5 +16,4 @@ $result = $messaging->listProviders( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index f0b54f62..34e20a74 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -17,5 +17,4 @@ $result = $messaging->listSubscribers( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 5ee4763e..2fdcb93d 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -16,5 +16,4 @@ $result = $messaging->listTargets( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index b8e517f2..d489bf44 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -16,5 +16,4 @@ $result = $messaging->listTopics( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 2057404a..71708a8b 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -21,5 +21,4 @@ $result = $messaging->updateAPNSProvider( bundleId: '', // optional sandbox: false // optional ); - ``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 4e7e8be5..01884f13 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -25,5 +25,4 @@ $result = $messaging->updateEmail( scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [] // optional ); - ``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 190fb102..0bac7199 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -17,5 +17,4 @@ $result = $messaging->updateFCMProvider( enabled: false, // optional serviceAccountJSON: [] // optional ); - ``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 396014fe..c32e95f3 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -23,5 +23,4 @@ $result = $messaging->updateMailgunProvider( replyToName: '', // optional replyToEmail: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index a5dc4d15..0dce5035 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -19,5 +19,4 @@ $result = $messaging->updateMsg91Provider( senderId: '', // optional authKey: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index fb6c1ad4..44406611 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -33,5 +33,4 @@ $result = $messaging->updatePush( critical: false, // optional priority: MessagePriority::NORMAL() // optional ); - ``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index adcff5b6..50af4fd5 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -21,5 +21,4 @@ $result = $messaging->updateResendProvider( replyToName: '', // optional replyToEmail: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index be9c4211..f13f1ea5 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -21,5 +21,4 @@ $result = $messaging->updateSendgridProvider( replyToName: '', // optional replyToEmail: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index 58e6c5f3..97008138 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -23,5 +23,4 @@ $result = $messaging->updateSesProvider( replyToName: '', // optional replyToEmail: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 100118fd..3cfd2580 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -20,5 +20,4 @@ $result = $messaging->updateSMS( draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 43eaf6e1..1c82f921 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -28,5 +28,4 @@ $result = $messaging->updateSMTPProvider( replyToEmail: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index c21ccea8..d8926768 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -19,5 +19,4 @@ $result = $messaging->updateTelesignProvider( apiKey: '', // optional from: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index adecdb2c..16c4355b 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -19,5 +19,4 @@ $result = $messaging->updateTextmagicProvider( apiKey: '', // optional from: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index b7e24d1c..14877cc9 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -16,5 +16,4 @@ $result = $messaging->updateTopic( name: '', // optional subscribe: ["any"] // optional ); - ``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 21057d69..35ec95d7 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -19,5 +19,4 @@ $result = $messaging->updateTwilioProvider( authToken: '', // optional from: '' // optional ); - ``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 15616e31..a4d0f88a 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -19,5 +19,4 @@ $result = $messaging->updateVonageProvider( apiSecret: '', // optional from: '' // optional ); - ``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index 2866f26b..5540b110 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -16,5 +16,4 @@ $result = $oauth2->approve( authorizationDetails: '', // optional scope: '' // optional ); - ``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index d2a3f3ef..d7a465ad 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -27,5 +27,4 @@ $result = $oauth2->authorizePost( audience: '', // optional requestUri: '' // optional ); - ``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index 7f2aa27d..ad373715 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -27,5 +27,4 @@ $result = $oauth2->authorize( audience: '', // optional requestUri: '' // optional ); - ``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index 37ae2cc6..00358d8a 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -18,5 +18,4 @@ $result = $oauth2->createDeviceAuthorization( resource: '', // optional audience: '' // optional ); - ``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index c7c31af1..95467652 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -14,5 +14,4 @@ $oauth2 = new Oauth2($client); $result = $oauth2->createGrant( userCode: '' ); - ``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index e8691f91..ddb3d7d6 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -26,5 +26,4 @@ $result = $oauth2->createPAR( resource: '', // optional audience: '' // optional ); - ``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index 8ec540ed..a4be2d6f 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -23,5 +23,4 @@ $result = $oauth2->createToken( resource: '', // optional audience: '' // optional ); - ``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index fb74fed5..a6469c30 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -14,5 +14,4 @@ $oauth2 = new Oauth2($client); $result = $oauth2->getGrant( grantId: '' ); - ``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index c0156181..49c1f499 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -16,5 +16,4 @@ $result = $oauth2->listOrganizations( offset: 0, // optional search: '' // optional ); - ``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index 64310972..3bbcf901 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -16,5 +16,4 @@ $result = $oauth2->listProjects( offset: 0, // optional search: '' // optional ); - ``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index 925270c6..bd98d721 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -14,5 +14,4 @@ $oauth2 = new Oauth2($client); $result = $oauth2->reject( grantId: '' ); - ``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 907a36ff..7122ed7f 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -17,5 +17,4 @@ $result = $oauth2->revoke( clientId: '', // optional clientSecret: '' // optional ); - ``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index cce4d57f..70a656e7 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -15,5 +15,4 @@ $result = $organization->createInstallation( appId: '', authorizationDetails: '' // optional ); - ``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md index f77fe40c..c7cb7dde 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-key.md @@ -18,5 +18,4 @@ $result = $organization->createKey( scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index 647fa32e..c0de51a8 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -19,5 +19,4 @@ $result = $organization->createMembership( url: 'https://example.com', // optional name: '' // optional ); - ``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index 4b9faa74..32fdc6f8 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -17,5 +17,4 @@ $result = $organization->createProject( name: '', region: Region::FRA() // optional ); - ``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md index 9dee34a0..c0eab5cd 100644 --- a/docs/examples/organization/delete-installation.md +++ b/docs/examples/organization/delete-installation.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->deleteInstallation( installationId: '' ); - ``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md index 656f9ba4..ca72f3dd 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-key.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->deleteKey( keyId: '' ); - ``` diff --git a/docs/examples/organization/delete-membership.md b/docs/examples/organization/delete-membership.md index 1dc7ae49..86b73786 100644 --- a/docs/examples/organization/delete-membership.md +++ b/docs/examples/organization/delete-membership.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->deleteMembership( membershipId: '' ); - ``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md index ee35f9b8..3456ab77 100644 --- a/docs/examples/organization/delete-project.md +++ b/docs/examples/organization/delete-project.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->deleteProject( projectId: '' ); - ``` diff --git a/docs/examples/organization/delete.md b/docs/examples/organization/delete.md index 83aec78c..1160857a 100644 --- a/docs/examples/organization/delete.md +++ b/docs/examples/organization/delete.md @@ -12,6 +12,4 @@ $client = (new Client()) $organization = new Organization($client); $result = $organization->delete(); - - ``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index bacc49b7..fea4b673 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->getInstallation( installationId: '' ); - ``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md index f312776a..bf651e9e 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-key.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->getKey( keyId: '' ); - ``` diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 317a9b90..bb5802ca 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->getMembership( membershipId: '' ); - ``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index e85ffaea..97fe8c37 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->getProject( projectId: '' ); - ``` diff --git a/docs/examples/organization/get.md b/docs/examples/organization/get.md index 43735ed9..6fb38198 100644 --- a/docs/examples/organization/get.md +++ b/docs/examples/organization/get.md @@ -12,6 +12,4 @@ $client = (new Client()) $organization = new Organization($client); $result = $organization->get(); - - ``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 60e6e7f4..016988c3 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -15,5 +15,4 @@ $result = $organization->listInstallations( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md index aed10b2d..dbe27502 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-keys.md @@ -15,5 +15,4 @@ $result = $organization->listKeys( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index fc4493a9..fa76eb4d 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -16,5 +16,4 @@ $result = $organization->listMemberships( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index 5c8b2048..d44084b8 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -16,5 +16,4 @@ $result = $organization->listProjects( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index 7344bb43..af6cf57b 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -15,5 +15,4 @@ $result = $organization->updateInstallation( installationId: '', authorizationDetails: '' // optional ); - ``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md index 9e5ccd44..575e6119 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-key.md @@ -18,5 +18,4 @@ $result = $organization->updateKey( scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index 36abfb40..63994a9f 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -15,5 +15,4 @@ $result = $organization->updateMembership( membershipId: '', roles: [] ); - ``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index ef2e2968..577fe9f8 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -15,5 +15,4 @@ $result = $organization->updateProject( projectId: '', name: '' ); - ``` diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index f23a78f8..1c2ccac4 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -14,5 +14,4 @@ $organization = new Organization($client); $result = $organization->update( name: '' ); - ``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 67e3b1ea..c303ca79 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -14,5 +14,4 @@ $presences = new Presences($client); $result = $presences->delete( presenceId: '' ); - ``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index 14dd2397..24619c6e 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -14,5 +14,4 @@ $presences = new Presences($client); $result = $presences->get( presenceId: '' ); - ``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index 0630b4a7..5fb17b99 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -16,5 +16,4 @@ $result = $presences->list( total: false, // optional ttl: 0 // optional ); - ``` diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 40d62016..dc05bcfe 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -22,5 +22,4 @@ $result = $presences->update( permissions: [Permission::read(Role::any())], // optional purge: false // optional ); - ``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index f7ceebcb..df2e58dc 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -21,5 +21,4 @@ $result = $presences->upsert( expiresAt: '2020-10-15T06:38:00.000+00:00', // optional metadata: [] // optional ); - ``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index fa629811..ae1df197 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -16,5 +16,4 @@ $result = $project->createAndroidPlatform( name: '', applicationId: '' ); - ``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 020c933e..6b2bbd24 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -16,5 +16,4 @@ $result = $project->createApplePlatform( name: '', bundleIdentifier: '' ); - ``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index 77da73e2..224dc841 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -16,5 +16,4 @@ $result = $project->createEphemeralKey( scopes: [ProjectKeyScopes::PROJECTREAD()], duration: 600 ); - ``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index 2b0da974..e7ea4295 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -16,5 +16,4 @@ $result = $project->createLinuxPlatform( name: '', packageName: '' ); - ``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index 1f700138..87da696c 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -15,5 +15,4 @@ $result = $project->createMockPhone( number: '+12065550100', otp: '' ); - ``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index 902f7c25..a16026a8 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->createSMTPTest( emails: [] ); - ``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index e09e8e38..1bf09c49 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -17,5 +17,4 @@ $result = $project->createVariable( value: '', secret: false // optional ); - ``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 8a3c2f75..dc1f7e81 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -16,5 +16,4 @@ $result = $project->createWebPlatform( name: '', hostname: 'app.example.com' ); - ``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index e41b23ca..c9dd6500 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -16,5 +16,4 @@ $result = $project->createWindowsPlatform( name: '', packageIdentifierName: '' ); - ``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md index 86c4b280..b964e9d1 100644 --- a/docs/examples/project/delete-key.md +++ b/docs/examples/project/delete-key.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->deleteKey( keyId: '' ); - ``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md index d6db1416..c800757f 100644 --- a/docs/examples/project/delete-mock-phone.md +++ b/docs/examples/project/delete-mock-phone.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->deleteMockPhone( number: '+12065550100' ); - ``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md index d8edb956..9171a0bd 100644 --- a/docs/examples/project/delete-platform.md +++ b/docs/examples/project/delete-platform.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->deletePlatform( platformId: '' ); - ``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index 64a151b5..988ff801 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->deleteVariable( variableId: '' ); - ``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md index 4cf71307..adb63241 100644 --- a/docs/examples/project/delete.md +++ b/docs/examples/project/delete.md @@ -12,6 +12,4 @@ $client = (new Client()) $project = new Project($client); $result = $project->delete(); - - ``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index 47b3c66e..87df1a1c 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -17,5 +17,4 @@ $result = $project->getEmailTemplate( templateId: ProjectEmailTemplateId::VERIFICATION(), locale: ProjectEmailTemplateLocale::AF() // optional ); - ``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md index 320d811e..45a87d10 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->getKey( keyId: '' ); - ``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index b78134bc..e9a69c28 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->getMockPhone( number: '+12065550100' ); - ``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index d6337365..718e0e37 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -15,5 +15,4 @@ $project = new Project($client); $result = $project->getOAuth2Provider( providerId: ProjectOAuthProviderId::AMAZON() ); - ``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md index 6e42717a..e99c8dea 100644 --- a/docs/examples/project/get-platform.md +++ b/docs/examples/project/get-platform.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->getPlatform( platformId: '' ); - ``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index fd7e88ca..d629ac72 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -15,5 +15,4 @@ $project = new Project($client); $result = $project->getPolicy( policyId: ProjectPolicyId::PASSWORDDICTIONARY() ); - ``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index 10d94b46..5d47cefe 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->getVariable( variableId: '' ); - ``` diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md index 956bd10c..4e90450b 100644 --- a/docs/examples/project/get.md +++ b/docs/examples/project/get.md @@ -12,6 +12,4 @@ $client = (new Client()) $project = new Project($client); $result = $project->get(); - - ``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 6993f43e..6887b8bd 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -15,5 +15,4 @@ $result = $project->listEmailTemplates( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index 7386ec2f..1430acd7 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -15,5 +15,4 @@ $result = $project->listKeys( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 5968ecd8..7c49e842 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -15,5 +15,4 @@ $result = $project->listMockPhones( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index d3bf0227..2cfec075 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -15,5 +15,4 @@ $result = $project->listOAuth2Providers( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 90f295a9..f5b1bbdd 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -15,5 +15,4 @@ $result = $project->listPlatforms( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index 915633c8..2b8ffd33 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -15,5 +15,4 @@ $result = $project->listPolicies( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index 319a84bb..8cce3662 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -15,5 +15,4 @@ $result = $project->listVariables( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 019e7c55..1898911d 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -16,5 +16,4 @@ $result = $project->updateAndroidPlatform( name: '', applicationId: '' ); - ``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index 194032ac..ec7f3245 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -16,5 +16,4 @@ $result = $project->updateApplePlatform( name: '', bundleIdentifier: '' ); - ``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 793f505b..006f40f3 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -16,5 +16,4 @@ $result = $project->updateAuthMethod( methodId: ProjectAuthMethodId::EMAILPASSWORD(), enabled: false ); - ``` diff --git a/docs/examples/project/update-deny-aliased-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md index 632606ff..c54022b9 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateDenyAliasedEmailPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-deny-corporate-email-policy.md b/docs/examples/project/update-deny-corporate-email-policy.md index 8b5f3931..d702cc35 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateDenyCorporateEmailPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md index faca5877..52698e38 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateDenyDisposableEmailPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md index ec3cc9ae..98419586 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateDenyFreeEmailPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md index a8bf6ea3..2659fb13 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -23,5 +23,4 @@ $result = $project->updateEmailTemplate( replyToEmail: 'email@example.com', // optional replyToName: '' // optional ); - ``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index c2397ee3..db883945 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -18,5 +18,4 @@ $result = $project->updateKey( scopes: [ProjectKeyScopes::PROJECTREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md index 1dccc7bc..aace3165 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateLabels( labels: [] ); - ``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index 3d582088..1e1cb5f9 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -16,5 +16,4 @@ $result = $project->updateLinuxPlatform( name: '', packageName: '' ); - ``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index 4f8e41ca..145d3167 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -19,5 +19,4 @@ $result = $project->updateMembershipPrivacyPolicy( userMFA: false, // optional userAccessedAt: false // optional ); - ``` diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index ad88c9c7..c0eb035d 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -17,5 +17,4 @@ $result = $project->updateMFAFactorsPolicy( phone: false, // optional custom: false // optional ); - ``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index b5acd20b..7befe9a8 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -15,5 +15,4 @@ $result = $project->updateMockPhone( number: '+12065550100', otp: '' ); - ``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index bab741e5..f73c85e4 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Amazon( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index cd7bf71b..f742927c 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -18,5 +18,4 @@ $result = $project->updateOAuth2Apple( p8File: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-appwrite.md b/docs/examples/project/update-o-auth-2-appwrite.md index 2ab41601..bf5252d4 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Appwrite( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index 3c1da8be..b80b4b15 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -17,5 +17,4 @@ $result = $project->updateOAuth2Auth0( endpoint: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md index d1daadba..0a6c66ac 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -17,5 +17,4 @@ $result = $project->updateOAuth2Authentik( endpoint: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index 70e1d8d8..8c3eba87 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Autodesk( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md index edab26c9..d33326ec 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Bitbucket( secret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md index 95f4a159..40de4667 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Bitly( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md index 7ad35373..55149987 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Box( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md index cc63d2a0..112a7301 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Dailymotion( apiSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index 7927c4e8..9a0b1616 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Discord( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md index 2151d36d..ffc8e735 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Disqus( secretKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md index 2591814a..982c6f3d 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Dropbox( appSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md index 22b0b287..01c45f24 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Etsy( sharedSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md index 2cf833c7..0545945a 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Facebook( appSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md index 21b71daf..420ebc06 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Figma( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md index c94ad657..bc8e7205 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -17,5 +17,4 @@ $result = $project->updateOAuth2FusionAuth( endpoint: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index 5acc8940..92dc5726 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2GitHub( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md index 04ed5984..485d05f1 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -17,5 +17,4 @@ $result = $project->updateOAuth2Gitlab( endpoint: 'https://example.com', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index 8a3d417f..28137e9a 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -18,5 +18,4 @@ $result = $project->updateOAuth2Google( prompt: [ProjectOAuth2GooglePrompt::NONE()], // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-hugging-face.md b/docs/examples/project/update-o-auth-2-hugging-face.md index c55c52f7..c42599ab 100644 --- a/docs/examples/project/update-o-auth-2-hugging-face.md +++ b/docs/examples/project/update-o-auth-2-hugging-face.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2HuggingFace( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md index cad00eb7..19d9b9b2 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -18,5 +18,4 @@ $result = $project->updateOAuth2Keycloak( realmName: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 876766e3..39aba891 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Kick( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md index d6a214eb..f80ea7a4 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Linkedin( primaryClientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index 0ac62ba8..349bf932 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -17,5 +17,4 @@ $result = $project->updateOAuth2Microsoft( tenant: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md index 68221536..d4de282b 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Notion( oauthClientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index e4300b96..f3b1b8a0 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -23,5 +23,4 @@ $result = $project->updateOAuth2Oidc( maxAge: 0, // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index 059eccd2..9f8df039 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -18,5 +18,4 @@ $result = $project->updateOAuth2Okta( authorizationServerId: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md index ecd6f64d..c6e4096f 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2PaypalSandbox( secretKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md index 71c59cba..bab2e8c4 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Paypal( secretKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md index 4f66c82e..411269c6 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Podio( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index faccadab..1247627c 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Salesforce( customerSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 30047912..08a2c921 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -29,5 +29,4 @@ $result = $project->updateOAuth2Server( defaultScopes: [], // optional installationScopes: [] // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index 2ba8079f..0f07f22a 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Slack( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md index 240f6ba3..08e7e89d 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Spotify( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md index 0dad5afd..975f3925 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Stripe( apiSecretKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md index 4ac45b9b..74e32d31 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2TradeshiftSandbox( oauth2ClientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md index 09567933..a9431d32 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Tradeshift( oauth2ClientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md index 2f33e435..0e66fc0e 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Twitch( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md index a0d46c74..77469fa1 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2WordPress( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md index 2c2682bd..379bb055 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Yahoo( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md index 3966d9e8..f756b100 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Yandex( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index bbbbf17f..624b7f4f 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Zoho( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md index 4c87ac2c..655a5482 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2Zoom( clientSecret: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md index b57524bb..93f3ef31 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -16,5 +16,4 @@ $result = $project->updateOAuth2X( secretKey: '', // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index db8a56c4..5a8da06f 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updatePasswordDictionaryPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md index 2a5f452d..2d4c36ef 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updatePasswordHistoryPolicy( total: 1 ); - ``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index 17f3956e..70cc79d1 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updatePasswordPersonalDataPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index c0cee223..08ca290f 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -18,5 +18,4 @@ $result = $project->updatePasswordStrengthPolicy( number: false, // optional symbols: false // optional ); - ``` diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index 6d08045a..1b8a71f2 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -16,5 +16,4 @@ $result = $project->updateProtocol( protocolId: ProjectProtocolId::REST(), enabled: false ); - ``` diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md index d7de7cdb..606dcca0 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -16,5 +16,4 @@ $result = $project->updateService( serviceId: ProjectServiceId::ACCOUNT(), enabled: false ); - ``` diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md index ffe8eefc..3973a5a9 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateSessionAlertPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index ad6e69bd..a6f29fc7 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateSessionDurationPolicy( duration: 60 ); - ``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md index f73683ca..57b9b4fb 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateSessionInvalidationPolicy( enabled: false ); - ``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md index 5f442db8..5dbda419 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateSessionLimitPolicy( total: 1 ); - ``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index a187517d..70996253 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -24,5 +24,4 @@ $result = $project->updateSMTP( secure: ProjectSMTPSecure::TLS(), // optional enabled: false // optional ); - ``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index 246a686c..0c75e101 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -14,5 +14,4 @@ $project = new Project($client); $result = $project->updateUserLimitPolicy( total: 0 ); - ``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index d10d1c0f..63246789 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -17,5 +17,4 @@ $result = $project->updateVariable( value: '', // optional secret: false // optional ); - ``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index cea95f56..5066fc6e 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -16,5 +16,4 @@ $result = $project->updateWebPlatform( name: '', hostname: 'app.example.com' ); - ``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index e5880f4c..25e4f3e9 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -16,5 +16,4 @@ $result = $project->updateWindowsPlatform( name: '', packageIdentifierName: '' ); - ``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index aa5ea565..94a17074 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -14,5 +14,4 @@ $proxy = new Proxy($client); $result = $proxy->createAPIRule( domain: '' ); - ``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index e5bcf7ce..df22f3cf 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -16,5 +16,4 @@ $result = $proxy->createFunctionRule( functionId: '', branch: '' // optional ); - ``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 3a2bbc8e..6dd8879e 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -17,5 +17,4 @@ $result = $proxy->createInvalidation( type: InvalidationType::TAG(), reference: '' // optional ); - ``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index b65c4dd6..8e08e4de 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -20,5 +20,4 @@ $result = $proxy->createRedirectRule( resourceId: '', resourceType: ProxyResourceType::SITE() ); - ``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index 56fe7b8f..9502404d 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -16,5 +16,4 @@ $result = $proxy->createSiteRule( siteId: '', branch: '' // optional ); - ``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index 4acd6aaa..34ab03d9 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -14,5 +14,4 @@ $proxy = new Proxy($client); $result = $proxy->deleteRule( ruleId: '' ); - ``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index 051ebb76..dd2f2276 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -14,5 +14,4 @@ $proxy = new Proxy($client); $result = $proxy->getRule( ruleId: '' ); - ``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index 72171d45..4f357f44 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -15,5 +15,4 @@ $result = $proxy->listRules( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index 5586c24a..c6248740 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -14,5 +14,4 @@ $proxy = new Proxy($client); $result = $proxy->updateRuleStatus( ruleId: '' ); - ``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index e41700e9..96bec4fd 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -20,5 +20,4 @@ $result = $sites->createDeployment( outputDirectory: '', // optional activate: false // optional ); - ``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index b162a06f..52cb598d 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -15,5 +15,4 @@ $result = $sites->createDuplicateDeployment( siteId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 1e4649ff..5eb34f8d 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -21,5 +21,4 @@ $result = $sites->createTemplateDeployment( reference: '', activate: false // optional ); - ``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index ed67e854..ea1baabd 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -18,5 +18,4 @@ $result = $sites->createVariable( value: '', secret: false // optional ); - ``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 7a1ff9b8..3ffffd13 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -18,5 +18,4 @@ $result = $sites->createVcsDeployment( reference: '', activate: false // optional ); - ``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 76057f76..a9c34485 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -41,5 +41,4 @@ $result = $sites->create( deploymentRetention: 0, // optional scopes: [ProjectKeyScopes::PROJECTREAD()] // optional ); - ``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index 6a2171f7..df06bd2c 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -15,5 +15,4 @@ $result = $sites->deleteDeployment( siteId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index 70f97175..67db0a86 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -15,5 +15,4 @@ $result = $sites->deleteLog( siteId: '', logId: '' ); - ``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 51bbe5bd..b8d24cb1 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -15,5 +15,4 @@ $result = $sites->deleteVariable( siteId: '', variableId: '' ); - ``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index a94561ee..8a37fe99 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -14,5 +14,4 @@ $sites = new Sites($client); $result = $sites->delete( siteId: '' ); - ``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 65016abf..b37b45e1 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -18,5 +18,4 @@ $result = $sites->getDeploymentDownload( type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional ); - ``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 608fe033..94138c06 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -15,5 +15,4 @@ $result = $sites->getDeployment( siteId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index cc11cb12..e5b561a0 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -15,5 +15,4 @@ $result = $sites->getLog( siteId: '', logId: '' ); - ``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 16269c45..9ab1ec37 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -15,5 +15,4 @@ $result = $sites->getVariable( siteId: '', variableId: '' ); - ``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index a3dc1b59..01319766 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -14,5 +14,4 @@ $sites = new Sites($client); $result = $sites->get( siteId: '' ); - ``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 0fe48dca..450c2890 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -17,5 +17,4 @@ $result = $sites->listDeployments( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index c601478a..74ea8821 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -12,6 +12,4 @@ $client = (new Client()) $sites = new Sites($client); $result = $sites->listFrameworks(); - - ``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 2fb47d68..28f71df2 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -16,5 +16,4 @@ $result = $sites->listLogs( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 04f77e50..3a6826ad 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -14,5 +14,4 @@ $sites = new Sites($client); $result = $sites->listSpecifications( type: 'runtimes' // optional ); - ``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 17b3782b..047e609e 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -16,5 +16,4 @@ $result = $sites->listVariables( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 0f6b055a..0d01e813 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -16,5 +16,4 @@ $result = $sites->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 0b99b602..d511aa62 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -15,5 +15,4 @@ $result = $sites->updateDeploymentStatus( siteId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index af42e0b0..ed1c580f 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -15,5 +15,4 @@ $result = $sites->updateSiteDeployment( siteId: '', deploymentId: '' ); - ``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index f9380b53..b1bc3600 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -18,5 +18,4 @@ $result = $sites->updateVariable( value: '', // optional secret: false // optional ); - ``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 17195026..ec1f3603 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -41,5 +41,4 @@ $result = $sites->update( deploymentRetention: 0, // optional scopes: [ProjectKeyScopes::PROJECTREAD()] // optional ); - ``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 55014afd..df878841 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -27,5 +27,4 @@ $result = $storage->createBucket( antivirus: false, // optional transformations: false // optional ); - ``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index a4d741b2..730b72cd 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -21,5 +21,4 @@ $result = $storage->createFile( permissions: [Permission::read(Role::any())], // optional folder: '' // optional ); - ``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index ac953809..d3e49726 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -14,5 +14,4 @@ $storage = new Storage($client); $result = $storage->deleteBucket( bucketId: '' ); - ``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 2011aaa8..89478352 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -15,5 +15,4 @@ $result = $storage->deleteFile( bucketId: '', fileId: '' ); - ``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 5425df46..6dbeac9c 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -14,5 +14,4 @@ $storage = new Storage($client); $result = $storage->getBucket( bucketId: '' ); - ``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 85d14149..58797f23 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -16,5 +16,4 @@ $result = $storage->getFileDownload( fileId: '', token: '' // optional ); - ``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 2b93922e..57820b94 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -29,5 +29,4 @@ $result = $storage->getFilePreview( output: ImageFormat::JPG(), // optional token: '' // optional ); - ``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 918c5103..270cf900 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -16,5 +16,4 @@ $result = $storage->getFileView( fileId: '', token: '' // optional ); - ``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 590ee663..5d5a1914 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -15,5 +15,4 @@ $result = $storage->getFile( bucketId: '', fileId: '' ); - ``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 7e3fc21c..5bc0f307 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -16,5 +16,4 @@ $result = $storage->listBuckets( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 263c7c02..46718e2b 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -17,5 +17,4 @@ $result = $storage->listFiles( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index b327f1c6..5557ce89 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -27,5 +27,4 @@ $result = $storage->updateBucket( antivirus: false, // optional transformations: false // optional ); - ``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 150c316f..05bcc65a 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -19,5 +19,4 @@ $result = $storage->updateFile( name: '', // optional permissions: [Permission::read(Role::any())] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index fb343745..e7e6b148 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->createBigIntColumn( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 3a88eed8..a149438c 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->createBooleanColumn( default: false, // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 009e3ef7..8139ba10 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->createDatetimeColumn( default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 515a1fbf..1df1a06c 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->createEmailColumn( default: 'email@example.com', // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 7a90b5a6..f79751d1 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->createEnumColumn( default: '', // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index f713c165..e23ce6e7 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -15,5 +15,4 @@ $result = $tablesDB->createFailover( databaseId: '', targetReplicaId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index bb7ab5dd..2f5b542e 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->createFloatColumn( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 703a57ca..78cddc7a 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -22,5 +22,4 @@ $result = $tablesDB->createIndex( orders: [OrderBy::ASC()], // optional lengths: [] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index e22c0b96..e7bb5e9c 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->createIntegerColumn( default: null, // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index ca67398f..42c1ca4c 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->createIpColumn( default: '', // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 7a9cced5..652ce3f9 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -18,5 +18,4 @@ $result = $tablesDB->createLineColumn( required: false, default: [[1, 2], [3, 4], [5, 6]] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index b4a2d1e1..83a999f8 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->createLongtextColumn( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index be10c8b8..e51d2e5c 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->createMediumtextColumn( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 97992761..520d3047 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -16,5 +16,4 @@ $result = $tablesDB->createMigration( specification: 's-1vcpu-1gb', autoCutover: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index e6987eaa..e60cf34e 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -25,5 +25,4 @@ $result = $tablesDB->createOperations( } ] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 8948e4c2..03c8fb70 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -18,5 +18,4 @@ $result = $tablesDB->createPointColumn( required: false, default: [1, 2] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 685ea383..ee5f65f4 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -18,5 +18,4 @@ $result = $tablesDB->createPolygonColumn( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index b707a404..0e31aaca 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -23,5 +23,4 @@ $result = $tablesDB->createRelationshipColumn( twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional ); - ``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 0df63548..1af62007 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -27,5 +27,4 @@ $result = $tablesDB->createRow( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index ab85f50c..6ae0f802 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -17,5 +17,4 @@ $result = $tablesDB->createRows( rows: [], transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index c3777026..3235e0c2 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->createStringColumn( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 6b7ecefe..e4d281b4 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -23,5 +23,4 @@ $result = $tablesDB->createTable( columns: [], // optional indexes: [] // optional ); - ``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 0e3d3e8b..592433a9 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->createTextColumn( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index cd77db32..022dc50c 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->createTransaction( ttl: 60 // optional ); - ``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index b32c9b00..e8044ac7 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->createUrlColumn( default: 'https://example.com', // optional array: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index a6d7dd15..b3b557b0 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->createVarcharColumn( array: false, // optional encrypt: false // optional ); - ``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index a0754fb7..e0f7503f 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -19,5 +19,4 @@ $result = $tablesDB->create( replicas: 0, // optional syncMode: 'async' // optional ); - ``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md index 3393c259..624449ea 100644 --- a/docs/examples/tablesdb/cutover-migration.md +++ b/docs/examples/tablesdb/cutover-migration.md @@ -15,5 +15,4 @@ $result = $tablesDB->cutoverMigration( databaseId: '', migrationId: '' ); - ``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 2a081078..57088a34 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->decrementRowColumn( min: null, // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 14b916c1..77647302 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -16,5 +16,4 @@ $result = $tablesDB->deleteColumn( tableId: '', key: '' ); - ``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index db9774bc..29fe9595 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -16,5 +16,4 @@ $result = $tablesDB->deleteIndex( tableId: '', key: '' ); - ``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md index d2ec6424..e2ee36c2 100644 --- a/docs/examples/tablesdb/delete-migration.md +++ b/docs/examples/tablesdb/delete-migration.md @@ -15,5 +15,4 @@ $result = $tablesDB->deleteMigration( databaseId: '', migrationId: '' ); - ``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 5eb7207b..164a4d23 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -17,5 +17,4 @@ $result = $tablesDB->deleteRow( rowId: '', transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 844f234c..2b13b6c7 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -17,5 +17,4 @@ $result = $tablesDB->deleteRows( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 054aa9cc..fd65a34f 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -15,5 +15,4 @@ $result = $tablesDB->deleteTable( databaseId: '', tableId: '' ); - ``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index e1c18a81..0127259d 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteTransaction( transactionId: '' ); - ``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 6ffaf88e..279bcf5f 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->delete( databaseId: '' ); - ``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index feb16dfa..9151c4e2 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -16,5 +16,4 @@ $result = $tablesDB->getColumn( tableId: '', key: '' ); - ``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index c28b9789..0e9834ab 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -16,5 +16,4 @@ $result = $tablesDB->getIndex( tableId: '', key: '' ); - ``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index 3f9c9cff..317e3fb0 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -15,5 +15,4 @@ $result = $tablesDB->getMigration( databaseId: '', migrationId: '' ); - ``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index a99a4983..5b7f832d 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getReplicas( databaseId: '' ); - ``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 6fb89f26..c0415a60 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -18,5 +18,4 @@ $result = $tablesDB->getRow( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index 2808eb95..bba69f9b 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getStatus( databaseId: '' ); - ``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index cc7f244b..5a2415f4 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -15,5 +15,4 @@ $result = $tablesDB->getTable( databaseId: '', tableId: '' ); - ``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index 1864856e..bbce444e 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getTransaction( transactionId: '' ); - ``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 17951508..cc771eb6 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->get( databaseId: '' ); - ``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index cd370a4c..0bcbe119 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->incrementRowColumn( max: null, // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 798043ae..8004a3a3 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -17,5 +17,4 @@ $result = $tablesDB->listColumns( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 60bffb96..dd865c5b 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -17,5 +17,4 @@ $result = $tablesDB->listIndexes( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index 5647ba36..f78c820f 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listMigrations( databaseId: '' ); - ``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index 4395eac1..9785761b 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -17,5 +17,4 @@ $result = $tablesDB->listOperations( limit: 1, // optional offset: 0 // optional ); - ``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index bfabe595..3d4bdfb9 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -19,5 +19,4 @@ $result = $tablesDB->listRows( total: false, // optional ttl: 0 // optional ); - ``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md index a35cfac6..b4080072 100644 --- a/docs/examples/tablesdb/list-specifications.md +++ b/docs/examples/tablesdb/list-specifications.md @@ -12,6 +12,4 @@ $client = (new Client()) $tablesDB = new TablesDB($client); $result = $tablesDB->listSpecifications(); - - ``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index a3427f78..e4c4134a 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -17,5 +17,4 @@ $result = $tablesDB->listTables( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 88b50603..90b698c5 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -14,5 +14,4 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listTransactions( queries: [] // optional ); - ``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 5a55042a..ec6ec046 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -16,5 +16,4 @@ $result = $tablesDB->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 382fc652..f606d031 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->updateBigIntColumn( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 2f06fd86..5aa0a76a 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateBooleanColumn( default: false, newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index dd4ff022..62c812fc 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateDatetimeColumn( default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index cc0eb8da..6587b10c 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateEmailColumn( default: 'email@example.com', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index b8e99cdc..cac25399 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->updateEnumColumn( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 0f2ca87f..08513191 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->updateFloatColumn( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 69061856..5e595c5c 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -21,5 +21,4 @@ $result = $tablesDB->updateIntegerColumn( max: null, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index f67e12b3..7a8a09a5 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateIpColumn( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 2fe6a41f..674e1ae2 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateLineColumn( default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 49c651ba..460b7411 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateLongtextColumn( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index a7da2987..d4539282 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateMediumtextColumn( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 7fdcc3c7..8b36739f 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updatePointColumn( default: [1, 2], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 0fc903c3..67f91c37 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updatePolygonColumn( default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 2d7bdd4b..9c439185 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateRelationshipColumn( onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index b8d8de8b..197179e8 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -27,5 +27,4 @@ $result = $tablesDB->updateRow( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 3a55cd02..5e9dd0aa 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -24,5 +24,4 @@ $result = $tablesDB->updateRows( queries: [], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index bf0305e9..b70a8c5c 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->updateStringColumn( size: 1, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 1fcda66a..1881d2e2 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -22,5 +22,4 @@ $result = $tablesDB->updateTable( enabled: false, // optional purge: false // optional ); - ``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 61c340fc..1720878e 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateTextColumn( default: '', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 952890bb..ee2c7fab 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -16,5 +16,4 @@ $result = $tablesDB->updateTransaction( commit: false, // optional rollback: false // optional ); - ``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index a6d83946..a8f0964a 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -19,5 +19,4 @@ $result = $tablesDB->updateUrlColumn( default: 'https://example.com', newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 88a4d396..db7b428a 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -20,5 +20,4 @@ $result = $tablesDB->updateVarcharColumn( size: 1, // optional newKey: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 9a89e9b4..24d46560 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -19,5 +19,4 @@ $result = $tablesDB->update( replicas: 0, // optional syncMode: 'async' // optional ); - ``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 27b2f5ad..37786239 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -27,5 +27,4 @@ $result = $tablesDB->upsertRow( permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional ); - ``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index a4f3e6c4..56aa2657 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -17,5 +17,4 @@ $result = $tablesDB->upsertRows( rows: [], transactionId: '' // optional ); - ``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index 96f36bde..b61627f9 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -16,5 +16,4 @@ $result = $teams->createInstallation( appId: '', authorizationDetails: '' // optional ); - ``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index a3c13093..4c09dc7e 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -20,5 +20,4 @@ $result = $teams->createMembership( url: 'https://example.com', // optional name: '' // optional ); - ``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 64771672..c4112e99 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -16,5 +16,4 @@ $result = $teams->create( name: '', roles: [] // optional ); - ``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md index 477e62e7..ead89460 100644 --- a/docs/examples/teams/delete-installation.md +++ b/docs/examples/teams/delete-installation.md @@ -15,5 +15,4 @@ $result = $teams->deleteInstallation( teamId: '', installationId: '' ); - ``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 1b46180c..fd686ec2 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -15,5 +15,4 @@ $result = $teams->deleteMembership( teamId: '', membershipId: '' ); - ``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 0cb936c9..af3754d9 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -14,5 +14,4 @@ $teams = new Teams($client); $result = $teams->delete( teamId: '' ); - ``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index c9a3e196..8d9a8bbd 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -15,5 +15,4 @@ $result = $teams->getInstallation( teamId: '', installationId: '' ); - ``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 3825124b..54189773 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -15,5 +15,4 @@ $result = $teams->getMembership( teamId: '', membershipId: '' ); - ``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 946050f5..eb7022b3 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -14,5 +14,4 @@ $teams = new Teams($client); $result = $teams->getPrefs( teamId: '' ); - ``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index b9a878f1..4c4ed589 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -14,5 +14,4 @@ $teams = new Teams($client); $result = $teams->get( teamId: '' ); - ``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index d8fbcb6d..b772c3b1 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -16,5 +16,4 @@ $result = $teams->listInstallations( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 9ef6d7b5..91991193 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -17,5 +17,4 @@ $result = $teams->listMemberships( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index f2dfb62e..118339e2 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -16,5 +16,4 @@ $result = $teams->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index 7f208484..17751638 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -16,5 +16,4 @@ $result = $teams->updateInstallation( installationId: '', authorizationDetails: '' // optional ); - ``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 34ff8af1..b83abc88 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -17,5 +17,4 @@ $result = $teams->updateMembershipStatus( userId: '', secret: '' ); - ``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 38e58c9f..87741774 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -16,5 +16,4 @@ $result = $teams->updateMembership( membershipId: '', roles: [] ); - ``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 61d9f152..21260a37 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -15,5 +15,4 @@ $result = $teams->updateName( teamId: '', name: '' ); - ``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 865d3b34..c6a98331 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -15,5 +15,4 @@ $result = $teams->updatePrefs( teamId: '', prefs: [] ); - ``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 202bb5a5..c700c568 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -16,5 +16,4 @@ $result = $tokens->createFileToken( fileId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index 5e39f1f3..2c4aea6f 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -14,5 +14,4 @@ $tokens = new Tokens($client); $result = $tokens->delete( tokenId: '' ); - ``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 950fccb1..37911e25 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -14,5 +14,4 @@ $tokens = new Tokens($client); $result = $tokens->get( tokenId: '' ); - ``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 202018d2..724d44ed 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -17,5 +17,4 @@ $result = $tokens->list( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index b5bd7ca6..9944a9ce 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -15,5 +15,4 @@ $result = $tokens->update( tokenId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional ); - ``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 70fcee88..34018bc6 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -17,5 +17,4 @@ $result = $users->createArgon2User( password: 'password', name: '' // optional ); - ``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index ecf1b41f..c8badcaf 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -17,5 +17,4 @@ $result = $users->createBcryptUser( password: 'password', name: '' // optional ); - ``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index de3737b2..063fdf26 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -16,5 +16,4 @@ $result = $users->createJWT( sessionId: '', // optional duration: 0 // optional ); - ``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 581e24ba..30478335 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -17,5 +17,4 @@ $result = $users->createMD5User( password: 'password', name: '' // optional ); - ``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 931caed6..d58681a4 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->createMFARecoveryCodes( userId: '' ); - ``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 25c1c192..c9426373 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -17,5 +17,4 @@ $result = $users->createPHPassUser( password: 'password', name: '' // optional ); - ``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index e34a58af..bd3077e7 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -20,5 +20,4 @@ $result = $users->createScryptModifiedUser( passwordSignerKey: '', name: '' // optional ); - ``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 38284b6c..d9565163 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -22,5 +22,4 @@ $result = $users->createScryptUser( passwordLength: null, name: '' // optional ); - ``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 4e9db385..625cd849 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->createSession( userId: '' ); - ``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index c35afdaa..94a674cb 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -19,5 +19,4 @@ $result = $users->createSHAUser( passwordVersion: PasswordHash::SHA1(), // optional name: '' // optional ); - ``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 79cb3d0c..e9d83ebb 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -20,5 +20,4 @@ $result = $users->createTarget( providerId: '', // optional name: '' // optional ); - ``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 08a3f8d4..b346dd53 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -16,5 +16,4 @@ $result = $users->createToken( length: 4, // optional expire: 60 // optional ); - ``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 49454881..0409e50f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -18,5 +18,4 @@ $result = $users->create( password: 'password', // optional name: '' // optional ); - ``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 7941b03c..9a812db6 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->deleteIdentity( identityId: '' ); - ``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 752d7ec3..8fa62661 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -16,5 +16,4 @@ $result = $users->deleteMFAAuthenticator( userId: '', type: AuthenticatorType::TOTP() ); - ``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index c9667ffd..3279befe 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -15,5 +15,4 @@ $result = $users->deleteSession( userId: '', sessionId: '' ); - ``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index ea502558..df58398a 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->deleteSessions( userId: '' ); - ``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 7d103ae0..ed23c177 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -15,5 +15,4 @@ $result = $users->deleteTarget( userId: '', targetId: '' ); - ``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index b088e47b..dd79743b 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->delete( userId: '' ); - ``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 47389599..4f6202df 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -15,5 +15,4 @@ $result = $users->getMFAChallenge( userId: '', challengeId: '' ); - ``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 3a624233..3978e1a8 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->getMFARecoveryCodes( userId: '' ); - ``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index d3072134..72ebd61a 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->getPrefs( userId: '' ); - ``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 674066d6..8f86c11c 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -15,5 +15,4 @@ $result = $users->getTarget( userId: '', targetId: '' ); - ``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index a2f1af35..f974d7c0 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->get( userId: '' ); - ``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 844bac8c..38b1be77 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -16,5 +16,4 @@ $result = $users->listIdentities( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 13bef5d4..b050bab0 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -16,5 +16,4 @@ $result = $users->listLogs( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 5b9152b2..b198103b 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -17,5 +17,4 @@ $result = $users->listMemberships( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index db27a5f5..ace853e6 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->listMFAFactors( userId: '' ); - ``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 86f83d7f..12c5cbe0 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -15,5 +15,4 @@ $result = $users->listSessions( userId: '', total: false // optional ); - ``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 015a497e..468ac2e2 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -16,5 +16,4 @@ $result = $users->listTargets( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 27034a93..87b03f3c 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -16,5 +16,4 @@ $result = $users->list( search: '', // optional total: false // optional ); - ``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index b1f5daf3..b188568a 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -15,5 +15,4 @@ $result = $users->updateEmailVerification( userId: '', emailVerification: false ); - ``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index bfd94fb9..d30f7d11 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -15,5 +15,4 @@ $result = $users->updateEmail( userId: '', email: 'email@example.com' ); - ``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index ceb92a36..b1e9e99f 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -15,5 +15,4 @@ $result = $users->updateImpersonator( userId: '', impersonator: false ); - ``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 3f9d29c5..7ac457f5 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -15,5 +15,4 @@ $result = $users->updateLabels( userId: '', labels: [] ); - ``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 9faadf3f..adee4c7c 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -14,5 +14,4 @@ $users = new Users($client); $result = $users->updateMFARecoveryCodes( userId: '' ); - ``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index c39ef665..6ff44fef 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -15,5 +15,4 @@ $result = $users->updateMFA( userId: '', mfa: false ); - ``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 13774567..fd274018 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -15,5 +15,4 @@ $result = $users->updateName( userId: '', name: '' ); - ``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 02c8bdb7..512c67b6 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -15,5 +15,4 @@ $result = $users->updatePassword( userId: '', password: 'password' ); - ``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 8863a159..0cfb243d 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -15,5 +15,4 @@ $result = $users->updatePhoneVerification( userId: '', phoneVerification: false ); - ``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index e7986665..b07c4bd8 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -15,5 +15,4 @@ $result = $users->updatePhone( userId: '', number: '+12065550100' ); - ``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 9014d36f..450f7a4b 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -15,5 +15,4 @@ $result = $users->updatePrefs( userId: '', prefs: [] ); - ``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 48e7491a..b9e003d9 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -15,5 +15,4 @@ $result = $users->updateStatus( userId: '', status: false ); - ``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 3f38f638..c4efc592 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -18,5 +18,4 @@ $result = $users->updateTarget( providerId: '', // optional name: '' // optional ); - ``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index f2e1d51c..2f99091d 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -22,5 +22,4 @@ $result = $webhooks->create( authPassword: 'password', // optional secret: '' // optional ); - ``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md index cb034e52..c96a1d5f 100644 --- a/docs/examples/webhooks/delete.md +++ b/docs/examples/webhooks/delete.md @@ -14,5 +14,4 @@ $webhooks = new Webhooks($client); $result = $webhooks->delete( webhookId: '' ); - ``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index 997404a5..85e95776 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -14,5 +14,4 @@ $webhooks = new Webhooks($client); $result = $webhooks->get( webhookId: '' ); - ``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index aa5d616c..e0652d51 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -15,5 +15,4 @@ $result = $webhooks->list( queries: [], // optional total: false // optional ); - ``` diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index 827d48a2..6a8168d5 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -15,5 +15,4 @@ $result = $webhooks->updateSecret( webhookId: '', secret: '' // optional ); - ``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index 255768a6..eeecf88a 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -21,5 +21,4 @@ $result = $webhooks->update( authUsername: '', // optional authPassword: 'password' // optional ); - ``` diff --git a/docs/functions.md b/docs/functions.md index bc4a62ed..e7898baf 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/functions ``` -** Get a list of all the project's functions. You can use the query params to filter your results. ** +** Get a list of all the project's functions. You can use the query params to filter your results. ** ### Parameters @@ -148,7 +148,7 @@ PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployment GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments ``` -** Get a list of all the function's code deployments. You can use the query params to filter your results. ** +** Get a list of all the function's code deployments. You can use the query params to filter your results. ** ### Parameters @@ -164,11 +164,11 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments ``` -** Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. +** Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). -Use the "command" param to set the entrypoint used to execute your code. ** +Use the "command" param to set the entrypoint used to execute your code. ** ### Parameters @@ -185,7 +185,7 @@ Use the "command" param to set the entrypoint used to execute your cod POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/duplicate ``` -** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** +** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** ### Parameters @@ -267,7 +267,7 @@ DELETE https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deployme GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/download ``` -** Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -283,7 +283,7 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentI PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/status ``` -** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** +** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** ### Parameters diff --git a/docs/oauth2.md b/docs/oauth2.md index c5e315e6..37e2083b 100644 --- a/docs/oauth2.md +++ b/docs/oauth2.md @@ -121,7 +121,7 @@ GET https://cloud.appwrite.io/v1/oauth2/{project_id}/grants/{grant_id} GET https://cloud.appwrite.io/v1/oauth2/{project_id}/organizations ``` -** 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. ** +** 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. ** ### Parameters @@ -163,7 +163,7 @@ POST https://cloud.appwrite.io/v1/oauth2/{project_id}/par GET https://cloud.appwrite.io/v1/oauth2/{project_id}/projects ``` -** 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. ** +** 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. ** ### Parameters diff --git a/docs/organization.md b/docs/organization.md index 93ed38c2..6e0e7705 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -12,7 +12,7 @@ GET https://cloud.appwrite.io/v1/organization PUT https://cloud.appwrite.io/v1/organization ``` -** Update the current organization's name. ** +** Update the current organization's name. ** ### Parameters @@ -73,7 +73,7 @@ GET https://cloud.appwrite.io/v1/organization/installations/{installationId} PUT https://cloud.appwrite.io/v1/organization/installations/{installationId} ``` -** 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. ** +** 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. ** ### Parameters @@ -187,7 +187,7 @@ GET https://cloud.appwrite.io/v1/organization/memberships POST https://cloud.appwrite.io/v1/organization/memberships ``` -** 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. ** +** 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. ** ### Parameters diff --git a/docs/project.md b/docs/project.md index 47c4b2a3..2e8d2e01 100644 --- a/docs/project.md +++ b/docs/project.md @@ -47,7 +47,7 @@ GET https://cloud.appwrite.io/v1/project/keys POST https://cloud.appwrite.io/v1/project/keys/ephemeral ``` -** Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. +** Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. You can also create a standard API key if you need a longer-lived key instead. ** @@ -146,7 +146,7 @@ POST https://cloud.appwrite.io/v1/project/mock-phones GET https://cloud.appwrite.io/v1/project/mock-phones/{number} ``` -** Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. ** +** Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. ** ### Parameters @@ -159,7 +159,7 @@ GET https://cloud.appwrite.io/v1/project/mock-phones/{number} PUT https://cloud.appwrite.io/v1/project/mock-phones/{number} ``` -** Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. ** +** Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. ** ### Parameters @@ -186,7 +186,7 @@ DELETE https://cloud.appwrite.io/v1/project/mock-phones/{number} GET https://cloud.appwrite.io/v1/project/oauth2 ``` -** Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. ** +** Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. ** ### Parameters @@ -948,7 +948,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/android PUT https://cloud.appwrite.io/v1/project/platforms/android/{platformId} ``` -** Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. ** +** Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. ** ### Parameters @@ -978,7 +978,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/apple PUT https://cloud.appwrite.io/v1/project/platforms/apple/{platformId} ``` -** Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. ** +** Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. ** ### Parameters @@ -1008,7 +1008,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/linux PUT https://cloud.appwrite.io/v1/project/platforms/linux/{platformId} ``` -** Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. ** +** Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. ** ### Parameters @@ -1038,7 +1038,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/web PUT https://cloud.appwrite.io/v1/project/platforms/web/{platformId} ``` -** Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. ** +** Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. ** ### Parameters @@ -1068,7 +1068,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/windows PUT https://cloud.appwrite.io/v1/project/platforms/windows/{platformId} ``` -** Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. ** +** Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. ** ### Parameters @@ -1083,7 +1083,7 @@ PUT https://cloud.appwrite.io/v1/project/platforms/windows/{platformId} GET https://cloud.appwrite.io/v1/project/platforms/{platformId} ``` -** Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ** +** Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ** ### Parameters @@ -1373,7 +1373,7 @@ PATCH https://cloud.appwrite.io/v1/project/services/{serviceId} PATCH https://cloud.appwrite.io/v1/project/smtp ``` -** Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ** +** Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ** ### Parameters diff --git a/docs/proxy.md b/docs/proxy.md index b429411d..baf24feb 100644 --- a/docs/proxy.md +++ b/docs/proxy.md @@ -36,7 +36,7 @@ GET https://cloud.appwrite.io/v1/proxy/rules POST https://cloud.appwrite.io/v1/proxy/rules/api ``` -** Create a new proxy rule for serving Appwrite's API on custom domain. +** Create a new proxy rule for serving Appwrite's API on custom domain. Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. ** diff --git a/docs/sites.md b/docs/sites.md index 52010d66..af1ce864 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/sites ``` -** Get a list of all the project's sites. You can use the query params to filter your results. ** +** Get a list of all the project's sites. You can use the query params to filter your results. ** ### Parameters @@ -152,7 +152,7 @@ PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployment GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments ``` -** Get a list of all the site's code deployments. You can use the query params to filter your results. ** +** Get a list of all the site's code deployments. You can use the query params to filter your results. ** ### Parameters @@ -168,7 +168,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments ``` -** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. ** +** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. ** ### Parameters @@ -186,7 +186,7 @@ POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/duplicate ``` -** Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** +** Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** ### Parameters @@ -267,7 +267,7 @@ DELETE https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId} GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/download ``` -** Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -283,7 +283,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/downl PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/status ``` -** Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** +** Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** ### Parameters diff --git a/docs/storage.md b/docs/storage.md index 86acceb0..cecf8af3 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -112,9 +112,9 @@ POST https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. -When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. +When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. -If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. +If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. ** ### Parameters @@ -176,7 +176,7 @@ DELETE https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId} GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/download ``` -** Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -217,7 +217,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/previ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/view ``` -** Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** +** Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** ### Parameters diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 458dbba6..bdd7882d 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -1187,7 +1187,7 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/index GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/rows ``` -** Get a list of all the user's rows in a given table. You can use the query params to filter your results. ** +** Get a list of all the user's rows in a given table. You can use the query params to filter your results. ** ### Parameters diff --git a/docs/teams.md b/docs/teams.md index 60315577..6f465c7a 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -48,7 +48,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId} PUT https://cloud.appwrite.io/v1/teams/{teamId} ``` -** Update the team's name by its unique ID. ** +** Update the team's name by its unique ID. ** ### Parameters @@ -119,7 +119,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} PUT https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} ``` -** 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. ** +** 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. ** ### Parameters @@ -148,7 +148,7 @@ DELETE https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` -** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** +** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** ### Parameters @@ -164,9 +164,9 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships POST https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` -** Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. +** Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. -You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. +You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. @@ -253,7 +253,7 @@ If the request is successful, a session for the user is automatically created. GET https://cloud.appwrite.io/v1/teams/{teamId}/prefs ``` -** Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). ** +** Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). ** ### Parameters @@ -266,7 +266,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/prefs PUT https://cloud.appwrite.io/v1/teams/{teamId}/prefs ``` -** Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. ** +** Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. ** ### Parameters diff --git a/docs/tokens.md b/docs/tokens.md index f474d1c4..bc3b9746 100644 --- a/docs/tokens.md +++ b/docs/tokens.md @@ -49,7 +49,7 @@ GET https://cloud.appwrite.io/v1/tokens/{tokenId} PATCH https://cloud.appwrite.io/v1/tokens/{tokenId} ``` -** Update a token by its unique ID. Use this endpoint to update a token's expiry date. ** +** Update a token by its unique ID. Use this endpoint to update a token's expiry date. ** ### Parameters diff --git a/docs/users.md b/docs/users.md index 7ded8472..5ef802e2 100644 --- a/docs/users.md +++ b/docs/users.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/users ``` -** Get a list of all the project's users. You can use the query params to filter your results. ** +** Get a list of all the project's users. You can use the query params to filter your results. ** ### Parameters @@ -199,7 +199,7 @@ GET https://cloud.appwrite.io/v1/users/{userId} DELETE https://cloud.appwrite.io/v1/users/{userId} ``` -** Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. ** +** Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. ** ### Parameters @@ -258,7 +258,7 @@ PUT https://cloud.appwrite.io/v1/users/{userId}/labels ** Update the user labels by its unique ID. -Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. ** +Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. ** ### Parameters @@ -575,7 +575,7 @@ If you want to generate a token for a custom authentication flow, use the [POST DELETE https://cloud.appwrite.io/v1/users/{userId}/sessions ``` -** Delete all user's sessions by using the user's unique ID. ** +** Delete all user's sessions by using the user's unique ID. ** ### Parameters @@ -602,7 +602,7 @@ DELETE https://cloud.appwrite.io/v1/users/{userId}/sessions/{sessionId} PATCH https://cloud.appwrite.io/v1/users/{userId}/status ``` -** Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. ** +** Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. ** ### Parameters @@ -649,7 +649,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/targets GET https://cloud.appwrite.io/v1/users/{userId}/targets/{targetId} ``` -** Get a user's push notification target by ID. ** +** Get a user's push notification target by ID. ** ### Parameters diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index 793474f6..631f0fb9 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -752,7 +752,7 @@ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } /** - * Generate recovery codes as backup for MFA flow. It's recommended to + * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their * authehticator. Recovery codes can be used as a MFA verification type in * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) @@ -903,7 +903,7 @@ public function updatePassword(string $password, ?string $oldPassword = null): \ } /** - * Update the currently logged in user's phone number. After updating the + * Update the currently logged in user's phone number. After updating the * phone number, the phone verification status will be reset. A confirmation * SMS is not sent automatically, however you can use the [POST * /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) @@ -1019,7 +1019,7 @@ public function updatePrefs(array $prefs): \Appwrite\Models\User * attached to the URL query string. Use the query string params to submit a * request to the [PUT * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) - * endpoint to complete the process. The verification link sent to the user's + * endpoint to complete the process. The verification link sent to the user's * email address is valid for 1 hour. * * @throws AppwriteException @@ -1365,8 +1365,8 @@ public function createSession(string $userId, string $secret): \Appwrite\Models\ } /** - * Use this endpoint to get a logged in user's session using a Session ID. - * Inputting 'current' will return the current session being used. + * Use this endpoint to get a logged in user's session using a Session ID. + * Inputting 'current' will return the current session being used. * * @throws AppwriteException */ @@ -1400,7 +1400,7 @@ public function getSession(string $sessionId): \Appwrite\Models\Session } /** - * Use this endpoint to extend a session's length. Extending a session is + * Use this endpoint to extend a session's length. Extending a session is * useful when session expiry is short. If the session was created using an * OAuth provider, this endpoint refreshes the access token from the provider. * @@ -1437,8 +1437,8 @@ public function updateSession(string $sessionId): \Appwrite\Models\Session } /** - * Logout the user. Use 'current' as the session ID to logout on this device, - * use a session ID to logout on another device. If you're looking to logout + * Logout the user. Use 'current' as the session ID to logout on this device, + * use a session ID to logout on another device. If you're looking to logout * the user on all devices, use [Delete * Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) * instead. @@ -1512,7 +1512,7 @@ public function updateStatus(): \Appwrite\Models\User * email with the one-time password. Use the returned user ID and secret and * submit a request to the [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's email + * endpoint to complete the login process. The secret sent to the user's email * is valid for 15 minutes. * * A user is limited to 10 active sessions at a time by default. [Learn more @@ -1564,7 +1564,7 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = * query string. Use the query string parameters to submit a request to the * [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The link sent to the user's email + * endpoint to complete the login process. The link sent to the user's email * address is valid for 1 hour. * * A user is limited to 10 active sessions at a time by default. [Learn more @@ -1615,7 +1615,7 @@ public function createMagicURLToken(string $userId, string $email, ?string $url /** * Allow the user to login to their account using the OAuth2 provider of their * choice. Each OAuth2 provider should be enabled from the Appwrite console - * first. Use the success and failure arguments to provide a redirect URL's + * first. Use the success and failure arguments to provide a redirect URL's * back to your app when login is completed. * * If authentication succeeds, `userId` and `secret` of a token will be @@ -1671,7 +1671,7 @@ public function createOAuth2Token(OAuthProvider $provider, ?string $success = nu * provided user ID has not be registered, a new user will be created. Use the * returned user ID and secret and submit a request to the [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's phone + * endpoint to complete the login process. The secret sent to the user's phone * is valid for 15 minutes. * * A user is limited to 10 active sessions at a time by default. [Learn more @@ -1720,7 +1720,7 @@ public function createPhoneToken(string $userId, string $phone): \Appwrite\Model * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). - * The verification link sent to the user's email address is valid for 7 days. + * The verification link sent to the user's email address is valid for 7 days. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), @@ -1768,7 +1768,7 @@ public function createEmailVerification(string $url): \Appwrite\Models\Token * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). - * The verification link sent to the user's email address is valid for 7 days. + * The verification link sent to the user's email address is valid for 7 days. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), @@ -1893,12 +1893,12 @@ public function updateVerification(string $userId, string $secret): \Appwrite\Mo /** * Use this endpoint to send a verification SMS to the currently logged in - * user. This endpoint is meant for use after updating a user's phone number + * user. This endpoint is meant for use after updating a user's phone number * using the * [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) * endpoint. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). - * The verification code sent to the user's phone number is valid for 15 + * The verification code sent to the user's phone number is valid for 15 * minutes. * * @throws AppwriteException @@ -1934,7 +1934,7 @@ public function createPhoneVerification(): \Appwrite\Models\Token /** * Use this endpoint to complete the user phone verification process. Use the - * **userId** and **secret** that were sent to your user's phone number to + * **userId** and **secret** that were sent to your user's phone number to * verify the user email ownership. If confirmed this route will return a 200 * status code. * diff --git a/src/Appwrite/Services/Advisor.php b/src/Appwrite/Services/Advisor.php index 7177e573..c09f9170 100644 --- a/src/Appwrite/Services/Advisor.php +++ b/src/Appwrite/Services/Advisor.php @@ -11,7 +11,7 @@ class Advisor extends Service { /** - * Get a list of all the project's analyzer reports. You can use the query + * Get a list of all the project's analyzer reports. You can use the query * params to filter your results. * * @throws AppwriteException @@ -53,7 +53,7 @@ public function listReports(?array $queries = null, ?bool $total = null): \Appwr } /** - * Get an analyzer report by its unique ID. The response includes the report's + * Get an analyzer report by its unique ID. The response includes the report's * metadata and the nested insights it produced. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Apps.php b/src/Appwrite/Services/Apps.php index 8f9405dd..c66741f0 100644 --- a/src/Appwrite/Services/Apps.php +++ b/src/Appwrite/Services/Apps.php @@ -590,7 +590,7 @@ public function listKeys(string $appId, ?array $queries = null, ?bool $total = n /** * 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. + * list the application's installations and create installation access tokens. * * @throws AppwriteException */ diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index 13a6ac23..cb9e14de 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -240,13 +240,13 @@ public function getImage(string $url, ?int $width = null, ?int $height = null): /** * Use this endpoint to show your user initials avatar icon on your website or * app. By default, this route will try to print your logged-in user name or - * email initials. You can also overwrite the user name if you pass the 'name' + * email initials. You can also overwrite the user name if you pass the 'name' * parameter. If no name is given and no user is logged, an empty avatar will * be returned. * * You can use the color and background params to change the avatar colors. By * default, a random theme will be selected. The random theme will persist for - * the user's initials when reloading the same theme will always return for + * the user's initials when reloading the same theme will always return for * the same initials. * * When one dimension is specified and the other is 0, the image is scaled diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index abdfecc1..b67014b4 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -84,7 +84,7 @@ public function createArchive(array $services, ?string $resourceId = null): \App } /** - * Get a backup archive using it's ID. + * Get a backup archive using it's ID. * * @throws AppwriteException */ @@ -231,7 +231,7 @@ public function createPolicy(string $policyId, array $services, int $retention, } /** - * Get a backup policy using it's ID. + * Get a backup policy using it's ID. * * @throws AppwriteException */ @@ -265,7 +265,7 @@ public function getPolicy(string $policyId): \Appwrite\Models\BackupPolicy } /** - * Update an existing policy using it's ID. + * Update an existing policy using it's ID. * * @throws AppwriteException */ @@ -307,7 +307,7 @@ public function updatePolicy(string $policyId, ?string $name = null, ?int $reten } /** - * Delete a policy using it's ID. + * Delete a policy using it's ID. * * @throws AppwriteException */ @@ -361,7 +361,7 @@ public function deletePolicy(string $policyId): string * * When restoring a DocumentsDB or VectorsDB database from a dedicated source, * the restore provisions a fresh dedicated backing database at the source - * database's own specification and lands the data there. An in-place restore + * database's own specification and lands the data there. An in-place restore * swaps the database onto that backing only once the restore has succeeded, * and retires the backing it displaced only once that swap is confirmed, so * the source keeps serving its own data until the restored data is in place diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index 496da695..3579519b 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -2513,7 +2513,7 @@ public function deleteAttribute(string $databaseId, string $collectionId, string } /** - * Get a list of all the user's documents in a given collection. You can use + * Get a list of all the user's documents in a given collection. You can use * the query params to filter your results. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index cf25654d..6058a67f 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -18,7 +18,7 @@ class Functions extends Service { /** - * Get a list of all the project's functions. You can use the query params to + * Get a list of all the project's functions. You can use the query params to * filter your results. * * @throws AppwriteException @@ -450,7 +450,7 @@ public function updateFunctionDeployment(string $functionId, string $deploymentI } /** - * Get a list of all the function's code deployments. You can use the query + * Get a list of all the function's code deployments. You can use the query * params to filter your results. * * @throws AppwriteException @@ -498,15 +498,15 @@ public function listDeployments(string $functionId, ?array $queries = null, ?str /** * Create a new function code deployment. Use this endpoint to upload a new - * version of your code function. To execute your newly uploaded code, you'll - * need to update the function's deployment to use your new deployment UID. + * version of your code function. To execute your newly uploaded code, you'll + * need to update the function's deployment to use your new deployment UID. * * This endpoint accepts a tar.gz file compressed with your code. Make sure to * include any dependencies your code has within the compressed file. You can * learn more about code packaging in the [Appwrite Cloud Functions * tutorial](https://appwrite.io/docs/functions). * - * Use the "command" param to set the entrypoint used to execute your code. + * Use the "command" param to set the entrypoint used to execute your code. * * @throws AppwriteException */ @@ -685,7 +685,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti * allows you to rebuild a deployment with the updated function configuration, * including its entrypoint and build commands if they have been modified. The * build process will be queued and executed asynchronously. The original - * deployment's code will be preserved and used for the new build. + * deployment's code will be preserved and used for the new build. * * @throws AppwriteException */ @@ -881,7 +881,7 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri /** * Get a function deployment content by its unique ID. The endpoint response - * return with a 'Content-Disposition: attachment' header that tells the + * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * * @throws AppwriteException @@ -920,9 +920,9 @@ public function getDeploymentDownload(string $functionId, string $deploymentId, /** * Cancel an ongoing function deployment build. If the build is already in - * progress, it will be stopped and marked as canceled. If the build hasn't + * progress, it will be stopped and marked as canceled. If the build hasn't * started yet, it will be marked as canceled without executing. You cannot - * cancel builds that have already completed (status 'ready') or failed. The + * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Oauth2.php b/src/Appwrite/Services/Oauth2.php index 4942a872..918ac8f9 100644 --- a/src/Appwrite/Services/Oauth2.php +++ b/src/Appwrite/Services/Oauth2.php @@ -366,7 +366,7 @@ public function getGrant(string $grantId): \Appwrite\Models\Oauth2Grant /** * List the organizations the OAuth2 access token can access. Resolves the - * token's `organization` authorization details, expanding the `*` wildcard + * token's `organization` authorization details, expanding the `*` wildcard * into the concrete set of organizations the user can see. * * @throws AppwriteException @@ -485,7 +485,7 @@ public function createPAR(string $clientId, string $redirectUri, string $respons } /** - * List the projects the OAuth2 access token can access. Resolves the token's + * 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. * diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php index 933c1f6c..271df32f 100644 --- a/src/Appwrite/Services/Organization.php +++ b/src/Appwrite/Services/Organization.php @@ -45,7 +45,7 @@ public function get(): \Appwrite\Models\Organization } /** - * Update the current organization's name. + * Update the current organization's name. * * @throws AppwriteException */ @@ -227,7 +227,7 @@ public function getInstallation(string $installationId): \Appwrite\Models\AppIns /** * Update an app installation on the organization. Only organization members - * with the owner role can update installations. The installation's granted + * 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. * @@ -524,8 +524,8 @@ public function listMemberships(?array $queries = null, ?string $search = null, /** * 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. + * 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. * * @throws AppwriteException */ diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index d8f60020..04a2c152 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -156,7 +156,7 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } /** - * Create a new ephemeral API key. It's recommended to have multiple API keys + * Create a new ephemeral API key. It's recommended to have multiple API keys * with strict scopes for separate functions within your project. * * You can also create a standard API key if you need a longer-lived key @@ -414,7 +414,7 @@ public function createMockPhone(string $number, string $otp): \Appwrite\Models\M /** * Get a mock phone by its unique number. This endpoint returns the mock - * phone's OTP. + * phone's OTP. * * @throws AppwriteException */ @@ -449,7 +449,7 @@ public function getMockPhone(string $number): \Appwrite\Models\MockNumber /** * Update a mock phone by its unique number. Use this endpoint to update the - * mock phone's OTP. + * mock phone's OTP. * * @throws AppwriteException */ @@ -515,7 +515,7 @@ public function deleteMockPhone(string $number): string /** * Get a list of all OAuth2 providers supported by the server, along with the - * project's configuration for each. Credential fields are write-only and + * project's configuration for each. Credential fields are write-only and * always returned empty. * * @throws AppwriteException @@ -2552,7 +2552,7 @@ public function createAndroidPlatform(string $platformId, string $name, string $ /** * Update an Android platform by its unique ID. Use this endpoint to update - * the platform's name or application ID. + * the platform's name or application ID. * * @throws AppwriteException */ @@ -2629,7 +2629,7 @@ public function createApplePlatform(string $platformId, string $name, string $bu /** * Update an Apple platform by its unique ID. Use this endpoint to update the - * platform's name or bundle identifier. + * platform's name or bundle identifier. * * @throws AppwriteException */ @@ -2706,7 +2706,7 @@ public function createLinuxPlatform(string $platformId, string $name, string $pa /** * Update a Linux platform by its unique ID. Use this endpoint to update the - * platform's name or package name. + * platform's name or package name. * * @throws AppwriteException */ @@ -2783,7 +2783,7 @@ public function createWebPlatform(string $platformId, string $name, string $host /** * Update a web platform by its unique ID. Use this endpoint to update the - * platform's name or hostname. + * platform's name or hostname. * * @throws AppwriteException */ @@ -2860,7 +2860,7 @@ public function createWindowsPlatform(string $platformId, string $name, string $ /** * Update a Windows platform by its unique ID. Use this endpoint to update the - * platform's name or package identifier name. + * platform's name or package identifier name. * * @throws AppwriteException */ @@ -2897,7 +2897,7 @@ public function updateWindowsPlatform(string $platformId, string $name, string $ } /** - * Get a platform by its unique ID. This endpoint returns the platform's + * Get a platform by its unique ID. This endpoint returns the platform's * details, including its name, type, and key configurations. * * @throws AppwriteException @@ -3807,7 +3807,7 @@ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appw /** * Update the SMTP configuration for your project. Use this endpoint to - * configure your project's SMTP provider with your custom settings for + * configure your project's SMTP provider with your custom settings for * sending transactional emails. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Proxy.php b/src/Appwrite/Services/Proxy.php index d77ecdde..4b04c9e1 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -100,7 +100,7 @@ public function listRules(?array $queries = null, ?bool $total = null): \Appwrit } /** - * Create a new proxy rule for serving Appwrite's API on custom domain. + * Create a new proxy rule for serving Appwrite's API on custom domain. * * Rule ID is automatically generated as MD5 hash of a rule domain for * performance purposes. diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index 92211fb9..59b2c791 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -19,7 +19,7 @@ class Sites extends Service { /** - * Get a list of all the project's sites. You can use the query params to + * Get a list of all the project's sites. You can use the query params to * filter your results. * * @throws AppwriteException @@ -462,7 +462,7 @@ public function updateSiteDeployment(string $siteId, string $deploymentId): \App } /** - * Get a list of all the site's code deployments. You can use the query params + * Get a list of all the site's code deployments. You can use the query params * to filter your results. * * @throws AppwriteException @@ -510,8 +510,8 @@ public function listDeployments(string $siteId, ?array $queries = null, ?string /** * Create a new site code deployment. Use this endpoint to upload a new - * version of your site code. To activate your newly uploaded code, you'll - * need to update the site's deployment to use your new deployment ID. + * version of your site code. To activate your newly uploaded code, you'll + * need to update the site's deployment to use your new deployment ID. * * @throws AppwriteException */ @@ -697,7 +697,7 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta * you to rebuild a deployment with the updated site configuration, including * its commands and output directory if they have been modified. The build * process will be queued and executed asynchronously. The original - * deployment's code will be preserved and used for the new build. + * deployment's code will be preserved and used for the new build. * * @throws AppwriteException */ @@ -889,7 +889,7 @@ public function deleteDeployment(string $siteId, string $deploymentId): string /** * Get a site deployment content by its unique ID. The endpoint response - * return with a 'Content-Disposition: attachment' header that tells the + * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * * @throws AppwriteException @@ -928,9 +928,9 @@ public function getDeploymentDownload(string $siteId, string $deploymentId, ?Dep /** * Cancel an ongoing site deployment build. If the build is already in - * progress, it will be stopped and marked as canceled. If the build hasn't + * progress, it will be stopped and marked as canceled. If the build hasn't * started yet, it will be marked as canceled without executing. You cannot - * cancel builds that have already completed (status 'ready') or failed. The + * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index afd5e497..ed3a2e93 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -321,11 +321,11 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea * The `content-range` header values should always be in bytes. * * When the first request is sent, the server will return the **File** object, - * and the subsequent part request must include the file's **id** in + * and the subsequent part request must include the file's **id** in * `x-appwrite-id` header to allow the server to know that the partial upload * is for the existing file and not for a new one. * - * If you're creating a new file using one of the Appwrite SDKs, all the + * If you're creating a new file using one of the Appwrite SDKs, all the * chunking logic will be managed by the SDK internally. * * @throws AppwriteException @@ -623,7 +623,7 @@ public function deleteFile(string $bucketId, string $fileId): string /** * Get a file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start + * 'Content-Disposition: attachment' header that tells the browser to start * downloading the file to user downloads directory. * * @throws AppwriteException @@ -739,7 +739,7 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n /** * Get a file content by its unique ID. This endpoint is similar to the - * download method but returns with no 'Content-Disposition: attachment' + * download method but returns with no 'Content-Disposition: attachment' * header. * * @throws AppwriteException diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index 29379052..8bdd3dd7 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -2904,7 +2904,7 @@ public function deleteIndex(string $databaseId, string $tableId, string $key): s } /** - * Get a list of all the user's rows in a given table. You can use the query + * Get a list of all the user's rows in a given table. You can use the query * params to filter your results. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index 8b0b3f42..9796da0d 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -133,7 +133,7 @@ public function get(string $teamId): \Appwrite\Models\Team } /** - * Update the team's name by its unique ID. + * Update the team's name by its unique ID. * * @throws AppwriteException */ @@ -320,7 +320,7 @@ public function getInstallation(string $teamId, string $installationId): \Appwri /** * Update an app installation on a team. Only team members with the owner role - * can update installations. The installation's granted scopes are refreshed + * can update installations. The installation's granted scopes are refreshed * to the scopes the app currently requests; previously issued installation * access tokens are revoked. * @@ -391,7 +391,7 @@ public function deleteInstallation(string $teamId, string $installationId): stri } /** - * Use this endpoint to list a team's members using the team's ID. All team + * Use this endpoint to list a team's members using the team's ID. All team * members have read access to this endpoint. Hide sensitive attributes from * the response by toggling membership privacy in the Console. * @@ -443,11 +443,11 @@ public function listMemberships(string $teamId, ?array $queries = null, ?string * invite unregistered users using an email or phone number. If initiated from * a Client SDK, Appwrite will send an email or sms with a link to join the * team to the invited user, and an account will be created for them if one - * doesn't exist. If initiated from a Server SDK, the new member will be added + * doesn't exist. If initiated from a Server SDK, the new member will be added * automatically to the team. * * You only need to provide one of a user ID, email, or phone number. Appwrite - * will prioritize accepting the user ID > email > phone number if you provide + * will prioritize accepting the user ID > email > phone number if you provide * more than one of these parameters. * * Use the `url` parameter to redirect the user from the invitation email to @@ -664,7 +664,7 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str } /** - * Get the team's shared preferences by its unique ID. If a preference doesn't + * Get the team's shared preferences by its unique ID. If a preference doesn't * need to be shared by all team members, prefer storing them in [user * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * @@ -700,7 +700,7 @@ public function getPrefs(string $teamId): \Appwrite\Models\Preferences } /** - * Update the team's preferences by its unique ID. The object you pass is + * Update the team's preferences by its unique ID. The object you pass is * stored as is and replaces any previous value. The maximum allowed prefs * size is 64kB and throws an error if exceeded. * diff --git a/src/Appwrite/Services/Tokens.php b/src/Appwrite/Services/Tokens.php index 9743df6c..1d2b5137 100644 --- a/src/Appwrite/Services/Tokens.php +++ b/src/Appwrite/Services/Tokens.php @@ -127,7 +127,7 @@ public function get(string $tokenId): \Appwrite\Models\ResourceToken } /** - * Update a token by its unique ID. Use this endpoint to update a token's + * Update a token by its unique ID. Use this endpoint to update a token's * expiry date. * * @throws AppwriteException diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index 2b6ae467..33754118 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -14,7 +14,7 @@ class Users extends Service { /** - * Get a list of all the project's users. You can use the query params to + * Get a list of all the project's users. You can use the query params to * filter your results. * * @throws AppwriteException @@ -533,7 +533,7 @@ public function get(string $userId): \Appwrite\Models\User } /** - * Delete a user by its unique ID, thereby releasing it's ID. Since ID is + * Delete a user by its unique ID, thereby releasing it's ID. Since ID is * released and can be reused, all user-related resources like documents or * storage files should be deleted before user deletion. If you want to keep * ID reserved, use the @@ -690,7 +690,7 @@ public function createJWT(string $userId, ?string $sessionId = null, ?int $durat * Update the user labels by its unique ID. * * Labels can be used to grant access to resources. While teams are a way for - * user's to share access to a resource, labels can be defined by the + * user's to share access to a resource, labels can be defined by the * developer to grant access without an invitation. See the [Permissions * docs](https://appwrite.io/docs/permissions) for more info. * @@ -1322,7 +1322,7 @@ public function createSession(string $userId): \Appwrite\Models\Session } /** - * Delete all user's sessions by using the user's unique ID. + * Delete all user's sessions by using the user's unique ID. * * @throws AppwriteException */ @@ -1380,7 +1380,7 @@ public function deleteSession(string $userId, string $sessionId): string /** * Update the user status by its unique ID. Use this endpoint as an - * alternative to deleting a user if you want to keep user's ID reserved. + * alternative to deleting a user if you want to keep user's ID reserved. * * @throws AppwriteException */ @@ -1504,7 +1504,7 @@ public function createTarget(string $userId, string $targetId, MessagingProvider } /** - * Get a user's push notification target by ID. + * Get a user's push notification target by ID. * * @throws AppwriteException */ From 406265d28bc30404df10faa542770f50d9a131f6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 26 Aug 2026 23:34:20 +0530 Subject: [PATCH 09/10] chore: update PHP SDK to 29.0.0 --- composer.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/composer.json b/composer.json index 51ce607f..224788da 100644 --- a/composer.json +++ b/composer.json @@ -34,14 +34,6 @@ "phpunit/phpunit": "^12", "rector/rector": "^2.2" }, - "provide": { - "ext-protobuf": "*" - }, - "config": { - "platform": { - "ext-protobuf": "1.0" - } - }, "prefer-stable": true, "minimum-stability": "dev" } From cb10641d6289116cc062f767a6e19ce241219da4 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 27 Aug 2026 10:00:32 +0530 Subject: [PATCH 10/10] chore: update PHP SDK to 29.0.0 --- CHANGELOG.md | 2 +- docs/avatars.md | 7 ++++- docs/examples/avatars/get-photo.md | 5 +++- docs/examples/functions/create-variable.md | 2 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/project/create-variable.md | 2 +- docs/examples/project/update-variable.md | 2 +- docs/examples/sites/create-variable.md | 2 +- docs/examples/sites/update-variable.md | 2 +- docs/examples/users/create-jwt.md | 2 +- docs/functions.md | 4 +-- docs/project.md | 4 +-- docs/sites.md | 4 +-- docs/users.md | 2 +- src/Appwrite/Services/Avatars.php | 30 ++++++++++++++++++---- tests/Appwrite/Services/FunctionsTest.php | 2 +- tests/Appwrite/Services/ProjectTest.php | 2 +- tests/Appwrite/Services/SitesTest.php | 2 +- 18 files changed, 53 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1d7e04a..526efd2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ * Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType` * Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes` * Breaking: `Project.wafEnabled` is now nullable -* Added: `avatars.getPhoto` +* Added: `avatars.getPhoto`, with `userId`, `emailHash`, and `name` to resolve an avatar for someone other than the caller * Added: `project.updateOAuth2HuggingFace`, the `OAuth2HuggingFace` model, and the `huggingface` OAuth provider * Added: `scopes` parameter to `sites.create` and `sites.update`, and `Site.scopes` * Added: `ExecutionResourceType` enum and the `bun-1.4` runtime diff --git a/docs/avatars.md b/docs/avatars.md index ca8341b2..d9f421f5 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -116,7 +116,9 @@ When one dimension is specified and the other is 0, the image is scaled with pre GET https://cloud.appwrite.io/v1/avatars/photo ``` -** Returns the best available profile photo for the currently authenticated user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. ** +** Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. + +The photo resolves for the currently authenticated user unless `userId` points at another user. Passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the user's own identity photos, email, and name leave the chain so they never shadow the avatar being asked for. Emails are only ever accepted pre-hashed, so no address ends up in a URL. ** ### Parameters @@ -127,6 +129,9 @@ GET https://cloud.appwrite.io/v1/avatars/photo | quality | integer | Output image quality between 0 and 100. Defaults to 100. | 100 | | output | string | Output image format. Defaults to 'png'. | png | | rating | string | Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. | g | +| userId | string | User ID to resolve the photo for. Defaults to 'current()' for the currently authenticated user. | current() | +| emailHash | string | SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own photo sources. Pass the hash, never the address itself. | | +| name | string | Name to render initials from instead of the user's own photo sources. Max length: 128 chars. | | ```http request diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md index 3483a705..5e8af418 100644 --- a/docs/examples/avatars/get-photo.md +++ b/docs/examples/avatars/get-photo.md @@ -16,6 +16,9 @@ $result = $avatars->getPhoto( height: 0, // optional quality: 0, // optional output: 'png', // optional - rating: 'g' // optional + rating: 'g', // optional + userId: '', // optional + emailHash: '', // optional + name: '' // optional ); ``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 206ac80b..46406878 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -14,7 +14,7 @@ $functions = new Functions($client); $result = $functions->createVariable( functionId: '', variableId: '', - key: '', + key: '', value: '', secret: false // optional ); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index a60cea5e..14a284d6 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -14,7 +14,7 @@ $functions = new Functions($client); $result = $functions->updateVariable( functionId: '', variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional ); diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 1bf09c49..b2471e59 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -13,7 +13,7 @@ $project = new Project($client); $result = $project->createVariable( variableId: '', - key: '', + key: '', value: '', secret: false // optional ); diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 63246789..f127b215 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -13,7 +13,7 @@ $project = new Project($client); $result = $project->updateVariable( variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional ); diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index ea1baabd..20983b68 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -14,7 +14,7 @@ $sites = new Sites($client); $result = $sites->createVariable( siteId: '', variableId: '', - key: '', + key: '', value: '', secret: false // optional ); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index b1bc3600..7d0e6691 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -14,7 +14,7 @@ $sites = new Sites($client); $result = $sites->updateVariable( siteId: '', variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional ); diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 063fdf26..2bb9fed1 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -13,7 +13,7 @@ $users = new Users($client); $result = $users->createJWT( userId: '', - sessionId: '', // optional + sessionId: '', // optional duration: 0 // optional ); ``` diff --git a/docs/functions.md b/docs/functions.md index e7898baf..00ae7360 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -382,7 +382,7 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/variables | --- | --- | --- | --- | | functionId | string | **Required** Function unique ID. | | | variableId | string | Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | 1 | @@ -413,7 +413,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId}/variables/{variableId} | --- | --- | --- | --- | | functionId | string | **Required** Function unique ID. | | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | | diff --git a/docs/project.md b/docs/project.md index 2e8d2e01..dc09a767 100644 --- a/docs/project.md +++ b/docs/project.md @@ -1477,7 +1477,7 @@ POST https://cloud.appwrite.io/v1/project/variables | Field Name | Type | Description | Default | | --- | --- | --- | --- | | variableId | string | Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only projects can read them during build and runtime. | 1 | @@ -1506,7 +1506,7 @@ PUT https://cloud.appwrite.io/v1/project/variables/{variableId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only projects can read them during build and runtime. | | diff --git a/docs/sites.md b/docs/sites.md index af1ce864..6fdd49d0 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -363,7 +363,7 @@ POST https://cloud.appwrite.io/v1/sites/{siteId}/variables | --- | --- | --- | --- | | siteId | string | **Required** Site unique ID. | | | variableId | string | Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | 1 | @@ -394,7 +394,7 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId}/variables/{variableId} | --- | --- | --- | --- | | siteId | string | **Required** Site unique ID. | | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | | diff --git a/docs/users.md b/docs/users.md index 5ef802e2..11a02a9a 100644 --- a/docs/users.md +++ b/docs/users.md @@ -248,7 +248,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/jwts | Field Name | Type | Description | Default | | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -| sessionId | string | Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. | recent | +| sessionId | string | Session ID. Use the string 'recent()' to use the most recent session, which is also the default. | recent() | | duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 | diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index cb9e14de..39ef900a 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -295,14 +295,22 @@ public function getInitials(?string $name = null, ?int $width = null, ?int $heig } /** - * Returns the best available profile photo for the currently authenticated - * user. The endpoint tries each source in priority order and returns the - * first successful result: OAuth2 identity photo, Gravatar, Libravatar, - * Appwrite Initials, built-in static fallback. + * Returns the best available profile photo for a user. The endpoint tries + * each source in priority order and returns the first successful result: + * OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in + * static fallback. + * + * The photo resolves for the currently authenticated user unless `userId` + * points at another user. Passing `emailHash` and/or `name` resolves the + * avatar from those values alone: the hash is looked up on Gravatar and + * Libravatar, the name is rendered as initials, and the user's own identity + * photos, email, and name leave the chain so they never shadow the avatar + * being asked for. Emails are only ever accepted pre-hashed, so no address + * ends up in a URL. * * @throws AppwriteException */ - public function getPhoto(?int $width = null, ?int $height = null, ?int $quality = null, ?string $output = null, ?string $rating = null): string + public function getPhoto(?int $width = null, ?int $height = null, ?int $quality = null, ?string $output = null, ?string $rating = null, ?string $userId = null, ?string $emailHash = null, ?string $name = null): string { $apiPath = str_replace( [], @@ -332,6 +340,18 @@ public function getPhoto(?int $width = null, ?int $height = null, ?int $quality $apiParams['rating'] = $rating; } + if (!is_null($userId)) { + $apiParams['userId'] = $userId; + } + + if (!is_null($emailHash)) { + $apiParams['emailHash'] = $emailHash; + } + + if (!is_null($name)) { + $apiParams['name'] = $name; + } + $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 0e950d3a..edb42660 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -991,7 +991,7 @@ public function testMethodCreateVariable(): void $response = $this->functions->createVariable( "", "", - "", + "", "" ); diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index edd1009e..362e48c1 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -3503,7 +3503,7 @@ public function testMethodCreateVariable(): void $response = $this->project->createVariable( "", - "", + "", "" ); diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index b80a5549..b2c9299f 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -967,7 +967,7 @@ public function testMethodCreateVariable(): void $response = $this->sites->createVariable( "", "", - "", + "", "" );