From e47b23e0bd18b5ef2d3ba227a21e0dfac1025131 Mon Sep 17 00:00:00 2001 From: premtsd-code Date: Wed, 27 May 2026 11:16:14 +0000 Subject: [PATCH 1/4] chore: update PHP SDK to 24.0.0 --- CHANGELOG.md | 8 - composer.json | 3 +- docs/examples/avatars/get-screenshot.md | 6 +- docs/examples/functions/create.md | 10 +- docs/examples/functions/update.md | 10 +- docs/examples/health/get-failed-jobs.md | 4 +- docs/examples/organization/create-key.md | 20 + docs/examples/organization/create-project.md | 19 + docs/examples/organization/delete-key.md | 16 + docs/examples/organization/delete-project.md | 16 + docs/examples/organization/get-key.md | 16 + docs/examples/organization/get-project.md | 16 + docs/examples/organization/list-keys.md | 17 + docs/examples/organization/list-projects.md | 18 + docs/examples/organization/update-key.md | 20 + docs/examples/organization/update-project.md | 17 + docs/examples/proxy/create-redirect-rule.md | 4 +- docs/examples/sites/create.md | 14 +- docs/examples/sites/update.md | 14 +- docs/functions.md | 4 + docs/organization.md | 144 +++ docs/project.md | 20 +- docs/sites.md | 4 + docs/storage.md | 4 +- docs/usage.md | 2 +- phpunit.xml | 2 +- src/Appwrite/Client.php | 4 +- src/Appwrite/Enums/BackupServices.php | 9 + .../Enums/{Theme.php => BrowserTheme.php} | 16 +- src/Appwrite/Enums/BuildRuntime.php | 862 ----------------- src/Appwrite/Enums/FunctionRuntime.php | 880 ++++++++++++++++++ .../Enums/{Name.php => HealthQueueName.php} | 82 +- src/Appwrite/Enums/OrganizationKeyScopes.php | 124 +++ src/Appwrite/Enums/ProjectOAuthProviderId.php | 18 - src/Appwrite/Enums/RedirectStatusCode.php | 70 ++ src/Appwrite/Enums/Region.php | 88 ++ src/Appwrite/Enums/Runtime.php | 862 ----------------- src/Appwrite/Enums/Scopes.php | 880 ------------------ .../Enums/{Adapter.php => SiteAdapter.php} | 16 +- src/Appwrite/Enums/SiteBuildRuntime.php | 880 ++++++++++++++++++ .../{Framework.php => SiteFramework.php} | 94 +- src/Appwrite/Enums/StatusCode.php | 70 -- src/Appwrite/Models/ActivityEvent.php | 48 +- src/Appwrite/Models/BillingLimits.php | 2 +- src/Appwrite/Models/FunctionModel.php | 14 + src/Appwrite/Models/ProjectList.php | 59 ++ src/Appwrite/Models/Site.php | 14 + src/Appwrite/Models/UsageGauge.php | 20 +- src/Appwrite/Services/Avatars.php | 6 +- src/Appwrite/Services/Functions.php | 219 ++++- src/Appwrite/Services/Health.php | 6 +- src/Appwrite/Services/Organization.php | 412 ++++++++ src/Appwrite/Services/Proxy.php | 6 +- src/Appwrite/Services/Sites.php | 229 ++++- src/Appwrite/Services/Storage.php | 194 +++- src/Appwrite/Services/Usage.php | 20 +- tests/Appwrite/QueryTest.php | 4 +- tests/Appwrite/Services/ActivitiesTest.php | 16 +- tests/Appwrite/Services/AvatarsTest.php | 2 +- tests/Appwrite/Services/FunctionsTest.php | 16 +- tests/Appwrite/Services/HealthTest.php | 4 +- tests/Appwrite/Services/OrganizationTest.php | 481 ++++++++++ tests/Appwrite/Services/ProjectTest.php | 4 +- tests/Appwrite/Services/ProxyTest.php | 4 +- tests/Appwrite/Services/SitesTest.php | 22 +- tests/Appwrite/Services/UsageTest.php | 4 +- 66 files changed, 4199 insertions(+), 2990 deletions(-) create mode 100644 docs/examples/organization/create-key.md create mode 100644 docs/examples/organization/create-project.md create mode 100644 docs/examples/organization/delete-key.md create mode 100644 docs/examples/organization/delete-project.md create mode 100644 docs/examples/organization/get-key.md create mode 100644 docs/examples/organization/get-project.md create mode 100644 docs/examples/organization/list-keys.md create mode 100644 docs/examples/organization/list-projects.md create mode 100644 docs/examples/organization/update-key.md create mode 100644 docs/examples/organization/update-project.md create mode 100644 docs/organization.md rename src/Appwrite/Enums/{Theme.php => BrowserTheme.php} (67%) delete mode 100644 src/Appwrite/Enums/BuildRuntime.php create mode 100644 src/Appwrite/Enums/FunctionRuntime.php rename src/Appwrite/Enums/{Name.php => HealthQueueName.php} (50%) create mode 100644 src/Appwrite/Enums/OrganizationKeyScopes.php create mode 100644 src/Appwrite/Enums/RedirectStatusCode.php create mode 100644 src/Appwrite/Enums/Region.php delete mode 100644 src/Appwrite/Enums/Runtime.php delete mode 100644 src/Appwrite/Enums/Scopes.php rename src/Appwrite/Enums/{Adapter.php => SiteAdapter.php} (68%) create mode 100644 src/Appwrite/Enums/SiteBuildRuntime.php rename src/Appwrite/Enums/{Framework.php => SiteFramework.php} (51%) delete mode 100644 src/Appwrite/Enums/StatusCode.php create mode 100644 src/Appwrite/Models/ProjectList.php create mode 100644 src/Appwrite/Services/Organization.php create mode 100644 tests/Appwrite/Services/OrganizationTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f15349..04807029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,5 @@ # Change Log -## 24.1.0 - -* Added `sizeActual` property to `File` model for actual stored size after compression/encryption -* Updated `BillingLimits` properties to be nullable to match the server's sparse "limits crossed" response -* Updated `Project.billingLimits` to be nullable -* Updated advisor example docs to use API key authentication -* Removed orphaned `Prompt` enum (already unused; superseded by `ProjectOAuth2GooglePrompt` in 24.0.0) - ## 24.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/composer.json b/composer.json index 0098e648..a5eb1aa5 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,9 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^10", + "phpunit/phpunit": "^12", "mockery/mockery": "1.6.12" }, + "prefer-stable": true, "minimum-stability": "dev" } diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 9db8b3cd..d2381633 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Avatars; -use Appwrite\Enums\Theme; +use Appwrite\Enums\BrowserTheme; use Appwrite\Enums\Timezone; use Appwrite\Enums\BrowserPermission; use Appwrite\Enums\ImageFormat; @@ -24,11 +24,11 @@ $result = $avatars->getScreenshot( viewportWidth: 1920, // optional viewportHeight: 1080, // optional scale: 2, // optional - theme: Theme::DARK(), // optional + theme: BrowserTheme::DARK(), // optional userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional fullpage: true, // optional locale: 'en-US', // optional - timezone: Timezone::AMERICANEWYORK(), // optional + timezone: Timezone::AFRICAABIDJAN(), // optional latitude: 37.7749, // optional longitude: -122.4194, // optional accuracy: 100, // optional diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 8f387dcb..10c6c32c 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,8 +3,8 @@ use Appwrite\Client; use Appwrite\Services\Functions; -use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -16,7 +16,7 @@ $functions = new Functions($client); $result = $functions->create( functionId: '', name: '', - runtime: Runtime::NODE145(), + runtime: FunctionRuntime::NODE145(), execute: ["any"], // optional events: [], // optional schedule: '', // optional @@ -25,12 +25,14 @@ $result = $functions->create( logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [Scopes::PROJECTREAD()], // optional + scopes: [ProjectKeyScopes::PROJECTREAD()], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 564428c9..da68d963 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -3,8 +3,8 @@ use Appwrite\Client; use Appwrite\Services\Functions; -use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -16,7 +16,7 @@ $functions = new Functions($client); $result = $functions->update( functionId: '', name: '', - runtime: Runtime::NODE145(), // optional + runtime: FunctionRuntime::NODE145(), // optional execute: ["any"], // optional events: [], // optional schedule: '', // optional @@ -25,12 +25,14 @@ $result = $functions->update( logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [Scopes::PROJECTREAD()], // optional + scopes: [ProjectKeyScopes::PROJECTREAD()], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 85867635..de204109 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Health; -use Appwrite\Enums\Name; +use Appwrite\Enums\HealthQueueName; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -13,6 +13,6 @@ $client = (new Client()) $health = new Health($client); $result = $health->getFailedJobs( - name: Name::V1DATABASE(), + name: HealthQueueName::V1DATABASE(), threshold: null // optional );``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md new file mode 100644 index 00000000..67127ca3 --- /dev/null +++ b/docs/examples/organization/create-key.md @@ -0,0 +1,20 @@ +```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->createKey( + keyId: '', + name: '', + scopes: [OrganizationKeyScopes::PROJECTSREAD()], + expire: '2020-10-15T06:38:00.000+00:00' // optional +);``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md new file mode 100644 index 00000000..ffb08c2e --- /dev/null +++ b/docs/examples/organization/create-project.md @@ -0,0 +1,19 @@ +```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->createProject( + projectId: '', + name: '', + region: Region::FRA() // optional +);``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md new file mode 100644 index 00000000..34a53d66 --- /dev/null +++ b/docs/examples/organization/delete-key.md @@ -0,0 +1,16 @@ +```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->deleteKey( + keyId: '' +);``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md new file mode 100644 index 00000000..6900101a --- /dev/null +++ b/docs/examples/organization/delete-project.md @@ -0,0 +1,16 @@ +```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->deleteProject( + projectId: '' +);``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md new file mode 100644 index 00000000..165b5663 --- /dev/null +++ b/docs/examples/organization/get-key.md @@ -0,0 +1,16 @@ +```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->getKey( + keyId: '' +);``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md new file mode 100644 index 00000000..27a101da --- /dev/null +++ b/docs/examples/organization/get-project.md @@ -0,0 +1,16 @@ +```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->getProject( + projectId: '' +);``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md new file mode 100644 index 00000000..7cc16f01 --- /dev/null +++ b/docs/examples/organization/list-keys.md @@ -0,0 +1,17 @@ +```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->listKeys( + queries: [], // optional + total: false // optional +);``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md new file mode 100644 index 00000000..5fafb599 --- /dev/null +++ b/docs/examples/organization/list-projects.md @@ -0,0 +1,18 @@ +```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->listProjects( + queries: [], // optional + search: '', // optional + total: false // optional +);``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md new file mode 100644 index 00000000..1187df49 --- /dev/null +++ b/docs/examples/organization/update-key.md @@ -0,0 +1,20 @@ +```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->updateKey( + keyId: '', + name: '', + scopes: [OrganizationKeyScopes::PROJECTSREAD()], + expire: '2020-10-15T06:38:00.000+00:00' // optional +);``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md new file mode 100644 index 00000000..45f1ee4b --- /dev/null +++ b/docs/examples/organization/update-project.md @@ -0,0 +1,17 @@ +```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->updateProject( + projectId: '', + name: '' +);``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index abef3f99..592eb1c8 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Proxy; -use Appwrite\Enums\StatusCode; +use Appwrite\Enums\RedirectStatusCode; use Appwrite\Enums\ProxyResourceType; $client = (new Client()) @@ -16,7 +16,7 @@ $proxy = new Proxy($client); $result = $proxy->createRedirectRule( domain: '', url: 'https://example.com', - statusCode: StatusCode::MOVEDPERMANENTLY301(), + statusCode: RedirectStatusCode::MOVEDPERMANENTLY(), resourceId: '', resourceType: ProxyResourceType::SITE() );``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 866a89cb..8dca15fa 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -3,9 +3,9 @@ use Appwrite\Client; use Appwrite\Services\Sites; -use Appwrite\Enums\Framework; -use Appwrite\Enums\BuildRuntime; -use Appwrite\Enums\Adapter; +use Appwrite\Enums\SiteFramework; +use Appwrite\Enums\SiteBuildRuntime; +use Appwrite\Enums\SiteAdapter; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -17,8 +17,8 @@ $sites = new Sites($client); $result = $sites->create( siteId: '', name: '', - framework: Framework::ANALOG(), - buildRuntime: BuildRuntime::NODE145(), + framework: SiteFramework::ANALOG(), + buildRuntime: SiteBuildRuntime::NODE145(), enabled: false, // optional logging: false, // optional timeout: 1, // optional @@ -26,13 +26,15 @@ $result = $sites->create( buildCommand: '', // optional startCommand: '', // optional outputDirectory: '', // optional - adapter: Adapter::STATIC(), // optional + adapter: SiteAdapter::STATIC(), // optional installationId: '', // optional fallbackFile: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index b2de5a27..d8dbdfea 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -3,9 +3,9 @@ use Appwrite\Client; use Appwrite\Services\Sites; -use Appwrite\Enums\Framework; -use Appwrite\Enums\BuildRuntime; -use Appwrite\Enums\Adapter; +use Appwrite\Enums\SiteFramework; +use Appwrite\Enums\SiteBuildRuntime; +use Appwrite\Enums\SiteAdapter; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -17,7 +17,7 @@ $sites = new Sites($client); $result = $sites->update( siteId: '', name: '', - framework: Framework::ANALOG(), + framework: SiteFramework::ANALOG(), enabled: false, // optional logging: false, // optional timeout: 1, // optional @@ -25,14 +25,16 @@ $result = $sites->update( buildCommand: '', // optional startCommand: '', // optional outputDirectory: '', // optional - buildRuntime: BuildRuntime::NODE145(), // optional - adapter: Adapter::STATIC(), // optional + buildRuntime: SiteBuildRuntime::NODE145(), // optional + adapter: SiteAdapter::STATIC(), // optional fallbackFile: '', // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/functions.md b/docs/functions.md index e77dc282..04fed225 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -43,6 +43,8 @@ POST https://cloud.appwrite.io/v1/functions | providerBranch | string | Production branch for the repo linked to the function. | | | providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | | | 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. | [] | | 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 | @@ -102,6 +104,8 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | providerBranch | string | Production branch for the repo linked to the function | | | providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | | | 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. | [] | | 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/organization.md b/docs/organization.md new file mode 100644 index 00000000..6bd35ae8 --- /dev/null +++ b/docs/organization.md @@ -0,0 +1,144 @@ +# Organization Service + + +```http request +GET https://cloud.appwrite.io/v1/organization/keys +``` + +** Get a list of all API keys 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: expire, accessedAt, name, scopes | [] | +| 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/keys +``` + +** Create a new organization API key. ** + +### 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 100 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 +GET https://cloud.appwrite.io/v1/organization/keys/{keyId} +``` + +** Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| keyId | string | **Required** Key unique ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/organization/keys/{keyId} +``` + +** Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| 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. | | +| 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 +DELETE https://cloud.appwrite.io/v1/organization/keys/{keyId} +``` + +** Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| keyId | string | **Required** Key unique ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/organization/projects +``` + +** Get a list of all projects. You can use the query params to filter your results. ** + +### 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: name, teamId, labels, search | [] | +| 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/projects +``` + +** Create a new project. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| 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. | | + + +```http request +GET https://cloud.appwrite.io/v1/organization/projects/{projectId} +``` + +** Get a project. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| projectId | string | **Required** Project unique ID. | | + + +```http request +PATCH https://cloud.appwrite.io/v1/organization/projects/{projectId} +``` + +** Update a project by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| projectId | string | **Required** Project unique ID. | | +| name | string | Project name. Max length: 128 chars. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/organization/projects/{projectId} +``` + +** Delete a project by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| projectId | string | **Required** Project unique ID. | | + diff --git a/docs/project.md b/docs/project.md index 7ef92d74..cfb294a3 100644 --- a/docs/project.md +++ b/docs/project.md @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | | -| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: example-google-client-secret | | +| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj | | | prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | | 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. | | @@ -549,7 +549,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/linkedin | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv | | -| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: example-linkedin-client-secret | | +| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== | | | 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. | | @@ -1292,12 +1292,12 @@ PATCH https://cloud.appwrite.io/v1/project/smtp | --- | --- | --- | --- | | host | string | SMTP server hostname (domain) | | | port | integer | SMTP server port | | -| username | string | SMTP server username. Leave empty for no authorization. | | -| password | string | SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). | | -| senderEmail | string | Email address shown in inbox as the sender of the email. | | -| senderName | string | Name shown in inbox as the sender of the email. | | -| replyToEmail | string | Email used when user replies to the email. | | -| replyToName | string | Name used when user replies to the email. | | +| username | string | SMTP server username. Pass an empty string to clear a previously set value. | | +| password | string | SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). | | +| senderEmail | string | Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. | | +| senderName | string | Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. | | +| replyToEmail | string | Email used when user replies to the email. Pass an empty string to clear a previously set value. | | +| replyToName | string | Name used when user replies to the email. Pass an empty string to clear a previously set value. | | | secure | string | Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. | | | enabled | boolean | Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. | | @@ -1344,8 +1344,8 @@ PATCH https://cloud.appwrite.io/v1/project/templates/email | subject | string | Subject of the email template. Can be up to 255 characters. | | | message | string | Plain or HTML body of the email template message. Can be up to 10MB of content. | | | senderName | string | Name of the email sender. | | -| senderEmail | string | Email of the sender. | | -| replyToEmail | string | Reply to email. | | +| senderEmail | string | Email of the sender. Pass an empty string to clear a previously set value. | | +| replyToEmail | string | Reply to email. Pass an empty string to clear a previously set value. | | | replyToName | string | Reply to name. | | diff --git a/docs/sites.md b/docs/sites.md index 16aa9a19..80247d5a 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -44,6 +44,8 @@ POST https://cloud.appwrite.io/v1/sites | providerBranch | string | Production branch for the repo linked to the site. | | | providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. | | | 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. | [] | | 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 | @@ -104,6 +106,8 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId} | providerBranch | string | Production branch for the repo linked to the site. | | | providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. | | | 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. | [] | | 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/storage.md b/docs/storage.md index c051c9b5..f2d206f5 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -31,7 +31,7 @@ POST https://cloud.appwrite.io/v1/storage/buckets | permissions | array | An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | fileSecurity | boolean | Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. | 1 | -| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 5GB. | [] | +| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 0B. | [] | | allowedFileExtensions | array | Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. | [] | | compression | string | Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none | | encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 | @@ -67,7 +67,7 @@ PUT https://cloud.appwrite.io/v1/storage/buckets/{bucketId} | permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | fileSecurity | boolean | Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. | 1 | -| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 5GB. | [] | +| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 0B. | [] | | allowedFileExtensions | array | Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. | [] | | compression | string | Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none | | encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 | diff --git a/docs/usage.md b/docs/usage.md index 41f907c2..5a7ad060 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -19,7 +19,7 @@ GET https://cloud.appwrite.io/v1/usage/events GET https://cloud.appwrite.io/v1/usage/gauges ``` -** Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, and timestamp. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. ** +** Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. ** ### Parameters diff --git a/phpunit.xml b/phpunit.xml index 8ed29b99..5f12846b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ '', - 'user-agent' => 'AppwritePHPSDK/24.1.0 ()', + 'user-agent' => 'AppwritePHPSDK/24.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '24.1.0', + 'x-sdk-version'=> '24.0.0', ]; /** diff --git a/src/Appwrite/Enums/BackupServices.php b/src/Appwrite/Enums/BackupServices.php index dd4fc22f..eea40a7f 100644 --- a/src/Appwrite/Enums/BackupServices.php +++ b/src/Appwrite/Enums/BackupServices.php @@ -10,6 +10,7 @@ class BackupServices implements JsonSerializable private static BackupServices $TABLESDB; private static BackupServices $DOCUMENTSDB; private static BackupServices $VECTORSDB; + private static BackupServices $DEDICATEDDATABASES; private static BackupServices $FUNCTIONS; private static BackupServices $STORAGE; @@ -58,6 +59,13 @@ public static function VECTORSDB(): BackupServices } return self::$VECTORSDB; } + public static function DEDICATEDDATABASES(): BackupServices + { + if (!isset(self::$DEDICATEDDATABASES)) { + self::$DEDICATEDDATABASES = new BackupServices('dedicatedDatabases'); + } + return self::$DEDICATEDDATABASES; + } public static function FUNCTIONS(): BackupServices { if (!isset(self::$FUNCTIONS)) { @@ -80,6 +88,7 @@ public static function from(string $value): self 'tablesdb' => self::TABLESDB(), 'documentsdb' => self::DOCUMENTSDB(), 'vectorsdb' => self::VECTORSDB(), + 'dedicatedDatabases' => self::DEDICATEDDATABASES(), 'functions' => self::FUNCTIONS(), 'storage' => self::STORAGE(), default => throw new \InvalidArgumentException('Unknown BackupServices value: ' . $value), diff --git a/src/Appwrite/Enums/Theme.php b/src/Appwrite/Enums/BrowserTheme.php similarity index 67% rename from src/Appwrite/Enums/Theme.php rename to src/Appwrite/Enums/BrowserTheme.php index fd6a7f22..838a5a23 100644 --- a/src/Appwrite/Enums/Theme.php +++ b/src/Appwrite/Enums/BrowserTheme.php @@ -4,10 +4,10 @@ use JsonSerializable; -class Theme implements JsonSerializable +class BrowserTheme implements JsonSerializable { - private static Theme $LIGHT; - private static Theme $DARK; + private static BrowserTheme $LIGHT; + private static BrowserTheme $DARK; private string $value; @@ -26,17 +26,17 @@ public function jsonSerialize(): string return $this->value; } - public static function LIGHT(): Theme + public static function LIGHT(): BrowserTheme { if (!isset(self::$LIGHT)) { - self::$LIGHT = new Theme('light'); + self::$LIGHT = new BrowserTheme('light'); } return self::$LIGHT; } - public static function DARK(): Theme + public static function DARK(): BrowserTheme { if (!isset(self::$DARK)) { - self::$DARK = new Theme('dark'); + self::$DARK = new BrowserTheme('dark'); } return self::$DARK; } @@ -46,7 +46,7 @@ public static function from(string $value): self return match ($value) { 'light' => self::LIGHT(), 'dark' => self::DARK(), - default => throw new \InvalidArgumentException('Unknown Theme value: ' . $value), + default => throw new \InvalidArgumentException('Unknown BrowserTheme value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php deleted file mode 100644 index 7b5369c1..00000000 --- a/src/Appwrite/Enums/BuildRuntime.php +++ /dev/null @@ -1,862 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NODE145(): BuildRuntime - { - if (!isset(self::$NODE145)) { - self::$NODE145 = new BuildRuntime('node-14.5'); - } - return self::$NODE145; - } - public static function NODE160(): BuildRuntime - { - if (!isset(self::$NODE160)) { - self::$NODE160 = new BuildRuntime('node-16.0'); - } - return self::$NODE160; - } - public static function NODE180(): BuildRuntime - { - if (!isset(self::$NODE180)) { - self::$NODE180 = new BuildRuntime('node-18.0'); - } - return self::$NODE180; - } - public static function NODE190(): BuildRuntime - { - if (!isset(self::$NODE190)) { - self::$NODE190 = new BuildRuntime('node-19.0'); - } - return self::$NODE190; - } - public static function NODE200(): BuildRuntime - { - if (!isset(self::$NODE200)) { - self::$NODE200 = new BuildRuntime('node-20.0'); - } - return self::$NODE200; - } - public static function NODE210(): BuildRuntime - { - if (!isset(self::$NODE210)) { - self::$NODE210 = new BuildRuntime('node-21.0'); - } - return self::$NODE210; - } - public static function NODE22(): BuildRuntime - { - if (!isset(self::$NODE22)) { - self::$NODE22 = new BuildRuntime('node-22'); - } - return self::$NODE22; - } - public static function NODE23(): BuildRuntime - { - if (!isset(self::$NODE23)) { - self::$NODE23 = new BuildRuntime('node-23'); - } - return self::$NODE23; - } - public static function NODE24(): BuildRuntime - { - if (!isset(self::$NODE24)) { - self::$NODE24 = new BuildRuntime('node-24'); - } - return self::$NODE24; - } - public static function NODE25(): BuildRuntime - { - if (!isset(self::$NODE25)) { - self::$NODE25 = new BuildRuntime('node-25'); - } - return self::$NODE25; - } - public static function PHP80(): BuildRuntime - { - if (!isset(self::$PHP80)) { - self::$PHP80 = new BuildRuntime('php-8.0'); - } - return self::$PHP80; - } - public static function PHP81(): BuildRuntime - { - if (!isset(self::$PHP81)) { - self::$PHP81 = new BuildRuntime('php-8.1'); - } - return self::$PHP81; - } - public static function PHP82(): BuildRuntime - { - if (!isset(self::$PHP82)) { - self::$PHP82 = new BuildRuntime('php-8.2'); - } - return self::$PHP82; - } - public static function PHP83(): BuildRuntime - { - if (!isset(self::$PHP83)) { - self::$PHP83 = new BuildRuntime('php-8.3'); - } - return self::$PHP83; - } - public static function PHP84(): BuildRuntime - { - if (!isset(self::$PHP84)) { - self::$PHP84 = new BuildRuntime('php-8.4'); - } - return self::$PHP84; - } - public static function RUBY30(): BuildRuntime - { - if (!isset(self::$RUBY30)) { - self::$RUBY30 = new BuildRuntime('ruby-3.0'); - } - return self::$RUBY30; - } - public static function RUBY31(): BuildRuntime - { - if (!isset(self::$RUBY31)) { - self::$RUBY31 = new BuildRuntime('ruby-3.1'); - } - return self::$RUBY31; - } - public static function RUBY32(): BuildRuntime - { - if (!isset(self::$RUBY32)) { - self::$RUBY32 = new BuildRuntime('ruby-3.2'); - } - return self::$RUBY32; - } - public static function RUBY33(): BuildRuntime - { - if (!isset(self::$RUBY33)) { - self::$RUBY33 = new BuildRuntime('ruby-3.3'); - } - return self::$RUBY33; - } - public static function RUBY34(): BuildRuntime - { - if (!isset(self::$RUBY34)) { - self::$RUBY34 = new BuildRuntime('ruby-3.4'); - } - return self::$RUBY34; - } - public static function RUBY40(): BuildRuntime - { - if (!isset(self::$RUBY40)) { - self::$RUBY40 = new BuildRuntime('ruby-4.0'); - } - return self::$RUBY40; - } - public static function PYTHON38(): BuildRuntime - { - if (!isset(self::$PYTHON38)) { - self::$PYTHON38 = new BuildRuntime('python-3.8'); - } - return self::$PYTHON38; - } - public static function PYTHON39(): BuildRuntime - { - if (!isset(self::$PYTHON39)) { - self::$PYTHON39 = new BuildRuntime('python-3.9'); - } - return self::$PYTHON39; - } - public static function PYTHON310(): BuildRuntime - { - if (!isset(self::$PYTHON310)) { - self::$PYTHON310 = new BuildRuntime('python-3.10'); - } - return self::$PYTHON310; - } - public static function PYTHON311(): BuildRuntime - { - if (!isset(self::$PYTHON311)) { - self::$PYTHON311 = new BuildRuntime('python-3.11'); - } - return self::$PYTHON311; - } - public static function PYTHON312(): BuildRuntime - { - if (!isset(self::$PYTHON312)) { - self::$PYTHON312 = new BuildRuntime('python-3.12'); - } - return self::$PYTHON312; - } - public static function PYTHON313(): BuildRuntime - { - if (!isset(self::$PYTHON313)) { - self::$PYTHON313 = new BuildRuntime('python-3.13'); - } - return self::$PYTHON313; - } - public static function PYTHON314(): BuildRuntime - { - if (!isset(self::$PYTHON314)) { - self::$PYTHON314 = new BuildRuntime('python-3.14'); - } - return self::$PYTHON314; - } - public static function PYTHONML311(): BuildRuntime - { - if (!isset(self::$PYTHONML311)) { - self::$PYTHONML311 = new BuildRuntime('python-ml-3.11'); - } - return self::$PYTHONML311; - } - public static function PYTHONML312(): BuildRuntime - { - if (!isset(self::$PYTHONML312)) { - self::$PYTHONML312 = new BuildRuntime('python-ml-3.12'); - } - return self::$PYTHONML312; - } - public static function PYTHONML313(): BuildRuntime - { - if (!isset(self::$PYTHONML313)) { - self::$PYTHONML313 = new BuildRuntime('python-ml-3.13'); - } - return self::$PYTHONML313; - } - public static function DENO121(): BuildRuntime - { - if (!isset(self::$DENO121)) { - self::$DENO121 = new BuildRuntime('deno-1.21'); - } - return self::$DENO121; - } - public static function DENO124(): BuildRuntime - { - if (!isset(self::$DENO124)) { - self::$DENO124 = new BuildRuntime('deno-1.24'); - } - return self::$DENO124; - } - public static function DENO135(): BuildRuntime - { - if (!isset(self::$DENO135)) { - self::$DENO135 = new BuildRuntime('deno-1.35'); - } - return self::$DENO135; - } - public static function DENO140(): BuildRuntime - { - if (!isset(self::$DENO140)) { - self::$DENO140 = new BuildRuntime('deno-1.40'); - } - return self::$DENO140; - } - public static function DENO146(): BuildRuntime - { - if (!isset(self::$DENO146)) { - self::$DENO146 = new BuildRuntime('deno-1.46'); - } - return self::$DENO146; - } - public static function DENO20(): BuildRuntime - { - if (!isset(self::$DENO20)) { - self::$DENO20 = new BuildRuntime('deno-2.0'); - } - return self::$DENO20; - } - public static function DENO25(): BuildRuntime - { - if (!isset(self::$DENO25)) { - self::$DENO25 = new BuildRuntime('deno-2.5'); - } - return self::$DENO25; - } - public static function DENO26(): BuildRuntime - { - if (!isset(self::$DENO26)) { - self::$DENO26 = new BuildRuntime('deno-2.6'); - } - return self::$DENO26; - } - public static function DART215(): BuildRuntime - { - if (!isset(self::$DART215)) { - self::$DART215 = new BuildRuntime('dart-2.15'); - } - return self::$DART215; - } - public static function DART216(): BuildRuntime - { - if (!isset(self::$DART216)) { - self::$DART216 = new BuildRuntime('dart-2.16'); - } - return self::$DART216; - } - public static function DART217(): BuildRuntime - { - if (!isset(self::$DART217)) { - self::$DART217 = new BuildRuntime('dart-2.17'); - } - return self::$DART217; - } - public static function DART218(): BuildRuntime - { - if (!isset(self::$DART218)) { - self::$DART218 = new BuildRuntime('dart-2.18'); - } - return self::$DART218; - } - public static function DART219(): BuildRuntime - { - if (!isset(self::$DART219)) { - self::$DART219 = new BuildRuntime('dart-2.19'); - } - return self::$DART219; - } - public static function DART30(): BuildRuntime - { - if (!isset(self::$DART30)) { - self::$DART30 = new BuildRuntime('dart-3.0'); - } - return self::$DART30; - } - public static function DART31(): BuildRuntime - { - if (!isset(self::$DART31)) { - self::$DART31 = new BuildRuntime('dart-3.1'); - } - return self::$DART31; - } - public static function DART33(): BuildRuntime - { - if (!isset(self::$DART33)) { - self::$DART33 = new BuildRuntime('dart-3.3'); - } - return self::$DART33; - } - public static function DART35(): BuildRuntime - { - if (!isset(self::$DART35)) { - self::$DART35 = new BuildRuntime('dart-3.5'); - } - return self::$DART35; - } - public static function DART38(): BuildRuntime - { - if (!isset(self::$DART38)) { - self::$DART38 = new BuildRuntime('dart-3.8'); - } - return self::$DART38; - } - public static function DART39(): BuildRuntime - { - if (!isset(self::$DART39)) { - self::$DART39 = new BuildRuntime('dart-3.9'); - } - return self::$DART39; - } - public static function DART310(): BuildRuntime - { - if (!isset(self::$DART310)) { - self::$DART310 = new BuildRuntime('dart-3.10'); - } - return self::$DART310; - } - public static function DART311(): BuildRuntime - { - if (!isset(self::$DART311)) { - self::$DART311 = new BuildRuntime('dart-3.11'); - } - return self::$DART311; - } - public static function DOTNET60(): BuildRuntime - { - if (!isset(self::$DOTNET60)) { - self::$DOTNET60 = new BuildRuntime('dotnet-6.0'); - } - return self::$DOTNET60; - } - public static function DOTNET70(): BuildRuntime - { - if (!isset(self::$DOTNET70)) { - self::$DOTNET70 = new BuildRuntime('dotnet-7.0'); - } - return self::$DOTNET70; - } - public static function DOTNET80(): BuildRuntime - { - if (!isset(self::$DOTNET80)) { - self::$DOTNET80 = new BuildRuntime('dotnet-8.0'); - } - return self::$DOTNET80; - } - public static function DOTNET10(): BuildRuntime - { - if (!isset(self::$DOTNET10)) { - self::$DOTNET10 = new BuildRuntime('dotnet-10'); - } - return self::$DOTNET10; - } - public static function JAVA80(): BuildRuntime - { - if (!isset(self::$JAVA80)) { - self::$JAVA80 = new BuildRuntime('java-8.0'); - } - return self::$JAVA80; - } - public static function JAVA110(): BuildRuntime - { - if (!isset(self::$JAVA110)) { - self::$JAVA110 = new BuildRuntime('java-11.0'); - } - return self::$JAVA110; - } - public static function JAVA170(): BuildRuntime - { - if (!isset(self::$JAVA170)) { - self::$JAVA170 = new BuildRuntime('java-17.0'); - } - return self::$JAVA170; - } - public static function JAVA180(): BuildRuntime - { - if (!isset(self::$JAVA180)) { - self::$JAVA180 = new BuildRuntime('java-18.0'); - } - return self::$JAVA180; - } - public static function JAVA210(): BuildRuntime - { - if (!isset(self::$JAVA210)) { - self::$JAVA210 = new BuildRuntime('java-21.0'); - } - return self::$JAVA210; - } - public static function JAVA22(): BuildRuntime - { - if (!isset(self::$JAVA22)) { - self::$JAVA22 = new BuildRuntime('java-22'); - } - return self::$JAVA22; - } - public static function JAVA25(): BuildRuntime - { - if (!isset(self::$JAVA25)) { - self::$JAVA25 = new BuildRuntime('java-25'); - } - return self::$JAVA25; - } - public static function SWIFT55(): BuildRuntime - { - if (!isset(self::$SWIFT55)) { - self::$SWIFT55 = new BuildRuntime('swift-5.5'); - } - return self::$SWIFT55; - } - public static function SWIFT58(): BuildRuntime - { - if (!isset(self::$SWIFT58)) { - self::$SWIFT58 = new BuildRuntime('swift-5.8'); - } - return self::$SWIFT58; - } - public static function SWIFT59(): BuildRuntime - { - if (!isset(self::$SWIFT59)) { - self::$SWIFT59 = new BuildRuntime('swift-5.9'); - } - return self::$SWIFT59; - } - public static function SWIFT510(): BuildRuntime - { - if (!isset(self::$SWIFT510)) { - self::$SWIFT510 = new BuildRuntime('swift-5.10'); - } - return self::$SWIFT510; - } - public static function SWIFT62(): BuildRuntime - { - if (!isset(self::$SWIFT62)) { - self::$SWIFT62 = new BuildRuntime('swift-6.2'); - } - return self::$SWIFT62; - } - public static function KOTLIN16(): BuildRuntime - { - if (!isset(self::$KOTLIN16)) { - self::$KOTLIN16 = new BuildRuntime('kotlin-1.6'); - } - return self::$KOTLIN16; - } - public static function KOTLIN18(): BuildRuntime - { - if (!isset(self::$KOTLIN18)) { - self::$KOTLIN18 = new BuildRuntime('kotlin-1.8'); - } - return self::$KOTLIN18; - } - public static function KOTLIN19(): BuildRuntime - { - if (!isset(self::$KOTLIN19)) { - self::$KOTLIN19 = new BuildRuntime('kotlin-1.9'); - } - return self::$KOTLIN19; - } - public static function KOTLIN20(): BuildRuntime - { - if (!isset(self::$KOTLIN20)) { - self::$KOTLIN20 = new BuildRuntime('kotlin-2.0'); - } - return self::$KOTLIN20; - } - public static function KOTLIN23(): BuildRuntime - { - if (!isset(self::$KOTLIN23)) { - self::$KOTLIN23 = new BuildRuntime('kotlin-2.3'); - } - return self::$KOTLIN23; - } - public static function CPP17(): BuildRuntime - { - if (!isset(self::$CPP17)) { - self::$CPP17 = new BuildRuntime('cpp-17'); - } - return self::$CPP17; - } - public static function CPP20(): BuildRuntime - { - if (!isset(self::$CPP20)) { - self::$CPP20 = new BuildRuntime('cpp-20'); - } - return self::$CPP20; - } - public static function BUN10(): BuildRuntime - { - if (!isset(self::$BUN10)) { - self::$BUN10 = new BuildRuntime('bun-1.0'); - } - return self::$BUN10; - } - public static function BUN11(): BuildRuntime - { - if (!isset(self::$BUN11)) { - self::$BUN11 = new BuildRuntime('bun-1.1'); - } - return self::$BUN11; - } - public static function BUN12(): BuildRuntime - { - if (!isset(self::$BUN12)) { - self::$BUN12 = new BuildRuntime('bun-1.2'); - } - return self::$BUN12; - } - public static function BUN13(): BuildRuntime - { - if (!isset(self::$BUN13)) { - self::$BUN13 = new BuildRuntime('bun-1.3'); - } - return self::$BUN13; - } - public static function GO123(): BuildRuntime - { - if (!isset(self::$GO123)) { - self::$GO123 = new BuildRuntime('go-1.23'); - } - return self::$GO123; - } - public static function GO124(): BuildRuntime - { - if (!isset(self::$GO124)) { - self::$GO124 = new BuildRuntime('go-1.24'); - } - return self::$GO124; - } - public static function GO125(): BuildRuntime - { - if (!isset(self::$GO125)) { - self::$GO125 = new BuildRuntime('go-1.25'); - } - return self::$GO125; - } - public static function GO126(): BuildRuntime - { - if (!isset(self::$GO126)) { - self::$GO126 = new BuildRuntime('go-1.26'); - } - return self::$GO126; - } - public static function RUST183(): BuildRuntime - { - if (!isset(self::$RUST183)) { - self::$RUST183 = new BuildRuntime('rust-1.83'); - } - return self::$RUST183; - } - public static function STATIC1(): BuildRuntime - { - if (!isset(self::$STATIC1)) { - self::$STATIC1 = new BuildRuntime('static-1'); - } - return self::$STATIC1; - } - public static function FLUTTER324(): BuildRuntime - { - if (!isset(self::$FLUTTER324)) { - self::$FLUTTER324 = new BuildRuntime('flutter-3.24'); - } - return self::$FLUTTER324; - } - public static function FLUTTER327(): BuildRuntime - { - if (!isset(self::$FLUTTER327)) { - self::$FLUTTER327 = new BuildRuntime('flutter-3.27'); - } - return self::$FLUTTER327; - } - public static function FLUTTER329(): BuildRuntime - { - if (!isset(self::$FLUTTER329)) { - self::$FLUTTER329 = new BuildRuntime('flutter-3.29'); - } - return self::$FLUTTER329; - } - public static function FLUTTER332(): BuildRuntime - { - if (!isset(self::$FLUTTER332)) { - self::$FLUTTER332 = new BuildRuntime('flutter-3.32'); - } - return self::$FLUTTER332; - } - public static function FLUTTER335(): BuildRuntime - { - if (!isset(self::$FLUTTER335)) { - self::$FLUTTER335 = new BuildRuntime('flutter-3.35'); - } - return self::$FLUTTER335; - } - public static function FLUTTER338(): BuildRuntime - { - if (!isset(self::$FLUTTER338)) { - self::$FLUTTER338 = new BuildRuntime('flutter-3.38'); - } - return self::$FLUTTER338; - } - public static function FLUTTER341(): BuildRuntime - { - if (!isset(self::$FLUTTER341)) { - self::$FLUTTER341 = new BuildRuntime('flutter-3.41'); - } - return self::$FLUTTER341; - } - - public static function from(string $value): self - { - return match ($value) { - 'node-14.5' => self::NODE145(), - 'node-16.0' => self::NODE160(), - 'node-18.0' => self::NODE180(), - 'node-19.0' => self::NODE190(), - 'node-20.0' => self::NODE200(), - 'node-21.0' => self::NODE210(), - 'node-22' => self::NODE22(), - 'node-23' => self::NODE23(), - 'node-24' => self::NODE24(), - 'node-25' => self::NODE25(), - 'php-8.0' => self::PHP80(), - 'php-8.1' => self::PHP81(), - 'php-8.2' => self::PHP82(), - 'php-8.3' => self::PHP83(), - 'php-8.4' => self::PHP84(), - 'ruby-3.0' => self::RUBY30(), - 'ruby-3.1' => self::RUBY31(), - 'ruby-3.2' => self::RUBY32(), - 'ruby-3.3' => self::RUBY33(), - 'ruby-3.4' => self::RUBY34(), - 'ruby-4.0' => self::RUBY40(), - 'python-3.8' => self::PYTHON38(), - 'python-3.9' => self::PYTHON39(), - 'python-3.10' => self::PYTHON310(), - 'python-3.11' => self::PYTHON311(), - 'python-3.12' => self::PYTHON312(), - 'python-3.13' => self::PYTHON313(), - 'python-3.14' => self::PYTHON314(), - 'python-ml-3.11' => self::PYTHONML311(), - 'python-ml-3.12' => self::PYTHONML312(), - 'python-ml-3.13' => self::PYTHONML313(), - 'deno-1.21' => self::DENO121(), - 'deno-1.24' => self::DENO124(), - 'deno-1.35' => self::DENO135(), - 'deno-1.40' => self::DENO140(), - 'deno-1.46' => self::DENO146(), - 'deno-2.0' => self::DENO20(), - 'deno-2.5' => self::DENO25(), - 'deno-2.6' => self::DENO26(), - 'dart-2.15' => self::DART215(), - 'dart-2.16' => self::DART216(), - 'dart-2.17' => self::DART217(), - 'dart-2.18' => self::DART218(), - 'dart-2.19' => self::DART219(), - 'dart-3.0' => self::DART30(), - 'dart-3.1' => self::DART31(), - 'dart-3.3' => self::DART33(), - 'dart-3.5' => self::DART35(), - 'dart-3.8' => self::DART38(), - 'dart-3.9' => self::DART39(), - 'dart-3.10' => self::DART310(), - 'dart-3.11' => self::DART311(), - 'dotnet-6.0' => self::DOTNET60(), - 'dotnet-7.0' => self::DOTNET70(), - 'dotnet-8.0' => self::DOTNET80(), - 'dotnet-10' => self::DOTNET10(), - 'java-8.0' => self::JAVA80(), - 'java-11.0' => self::JAVA110(), - 'java-17.0' => self::JAVA170(), - 'java-18.0' => self::JAVA180(), - 'java-21.0' => self::JAVA210(), - 'java-22' => self::JAVA22(), - 'java-25' => self::JAVA25(), - 'swift-5.5' => self::SWIFT55(), - 'swift-5.8' => self::SWIFT58(), - 'swift-5.9' => self::SWIFT59(), - 'swift-5.10' => self::SWIFT510(), - 'swift-6.2' => self::SWIFT62(), - 'kotlin-1.6' => self::KOTLIN16(), - 'kotlin-1.8' => self::KOTLIN18(), - 'kotlin-1.9' => self::KOTLIN19(), - 'kotlin-2.0' => self::KOTLIN20(), - 'kotlin-2.3' => self::KOTLIN23(), - 'cpp-17' => self::CPP17(), - 'cpp-20' => self::CPP20(), - 'bun-1.0' => self::BUN10(), - 'bun-1.1' => self::BUN11(), - 'bun-1.2' => self::BUN12(), - 'bun-1.3' => self::BUN13(), - 'go-1.23' => self::GO123(), - 'go-1.24' => self::GO124(), - 'go-1.25' => self::GO125(), - 'go-1.26' => self::GO126(), - 'rust-1.83' => self::RUST183(), - 'static-1' => self::STATIC1(), - 'flutter-3.24' => self::FLUTTER324(), - 'flutter-3.27' => self::FLUTTER327(), - 'flutter-3.29' => self::FLUTTER329(), - 'flutter-3.32' => self::FLUTTER332(), - 'flutter-3.35' => self::FLUTTER335(), - 'flutter-3.38' => self::FLUTTER338(), - 'flutter-3.41' => self::FLUTTER341(), - default => throw new \InvalidArgumentException('Unknown BuildRuntime value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/FunctionRuntime.php b/src/Appwrite/Enums/FunctionRuntime.php new file mode 100644 index 00000000..49426019 --- /dev/null +++ b/src/Appwrite/Enums/FunctionRuntime.php @@ -0,0 +1,880 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NODE145(): FunctionRuntime + { + if (!isset(self::$NODE145)) { + self::$NODE145 = new FunctionRuntime('node-14.5'); + } + return self::$NODE145; + } + public static function NODE160(): FunctionRuntime + { + if (!isset(self::$NODE160)) { + self::$NODE160 = new FunctionRuntime('node-16.0'); + } + return self::$NODE160; + } + public static function NODE180(): FunctionRuntime + { + if (!isset(self::$NODE180)) { + self::$NODE180 = new FunctionRuntime('node-18.0'); + } + return self::$NODE180; + } + public static function NODE190(): FunctionRuntime + { + if (!isset(self::$NODE190)) { + self::$NODE190 = new FunctionRuntime('node-19.0'); + } + return self::$NODE190; + } + public static function NODE200(): FunctionRuntime + { + if (!isset(self::$NODE200)) { + self::$NODE200 = new FunctionRuntime('node-20.0'); + } + return self::$NODE200; + } + public static function NODE210(): FunctionRuntime + { + if (!isset(self::$NODE210)) { + self::$NODE210 = new FunctionRuntime('node-21.0'); + } + return self::$NODE210; + } + public static function NODE22(): FunctionRuntime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new FunctionRuntime('node-22'); + } + return self::$NODE22; + } + public static function NODE23(): FunctionRuntime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new FunctionRuntime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): FunctionRuntime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new FunctionRuntime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): FunctionRuntime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new FunctionRuntime('node-25'); + } + return self::$NODE25; + } + public static function PHP80(): FunctionRuntime + { + if (!isset(self::$PHP80)) { + self::$PHP80 = new FunctionRuntime('php-8.0'); + } + return self::$PHP80; + } + public static function PHP81(): FunctionRuntime + { + if (!isset(self::$PHP81)) { + self::$PHP81 = new FunctionRuntime('php-8.1'); + } + return self::$PHP81; + } + public static function PHP82(): FunctionRuntime + { + if (!isset(self::$PHP82)) { + self::$PHP82 = new FunctionRuntime('php-8.2'); + } + return self::$PHP82; + } + public static function PHP83(): FunctionRuntime + { + if (!isset(self::$PHP83)) { + self::$PHP83 = new FunctionRuntime('php-8.3'); + } + return self::$PHP83; + } + public static function PHP84(): FunctionRuntime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new FunctionRuntime('php-8.4'); + } + return self::$PHP84; + } + public static function RUBY30(): FunctionRuntime + { + if (!isset(self::$RUBY30)) { + self::$RUBY30 = new FunctionRuntime('ruby-3.0'); + } + return self::$RUBY30; + } + public static function RUBY31(): FunctionRuntime + { + if (!isset(self::$RUBY31)) { + self::$RUBY31 = new FunctionRuntime('ruby-3.1'); + } + return self::$RUBY31; + } + public static function RUBY32(): FunctionRuntime + { + if (!isset(self::$RUBY32)) { + self::$RUBY32 = new FunctionRuntime('ruby-3.2'); + } + return self::$RUBY32; + } + public static function RUBY33(): FunctionRuntime + { + if (!isset(self::$RUBY33)) { + self::$RUBY33 = new FunctionRuntime('ruby-3.3'); + } + return self::$RUBY33; + } + public static function RUBY34(): FunctionRuntime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new FunctionRuntime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): FunctionRuntime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new FunctionRuntime('ruby-4.0'); + } + return self::$RUBY40; + } + public static function PYTHON38(): FunctionRuntime + { + if (!isset(self::$PYTHON38)) { + self::$PYTHON38 = new FunctionRuntime('python-3.8'); + } + return self::$PYTHON38; + } + public static function PYTHON39(): FunctionRuntime + { + if (!isset(self::$PYTHON39)) { + self::$PYTHON39 = new FunctionRuntime('python-3.9'); + } + return self::$PYTHON39; + } + public static function PYTHON310(): FunctionRuntime + { + if (!isset(self::$PYTHON310)) { + self::$PYTHON310 = new FunctionRuntime('python-3.10'); + } + return self::$PYTHON310; + } + public static function PYTHON311(): FunctionRuntime + { + if (!isset(self::$PYTHON311)) { + self::$PYTHON311 = new FunctionRuntime('python-3.11'); + } + return self::$PYTHON311; + } + public static function PYTHON312(): FunctionRuntime + { + if (!isset(self::$PYTHON312)) { + self::$PYTHON312 = new FunctionRuntime('python-3.12'); + } + return self::$PYTHON312; + } + public static function PYTHON313(): FunctionRuntime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new FunctionRuntime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): FunctionRuntime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new FunctionRuntime('python-3.14'); + } + return self::$PYTHON314; + } + public static function PYTHONML311(): FunctionRuntime + { + if (!isset(self::$PYTHONML311)) { + self::$PYTHONML311 = new FunctionRuntime('python-ml-3.11'); + } + return self::$PYTHONML311; + } + public static function PYTHONML312(): FunctionRuntime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new FunctionRuntime('python-ml-3.12'); + } + return self::$PYTHONML312; + } + public static function PYTHONML313(): FunctionRuntime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new FunctionRuntime('python-ml-3.13'); + } + return self::$PYTHONML313; + } + public static function DENO121(): FunctionRuntime + { + if (!isset(self::$DENO121)) { + self::$DENO121 = new FunctionRuntime('deno-1.21'); + } + return self::$DENO121; + } + public static function DENO124(): FunctionRuntime + { + if (!isset(self::$DENO124)) { + self::$DENO124 = new FunctionRuntime('deno-1.24'); + } + return self::$DENO124; + } + public static function DENO135(): FunctionRuntime + { + if (!isset(self::$DENO135)) { + self::$DENO135 = new FunctionRuntime('deno-1.35'); + } + return self::$DENO135; + } + public static function DENO140(): FunctionRuntime + { + if (!isset(self::$DENO140)) { + self::$DENO140 = new FunctionRuntime('deno-1.40'); + } + return self::$DENO140; + } + public static function DENO146(): FunctionRuntime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new FunctionRuntime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): FunctionRuntime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new FunctionRuntime('deno-2.0'); + } + return self::$DENO20; + } + public static function DENO25(): FunctionRuntime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new FunctionRuntime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): FunctionRuntime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new FunctionRuntime('deno-2.6'); + } + return self::$DENO26; + } + public static function DART215(): FunctionRuntime + { + if (!isset(self::$DART215)) { + self::$DART215 = new FunctionRuntime('dart-2.15'); + } + return self::$DART215; + } + public static function DART216(): FunctionRuntime + { + if (!isset(self::$DART216)) { + self::$DART216 = new FunctionRuntime('dart-2.16'); + } + return self::$DART216; + } + public static function DART217(): FunctionRuntime + { + if (!isset(self::$DART217)) { + self::$DART217 = new FunctionRuntime('dart-2.17'); + } + return self::$DART217; + } + public static function DART218(): FunctionRuntime + { + if (!isset(self::$DART218)) { + self::$DART218 = new FunctionRuntime('dart-2.18'); + } + return self::$DART218; + } + public static function DART219(): FunctionRuntime + { + if (!isset(self::$DART219)) { + self::$DART219 = new FunctionRuntime('dart-2.19'); + } + return self::$DART219; + } + public static function DART30(): FunctionRuntime + { + if (!isset(self::$DART30)) { + self::$DART30 = new FunctionRuntime('dart-3.0'); + } + return self::$DART30; + } + public static function DART31(): FunctionRuntime + { + if (!isset(self::$DART31)) { + self::$DART31 = new FunctionRuntime('dart-3.1'); + } + return self::$DART31; + } + public static function DART33(): FunctionRuntime + { + if (!isset(self::$DART33)) { + self::$DART33 = new FunctionRuntime('dart-3.3'); + } + return self::$DART33; + } + public static function DART35(): FunctionRuntime + { + if (!isset(self::$DART35)) { + self::$DART35 = new FunctionRuntime('dart-3.5'); + } + return self::$DART35; + } + public static function DART38(): FunctionRuntime + { + if (!isset(self::$DART38)) { + self::$DART38 = new FunctionRuntime('dart-3.8'); + } + return self::$DART38; + } + public static function DART39(): FunctionRuntime + { + if (!isset(self::$DART39)) { + self::$DART39 = new FunctionRuntime('dart-3.9'); + } + return self::$DART39; + } + public static function DART310(): FunctionRuntime + { + if (!isset(self::$DART310)) { + self::$DART310 = new FunctionRuntime('dart-3.10'); + } + return self::$DART310; + } + public static function DART311(): FunctionRuntime + { + if (!isset(self::$DART311)) { + self::$DART311 = new FunctionRuntime('dart-3.11'); + } + return self::$DART311; + } + public static function DART312(): FunctionRuntime + { + if (!isset(self::$DART312)) { + self::$DART312 = new FunctionRuntime('dart-3.12'); + } + return self::$DART312; + } + public static function DOTNET60(): FunctionRuntime + { + if (!isset(self::$DOTNET60)) { + self::$DOTNET60 = new FunctionRuntime('dotnet-6.0'); + } + return self::$DOTNET60; + } + public static function DOTNET70(): FunctionRuntime + { + if (!isset(self::$DOTNET70)) { + self::$DOTNET70 = new FunctionRuntime('dotnet-7.0'); + } + return self::$DOTNET70; + } + public static function DOTNET80(): FunctionRuntime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new FunctionRuntime('dotnet-8.0'); + } + return self::$DOTNET80; + } + public static function DOTNET10(): FunctionRuntime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new FunctionRuntime('dotnet-10'); + } + return self::$DOTNET10; + } + public static function JAVA80(): FunctionRuntime + { + if (!isset(self::$JAVA80)) { + self::$JAVA80 = new FunctionRuntime('java-8.0'); + } + return self::$JAVA80; + } + public static function JAVA110(): FunctionRuntime + { + if (!isset(self::$JAVA110)) { + self::$JAVA110 = new FunctionRuntime('java-11.0'); + } + return self::$JAVA110; + } + public static function JAVA170(): FunctionRuntime + { + if (!isset(self::$JAVA170)) { + self::$JAVA170 = new FunctionRuntime('java-17.0'); + } + return self::$JAVA170; + } + public static function JAVA180(): FunctionRuntime + { + if (!isset(self::$JAVA180)) { + self::$JAVA180 = new FunctionRuntime('java-18.0'); + } + return self::$JAVA180; + } + public static function JAVA210(): FunctionRuntime + { + if (!isset(self::$JAVA210)) { + self::$JAVA210 = new FunctionRuntime('java-21.0'); + } + return self::$JAVA210; + } + public static function JAVA22(): FunctionRuntime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new FunctionRuntime('java-22'); + } + return self::$JAVA22; + } + public static function JAVA25(): FunctionRuntime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new FunctionRuntime('java-25'); + } + return self::$JAVA25; + } + public static function SWIFT55(): FunctionRuntime + { + if (!isset(self::$SWIFT55)) { + self::$SWIFT55 = new FunctionRuntime('swift-5.5'); + } + return self::$SWIFT55; + } + public static function SWIFT58(): FunctionRuntime + { + if (!isset(self::$SWIFT58)) { + self::$SWIFT58 = new FunctionRuntime('swift-5.8'); + } + return self::$SWIFT58; + } + public static function SWIFT59(): FunctionRuntime + { + if (!isset(self::$SWIFT59)) { + self::$SWIFT59 = new FunctionRuntime('swift-5.9'); + } + return self::$SWIFT59; + } + public static function SWIFT510(): FunctionRuntime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new FunctionRuntime('swift-5.10'); + } + return self::$SWIFT510; + } + public static function SWIFT62(): FunctionRuntime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new FunctionRuntime('swift-6.2'); + } + return self::$SWIFT62; + } + public static function KOTLIN16(): FunctionRuntime + { + if (!isset(self::$KOTLIN16)) { + self::$KOTLIN16 = new FunctionRuntime('kotlin-1.6'); + } + return self::$KOTLIN16; + } + public static function KOTLIN18(): FunctionRuntime + { + if (!isset(self::$KOTLIN18)) { + self::$KOTLIN18 = new FunctionRuntime('kotlin-1.8'); + } + return self::$KOTLIN18; + } + public static function KOTLIN19(): FunctionRuntime + { + if (!isset(self::$KOTLIN19)) { + self::$KOTLIN19 = new FunctionRuntime('kotlin-1.9'); + } + return self::$KOTLIN19; + } + public static function KOTLIN20(): FunctionRuntime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new FunctionRuntime('kotlin-2.0'); + } + return self::$KOTLIN20; + } + public static function KOTLIN23(): FunctionRuntime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new FunctionRuntime('kotlin-2.3'); + } + return self::$KOTLIN23; + } + public static function CPP17(): FunctionRuntime + { + if (!isset(self::$CPP17)) { + self::$CPP17 = new FunctionRuntime('cpp-17'); + } + return self::$CPP17; + } + public static function CPP20(): FunctionRuntime + { + if (!isset(self::$CPP20)) { + self::$CPP20 = new FunctionRuntime('cpp-20'); + } + return self::$CPP20; + } + public static function BUN10(): FunctionRuntime + { + if (!isset(self::$BUN10)) { + self::$BUN10 = new FunctionRuntime('bun-1.0'); + } + return self::$BUN10; + } + public static function BUN11(): FunctionRuntime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new FunctionRuntime('bun-1.1'); + } + return self::$BUN11; + } + public static function BUN12(): FunctionRuntime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new FunctionRuntime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): FunctionRuntime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new FunctionRuntime('bun-1.3'); + } + return self::$BUN13; + } + public static function GO123(): FunctionRuntime + { + if (!isset(self::$GO123)) { + self::$GO123 = new FunctionRuntime('go-1.23'); + } + return self::$GO123; + } + public static function GO124(): FunctionRuntime + { + if (!isset(self::$GO124)) { + self::$GO124 = new FunctionRuntime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): FunctionRuntime + { + if (!isset(self::$GO125)) { + self::$GO125 = new FunctionRuntime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): FunctionRuntime + { + if (!isset(self::$GO126)) { + self::$GO126 = new FunctionRuntime('go-1.26'); + } + return self::$GO126; + } + public static function RUST183(): FunctionRuntime + { + if (!isset(self::$RUST183)) { + self::$RUST183 = new FunctionRuntime('rust-1.83'); + } + return self::$RUST183; + } + public static function STATIC1(): FunctionRuntime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new FunctionRuntime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): FunctionRuntime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new FunctionRuntime('flutter-3.24'); + } + return self::$FLUTTER324; + } + public static function FLUTTER327(): FunctionRuntime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new FunctionRuntime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): FunctionRuntime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new FunctionRuntime('flutter-3.29'); + } + return self::$FLUTTER329; + } + public static function FLUTTER332(): FunctionRuntime + { + if (!isset(self::$FLUTTER332)) { + self::$FLUTTER332 = new FunctionRuntime('flutter-3.32'); + } + return self::$FLUTTER332; + } + public static function FLUTTER335(): FunctionRuntime + { + if (!isset(self::$FLUTTER335)) { + self::$FLUTTER335 = new FunctionRuntime('flutter-3.35'); + } + return self::$FLUTTER335; + } + public static function FLUTTER338(): FunctionRuntime + { + if (!isset(self::$FLUTTER338)) { + self::$FLUTTER338 = new FunctionRuntime('flutter-3.38'); + } + return self::$FLUTTER338; + } + public static function FLUTTER341(): FunctionRuntime + { + if (!isset(self::$FLUTTER341)) { + self::$FLUTTER341 = new FunctionRuntime('flutter-3.41'); + } + return self::$FLUTTER341; + } + public static function FLUTTER344(): FunctionRuntime + { + if (!isset(self::$FLUTTER344)) { + self::$FLUTTER344 = new FunctionRuntime('flutter-3.44'); + } + return self::$FLUTTER344; + } + + public static function from(string $value): self + { + return match ($value) { + 'node-14.5' => self::NODE145(), + 'node-16.0' => self::NODE160(), + 'node-18.0' => self::NODE180(), + 'node-19.0' => self::NODE190(), + 'node-20.0' => self::NODE200(), + 'node-21.0' => self::NODE210(), + 'node-22' => self::NODE22(), + 'node-23' => self::NODE23(), + 'node-24' => self::NODE24(), + 'node-25' => self::NODE25(), + 'php-8.0' => self::PHP80(), + 'php-8.1' => self::PHP81(), + 'php-8.2' => self::PHP82(), + 'php-8.3' => self::PHP83(), + 'php-8.4' => self::PHP84(), + 'ruby-3.0' => self::RUBY30(), + 'ruby-3.1' => self::RUBY31(), + 'ruby-3.2' => self::RUBY32(), + 'ruby-3.3' => self::RUBY33(), + 'ruby-3.4' => self::RUBY34(), + 'ruby-4.0' => self::RUBY40(), + 'python-3.8' => self::PYTHON38(), + 'python-3.9' => self::PYTHON39(), + 'python-3.10' => self::PYTHON310(), + 'python-3.11' => self::PYTHON311(), + 'python-3.12' => self::PYTHON312(), + 'python-3.13' => self::PYTHON313(), + 'python-3.14' => self::PYTHON314(), + 'python-ml-3.11' => self::PYTHONML311(), + 'python-ml-3.12' => self::PYTHONML312(), + 'python-ml-3.13' => self::PYTHONML313(), + 'deno-1.21' => self::DENO121(), + 'deno-1.24' => self::DENO124(), + 'deno-1.35' => self::DENO135(), + 'deno-1.40' => self::DENO140(), + 'deno-1.46' => self::DENO146(), + 'deno-2.0' => self::DENO20(), + 'deno-2.5' => self::DENO25(), + 'deno-2.6' => self::DENO26(), + 'dart-2.15' => self::DART215(), + 'dart-2.16' => self::DART216(), + 'dart-2.17' => self::DART217(), + 'dart-2.18' => self::DART218(), + 'dart-2.19' => self::DART219(), + 'dart-3.0' => self::DART30(), + 'dart-3.1' => self::DART31(), + 'dart-3.3' => self::DART33(), + 'dart-3.5' => self::DART35(), + 'dart-3.8' => self::DART38(), + 'dart-3.9' => self::DART39(), + 'dart-3.10' => self::DART310(), + 'dart-3.11' => self::DART311(), + 'dart-3.12' => self::DART312(), + 'dotnet-6.0' => self::DOTNET60(), + 'dotnet-7.0' => self::DOTNET70(), + 'dotnet-8.0' => self::DOTNET80(), + 'dotnet-10' => self::DOTNET10(), + 'java-8.0' => self::JAVA80(), + 'java-11.0' => self::JAVA110(), + 'java-17.0' => self::JAVA170(), + 'java-18.0' => self::JAVA180(), + 'java-21.0' => self::JAVA210(), + 'java-22' => self::JAVA22(), + 'java-25' => self::JAVA25(), + 'swift-5.5' => self::SWIFT55(), + 'swift-5.8' => self::SWIFT58(), + 'swift-5.9' => self::SWIFT59(), + 'swift-5.10' => self::SWIFT510(), + 'swift-6.2' => self::SWIFT62(), + 'kotlin-1.6' => self::KOTLIN16(), + 'kotlin-1.8' => self::KOTLIN18(), + 'kotlin-1.9' => self::KOTLIN19(), + 'kotlin-2.0' => self::KOTLIN20(), + 'kotlin-2.3' => self::KOTLIN23(), + 'cpp-17' => self::CPP17(), + 'cpp-20' => self::CPP20(), + 'bun-1.0' => self::BUN10(), + 'bun-1.1' => self::BUN11(), + 'bun-1.2' => self::BUN12(), + 'bun-1.3' => self::BUN13(), + 'go-1.23' => self::GO123(), + 'go-1.24' => self::GO124(), + 'go-1.25' => self::GO125(), + 'go-1.26' => self::GO126(), + 'rust-1.83' => self::RUST183(), + 'static-1' => self::STATIC1(), + 'flutter-3.24' => self::FLUTTER324(), + 'flutter-3.27' => self::FLUTTER327(), + 'flutter-3.29' => self::FLUTTER329(), + 'flutter-3.32' => self::FLUTTER332(), + 'flutter-3.35' => self::FLUTTER335(), + 'flutter-3.38' => self::FLUTTER338(), + 'flutter-3.41' => self::FLUTTER341(), + 'flutter-3.44' => self::FLUTTER344(), + default => throw new \InvalidArgumentException('Unknown FunctionRuntime value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/Name.php b/src/Appwrite/Enums/HealthQueueName.php similarity index 50% rename from src/Appwrite/Enums/Name.php rename to src/Appwrite/Enums/HealthQueueName.php index 0265d468..e03d7c81 100644 --- a/src/Appwrite/Enums/Name.php +++ b/src/Appwrite/Enums/HealthQueueName.php @@ -4,21 +4,21 @@ use JsonSerializable; -class Name implements JsonSerializable +class HealthQueueName implements JsonSerializable { - private static Name $V1DATABASE; - private static Name $V1DELETES; - private static Name $V1AUDITS; - private static Name $V1MAILS; - private static Name $V1FUNCTIONS; - private static Name $V1STATSRESOURCES; - private static Name $V1STATSUSAGE; - private static Name $V1WEBHOOKS; - private static Name $V1CERTIFICATES; - private static Name $V1BUILDS; - private static Name $V1SCREENSHOTS; - private static Name $V1MESSAGING; - private static Name $V1MIGRATIONS; + private static HealthQueueName $V1DATABASE; + private static HealthQueueName $V1DELETES; + private static HealthQueueName $V1AUDITS; + private static HealthQueueName $V1MAILS; + private static HealthQueueName $V1FUNCTIONS; + private static HealthQueueName $V1STATSRESOURCES; + private static HealthQueueName $V1STATSUSAGE; + private static HealthQueueName $V1WEBHOOKS; + private static HealthQueueName $V1CERTIFICATES; + private static HealthQueueName $V1BUILDS; + private static HealthQueueName $V1SCREENSHOTS; + private static HealthQueueName $V1MESSAGING; + private static HealthQueueName $V1MIGRATIONS; private string $value; @@ -37,94 +37,94 @@ public function jsonSerialize(): string return $this->value; } - public static function V1DATABASE(): Name + public static function V1DATABASE(): HealthQueueName { if (!isset(self::$V1DATABASE)) { - self::$V1DATABASE = new Name('v1-database'); + self::$V1DATABASE = new HealthQueueName('v1-database'); } return self::$V1DATABASE; } - public static function V1DELETES(): Name + public static function V1DELETES(): HealthQueueName { if (!isset(self::$V1DELETES)) { - self::$V1DELETES = new Name('v1-deletes'); + self::$V1DELETES = new HealthQueueName('v1-deletes'); } return self::$V1DELETES; } - public static function V1AUDITS(): Name + public static function V1AUDITS(): HealthQueueName { if (!isset(self::$V1AUDITS)) { - self::$V1AUDITS = new Name('v1-audits'); + self::$V1AUDITS = new HealthQueueName('v1-audits'); } return self::$V1AUDITS; } - public static function V1MAILS(): Name + public static function V1MAILS(): HealthQueueName { if (!isset(self::$V1MAILS)) { - self::$V1MAILS = new Name('v1-mails'); + self::$V1MAILS = new HealthQueueName('v1-mails'); } return self::$V1MAILS; } - public static function V1FUNCTIONS(): Name + public static function V1FUNCTIONS(): HealthQueueName { if (!isset(self::$V1FUNCTIONS)) { - self::$V1FUNCTIONS = new Name('v1-functions'); + self::$V1FUNCTIONS = new HealthQueueName('v1-functions'); } return self::$V1FUNCTIONS; } - public static function V1STATSRESOURCES(): Name + public static function V1STATSRESOURCES(): HealthQueueName { if (!isset(self::$V1STATSRESOURCES)) { - self::$V1STATSRESOURCES = new Name('v1-stats-resources'); + self::$V1STATSRESOURCES = new HealthQueueName('v1-stats-resources'); } return self::$V1STATSRESOURCES; } - public static function V1STATSUSAGE(): Name + public static function V1STATSUSAGE(): HealthQueueName { if (!isset(self::$V1STATSUSAGE)) { - self::$V1STATSUSAGE = new Name('v1-stats-usage'); + self::$V1STATSUSAGE = new HealthQueueName('v1-stats-usage'); } return self::$V1STATSUSAGE; } - public static function V1WEBHOOKS(): Name + public static function V1WEBHOOKS(): HealthQueueName { if (!isset(self::$V1WEBHOOKS)) { - self::$V1WEBHOOKS = new Name('v1-webhooks'); + self::$V1WEBHOOKS = new HealthQueueName('v1-webhooks'); } return self::$V1WEBHOOKS; } - public static function V1CERTIFICATES(): Name + public static function V1CERTIFICATES(): HealthQueueName { if (!isset(self::$V1CERTIFICATES)) { - self::$V1CERTIFICATES = new Name('v1-certificates'); + self::$V1CERTIFICATES = new HealthQueueName('v1-certificates'); } return self::$V1CERTIFICATES; } - public static function V1BUILDS(): Name + public static function V1BUILDS(): HealthQueueName { if (!isset(self::$V1BUILDS)) { - self::$V1BUILDS = new Name('v1-builds'); + self::$V1BUILDS = new HealthQueueName('v1-builds'); } return self::$V1BUILDS; } - public static function V1SCREENSHOTS(): Name + public static function V1SCREENSHOTS(): HealthQueueName { if (!isset(self::$V1SCREENSHOTS)) { - self::$V1SCREENSHOTS = new Name('v1-screenshots'); + self::$V1SCREENSHOTS = new HealthQueueName('v1-screenshots'); } return self::$V1SCREENSHOTS; } - public static function V1MESSAGING(): Name + public static function V1MESSAGING(): HealthQueueName { if (!isset(self::$V1MESSAGING)) { - self::$V1MESSAGING = new Name('v1-messaging'); + self::$V1MESSAGING = new HealthQueueName('v1-messaging'); } return self::$V1MESSAGING; } - public static function V1MIGRATIONS(): Name + public static function V1MIGRATIONS(): HealthQueueName { if (!isset(self::$V1MIGRATIONS)) { - self::$V1MIGRATIONS = new Name('v1-migrations'); + self::$V1MIGRATIONS = new HealthQueueName('v1-migrations'); } return self::$V1MIGRATIONS; } @@ -145,7 +145,7 @@ public static function from(string $value): self 'v1-screenshots' => self::V1SCREENSHOTS(), 'v1-messaging' => self::V1MESSAGING(), 'v1-migrations' => self::V1MIGRATIONS(), - default => throw new \InvalidArgumentException('Unknown Name value: ' . $value), + default => throw new \InvalidArgumentException('Unknown HealthQueueName value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/OrganizationKeyScopes.php b/src/Appwrite/Enums/OrganizationKeyScopes.php new file mode 100644 index 00000000..b013d0f2 --- /dev/null +++ b/src/Appwrite/Enums/OrganizationKeyScopes.php @@ -0,0 +1,124 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function PROJECTSREAD(): OrganizationKeyScopes + { + if (!isset(self::$PROJECTSREAD)) { + self::$PROJECTSREAD = new OrganizationKeyScopes('projects.read'); + } + return self::$PROJECTSREAD; + } + public static function PROJECTSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$PROJECTSWRITE)) { + self::$PROJECTSWRITE = new OrganizationKeyScopes('projects.write'); + } + return self::$PROJECTSWRITE; + } + public static function DEVKEYSREAD(): OrganizationKeyScopes + { + if (!isset(self::$DEVKEYSREAD)) { + self::$DEVKEYSREAD = new OrganizationKeyScopes('devKeys.read'); + } + return self::$DEVKEYSREAD; + } + public static function DEVKEYSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$DEVKEYSWRITE)) { + self::$DEVKEYSWRITE = new OrganizationKeyScopes('devKeys.write'); + } + return self::$DEVKEYSWRITE; + } + public static function ORGANIZATIONKEYSREAD(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONKEYSREAD)) { + self::$ORGANIZATIONKEYSREAD = new OrganizationKeyScopes('organization.keys.read'); + } + return self::$ORGANIZATIONKEYSREAD; + } + public static function ORGANIZATIONKEYSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$ORGANIZATIONKEYSWRITE)) { + self::$ORGANIZATIONKEYSWRITE = new OrganizationKeyScopes('organization.keys.write'); + } + return self::$ORGANIZATIONKEYSWRITE; + } + public static function DOMAINSREAD(): OrganizationKeyScopes + { + if (!isset(self::$DOMAINSREAD)) { + self::$DOMAINSREAD = new OrganizationKeyScopes('domains.read'); + } + return self::$DOMAINSREAD; + } + public static function DOMAINSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$DOMAINSWRITE)) { + self::$DOMAINSWRITE = new OrganizationKeyScopes('domains.write'); + } + return self::$DOMAINSWRITE; + } + public static function KEYSREAD(): OrganizationKeyScopes + { + if (!isset(self::$KEYSREAD)) { + self::$KEYSREAD = new OrganizationKeyScopes('keys.read'); + } + return self::$KEYSREAD; + } + public static function KEYSWRITE(): OrganizationKeyScopes + { + if (!isset(self::$KEYSWRITE)) { + self::$KEYSWRITE = new OrganizationKeyScopes('keys.write'); + } + return self::$KEYSWRITE; + } + + public static function from(string $value): self + { + return match ($value) { + 'projects.read' => self::PROJECTSREAD(), + 'projects.write' => self::PROJECTSWRITE(), + 'devKeys.read' => self::DEVKEYSREAD(), + 'devKeys.write' => self::DEVKEYSWRITE(), + 'organization.keys.read' => self::ORGANIZATIONKEYSREAD(), + 'organization.keys.write' => self::ORGANIZATIONKEYSWRITE(), + 'domains.read' => self::DOMAINSREAD(), + 'domains.write' => self::DOMAINSWRITE(), + 'keys.read' => self::KEYSREAD(), + 'keys.write' => self::KEYSWRITE(), + default => throw new \InvalidArgumentException('Unknown OrganizationKeyScopes value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/ProjectOAuthProviderId.php b/src/Appwrite/Enums/ProjectOAuthProviderId.php index 206ed4b1..a9325a75 100644 --- a/src/Appwrite/Enums/ProjectOAuthProviderId.php +++ b/src/Appwrite/Enums/ProjectOAuthProviderId.php @@ -49,8 +49,6 @@ class ProjectOAuthProviderId implements JsonSerializable private static ProjectOAuthProviderId $YANDEX; private static ProjectOAuthProviderId $ZOHO; private static ProjectOAuthProviderId $ZOOM; - private static ProjectOAuthProviderId $GITHUBIMAGINE; - private static ProjectOAuthProviderId $GOOGLEIMAGINE; private string $value; @@ -370,20 +368,6 @@ public static function ZOOM(): ProjectOAuthProviderId } return self::$ZOOM; } - public static function GITHUBIMAGINE(): ProjectOAuthProviderId - { - if (!isset(self::$GITHUBIMAGINE)) { - self::$GITHUBIMAGINE = new ProjectOAuthProviderId('githubImagine'); - } - return self::$GITHUBIMAGINE; - } - public static function GOOGLEIMAGINE(): ProjectOAuthProviderId - { - if (!isset(self::$GOOGLEIMAGINE)) { - self::$GOOGLEIMAGINE = new ProjectOAuthProviderId('googleImagine'); - } - return self::$GOOGLEIMAGINE; - } public static function from(string $value): self { @@ -431,8 +415,6 @@ public static function from(string $value): self 'yandex' => self::YANDEX(), 'zoho' => self::ZOHO(), 'zoom' => self::ZOOM(), - 'githubImagine' => self::GITHUBIMAGINE(), - 'googleImagine' => self::GOOGLEIMAGINE(), default => throw new \InvalidArgumentException('Unknown ProjectOAuthProviderId value: ' . $value), }; } diff --git a/src/Appwrite/Enums/RedirectStatusCode.php b/src/Appwrite/Enums/RedirectStatusCode.php new file mode 100644 index 00000000..d76aa044 --- /dev/null +++ b/src/Appwrite/Enums/RedirectStatusCode.php @@ -0,0 +1,70 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function MOVEDPERMANENTLY(): RedirectStatusCode + { + if (!isset(self::$MOVEDPERMANENTLY)) { + self::$MOVEDPERMANENTLY = new RedirectStatusCode('301'); + } + return self::$MOVEDPERMANENTLY; + } + public static function FOUND(): RedirectStatusCode + { + if (!isset(self::$FOUND)) { + self::$FOUND = new RedirectStatusCode('302'); + } + return self::$FOUND; + } + public static function TEMPORARYREDIRECT(): RedirectStatusCode + { + if (!isset(self::$TEMPORARYREDIRECT)) { + self::$TEMPORARYREDIRECT = new RedirectStatusCode('307'); + } + return self::$TEMPORARYREDIRECT; + } + public static function PERMANENTREDIRECT(): RedirectStatusCode + { + if (!isset(self::$PERMANENTREDIRECT)) { + self::$PERMANENTREDIRECT = new RedirectStatusCode('308'); + } + return self::$PERMANENTREDIRECT; + } + + public static function from(string $value): self + { + return match ($value) { + '301' => self::MOVEDPERMANENTLY(), + '302' => self::FOUND(), + '307' => self::TEMPORARYREDIRECT(), + '308' => self::PERMANENTREDIRECT(), + default => throw new \InvalidArgumentException('Unknown RedirectStatusCode value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/Region.php b/src/Appwrite/Enums/Region.php new file mode 100644 index 00000000..7695a582 --- /dev/null +++ b/src/Appwrite/Enums/Region.php @@ -0,0 +1,88 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function FRA(): Region + { + if (!isset(self::$FRA)) { + self::$FRA = new Region('fra'); + } + return self::$FRA; + } + public static function NYC(): Region + { + if (!isset(self::$NYC)) { + self::$NYC = new Region('nyc'); + } + return self::$NYC; + } + public static function SYD(): Region + { + if (!isset(self::$SYD)) { + self::$SYD = new Region('syd'); + } + return self::$SYD; + } + public static function SFO(): Region + { + if (!isset(self::$SFO)) { + self::$SFO = new Region('sfo'); + } + return self::$SFO; + } + public static function SGP(): Region + { + if (!isset(self::$SGP)) { + self::$SGP = new Region('sgp'); + } + return self::$SGP; + } + public static function TOR(): Region + { + if (!isset(self::$TOR)) { + self::$TOR = new Region('tor'); + } + return self::$TOR; + } + + public static function from(string $value): self + { + return match ($value) { + 'fra' => self::FRA(), + 'nyc' => self::NYC(), + 'syd' => self::SYD(), + 'sfo' => self::SFO(), + 'sgp' => self::SGP(), + 'tor' => self::TOR(), + default => throw new \InvalidArgumentException('Unknown Region value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php deleted file mode 100644 index 667d0d3f..00000000 --- a/src/Appwrite/Enums/Runtime.php +++ /dev/null @@ -1,862 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NODE145(): Runtime - { - if (!isset(self::$NODE145)) { - self::$NODE145 = new Runtime('node-14.5'); - } - return self::$NODE145; - } - public static function NODE160(): Runtime - { - if (!isset(self::$NODE160)) { - self::$NODE160 = new Runtime('node-16.0'); - } - return self::$NODE160; - } - public static function NODE180(): Runtime - { - if (!isset(self::$NODE180)) { - self::$NODE180 = new Runtime('node-18.0'); - } - return self::$NODE180; - } - public static function NODE190(): Runtime - { - if (!isset(self::$NODE190)) { - self::$NODE190 = new Runtime('node-19.0'); - } - return self::$NODE190; - } - public static function NODE200(): Runtime - { - if (!isset(self::$NODE200)) { - self::$NODE200 = new Runtime('node-20.0'); - } - return self::$NODE200; - } - public static function NODE210(): Runtime - { - if (!isset(self::$NODE210)) { - self::$NODE210 = new Runtime('node-21.0'); - } - return self::$NODE210; - } - public static function NODE22(): Runtime - { - if (!isset(self::$NODE22)) { - self::$NODE22 = new Runtime('node-22'); - } - return self::$NODE22; - } - public static function NODE23(): Runtime - { - if (!isset(self::$NODE23)) { - self::$NODE23 = new Runtime('node-23'); - } - return self::$NODE23; - } - public static function NODE24(): Runtime - { - if (!isset(self::$NODE24)) { - self::$NODE24 = new Runtime('node-24'); - } - return self::$NODE24; - } - public static function NODE25(): Runtime - { - if (!isset(self::$NODE25)) { - self::$NODE25 = new Runtime('node-25'); - } - return self::$NODE25; - } - public static function PHP80(): Runtime - { - if (!isset(self::$PHP80)) { - self::$PHP80 = new Runtime('php-8.0'); - } - return self::$PHP80; - } - public static function PHP81(): Runtime - { - if (!isset(self::$PHP81)) { - self::$PHP81 = new Runtime('php-8.1'); - } - return self::$PHP81; - } - public static function PHP82(): Runtime - { - if (!isset(self::$PHP82)) { - self::$PHP82 = new Runtime('php-8.2'); - } - return self::$PHP82; - } - public static function PHP83(): Runtime - { - if (!isset(self::$PHP83)) { - self::$PHP83 = new Runtime('php-8.3'); - } - return self::$PHP83; - } - public static function PHP84(): Runtime - { - if (!isset(self::$PHP84)) { - self::$PHP84 = new Runtime('php-8.4'); - } - return self::$PHP84; - } - public static function RUBY30(): Runtime - { - if (!isset(self::$RUBY30)) { - self::$RUBY30 = new Runtime('ruby-3.0'); - } - return self::$RUBY30; - } - public static function RUBY31(): Runtime - { - if (!isset(self::$RUBY31)) { - self::$RUBY31 = new Runtime('ruby-3.1'); - } - return self::$RUBY31; - } - public static function RUBY32(): Runtime - { - if (!isset(self::$RUBY32)) { - self::$RUBY32 = new Runtime('ruby-3.2'); - } - return self::$RUBY32; - } - public static function RUBY33(): Runtime - { - if (!isset(self::$RUBY33)) { - self::$RUBY33 = new Runtime('ruby-3.3'); - } - return self::$RUBY33; - } - public static function RUBY34(): Runtime - { - if (!isset(self::$RUBY34)) { - self::$RUBY34 = new Runtime('ruby-3.4'); - } - return self::$RUBY34; - } - public static function RUBY40(): Runtime - { - if (!isset(self::$RUBY40)) { - self::$RUBY40 = new Runtime('ruby-4.0'); - } - return self::$RUBY40; - } - public static function PYTHON38(): Runtime - { - if (!isset(self::$PYTHON38)) { - self::$PYTHON38 = new Runtime('python-3.8'); - } - return self::$PYTHON38; - } - public static function PYTHON39(): Runtime - { - if (!isset(self::$PYTHON39)) { - self::$PYTHON39 = new Runtime('python-3.9'); - } - return self::$PYTHON39; - } - public static function PYTHON310(): Runtime - { - if (!isset(self::$PYTHON310)) { - self::$PYTHON310 = new Runtime('python-3.10'); - } - return self::$PYTHON310; - } - public static function PYTHON311(): Runtime - { - if (!isset(self::$PYTHON311)) { - self::$PYTHON311 = new Runtime('python-3.11'); - } - return self::$PYTHON311; - } - public static function PYTHON312(): Runtime - { - if (!isset(self::$PYTHON312)) { - self::$PYTHON312 = new Runtime('python-3.12'); - } - return self::$PYTHON312; - } - public static function PYTHON313(): Runtime - { - if (!isset(self::$PYTHON313)) { - self::$PYTHON313 = new Runtime('python-3.13'); - } - return self::$PYTHON313; - } - public static function PYTHON314(): Runtime - { - if (!isset(self::$PYTHON314)) { - self::$PYTHON314 = new Runtime('python-3.14'); - } - return self::$PYTHON314; - } - public static function PYTHONML311(): Runtime - { - if (!isset(self::$PYTHONML311)) { - self::$PYTHONML311 = new Runtime('python-ml-3.11'); - } - return self::$PYTHONML311; - } - public static function PYTHONML312(): Runtime - { - if (!isset(self::$PYTHONML312)) { - self::$PYTHONML312 = new Runtime('python-ml-3.12'); - } - return self::$PYTHONML312; - } - public static function PYTHONML313(): Runtime - { - if (!isset(self::$PYTHONML313)) { - self::$PYTHONML313 = new Runtime('python-ml-3.13'); - } - return self::$PYTHONML313; - } - public static function DENO121(): Runtime - { - if (!isset(self::$DENO121)) { - self::$DENO121 = new Runtime('deno-1.21'); - } - return self::$DENO121; - } - public static function DENO124(): Runtime - { - if (!isset(self::$DENO124)) { - self::$DENO124 = new Runtime('deno-1.24'); - } - return self::$DENO124; - } - public static function DENO135(): Runtime - { - if (!isset(self::$DENO135)) { - self::$DENO135 = new Runtime('deno-1.35'); - } - return self::$DENO135; - } - public static function DENO140(): Runtime - { - if (!isset(self::$DENO140)) { - self::$DENO140 = new Runtime('deno-1.40'); - } - return self::$DENO140; - } - public static function DENO146(): Runtime - { - if (!isset(self::$DENO146)) { - self::$DENO146 = new Runtime('deno-1.46'); - } - return self::$DENO146; - } - public static function DENO20(): Runtime - { - if (!isset(self::$DENO20)) { - self::$DENO20 = new Runtime('deno-2.0'); - } - return self::$DENO20; - } - public static function DENO25(): Runtime - { - if (!isset(self::$DENO25)) { - self::$DENO25 = new Runtime('deno-2.5'); - } - return self::$DENO25; - } - public static function DENO26(): Runtime - { - if (!isset(self::$DENO26)) { - self::$DENO26 = new Runtime('deno-2.6'); - } - return self::$DENO26; - } - public static function DART215(): Runtime - { - if (!isset(self::$DART215)) { - self::$DART215 = new Runtime('dart-2.15'); - } - return self::$DART215; - } - public static function DART216(): Runtime - { - if (!isset(self::$DART216)) { - self::$DART216 = new Runtime('dart-2.16'); - } - return self::$DART216; - } - public static function DART217(): Runtime - { - if (!isset(self::$DART217)) { - self::$DART217 = new Runtime('dart-2.17'); - } - return self::$DART217; - } - public static function DART218(): Runtime - { - if (!isset(self::$DART218)) { - self::$DART218 = new Runtime('dart-2.18'); - } - return self::$DART218; - } - public static function DART219(): Runtime - { - if (!isset(self::$DART219)) { - self::$DART219 = new Runtime('dart-2.19'); - } - return self::$DART219; - } - public static function DART30(): Runtime - { - if (!isset(self::$DART30)) { - self::$DART30 = new Runtime('dart-3.0'); - } - return self::$DART30; - } - public static function DART31(): Runtime - { - if (!isset(self::$DART31)) { - self::$DART31 = new Runtime('dart-3.1'); - } - return self::$DART31; - } - public static function DART33(): Runtime - { - if (!isset(self::$DART33)) { - self::$DART33 = new Runtime('dart-3.3'); - } - return self::$DART33; - } - public static function DART35(): Runtime - { - if (!isset(self::$DART35)) { - self::$DART35 = new Runtime('dart-3.5'); - } - return self::$DART35; - } - public static function DART38(): Runtime - { - if (!isset(self::$DART38)) { - self::$DART38 = new Runtime('dart-3.8'); - } - return self::$DART38; - } - public static function DART39(): Runtime - { - if (!isset(self::$DART39)) { - self::$DART39 = new Runtime('dart-3.9'); - } - return self::$DART39; - } - public static function DART310(): Runtime - { - if (!isset(self::$DART310)) { - self::$DART310 = new Runtime('dart-3.10'); - } - return self::$DART310; - } - public static function DART311(): Runtime - { - if (!isset(self::$DART311)) { - self::$DART311 = new Runtime('dart-3.11'); - } - return self::$DART311; - } - public static function DOTNET60(): Runtime - { - if (!isset(self::$DOTNET60)) { - self::$DOTNET60 = new Runtime('dotnet-6.0'); - } - return self::$DOTNET60; - } - public static function DOTNET70(): Runtime - { - if (!isset(self::$DOTNET70)) { - self::$DOTNET70 = new Runtime('dotnet-7.0'); - } - return self::$DOTNET70; - } - public static function DOTNET80(): Runtime - { - if (!isset(self::$DOTNET80)) { - self::$DOTNET80 = new Runtime('dotnet-8.0'); - } - return self::$DOTNET80; - } - public static function DOTNET10(): Runtime - { - if (!isset(self::$DOTNET10)) { - self::$DOTNET10 = new Runtime('dotnet-10'); - } - return self::$DOTNET10; - } - public static function JAVA80(): Runtime - { - if (!isset(self::$JAVA80)) { - self::$JAVA80 = new Runtime('java-8.0'); - } - return self::$JAVA80; - } - public static function JAVA110(): Runtime - { - if (!isset(self::$JAVA110)) { - self::$JAVA110 = new Runtime('java-11.0'); - } - return self::$JAVA110; - } - public static function JAVA170(): Runtime - { - if (!isset(self::$JAVA170)) { - self::$JAVA170 = new Runtime('java-17.0'); - } - return self::$JAVA170; - } - public static function JAVA180(): Runtime - { - if (!isset(self::$JAVA180)) { - self::$JAVA180 = new Runtime('java-18.0'); - } - return self::$JAVA180; - } - public static function JAVA210(): Runtime - { - if (!isset(self::$JAVA210)) { - self::$JAVA210 = new Runtime('java-21.0'); - } - return self::$JAVA210; - } - public static function JAVA22(): Runtime - { - if (!isset(self::$JAVA22)) { - self::$JAVA22 = new Runtime('java-22'); - } - return self::$JAVA22; - } - public static function JAVA25(): Runtime - { - if (!isset(self::$JAVA25)) { - self::$JAVA25 = new Runtime('java-25'); - } - return self::$JAVA25; - } - public static function SWIFT55(): Runtime - { - if (!isset(self::$SWIFT55)) { - self::$SWIFT55 = new Runtime('swift-5.5'); - } - return self::$SWIFT55; - } - public static function SWIFT58(): Runtime - { - if (!isset(self::$SWIFT58)) { - self::$SWIFT58 = new Runtime('swift-5.8'); - } - return self::$SWIFT58; - } - public static function SWIFT59(): Runtime - { - if (!isset(self::$SWIFT59)) { - self::$SWIFT59 = new Runtime('swift-5.9'); - } - return self::$SWIFT59; - } - public static function SWIFT510(): Runtime - { - if (!isset(self::$SWIFT510)) { - self::$SWIFT510 = new Runtime('swift-5.10'); - } - return self::$SWIFT510; - } - public static function SWIFT62(): Runtime - { - if (!isset(self::$SWIFT62)) { - self::$SWIFT62 = new Runtime('swift-6.2'); - } - return self::$SWIFT62; - } - public static function KOTLIN16(): Runtime - { - if (!isset(self::$KOTLIN16)) { - self::$KOTLIN16 = new Runtime('kotlin-1.6'); - } - return self::$KOTLIN16; - } - public static function KOTLIN18(): Runtime - { - if (!isset(self::$KOTLIN18)) { - self::$KOTLIN18 = new Runtime('kotlin-1.8'); - } - return self::$KOTLIN18; - } - public static function KOTLIN19(): Runtime - { - if (!isset(self::$KOTLIN19)) { - self::$KOTLIN19 = new Runtime('kotlin-1.9'); - } - return self::$KOTLIN19; - } - public static function KOTLIN20(): Runtime - { - if (!isset(self::$KOTLIN20)) { - self::$KOTLIN20 = new Runtime('kotlin-2.0'); - } - return self::$KOTLIN20; - } - public static function KOTLIN23(): Runtime - { - if (!isset(self::$KOTLIN23)) { - self::$KOTLIN23 = new Runtime('kotlin-2.3'); - } - return self::$KOTLIN23; - } - public static function CPP17(): Runtime - { - if (!isset(self::$CPP17)) { - self::$CPP17 = new Runtime('cpp-17'); - } - return self::$CPP17; - } - public static function CPP20(): Runtime - { - if (!isset(self::$CPP20)) { - self::$CPP20 = new Runtime('cpp-20'); - } - return self::$CPP20; - } - public static function BUN10(): Runtime - { - if (!isset(self::$BUN10)) { - self::$BUN10 = new Runtime('bun-1.0'); - } - return self::$BUN10; - } - public static function BUN11(): Runtime - { - if (!isset(self::$BUN11)) { - self::$BUN11 = new Runtime('bun-1.1'); - } - return self::$BUN11; - } - public static function BUN12(): Runtime - { - if (!isset(self::$BUN12)) { - self::$BUN12 = new Runtime('bun-1.2'); - } - return self::$BUN12; - } - public static function BUN13(): Runtime - { - if (!isset(self::$BUN13)) { - self::$BUN13 = new Runtime('bun-1.3'); - } - return self::$BUN13; - } - public static function GO123(): Runtime - { - if (!isset(self::$GO123)) { - self::$GO123 = new Runtime('go-1.23'); - } - return self::$GO123; - } - public static function GO124(): Runtime - { - if (!isset(self::$GO124)) { - self::$GO124 = new Runtime('go-1.24'); - } - return self::$GO124; - } - public static function GO125(): Runtime - { - if (!isset(self::$GO125)) { - self::$GO125 = new Runtime('go-1.25'); - } - return self::$GO125; - } - public static function GO126(): Runtime - { - if (!isset(self::$GO126)) { - self::$GO126 = new Runtime('go-1.26'); - } - return self::$GO126; - } - public static function RUST183(): Runtime - { - if (!isset(self::$RUST183)) { - self::$RUST183 = new Runtime('rust-1.83'); - } - return self::$RUST183; - } - public static function STATIC1(): Runtime - { - if (!isset(self::$STATIC1)) { - self::$STATIC1 = new Runtime('static-1'); - } - return self::$STATIC1; - } - public static function FLUTTER324(): Runtime - { - if (!isset(self::$FLUTTER324)) { - self::$FLUTTER324 = new Runtime('flutter-3.24'); - } - return self::$FLUTTER324; - } - public static function FLUTTER327(): Runtime - { - if (!isset(self::$FLUTTER327)) { - self::$FLUTTER327 = new Runtime('flutter-3.27'); - } - return self::$FLUTTER327; - } - public static function FLUTTER329(): Runtime - { - if (!isset(self::$FLUTTER329)) { - self::$FLUTTER329 = new Runtime('flutter-3.29'); - } - return self::$FLUTTER329; - } - public static function FLUTTER332(): Runtime - { - if (!isset(self::$FLUTTER332)) { - self::$FLUTTER332 = new Runtime('flutter-3.32'); - } - return self::$FLUTTER332; - } - public static function FLUTTER335(): Runtime - { - if (!isset(self::$FLUTTER335)) { - self::$FLUTTER335 = new Runtime('flutter-3.35'); - } - return self::$FLUTTER335; - } - public static function FLUTTER338(): Runtime - { - if (!isset(self::$FLUTTER338)) { - self::$FLUTTER338 = new Runtime('flutter-3.38'); - } - return self::$FLUTTER338; - } - public static function FLUTTER341(): Runtime - { - if (!isset(self::$FLUTTER341)) { - self::$FLUTTER341 = new Runtime('flutter-3.41'); - } - return self::$FLUTTER341; - } - - public static function from(string $value): self - { - return match ($value) { - 'node-14.5' => self::NODE145(), - 'node-16.0' => self::NODE160(), - 'node-18.0' => self::NODE180(), - 'node-19.0' => self::NODE190(), - 'node-20.0' => self::NODE200(), - 'node-21.0' => self::NODE210(), - 'node-22' => self::NODE22(), - 'node-23' => self::NODE23(), - 'node-24' => self::NODE24(), - 'node-25' => self::NODE25(), - 'php-8.0' => self::PHP80(), - 'php-8.1' => self::PHP81(), - 'php-8.2' => self::PHP82(), - 'php-8.3' => self::PHP83(), - 'php-8.4' => self::PHP84(), - 'ruby-3.0' => self::RUBY30(), - 'ruby-3.1' => self::RUBY31(), - 'ruby-3.2' => self::RUBY32(), - 'ruby-3.3' => self::RUBY33(), - 'ruby-3.4' => self::RUBY34(), - 'ruby-4.0' => self::RUBY40(), - 'python-3.8' => self::PYTHON38(), - 'python-3.9' => self::PYTHON39(), - 'python-3.10' => self::PYTHON310(), - 'python-3.11' => self::PYTHON311(), - 'python-3.12' => self::PYTHON312(), - 'python-3.13' => self::PYTHON313(), - 'python-3.14' => self::PYTHON314(), - 'python-ml-3.11' => self::PYTHONML311(), - 'python-ml-3.12' => self::PYTHONML312(), - 'python-ml-3.13' => self::PYTHONML313(), - 'deno-1.21' => self::DENO121(), - 'deno-1.24' => self::DENO124(), - 'deno-1.35' => self::DENO135(), - 'deno-1.40' => self::DENO140(), - 'deno-1.46' => self::DENO146(), - 'deno-2.0' => self::DENO20(), - 'deno-2.5' => self::DENO25(), - 'deno-2.6' => self::DENO26(), - 'dart-2.15' => self::DART215(), - 'dart-2.16' => self::DART216(), - 'dart-2.17' => self::DART217(), - 'dart-2.18' => self::DART218(), - 'dart-2.19' => self::DART219(), - 'dart-3.0' => self::DART30(), - 'dart-3.1' => self::DART31(), - 'dart-3.3' => self::DART33(), - 'dart-3.5' => self::DART35(), - 'dart-3.8' => self::DART38(), - 'dart-3.9' => self::DART39(), - 'dart-3.10' => self::DART310(), - 'dart-3.11' => self::DART311(), - 'dotnet-6.0' => self::DOTNET60(), - 'dotnet-7.0' => self::DOTNET70(), - 'dotnet-8.0' => self::DOTNET80(), - 'dotnet-10' => self::DOTNET10(), - 'java-8.0' => self::JAVA80(), - 'java-11.0' => self::JAVA110(), - 'java-17.0' => self::JAVA170(), - 'java-18.0' => self::JAVA180(), - 'java-21.0' => self::JAVA210(), - 'java-22' => self::JAVA22(), - 'java-25' => self::JAVA25(), - 'swift-5.5' => self::SWIFT55(), - 'swift-5.8' => self::SWIFT58(), - 'swift-5.9' => self::SWIFT59(), - 'swift-5.10' => self::SWIFT510(), - 'swift-6.2' => self::SWIFT62(), - 'kotlin-1.6' => self::KOTLIN16(), - 'kotlin-1.8' => self::KOTLIN18(), - 'kotlin-1.9' => self::KOTLIN19(), - 'kotlin-2.0' => self::KOTLIN20(), - 'kotlin-2.3' => self::KOTLIN23(), - 'cpp-17' => self::CPP17(), - 'cpp-20' => self::CPP20(), - 'bun-1.0' => self::BUN10(), - 'bun-1.1' => self::BUN11(), - 'bun-1.2' => self::BUN12(), - 'bun-1.3' => self::BUN13(), - 'go-1.23' => self::GO123(), - 'go-1.24' => self::GO124(), - 'go-1.25' => self::GO125(), - 'go-1.26' => self::GO126(), - 'rust-1.83' => self::RUST183(), - 'static-1' => self::STATIC1(), - 'flutter-3.24' => self::FLUTTER324(), - 'flutter-3.27' => self::FLUTTER327(), - 'flutter-3.29' => self::FLUTTER329(), - 'flutter-3.32' => self::FLUTTER332(), - 'flutter-3.35' => self::FLUTTER335(), - 'flutter-3.38' => self::FLUTTER338(), - 'flutter-3.41' => self::FLUTTER341(), - default => throw new \InvalidArgumentException('Unknown Runtime value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/Scopes.php b/src/Appwrite/Enums/Scopes.php deleted file mode 100644 index 493c2e11..00000000 --- a/src/Appwrite/Enums/Scopes.php +++ /dev/null @@ -1,880 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function PROJECTREAD(): Scopes - { - if (!isset(self::$PROJECTREAD)) { - self::$PROJECTREAD = new Scopes('project.read'); - } - return self::$PROJECTREAD; - } - public static function PROJECTWRITE(): Scopes - { - if (!isset(self::$PROJECTWRITE)) { - self::$PROJECTWRITE = new Scopes('project.write'); - } - return self::$PROJECTWRITE; - } - public static function KEYSREAD(): Scopes - { - if (!isset(self::$KEYSREAD)) { - self::$KEYSREAD = new Scopes('keys.read'); - } - return self::$KEYSREAD; - } - public static function KEYSWRITE(): Scopes - { - if (!isset(self::$KEYSWRITE)) { - self::$KEYSWRITE = new Scopes('keys.write'); - } - return self::$KEYSWRITE; - } - public static function PLATFORMSREAD(): Scopes - { - if (!isset(self::$PLATFORMSREAD)) { - self::$PLATFORMSREAD = new Scopes('platforms.read'); - } - return self::$PLATFORMSREAD; - } - public static function PLATFORMSWRITE(): Scopes - { - if (!isset(self::$PLATFORMSWRITE)) { - self::$PLATFORMSWRITE = new Scopes('platforms.write'); - } - return self::$PLATFORMSWRITE; - } - public static function MOCKSREAD(): Scopes - { - if (!isset(self::$MOCKSREAD)) { - self::$MOCKSREAD = new Scopes('mocks.read'); - } - return self::$MOCKSREAD; - } - public static function MOCKSWRITE(): Scopes - { - if (!isset(self::$MOCKSWRITE)) { - self::$MOCKSWRITE = new Scopes('mocks.write'); - } - return self::$MOCKSWRITE; - } - public static function POLICIESREAD(): Scopes - { - if (!isset(self::$POLICIESREAD)) { - self::$POLICIESREAD = new Scopes('policies.read'); - } - return self::$POLICIESREAD; - } - public static function POLICIESWRITE(): Scopes - { - if (!isset(self::$POLICIESWRITE)) { - self::$POLICIESWRITE = new Scopes('policies.write'); - } - return self::$POLICIESWRITE; - } - public static function PROJECTPOLICIESREAD(): Scopes - { - if (!isset(self::$PROJECTPOLICIESREAD)) { - self::$PROJECTPOLICIESREAD = new Scopes('project.policies.read'); - } - return self::$PROJECTPOLICIESREAD; - } - public static function PROJECTPOLICIESWRITE(): Scopes - { - if (!isset(self::$PROJECTPOLICIESWRITE)) { - self::$PROJECTPOLICIESWRITE = new Scopes('project.policies.write'); - } - return self::$PROJECTPOLICIESWRITE; - } - public static function TEMPLATESREAD(): Scopes - { - if (!isset(self::$TEMPLATESREAD)) { - self::$TEMPLATESREAD = new Scopes('templates.read'); - } - return self::$TEMPLATESREAD; - } - public static function TEMPLATESWRITE(): Scopes - { - if (!isset(self::$TEMPLATESWRITE)) { - self::$TEMPLATESWRITE = new Scopes('templates.write'); - } - return self::$TEMPLATESWRITE; - } - public static function OAUTH2READ(): Scopes - { - if (!isset(self::$OAUTH2READ)) { - self::$OAUTH2READ = new Scopes('oauth2.read'); - } - return self::$OAUTH2READ; - } - public static function OAUTH2WRITE(): Scopes - { - if (!isset(self::$OAUTH2WRITE)) { - self::$OAUTH2WRITE = new Scopes('oauth2.write'); - } - return self::$OAUTH2WRITE; - } - public static function USERSREAD(): Scopes - { - if (!isset(self::$USERSREAD)) { - self::$USERSREAD = new Scopes('users.read'); - } - return self::$USERSREAD; - } - public static function USERSWRITE(): Scopes - { - if (!isset(self::$USERSWRITE)) { - self::$USERSWRITE = new Scopes('users.write'); - } - return self::$USERSWRITE; - } - public static function SESSIONSREAD(): Scopes - { - if (!isset(self::$SESSIONSREAD)) { - self::$SESSIONSREAD = new Scopes('sessions.read'); - } - return self::$SESSIONSREAD; - } - public static function SESSIONSWRITE(): Scopes - { - if (!isset(self::$SESSIONSWRITE)) { - self::$SESSIONSWRITE = new Scopes('sessions.write'); - } - return self::$SESSIONSWRITE; - } - public static function TEAMSREAD(): Scopes - { - if (!isset(self::$TEAMSREAD)) { - self::$TEAMSREAD = new Scopes('teams.read'); - } - return self::$TEAMSREAD; - } - public static function TEAMSWRITE(): Scopes - { - if (!isset(self::$TEAMSWRITE)) { - self::$TEAMSWRITE = new Scopes('teams.write'); - } - return self::$TEAMSWRITE; - } - public static function DATABASESREAD(): Scopes - { - if (!isset(self::$DATABASESREAD)) { - self::$DATABASESREAD = new Scopes('databases.read'); - } - return self::$DATABASESREAD; - } - public static function DATABASESWRITE(): Scopes - { - if (!isset(self::$DATABASESWRITE)) { - self::$DATABASESWRITE = new Scopes('databases.write'); - } - return self::$DATABASESWRITE; - } - public static function TABLESREAD(): Scopes - { - if (!isset(self::$TABLESREAD)) { - self::$TABLESREAD = new Scopes('tables.read'); - } - return self::$TABLESREAD; - } - public static function TABLESWRITE(): Scopes - { - if (!isset(self::$TABLESWRITE)) { - self::$TABLESWRITE = new Scopes('tables.write'); - } - return self::$TABLESWRITE; - } - public static function COLUMNSREAD(): Scopes - { - if (!isset(self::$COLUMNSREAD)) { - self::$COLUMNSREAD = new Scopes('columns.read'); - } - return self::$COLUMNSREAD; - } - public static function COLUMNSWRITE(): Scopes - { - if (!isset(self::$COLUMNSWRITE)) { - self::$COLUMNSWRITE = new Scopes('columns.write'); - } - return self::$COLUMNSWRITE; - } - public static function INDEXESREAD(): Scopes - { - if (!isset(self::$INDEXESREAD)) { - self::$INDEXESREAD = new Scopes('indexes.read'); - } - return self::$INDEXESREAD; - } - public static function INDEXESWRITE(): Scopes - { - if (!isset(self::$INDEXESWRITE)) { - self::$INDEXESWRITE = new Scopes('indexes.write'); - } - return self::$INDEXESWRITE; - } - public static function ROWSREAD(): Scopes - { - if (!isset(self::$ROWSREAD)) { - self::$ROWSREAD = new Scopes('rows.read'); - } - return self::$ROWSREAD; - } - public static function ROWSWRITE(): Scopes - { - if (!isset(self::$ROWSWRITE)) { - self::$ROWSWRITE = new Scopes('rows.write'); - } - return self::$ROWSWRITE; - } - public static function COLLECTIONSREAD(): Scopes - { - if (!isset(self::$COLLECTIONSREAD)) { - self::$COLLECTIONSREAD = new Scopes('collections.read'); - } - return self::$COLLECTIONSREAD; - } - public static function COLLECTIONSWRITE(): Scopes - { - if (!isset(self::$COLLECTIONSWRITE)) { - self::$COLLECTIONSWRITE = new Scopes('collections.write'); - } - return self::$COLLECTIONSWRITE; - } - public static function ATTRIBUTESREAD(): Scopes - { - if (!isset(self::$ATTRIBUTESREAD)) { - self::$ATTRIBUTESREAD = new Scopes('attributes.read'); - } - return self::$ATTRIBUTESREAD; - } - public static function ATTRIBUTESWRITE(): Scopes - { - if (!isset(self::$ATTRIBUTESWRITE)) { - self::$ATTRIBUTESWRITE = new Scopes('attributes.write'); - } - return self::$ATTRIBUTESWRITE; - } - public static function DOCUMENTSREAD(): Scopes - { - if (!isset(self::$DOCUMENTSREAD)) { - self::$DOCUMENTSREAD = new Scopes('documents.read'); - } - return self::$DOCUMENTSREAD; - } - public static function DOCUMENTSWRITE(): Scopes - { - if (!isset(self::$DOCUMENTSWRITE)) { - self::$DOCUMENTSWRITE = new Scopes('documents.write'); - } - return self::$DOCUMENTSWRITE; - } - public static function BUCKETSREAD(): Scopes - { - if (!isset(self::$BUCKETSREAD)) { - self::$BUCKETSREAD = new Scopes('buckets.read'); - } - return self::$BUCKETSREAD; - } - public static function BUCKETSWRITE(): Scopes - { - if (!isset(self::$BUCKETSWRITE)) { - self::$BUCKETSWRITE = new Scopes('buckets.write'); - } - return self::$BUCKETSWRITE; - } - public static function FILESREAD(): Scopes - { - if (!isset(self::$FILESREAD)) { - self::$FILESREAD = new Scopes('files.read'); - } - return self::$FILESREAD; - } - public static function FILESWRITE(): Scopes - { - if (!isset(self::$FILESWRITE)) { - self::$FILESWRITE = new Scopes('files.write'); - } - return self::$FILESWRITE; - } - public static function TOKENSREAD(): Scopes - { - if (!isset(self::$TOKENSREAD)) { - self::$TOKENSREAD = new Scopes('tokens.read'); - } - return self::$TOKENSREAD; - } - public static function TOKENSWRITE(): Scopes - { - if (!isset(self::$TOKENSWRITE)) { - self::$TOKENSWRITE = new Scopes('tokens.write'); - } - return self::$TOKENSWRITE; - } - public static function FUNCTIONSREAD(): Scopes - { - if (!isset(self::$FUNCTIONSREAD)) { - self::$FUNCTIONSREAD = new Scopes('functions.read'); - } - return self::$FUNCTIONSREAD; - } - public static function FUNCTIONSWRITE(): Scopes - { - if (!isset(self::$FUNCTIONSWRITE)) { - self::$FUNCTIONSWRITE = new Scopes('functions.write'); - } - return self::$FUNCTIONSWRITE; - } - public static function EXECUTIONSREAD(): Scopes - { - if (!isset(self::$EXECUTIONSREAD)) { - self::$EXECUTIONSREAD = new Scopes('executions.read'); - } - return self::$EXECUTIONSREAD; - } - public static function EXECUTIONSWRITE(): Scopes - { - if (!isset(self::$EXECUTIONSWRITE)) { - self::$EXECUTIONSWRITE = new Scopes('executions.write'); - } - return self::$EXECUTIONSWRITE; - } - public static function EXECUTIONREAD(): Scopes - { - if (!isset(self::$EXECUTIONREAD)) { - self::$EXECUTIONREAD = new Scopes('execution.read'); - } - return self::$EXECUTIONREAD; - } - public static function EXECUTIONWRITE(): Scopes - { - if (!isset(self::$EXECUTIONWRITE)) { - self::$EXECUTIONWRITE = new Scopes('execution.write'); - } - return self::$EXECUTIONWRITE; - } - public static function SITESREAD(): Scopes - { - if (!isset(self::$SITESREAD)) { - self::$SITESREAD = new Scopes('sites.read'); - } - return self::$SITESREAD; - } - public static function SITESWRITE(): Scopes - { - if (!isset(self::$SITESWRITE)) { - self::$SITESWRITE = new Scopes('sites.write'); - } - return self::$SITESWRITE; - } - public static function LOGREAD(): Scopes - { - if (!isset(self::$LOGREAD)) { - self::$LOGREAD = new Scopes('log.read'); - } - return self::$LOGREAD; - } - public static function LOGWRITE(): Scopes - { - if (!isset(self::$LOGWRITE)) { - self::$LOGWRITE = new Scopes('log.write'); - } - return self::$LOGWRITE; - } - public static function PROVIDERSREAD(): Scopes - { - if (!isset(self::$PROVIDERSREAD)) { - self::$PROVIDERSREAD = new Scopes('providers.read'); - } - return self::$PROVIDERSREAD; - } - public static function PROVIDERSWRITE(): Scopes - { - if (!isset(self::$PROVIDERSWRITE)) { - self::$PROVIDERSWRITE = new Scopes('providers.write'); - } - return self::$PROVIDERSWRITE; - } - public static function TOPICSREAD(): Scopes - { - if (!isset(self::$TOPICSREAD)) { - self::$TOPICSREAD = new Scopes('topics.read'); - } - return self::$TOPICSREAD; - } - public static function TOPICSWRITE(): Scopes - { - if (!isset(self::$TOPICSWRITE)) { - self::$TOPICSWRITE = new Scopes('topics.write'); - } - return self::$TOPICSWRITE; - } - public static function SUBSCRIBERSREAD(): Scopes - { - if (!isset(self::$SUBSCRIBERSREAD)) { - self::$SUBSCRIBERSREAD = new Scopes('subscribers.read'); - } - return self::$SUBSCRIBERSREAD; - } - public static function SUBSCRIBERSWRITE(): Scopes - { - if (!isset(self::$SUBSCRIBERSWRITE)) { - self::$SUBSCRIBERSWRITE = new Scopes('subscribers.write'); - } - return self::$SUBSCRIBERSWRITE; - } - public static function TARGETSREAD(): Scopes - { - if (!isset(self::$TARGETSREAD)) { - self::$TARGETSREAD = new Scopes('targets.read'); - } - return self::$TARGETSREAD; - } - public static function TARGETSWRITE(): Scopes - { - if (!isset(self::$TARGETSWRITE)) { - self::$TARGETSWRITE = new Scopes('targets.write'); - } - return self::$TARGETSWRITE; - } - public static function MESSAGESREAD(): Scopes - { - if (!isset(self::$MESSAGESREAD)) { - self::$MESSAGESREAD = new Scopes('messages.read'); - } - return self::$MESSAGESREAD; - } - public static function MESSAGESWRITE(): Scopes - { - if (!isset(self::$MESSAGESWRITE)) { - self::$MESSAGESWRITE = new Scopes('messages.write'); - } - return self::$MESSAGESWRITE; - } - public static function RULESREAD(): Scopes - { - if (!isset(self::$RULESREAD)) { - self::$RULESREAD = new Scopes('rules.read'); - } - return self::$RULESREAD; - } - public static function RULESWRITE(): Scopes - { - if (!isset(self::$RULESWRITE)) { - self::$RULESWRITE = new Scopes('rules.write'); - } - return self::$RULESWRITE; - } - public static function WEBHOOKSREAD(): Scopes - { - if (!isset(self::$WEBHOOKSREAD)) { - self::$WEBHOOKSREAD = new Scopes('webhooks.read'); - } - return self::$WEBHOOKSREAD; - } - public static function WEBHOOKSWRITE(): Scopes - { - if (!isset(self::$WEBHOOKSWRITE)) { - self::$WEBHOOKSWRITE = new Scopes('webhooks.write'); - } - return self::$WEBHOOKSWRITE; - } - public static function LOCALEREAD(): Scopes - { - if (!isset(self::$LOCALEREAD)) { - self::$LOCALEREAD = new Scopes('locale.read'); - } - return self::$LOCALEREAD; - } - public static function AVATARSREAD(): Scopes - { - if (!isset(self::$AVATARSREAD)) { - self::$AVATARSREAD = new Scopes('avatars.read'); - } - return self::$AVATARSREAD; - } - public static function HEALTHREAD(): Scopes - { - if (!isset(self::$HEALTHREAD)) { - self::$HEALTHREAD = new Scopes('health.read'); - } - return self::$HEALTHREAD; - } - public static function ASSISTANTREAD(): Scopes - { - if (!isset(self::$ASSISTANTREAD)) { - self::$ASSISTANTREAD = new Scopes('assistant.read'); - } - return self::$ASSISTANTREAD; - } - public static function MIGRATIONSREAD(): Scopes - { - if (!isset(self::$MIGRATIONSREAD)) { - self::$MIGRATIONSREAD = new Scopes('migrations.read'); - } - return self::$MIGRATIONSREAD; - } - public static function MIGRATIONSWRITE(): Scopes - { - if (!isset(self::$MIGRATIONSWRITE)) { - self::$MIGRATIONSWRITE = new Scopes('migrations.write'); - } - return self::$MIGRATIONSWRITE; - } - public static function SCHEDULESREAD(): Scopes - { - if (!isset(self::$SCHEDULESREAD)) { - self::$SCHEDULESREAD = new Scopes('schedules.read'); - } - return self::$SCHEDULESREAD; - } - public static function SCHEDULESWRITE(): Scopes - { - if (!isset(self::$SCHEDULESWRITE)) { - self::$SCHEDULESWRITE = new Scopes('schedules.write'); - } - return self::$SCHEDULESWRITE; - } - public static function VCSREAD(): Scopes - { - if (!isset(self::$VCSREAD)) { - self::$VCSREAD = new Scopes('vcs.read'); - } - return self::$VCSREAD; - } - public static function VCSWRITE(): Scopes - { - if (!isset(self::$VCSWRITE)) { - self::$VCSWRITE = new Scopes('vcs.write'); - } - return self::$VCSWRITE; - } - public static function INSIGHTSREAD(): Scopes - { - if (!isset(self::$INSIGHTSREAD)) { - self::$INSIGHTSREAD = new Scopes('insights.read'); - } - return self::$INSIGHTSREAD; - } - public static function INSIGHTSWRITE(): Scopes - { - if (!isset(self::$INSIGHTSWRITE)) { - self::$INSIGHTSWRITE = new Scopes('insights.write'); - } - return self::$INSIGHTSWRITE; - } - public static function REPORTSREAD(): Scopes - { - if (!isset(self::$REPORTSREAD)) { - self::$REPORTSREAD = new Scopes('reports.read'); - } - return self::$REPORTSREAD; - } - public static function REPORTSWRITE(): Scopes - { - if (!isset(self::$REPORTSWRITE)) { - self::$REPORTSWRITE = new Scopes('reports.write'); - } - return self::$REPORTSWRITE; - } - public static function PRESENCESREAD(): Scopes - { - if (!isset(self::$PRESENCESREAD)) { - self::$PRESENCESREAD = new Scopes('presences.read'); - } - return self::$PRESENCESREAD; - } - public static function PRESENCESWRITE(): Scopes - { - if (!isset(self::$PRESENCESWRITE)) { - self::$PRESENCESWRITE = new Scopes('presences.write'); - } - return self::$PRESENCESWRITE; - } - public static function BACKUPSPOLICIESREAD(): Scopes - { - if (!isset(self::$BACKUPSPOLICIESREAD)) { - self::$BACKUPSPOLICIESREAD = new Scopes('backups.policies.read'); - } - return self::$BACKUPSPOLICIESREAD; - } - public static function BACKUPSPOLICIESWRITE(): Scopes - { - if (!isset(self::$BACKUPSPOLICIESWRITE)) { - self::$BACKUPSPOLICIESWRITE = new Scopes('backups.policies.write'); - } - return self::$BACKUPSPOLICIESWRITE; - } - public static function ARCHIVESREAD(): Scopes - { - if (!isset(self::$ARCHIVESREAD)) { - self::$ARCHIVESREAD = new Scopes('archives.read'); - } - return self::$ARCHIVESREAD; - } - public static function ARCHIVESWRITE(): Scopes - { - if (!isset(self::$ARCHIVESWRITE)) { - self::$ARCHIVESWRITE = new Scopes('archives.write'); - } - return self::$ARCHIVESWRITE; - } - public static function RESTORATIONSREAD(): Scopes - { - if (!isset(self::$RESTORATIONSREAD)) { - self::$RESTORATIONSREAD = new Scopes('restorations.read'); - } - return self::$RESTORATIONSREAD; - } - public static function RESTORATIONSWRITE(): Scopes - { - if (!isset(self::$RESTORATIONSWRITE)) { - self::$RESTORATIONSWRITE = new Scopes('restorations.write'); - } - return self::$RESTORATIONSWRITE; - } - public static function DOMAINSREAD(): Scopes - { - if (!isset(self::$DOMAINSREAD)) { - self::$DOMAINSREAD = new Scopes('domains.read'); - } - return self::$DOMAINSREAD; - } - public static function DOMAINSWRITE(): Scopes - { - if (!isset(self::$DOMAINSWRITE)) { - self::$DOMAINSWRITE = new Scopes('domains.write'); - } - return self::$DOMAINSWRITE; - } - public static function EVENTSREAD(): Scopes - { - if (!isset(self::$EVENTSREAD)) { - self::$EVENTSREAD = new Scopes('events.read'); - } - return self::$EVENTSREAD; - } - public static function USAGEREAD(): Scopes - { - if (!isset(self::$USAGEREAD)) { - self::$USAGEREAD = new Scopes('usage.read'); - } - return self::$USAGEREAD; - } - - public static function from(string $value): self - { - return match ($value) { - 'project.read' => self::PROJECTREAD(), - 'project.write' => self::PROJECTWRITE(), - 'keys.read' => self::KEYSREAD(), - 'keys.write' => self::KEYSWRITE(), - 'platforms.read' => self::PLATFORMSREAD(), - 'platforms.write' => self::PLATFORMSWRITE(), - 'mocks.read' => self::MOCKSREAD(), - 'mocks.write' => self::MOCKSWRITE(), - 'policies.read' => self::POLICIESREAD(), - 'policies.write' => self::POLICIESWRITE(), - 'project.policies.read' => self::PROJECTPOLICIESREAD(), - 'project.policies.write' => self::PROJECTPOLICIESWRITE(), - 'templates.read' => self::TEMPLATESREAD(), - 'templates.write' => self::TEMPLATESWRITE(), - 'oauth2.read' => self::OAUTH2READ(), - 'oauth2.write' => self::OAUTH2WRITE(), - 'users.read' => self::USERSREAD(), - 'users.write' => self::USERSWRITE(), - 'sessions.read' => self::SESSIONSREAD(), - 'sessions.write' => self::SESSIONSWRITE(), - 'teams.read' => self::TEAMSREAD(), - 'teams.write' => self::TEAMSWRITE(), - 'databases.read' => self::DATABASESREAD(), - 'databases.write' => self::DATABASESWRITE(), - 'tables.read' => self::TABLESREAD(), - 'tables.write' => self::TABLESWRITE(), - 'columns.read' => self::COLUMNSREAD(), - 'columns.write' => self::COLUMNSWRITE(), - 'indexes.read' => self::INDEXESREAD(), - 'indexes.write' => self::INDEXESWRITE(), - 'rows.read' => self::ROWSREAD(), - 'rows.write' => self::ROWSWRITE(), - 'collections.read' => self::COLLECTIONSREAD(), - 'collections.write' => self::COLLECTIONSWRITE(), - 'attributes.read' => self::ATTRIBUTESREAD(), - 'attributes.write' => self::ATTRIBUTESWRITE(), - 'documents.read' => self::DOCUMENTSREAD(), - 'documents.write' => self::DOCUMENTSWRITE(), - 'buckets.read' => self::BUCKETSREAD(), - 'buckets.write' => self::BUCKETSWRITE(), - 'files.read' => self::FILESREAD(), - 'files.write' => self::FILESWRITE(), - 'tokens.read' => self::TOKENSREAD(), - 'tokens.write' => self::TOKENSWRITE(), - 'functions.read' => self::FUNCTIONSREAD(), - 'functions.write' => self::FUNCTIONSWRITE(), - 'executions.read' => self::EXECUTIONSREAD(), - 'executions.write' => self::EXECUTIONSWRITE(), - 'execution.read' => self::EXECUTIONREAD(), - 'execution.write' => self::EXECUTIONWRITE(), - 'sites.read' => self::SITESREAD(), - 'sites.write' => self::SITESWRITE(), - 'log.read' => self::LOGREAD(), - 'log.write' => self::LOGWRITE(), - 'providers.read' => self::PROVIDERSREAD(), - 'providers.write' => self::PROVIDERSWRITE(), - 'topics.read' => self::TOPICSREAD(), - 'topics.write' => self::TOPICSWRITE(), - 'subscribers.read' => self::SUBSCRIBERSREAD(), - 'subscribers.write' => self::SUBSCRIBERSWRITE(), - 'targets.read' => self::TARGETSREAD(), - 'targets.write' => self::TARGETSWRITE(), - 'messages.read' => self::MESSAGESREAD(), - 'messages.write' => self::MESSAGESWRITE(), - 'rules.read' => self::RULESREAD(), - 'rules.write' => self::RULESWRITE(), - 'webhooks.read' => self::WEBHOOKSREAD(), - 'webhooks.write' => self::WEBHOOKSWRITE(), - 'locale.read' => self::LOCALEREAD(), - 'avatars.read' => self::AVATARSREAD(), - 'health.read' => self::HEALTHREAD(), - 'assistant.read' => self::ASSISTANTREAD(), - 'migrations.read' => self::MIGRATIONSREAD(), - 'migrations.write' => self::MIGRATIONSWRITE(), - 'schedules.read' => self::SCHEDULESREAD(), - 'schedules.write' => self::SCHEDULESWRITE(), - 'vcs.read' => self::VCSREAD(), - 'vcs.write' => self::VCSWRITE(), - 'insights.read' => self::INSIGHTSREAD(), - 'insights.write' => self::INSIGHTSWRITE(), - 'reports.read' => self::REPORTSREAD(), - 'reports.write' => self::REPORTSWRITE(), - 'presences.read' => self::PRESENCESREAD(), - 'presences.write' => self::PRESENCESWRITE(), - 'backups.policies.read' => self::BACKUPSPOLICIESREAD(), - 'backups.policies.write' => self::BACKUPSPOLICIESWRITE(), - 'archives.read' => self::ARCHIVESREAD(), - 'archives.write' => self::ARCHIVESWRITE(), - 'restorations.read' => self::RESTORATIONSREAD(), - 'restorations.write' => self::RESTORATIONSWRITE(), - 'domains.read' => self::DOMAINSREAD(), - 'domains.write' => self::DOMAINSWRITE(), - 'events.read' => self::EVENTSREAD(), - 'usage.read' => self::USAGEREAD(), - default => throw new \InvalidArgumentException('Unknown Scopes value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/Adapter.php b/src/Appwrite/Enums/SiteAdapter.php similarity index 68% rename from src/Appwrite/Enums/Adapter.php rename to src/Appwrite/Enums/SiteAdapter.php index b9be67f0..1408c41e 100644 --- a/src/Appwrite/Enums/Adapter.php +++ b/src/Appwrite/Enums/SiteAdapter.php @@ -4,10 +4,10 @@ use JsonSerializable; -class Adapter implements JsonSerializable +class SiteAdapter implements JsonSerializable { - private static Adapter $STATIC; - private static Adapter $SSR; + private static SiteAdapter $STATIC; + private static SiteAdapter $SSR; private string $value; @@ -26,17 +26,17 @@ public function jsonSerialize(): string return $this->value; } - public static function STATIC(): Adapter + public static function STATIC(): SiteAdapter { if (!isset(self::$STATIC)) { - self::$STATIC = new Adapter('static'); + self::$STATIC = new SiteAdapter('static'); } return self::$STATIC; } - public static function SSR(): Adapter + public static function SSR(): SiteAdapter { if (!isset(self::$SSR)) { - self::$SSR = new Adapter('ssr'); + self::$SSR = new SiteAdapter('ssr'); } return self::$SSR; } @@ -46,7 +46,7 @@ public static function from(string $value): self return match ($value) { 'static' => self::STATIC(), 'ssr' => self::SSR(), - default => throw new \InvalidArgumentException('Unknown Adapter value: ' . $value), + default => throw new \InvalidArgumentException('Unknown SiteAdapter value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/SiteBuildRuntime.php b/src/Appwrite/Enums/SiteBuildRuntime.php new file mode 100644 index 00000000..217834df --- /dev/null +++ b/src/Appwrite/Enums/SiteBuildRuntime.php @@ -0,0 +1,880 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NODE145(): SiteBuildRuntime + { + if (!isset(self::$NODE145)) { + self::$NODE145 = new SiteBuildRuntime('node-14.5'); + } + return self::$NODE145; + } + public static function NODE160(): SiteBuildRuntime + { + if (!isset(self::$NODE160)) { + self::$NODE160 = new SiteBuildRuntime('node-16.0'); + } + return self::$NODE160; + } + public static function NODE180(): SiteBuildRuntime + { + if (!isset(self::$NODE180)) { + self::$NODE180 = new SiteBuildRuntime('node-18.0'); + } + return self::$NODE180; + } + public static function NODE190(): SiteBuildRuntime + { + if (!isset(self::$NODE190)) { + self::$NODE190 = new SiteBuildRuntime('node-19.0'); + } + return self::$NODE190; + } + public static function NODE200(): SiteBuildRuntime + { + if (!isset(self::$NODE200)) { + self::$NODE200 = new SiteBuildRuntime('node-20.0'); + } + return self::$NODE200; + } + public static function NODE210(): SiteBuildRuntime + { + if (!isset(self::$NODE210)) { + self::$NODE210 = new SiteBuildRuntime('node-21.0'); + } + return self::$NODE210; + } + public static function NODE22(): SiteBuildRuntime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new SiteBuildRuntime('node-22'); + } + return self::$NODE22; + } + public static function NODE23(): SiteBuildRuntime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new SiteBuildRuntime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): SiteBuildRuntime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new SiteBuildRuntime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): SiteBuildRuntime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new SiteBuildRuntime('node-25'); + } + return self::$NODE25; + } + public static function PHP80(): SiteBuildRuntime + { + if (!isset(self::$PHP80)) { + self::$PHP80 = new SiteBuildRuntime('php-8.0'); + } + return self::$PHP80; + } + public static function PHP81(): SiteBuildRuntime + { + if (!isset(self::$PHP81)) { + self::$PHP81 = new SiteBuildRuntime('php-8.1'); + } + return self::$PHP81; + } + public static function PHP82(): SiteBuildRuntime + { + if (!isset(self::$PHP82)) { + self::$PHP82 = new SiteBuildRuntime('php-8.2'); + } + return self::$PHP82; + } + public static function PHP83(): SiteBuildRuntime + { + if (!isset(self::$PHP83)) { + self::$PHP83 = new SiteBuildRuntime('php-8.3'); + } + return self::$PHP83; + } + public static function PHP84(): SiteBuildRuntime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new SiteBuildRuntime('php-8.4'); + } + return self::$PHP84; + } + public static function RUBY30(): SiteBuildRuntime + { + if (!isset(self::$RUBY30)) { + self::$RUBY30 = new SiteBuildRuntime('ruby-3.0'); + } + return self::$RUBY30; + } + public static function RUBY31(): SiteBuildRuntime + { + if (!isset(self::$RUBY31)) { + self::$RUBY31 = new SiteBuildRuntime('ruby-3.1'); + } + return self::$RUBY31; + } + public static function RUBY32(): SiteBuildRuntime + { + if (!isset(self::$RUBY32)) { + self::$RUBY32 = new SiteBuildRuntime('ruby-3.2'); + } + return self::$RUBY32; + } + public static function RUBY33(): SiteBuildRuntime + { + if (!isset(self::$RUBY33)) { + self::$RUBY33 = new SiteBuildRuntime('ruby-3.3'); + } + return self::$RUBY33; + } + public static function RUBY34(): SiteBuildRuntime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new SiteBuildRuntime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): SiteBuildRuntime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new SiteBuildRuntime('ruby-4.0'); + } + return self::$RUBY40; + } + public static function PYTHON38(): SiteBuildRuntime + { + if (!isset(self::$PYTHON38)) { + self::$PYTHON38 = new SiteBuildRuntime('python-3.8'); + } + return self::$PYTHON38; + } + public static function PYTHON39(): SiteBuildRuntime + { + if (!isset(self::$PYTHON39)) { + self::$PYTHON39 = new SiteBuildRuntime('python-3.9'); + } + return self::$PYTHON39; + } + public static function PYTHON310(): SiteBuildRuntime + { + if (!isset(self::$PYTHON310)) { + self::$PYTHON310 = new SiteBuildRuntime('python-3.10'); + } + return self::$PYTHON310; + } + public static function PYTHON311(): SiteBuildRuntime + { + if (!isset(self::$PYTHON311)) { + self::$PYTHON311 = new SiteBuildRuntime('python-3.11'); + } + return self::$PYTHON311; + } + public static function PYTHON312(): SiteBuildRuntime + { + if (!isset(self::$PYTHON312)) { + self::$PYTHON312 = new SiteBuildRuntime('python-3.12'); + } + return self::$PYTHON312; + } + public static function PYTHON313(): SiteBuildRuntime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new SiteBuildRuntime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): SiteBuildRuntime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new SiteBuildRuntime('python-3.14'); + } + return self::$PYTHON314; + } + public static function PYTHONML311(): SiteBuildRuntime + { + if (!isset(self::$PYTHONML311)) { + self::$PYTHONML311 = new SiteBuildRuntime('python-ml-3.11'); + } + return self::$PYTHONML311; + } + public static function PYTHONML312(): SiteBuildRuntime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new SiteBuildRuntime('python-ml-3.12'); + } + return self::$PYTHONML312; + } + public static function PYTHONML313(): SiteBuildRuntime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new SiteBuildRuntime('python-ml-3.13'); + } + return self::$PYTHONML313; + } + public static function DENO121(): SiteBuildRuntime + { + if (!isset(self::$DENO121)) { + self::$DENO121 = new SiteBuildRuntime('deno-1.21'); + } + return self::$DENO121; + } + public static function DENO124(): SiteBuildRuntime + { + if (!isset(self::$DENO124)) { + self::$DENO124 = new SiteBuildRuntime('deno-1.24'); + } + return self::$DENO124; + } + public static function DENO135(): SiteBuildRuntime + { + if (!isset(self::$DENO135)) { + self::$DENO135 = new SiteBuildRuntime('deno-1.35'); + } + return self::$DENO135; + } + public static function DENO140(): SiteBuildRuntime + { + if (!isset(self::$DENO140)) { + self::$DENO140 = new SiteBuildRuntime('deno-1.40'); + } + return self::$DENO140; + } + public static function DENO146(): SiteBuildRuntime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new SiteBuildRuntime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): SiteBuildRuntime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new SiteBuildRuntime('deno-2.0'); + } + return self::$DENO20; + } + public static function DENO25(): SiteBuildRuntime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new SiteBuildRuntime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): SiteBuildRuntime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new SiteBuildRuntime('deno-2.6'); + } + return self::$DENO26; + } + public static function DART215(): SiteBuildRuntime + { + if (!isset(self::$DART215)) { + self::$DART215 = new SiteBuildRuntime('dart-2.15'); + } + return self::$DART215; + } + public static function DART216(): SiteBuildRuntime + { + if (!isset(self::$DART216)) { + self::$DART216 = new SiteBuildRuntime('dart-2.16'); + } + return self::$DART216; + } + public static function DART217(): SiteBuildRuntime + { + if (!isset(self::$DART217)) { + self::$DART217 = new SiteBuildRuntime('dart-2.17'); + } + return self::$DART217; + } + public static function DART218(): SiteBuildRuntime + { + if (!isset(self::$DART218)) { + self::$DART218 = new SiteBuildRuntime('dart-2.18'); + } + return self::$DART218; + } + public static function DART219(): SiteBuildRuntime + { + if (!isset(self::$DART219)) { + self::$DART219 = new SiteBuildRuntime('dart-2.19'); + } + return self::$DART219; + } + public static function DART30(): SiteBuildRuntime + { + if (!isset(self::$DART30)) { + self::$DART30 = new SiteBuildRuntime('dart-3.0'); + } + return self::$DART30; + } + public static function DART31(): SiteBuildRuntime + { + if (!isset(self::$DART31)) { + self::$DART31 = new SiteBuildRuntime('dart-3.1'); + } + return self::$DART31; + } + public static function DART33(): SiteBuildRuntime + { + if (!isset(self::$DART33)) { + self::$DART33 = new SiteBuildRuntime('dart-3.3'); + } + return self::$DART33; + } + public static function DART35(): SiteBuildRuntime + { + if (!isset(self::$DART35)) { + self::$DART35 = new SiteBuildRuntime('dart-3.5'); + } + return self::$DART35; + } + public static function DART38(): SiteBuildRuntime + { + if (!isset(self::$DART38)) { + self::$DART38 = new SiteBuildRuntime('dart-3.8'); + } + return self::$DART38; + } + public static function DART39(): SiteBuildRuntime + { + if (!isset(self::$DART39)) { + self::$DART39 = new SiteBuildRuntime('dart-3.9'); + } + return self::$DART39; + } + public static function DART310(): SiteBuildRuntime + { + if (!isset(self::$DART310)) { + self::$DART310 = new SiteBuildRuntime('dart-3.10'); + } + return self::$DART310; + } + public static function DART311(): SiteBuildRuntime + { + if (!isset(self::$DART311)) { + self::$DART311 = new SiteBuildRuntime('dart-3.11'); + } + return self::$DART311; + } + public static function DART312(): SiteBuildRuntime + { + if (!isset(self::$DART312)) { + self::$DART312 = new SiteBuildRuntime('dart-3.12'); + } + return self::$DART312; + } + public static function DOTNET60(): SiteBuildRuntime + { + if (!isset(self::$DOTNET60)) { + self::$DOTNET60 = new SiteBuildRuntime('dotnet-6.0'); + } + return self::$DOTNET60; + } + public static function DOTNET70(): SiteBuildRuntime + { + if (!isset(self::$DOTNET70)) { + self::$DOTNET70 = new SiteBuildRuntime('dotnet-7.0'); + } + return self::$DOTNET70; + } + public static function DOTNET80(): SiteBuildRuntime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new SiteBuildRuntime('dotnet-8.0'); + } + return self::$DOTNET80; + } + public static function DOTNET10(): SiteBuildRuntime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new SiteBuildRuntime('dotnet-10'); + } + return self::$DOTNET10; + } + public static function JAVA80(): SiteBuildRuntime + { + if (!isset(self::$JAVA80)) { + self::$JAVA80 = new SiteBuildRuntime('java-8.0'); + } + return self::$JAVA80; + } + public static function JAVA110(): SiteBuildRuntime + { + if (!isset(self::$JAVA110)) { + self::$JAVA110 = new SiteBuildRuntime('java-11.0'); + } + return self::$JAVA110; + } + public static function JAVA170(): SiteBuildRuntime + { + if (!isset(self::$JAVA170)) { + self::$JAVA170 = new SiteBuildRuntime('java-17.0'); + } + return self::$JAVA170; + } + public static function JAVA180(): SiteBuildRuntime + { + if (!isset(self::$JAVA180)) { + self::$JAVA180 = new SiteBuildRuntime('java-18.0'); + } + return self::$JAVA180; + } + public static function JAVA210(): SiteBuildRuntime + { + if (!isset(self::$JAVA210)) { + self::$JAVA210 = new SiteBuildRuntime('java-21.0'); + } + return self::$JAVA210; + } + public static function JAVA22(): SiteBuildRuntime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new SiteBuildRuntime('java-22'); + } + return self::$JAVA22; + } + public static function JAVA25(): SiteBuildRuntime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new SiteBuildRuntime('java-25'); + } + return self::$JAVA25; + } + public static function SWIFT55(): SiteBuildRuntime + { + if (!isset(self::$SWIFT55)) { + self::$SWIFT55 = new SiteBuildRuntime('swift-5.5'); + } + return self::$SWIFT55; + } + public static function SWIFT58(): SiteBuildRuntime + { + if (!isset(self::$SWIFT58)) { + self::$SWIFT58 = new SiteBuildRuntime('swift-5.8'); + } + return self::$SWIFT58; + } + public static function SWIFT59(): SiteBuildRuntime + { + if (!isset(self::$SWIFT59)) { + self::$SWIFT59 = new SiteBuildRuntime('swift-5.9'); + } + return self::$SWIFT59; + } + public static function SWIFT510(): SiteBuildRuntime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new SiteBuildRuntime('swift-5.10'); + } + return self::$SWIFT510; + } + public static function SWIFT62(): SiteBuildRuntime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new SiteBuildRuntime('swift-6.2'); + } + return self::$SWIFT62; + } + public static function KOTLIN16(): SiteBuildRuntime + { + if (!isset(self::$KOTLIN16)) { + self::$KOTLIN16 = new SiteBuildRuntime('kotlin-1.6'); + } + return self::$KOTLIN16; + } + public static function KOTLIN18(): SiteBuildRuntime + { + if (!isset(self::$KOTLIN18)) { + self::$KOTLIN18 = new SiteBuildRuntime('kotlin-1.8'); + } + return self::$KOTLIN18; + } + public static function KOTLIN19(): SiteBuildRuntime + { + if (!isset(self::$KOTLIN19)) { + self::$KOTLIN19 = new SiteBuildRuntime('kotlin-1.9'); + } + return self::$KOTLIN19; + } + public static function KOTLIN20(): SiteBuildRuntime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new SiteBuildRuntime('kotlin-2.0'); + } + return self::$KOTLIN20; + } + public static function KOTLIN23(): SiteBuildRuntime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new SiteBuildRuntime('kotlin-2.3'); + } + return self::$KOTLIN23; + } + public static function CPP17(): SiteBuildRuntime + { + if (!isset(self::$CPP17)) { + self::$CPP17 = new SiteBuildRuntime('cpp-17'); + } + return self::$CPP17; + } + public static function CPP20(): SiteBuildRuntime + { + if (!isset(self::$CPP20)) { + self::$CPP20 = new SiteBuildRuntime('cpp-20'); + } + return self::$CPP20; + } + public static function BUN10(): SiteBuildRuntime + { + if (!isset(self::$BUN10)) { + self::$BUN10 = new SiteBuildRuntime('bun-1.0'); + } + return self::$BUN10; + } + public static function BUN11(): SiteBuildRuntime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new SiteBuildRuntime('bun-1.1'); + } + return self::$BUN11; + } + public static function BUN12(): SiteBuildRuntime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new SiteBuildRuntime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): SiteBuildRuntime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new SiteBuildRuntime('bun-1.3'); + } + return self::$BUN13; + } + public static function GO123(): SiteBuildRuntime + { + if (!isset(self::$GO123)) { + self::$GO123 = new SiteBuildRuntime('go-1.23'); + } + return self::$GO123; + } + public static function GO124(): SiteBuildRuntime + { + if (!isset(self::$GO124)) { + self::$GO124 = new SiteBuildRuntime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): SiteBuildRuntime + { + if (!isset(self::$GO125)) { + self::$GO125 = new SiteBuildRuntime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): SiteBuildRuntime + { + if (!isset(self::$GO126)) { + self::$GO126 = new SiteBuildRuntime('go-1.26'); + } + return self::$GO126; + } + public static function RUST183(): SiteBuildRuntime + { + if (!isset(self::$RUST183)) { + self::$RUST183 = new SiteBuildRuntime('rust-1.83'); + } + return self::$RUST183; + } + public static function STATIC1(): SiteBuildRuntime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new SiteBuildRuntime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new SiteBuildRuntime('flutter-3.24'); + } + return self::$FLUTTER324; + } + public static function FLUTTER327(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new SiteBuildRuntime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new SiteBuildRuntime('flutter-3.29'); + } + return self::$FLUTTER329; + } + public static function FLUTTER332(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER332)) { + self::$FLUTTER332 = new SiteBuildRuntime('flutter-3.32'); + } + return self::$FLUTTER332; + } + public static function FLUTTER335(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER335)) { + self::$FLUTTER335 = new SiteBuildRuntime('flutter-3.35'); + } + return self::$FLUTTER335; + } + public static function FLUTTER338(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER338)) { + self::$FLUTTER338 = new SiteBuildRuntime('flutter-3.38'); + } + return self::$FLUTTER338; + } + public static function FLUTTER341(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER341)) { + self::$FLUTTER341 = new SiteBuildRuntime('flutter-3.41'); + } + return self::$FLUTTER341; + } + public static function FLUTTER344(): SiteBuildRuntime + { + if (!isset(self::$FLUTTER344)) { + self::$FLUTTER344 = new SiteBuildRuntime('flutter-3.44'); + } + return self::$FLUTTER344; + } + + public static function from(string $value): self + { + return match ($value) { + 'node-14.5' => self::NODE145(), + 'node-16.0' => self::NODE160(), + 'node-18.0' => self::NODE180(), + 'node-19.0' => self::NODE190(), + 'node-20.0' => self::NODE200(), + 'node-21.0' => self::NODE210(), + 'node-22' => self::NODE22(), + 'node-23' => self::NODE23(), + 'node-24' => self::NODE24(), + 'node-25' => self::NODE25(), + 'php-8.0' => self::PHP80(), + 'php-8.1' => self::PHP81(), + 'php-8.2' => self::PHP82(), + 'php-8.3' => self::PHP83(), + 'php-8.4' => self::PHP84(), + 'ruby-3.0' => self::RUBY30(), + 'ruby-3.1' => self::RUBY31(), + 'ruby-3.2' => self::RUBY32(), + 'ruby-3.3' => self::RUBY33(), + 'ruby-3.4' => self::RUBY34(), + 'ruby-4.0' => self::RUBY40(), + 'python-3.8' => self::PYTHON38(), + 'python-3.9' => self::PYTHON39(), + 'python-3.10' => self::PYTHON310(), + 'python-3.11' => self::PYTHON311(), + 'python-3.12' => self::PYTHON312(), + 'python-3.13' => self::PYTHON313(), + 'python-3.14' => self::PYTHON314(), + 'python-ml-3.11' => self::PYTHONML311(), + 'python-ml-3.12' => self::PYTHONML312(), + 'python-ml-3.13' => self::PYTHONML313(), + 'deno-1.21' => self::DENO121(), + 'deno-1.24' => self::DENO124(), + 'deno-1.35' => self::DENO135(), + 'deno-1.40' => self::DENO140(), + 'deno-1.46' => self::DENO146(), + 'deno-2.0' => self::DENO20(), + 'deno-2.5' => self::DENO25(), + 'deno-2.6' => self::DENO26(), + 'dart-2.15' => self::DART215(), + 'dart-2.16' => self::DART216(), + 'dart-2.17' => self::DART217(), + 'dart-2.18' => self::DART218(), + 'dart-2.19' => self::DART219(), + 'dart-3.0' => self::DART30(), + 'dart-3.1' => self::DART31(), + 'dart-3.3' => self::DART33(), + 'dart-3.5' => self::DART35(), + 'dart-3.8' => self::DART38(), + 'dart-3.9' => self::DART39(), + 'dart-3.10' => self::DART310(), + 'dart-3.11' => self::DART311(), + 'dart-3.12' => self::DART312(), + 'dotnet-6.0' => self::DOTNET60(), + 'dotnet-7.0' => self::DOTNET70(), + 'dotnet-8.0' => self::DOTNET80(), + 'dotnet-10' => self::DOTNET10(), + 'java-8.0' => self::JAVA80(), + 'java-11.0' => self::JAVA110(), + 'java-17.0' => self::JAVA170(), + 'java-18.0' => self::JAVA180(), + 'java-21.0' => self::JAVA210(), + 'java-22' => self::JAVA22(), + 'java-25' => self::JAVA25(), + 'swift-5.5' => self::SWIFT55(), + 'swift-5.8' => self::SWIFT58(), + 'swift-5.9' => self::SWIFT59(), + 'swift-5.10' => self::SWIFT510(), + 'swift-6.2' => self::SWIFT62(), + 'kotlin-1.6' => self::KOTLIN16(), + 'kotlin-1.8' => self::KOTLIN18(), + 'kotlin-1.9' => self::KOTLIN19(), + 'kotlin-2.0' => self::KOTLIN20(), + 'kotlin-2.3' => self::KOTLIN23(), + 'cpp-17' => self::CPP17(), + 'cpp-20' => self::CPP20(), + 'bun-1.0' => self::BUN10(), + 'bun-1.1' => self::BUN11(), + 'bun-1.2' => self::BUN12(), + 'bun-1.3' => self::BUN13(), + 'go-1.23' => self::GO123(), + 'go-1.24' => self::GO124(), + 'go-1.25' => self::GO125(), + 'go-1.26' => self::GO126(), + 'rust-1.83' => self::RUST183(), + 'static-1' => self::STATIC1(), + 'flutter-3.24' => self::FLUTTER324(), + 'flutter-3.27' => self::FLUTTER327(), + 'flutter-3.29' => self::FLUTTER329(), + 'flutter-3.32' => self::FLUTTER332(), + 'flutter-3.35' => self::FLUTTER335(), + 'flutter-3.38' => self::FLUTTER338(), + 'flutter-3.41' => self::FLUTTER341(), + 'flutter-3.44' => self::FLUTTER344(), + default => throw new \InvalidArgumentException('Unknown SiteBuildRuntime value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/Framework.php b/src/Appwrite/Enums/SiteFramework.php similarity index 51% rename from src/Appwrite/Enums/Framework.php rename to src/Appwrite/Enums/SiteFramework.php index 2dd77c5f..54ed3c98 100644 --- a/src/Appwrite/Enums/Framework.php +++ b/src/Appwrite/Enums/SiteFramework.php @@ -4,23 +4,23 @@ use JsonSerializable; -class Framework implements JsonSerializable +class SiteFramework implements JsonSerializable { - private static Framework $ANALOG; - private static Framework $ANGULAR; - private static Framework $NEXTJS; - private static Framework $REACT; - private static Framework $NUXT; - private static Framework $VUE; - private static Framework $SVELTEKIT; - private static Framework $ASTRO; - private static Framework $TANSTACKSTART; - private static Framework $REMIX; - private static Framework $LYNX; - private static Framework $FLUTTER; - private static Framework $REACTNATIVE; - private static Framework $VITE; - private static Framework $OTHER; + private static SiteFramework $ANALOG; + private static SiteFramework $ANGULAR; + private static SiteFramework $NEXTJS; + private static SiteFramework $REACT; + private static SiteFramework $NUXT; + private static SiteFramework $VUE; + private static SiteFramework $SVELTEKIT; + private static SiteFramework $ASTRO; + private static SiteFramework $TANSTACKSTART; + private static SiteFramework $REMIX; + private static SiteFramework $LYNX; + private static SiteFramework $FLUTTER; + private static SiteFramework $REACTNATIVE; + private static SiteFramework $VITE; + private static SiteFramework $OTHER; private string $value; @@ -39,108 +39,108 @@ public function jsonSerialize(): string return $this->value; } - public static function ANALOG(): Framework + public static function ANALOG(): SiteFramework { if (!isset(self::$ANALOG)) { - self::$ANALOG = new Framework('analog'); + self::$ANALOG = new SiteFramework('analog'); } return self::$ANALOG; } - public static function ANGULAR(): Framework + public static function ANGULAR(): SiteFramework { if (!isset(self::$ANGULAR)) { - self::$ANGULAR = new Framework('angular'); + self::$ANGULAR = new SiteFramework('angular'); } return self::$ANGULAR; } - public static function NEXTJS(): Framework + public static function NEXTJS(): SiteFramework { if (!isset(self::$NEXTJS)) { - self::$NEXTJS = new Framework('nextjs'); + self::$NEXTJS = new SiteFramework('nextjs'); } return self::$NEXTJS; } - public static function REACT(): Framework + public static function REACT(): SiteFramework { if (!isset(self::$REACT)) { - self::$REACT = new Framework('react'); + self::$REACT = new SiteFramework('react'); } return self::$REACT; } - public static function NUXT(): Framework + public static function NUXT(): SiteFramework { if (!isset(self::$NUXT)) { - self::$NUXT = new Framework('nuxt'); + self::$NUXT = new SiteFramework('nuxt'); } return self::$NUXT; } - public static function VUE(): Framework + public static function VUE(): SiteFramework { if (!isset(self::$VUE)) { - self::$VUE = new Framework('vue'); + self::$VUE = new SiteFramework('vue'); } return self::$VUE; } - public static function SVELTEKIT(): Framework + public static function SVELTEKIT(): SiteFramework { if (!isset(self::$SVELTEKIT)) { - self::$SVELTEKIT = new Framework('sveltekit'); + self::$SVELTEKIT = new SiteFramework('sveltekit'); } return self::$SVELTEKIT; } - public static function ASTRO(): Framework + public static function ASTRO(): SiteFramework { if (!isset(self::$ASTRO)) { - self::$ASTRO = new Framework('astro'); + self::$ASTRO = new SiteFramework('astro'); } return self::$ASTRO; } - public static function TANSTACKSTART(): Framework + public static function TANSTACKSTART(): SiteFramework { if (!isset(self::$TANSTACKSTART)) { - self::$TANSTACKSTART = new Framework('tanstack-start'); + self::$TANSTACKSTART = new SiteFramework('tanstack-start'); } return self::$TANSTACKSTART; } - public static function REMIX(): Framework + public static function REMIX(): SiteFramework { if (!isset(self::$REMIX)) { - self::$REMIX = new Framework('remix'); + self::$REMIX = new SiteFramework('remix'); } return self::$REMIX; } - public static function LYNX(): Framework + public static function LYNX(): SiteFramework { if (!isset(self::$LYNX)) { - self::$LYNX = new Framework('lynx'); + self::$LYNX = new SiteFramework('lynx'); } return self::$LYNX; } - public static function FLUTTER(): Framework + public static function FLUTTER(): SiteFramework { if (!isset(self::$FLUTTER)) { - self::$FLUTTER = new Framework('flutter'); + self::$FLUTTER = new SiteFramework('flutter'); } return self::$FLUTTER; } - public static function REACTNATIVE(): Framework + public static function REACTNATIVE(): SiteFramework { if (!isset(self::$REACTNATIVE)) { - self::$REACTNATIVE = new Framework('react-native'); + self::$REACTNATIVE = new SiteFramework('react-native'); } return self::$REACTNATIVE; } - public static function VITE(): Framework + public static function VITE(): SiteFramework { if (!isset(self::$VITE)) { - self::$VITE = new Framework('vite'); + self::$VITE = new SiteFramework('vite'); } return self::$VITE; } - public static function OTHER(): Framework + public static function OTHER(): SiteFramework { if (!isset(self::$OTHER)) { - self::$OTHER = new Framework('other'); + self::$OTHER = new SiteFramework('other'); } return self::$OTHER; } @@ -163,7 +163,7 @@ public static function from(string $value): self 'react-native' => self::REACTNATIVE(), 'vite' => self::VITE(), 'other' => self::OTHER(), - default => throw new \InvalidArgumentException('Unknown Framework value: ' . $value), + default => throw new \InvalidArgumentException('Unknown SiteFramework value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/StatusCode.php b/src/Appwrite/Enums/StatusCode.php deleted file mode 100644 index 08d3ea92..00000000 --- a/src/Appwrite/Enums/StatusCode.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 MOVEDPERMANENTLY301(): StatusCode - { - if (!isset(self::$MOVEDPERMANENTLY301)) { - self::$MOVEDPERMANENTLY301 = new StatusCode('301'); - } - return self::$MOVEDPERMANENTLY301; - } - public static function FOUND302(): StatusCode - { - if (!isset(self::$FOUND302)) { - self::$FOUND302 = new StatusCode('302'); - } - return self::$FOUND302; - } - public static function TEMPORARYREDIRECT307(): StatusCode - { - if (!isset(self::$TEMPORARYREDIRECT307)) { - self::$TEMPORARYREDIRECT307 = new StatusCode('307'); - } - return self::$TEMPORARYREDIRECT307; - } - public static function PERMANENTREDIRECT308(): StatusCode - { - if (!isset(self::$PERMANENTREDIRECT308)) { - self::$PERMANENTREDIRECT308 = new StatusCode('308'); - } - return self::$PERMANENTREDIRECT308; - } - - public static function from(string $value): self - { - return match ($value) { - '301' => self::MOVEDPERMANENTLY301(), - '302' => self::FOUND302(), - '307' => self::TEMPORARYREDIRECT307(), - '308' => self::PERMANENTREDIRECT308(), - default => throw new \InvalidArgumentException('Unknown StatusCode value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Models/ActivityEvent.php b/src/Appwrite/Models/ActivityEvent.php index 92c16093..e019fcb5 100644 --- a/src/Appwrite/Models/ActivityEvent.php +++ b/src/Appwrite/Models/ActivityEvent.php @@ -13,10 +13,10 @@ * ActivityEvent constructor. * * @param string $id event id. - * @param string $userType user type. - * @param string $userId user id. - * @param string $userEmail user email. - * @param string $userName user name. + * @param string $actorType actor type. + * @param string $actorId actor id. + * @param string $actorEmail actor email. + * @param string $actorName actor name. * @param string $resourceParent resource parent. * @param string $resourceType resource type. * @param string $resourceId resource id. @@ -47,10 +47,10 @@ */ public function __construct( public string $id, - public string $userType, - public string $userId, - public string $userEmail, - public string $userName, + public string $actorType, + public string $actorId, + public string $actorEmail, + public string $actorName, public string $resourceParent, public string $resourceType, public string $resourceId, @@ -89,17 +89,17 @@ 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('userType', $data)) { - throw new \InvalidArgumentException('Missing required field "userType" for ' . static::class . '.'); + if (!array_key_exists('actorType', $data)) { + throw new \InvalidArgumentException('Missing required field "actorType" for ' . static::class . '.'); } - if (!array_key_exists('userId', $data)) { - throw new \InvalidArgumentException('Missing required field "userId" for ' . static::class . '.'); + if (!array_key_exists('actorId', $data)) { + throw new \InvalidArgumentException('Missing required field "actorId" for ' . static::class . '.'); } - if (!array_key_exists('userEmail', $data)) { - throw new \InvalidArgumentException('Missing required field "userEmail" for ' . static::class . '.'); + if (!array_key_exists('actorEmail', $data)) { + throw new \InvalidArgumentException('Missing required field "actorEmail" for ' . static::class . '.'); } - if (!array_key_exists('userName', $data)) { - throw new \InvalidArgumentException('Missing required field "userName" for ' . static::class . '.'); + if (!array_key_exists('actorName', $data)) { + throw new \InvalidArgumentException('Missing required field "actorName" for ' . static::class . '.'); } if (!array_key_exists('resourceParent', $data)) { throw new \InvalidArgumentException('Missing required field "resourceParent" for ' . static::class . '.'); @@ -185,10 +185,10 @@ public static function from(array $data): static return new static( id: $data['$id'], - userType: $data['userType'], - userId: $data['userId'], - userEmail: $data['userEmail'], - userName: $data['userName'], + actorType: $data['actorType'], + actorId: $data['actorId'], + actorEmail: $data['actorEmail'], + actorName: $data['actorName'], resourceParent: $data['resourceParent'], resourceType: $data['resourceType'], resourceId: $data['resourceId'], @@ -226,10 +226,10 @@ public function toArray(): array { $result = [ '$id' => static::serializeValue($this->id), - 'userType' => static::serializeValue($this->userType), - 'userId' => static::serializeValue($this->userId), - 'userEmail' => static::serializeValue($this->userEmail), - 'userName' => static::serializeValue($this->userName), + 'actorType' => static::serializeValue($this->actorType), + 'actorId' => static::serializeValue($this->actorId), + 'actorEmail' => static::serializeValue($this->actorEmail), + 'actorName' => static::serializeValue($this->actorName), 'resourceParent' => static::serializeValue($this->resourceParent), 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId), diff --git a/src/Appwrite/Models/BillingLimits.php b/src/Appwrite/Models/BillingLimits.php index f80a7441..83362ae4 100644 --- a/src/Appwrite/Models/BillingLimits.php +++ b/src/Appwrite/Models/BillingLimits.php @@ -3,7 +3,7 @@ namespace Appwrite\Models; /** - * BillingLimits + * Limits */ readonly class BillingLimits { diff --git a/src/Appwrite/Models/FunctionModel.php b/src/Appwrite/Models/FunctionModel.php index 8d51da29..fa68aa6b 100644 --- a/src/Appwrite/Models/FunctionModel.php +++ b/src/Appwrite/Models/FunctionModel.php @@ -40,6 +40,8 @@ * @param string $providerBranch vcs (version control system) branch name * @param string $providerRootDirectory path to function in vcs (version control system) repository * @param bool $providerSilentMode is vcs (version control system) connection is in silent mode? when in silence mode, no comments will be posted on the repository pull or merge requests + * @param array $providerBranches list of branch name patterns that trigger automatic deployments. supports glob wildcards. empty list deploys on all branches. + * @param array $providerPaths list of file path patterns that trigger automatic deployments. supports glob wildcards. empty list deploys on all file changes. * @param string $buildSpecification machine specification for deployment builds. * @param string $runtimeSpecification machine specification for executions. */ @@ -72,6 +74,8 @@ public function __construct( public string $providerBranch, public string $providerRootDirectory, public bool $providerSilentMode, + public array $providerBranches, + public array $providerPaths, public string $buildSpecification, public string $runtimeSpecification ) { @@ -166,6 +170,12 @@ public static function from(array $data): static if (!array_key_exists('providerSilentMode', $data)) { throw new \InvalidArgumentException('Missing required field "providerSilentMode" for ' . static::class . '.'); } + if (!array_key_exists('providerBranches', $data)) { + throw new \InvalidArgumentException('Missing required field "providerBranches" for ' . static::class . '.'); + } + if (!array_key_exists('providerPaths', $data)) { + throw new \InvalidArgumentException('Missing required field "providerPaths" for ' . static::class . '.'); + } if (!array_key_exists('buildSpecification', $data)) { throw new \InvalidArgumentException('Missing required field "buildSpecification" for ' . static::class . '.'); } @@ -207,6 +217,8 @@ public static function from(array $data): static providerBranch: $data['providerBranch'], providerRootDirectory: $data['providerRootDirectory'], providerSilentMode: $data['providerSilentMode'], + providerBranches: $data['providerBranches'], + providerPaths: $data['providerPaths'], buildSpecification: $data['buildSpecification'], runtimeSpecification: $data['runtimeSpecification'] ); @@ -246,6 +258,8 @@ public function toArray(): array 'providerBranch' => static::serializeValue($this->providerBranch), 'providerRootDirectory' => static::serializeValue($this->providerRootDirectory), 'providerSilentMode' => static::serializeValue($this->providerSilentMode), + 'providerBranches' => static::serializeValue($this->providerBranches), + 'providerPaths' => static::serializeValue($this->providerPaths), 'buildSpecification' => static::serializeValue($this->buildSpecification), 'runtimeSpecification' => static::serializeValue($this->runtimeSpecification) ]; diff --git a/src/Appwrite/Models/ProjectList.php b/src/Appwrite/Models/ProjectList.php new file mode 100644 index 00000000..1084c0eb --- /dev/null +++ b/src/Appwrite/Models/ProjectList.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(Project::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/Site.php b/src/Appwrite/Models/Site.php index 6b34636f..19fd5ecf 100644 --- a/src/Appwrite/Models/Site.php +++ b/src/Appwrite/Models/Site.php @@ -39,6 +39,8 @@ * @param string $providerBranch vcs (version control system) branch name * @param string $providerRootDirectory path to site in vcs (version control system) repository * @param bool $providerSilentMode is vcs (version control system) connection is in silent mode? when in silence mode, no comments will be posted on the repository pull or merge requests + * @param array $providerBranches list of branch name patterns that trigger automatic deployments. supports glob wildcards. empty list deploys on all branches. + * @param array $providerPaths list of file path patterns that trigger automatic deployments. supports glob wildcards. empty list deploys on all file changes. * @param string $buildSpecification machine specification for deployment builds. * @param string $runtimeSpecification machine specification for ssr executions. * @param string $buildRuntime site build runtime. @@ -73,6 +75,8 @@ public function __construct( public string $providerBranch, public string $providerRootDirectory, public bool $providerSilentMode, + public array $providerBranches, + public array $providerPaths, public string $buildSpecification, public string $runtimeSpecification, public string $buildRuntime, @@ -167,6 +171,12 @@ public static function from(array $data): static if (!array_key_exists('providerSilentMode', $data)) { throw new \InvalidArgumentException('Missing required field "providerSilentMode" for ' . static::class . '.'); } + if (!array_key_exists('providerBranches', $data)) { + throw new \InvalidArgumentException('Missing required field "providerBranches" for ' . static::class . '.'); + } + if (!array_key_exists('providerPaths', $data)) { + throw new \InvalidArgumentException('Missing required field "providerPaths" for ' . static::class . '.'); + } if (!array_key_exists('buildSpecification', $data)) { throw new \InvalidArgumentException('Missing required field "buildSpecification" for ' . static::class . '.'); } @@ -216,6 +226,8 @@ public static function from(array $data): static providerBranch: $data['providerBranch'], providerRootDirectory: $data['providerRootDirectory'], providerSilentMode: $data['providerSilentMode'], + providerBranches: $data['providerBranches'], + providerPaths: $data['providerPaths'], buildSpecification: $data['buildSpecification'], runtimeSpecification: $data['runtimeSpecification'], buildRuntime: $data['buildRuntime'], @@ -257,6 +269,8 @@ public function toArray(): array 'providerBranch' => static::serializeValue($this->providerBranch), 'providerRootDirectory' => static::serializeValue($this->providerRootDirectory), 'providerSilentMode' => static::serializeValue($this->providerSilentMode), + 'providerBranches' => static::serializeValue($this->providerBranches), + 'providerPaths' => static::serializeValue($this->providerPaths), 'buildSpecification' => static::serializeValue($this->buildSpecification), 'runtimeSpecification' => static::serializeValue($this->runtimeSpecification), 'buildRuntime' => static::serializeValue($this->buildRuntime), diff --git a/src/Appwrite/Models/UsageGauge.php b/src/Appwrite/Models/UsageGauge.php index 24012c21..e584243d 100644 --- a/src/Appwrite/Models/UsageGauge.php +++ b/src/Appwrite/Models/UsageGauge.php @@ -15,11 +15,15 @@ * @param string $metric the metric key. * @param int $value the current snapshot value. * @param string $time the snapshot timestamp. + * @param string $resourceType the resource type. + * @param string $resourceId the resource id. */ public function __construct( public string $metric, public int $value, - public string $time + public string $time, + public string $resourceType, + public string $resourceId ) { } @@ -37,11 +41,19 @@ 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('resourceType', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceType" for ' . static::class . '.'); + } + if (!array_key_exists('resourceId', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceId" for ' . static::class . '.'); + } return new static( metric: $data['metric'], value: $data['value'], - time: $data['time'] + time: $data['time'], + resourceType: $data['resourceType'], + resourceId: $data['resourceId'] ); } @@ -53,7 +65,9 @@ public function toArray(): array $result = [ 'metric' => static::serializeValue($this->metric), 'value' => static::serializeValue($this->value), - 'time' => static::serializeValue($this->time) + 'time' => static::serializeValue($this->time), + 'resourceType' => static::serializeValue($this->resourceType), + 'resourceId' => static::serializeValue($this->resourceId) ]; return $result; diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index 71184f13..b3a7d11e 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -9,7 +9,7 @@ use Appwrite\Enums\Browser; use Appwrite\Enums\CreditCard; use Appwrite\Enums\Flag; -use Appwrite\Enums\Theme; +use Appwrite\Enums\BrowserTheme; use Appwrite\Enums\Timezone; use Appwrite\Enums\BrowserPermission; use Appwrite\Enums\ImageFormat; @@ -399,7 +399,7 @@ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?boo * @param ?int $viewportWidth * @param ?int $viewportHeight * @param ?float $scale - * @param ?Theme $theme + * @param ?BrowserTheme $theme * @param ?string $userAgent * @param ?bool $fullpage * @param ?string $locale @@ -417,7 +417,7 @@ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?boo * @throws AppwriteException * @return string */ - public function getScreenshot(string $url, ?array $headers = null, ?int $viewportWidth = null, ?int $viewportHeight = null, ?float $scale = null, ?Theme $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 + 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 { $apiPath = str_replace( [], diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index 7d44d391..689702f1 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -6,8 +6,8 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -77,7 +77,7 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * * @param string $functionId * @param string $name - * @param Runtime $runtime + * @param FunctionRuntime $runtime * @param ?array $execute * @param ?array $events * @param ?string $schedule @@ -92,13 +92,15 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @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\FunctionModel */ - public function create(string $functionId, string $name, Runtime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\FunctionModel + public function create(string $functionId, string $name, FunctionRuntime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel { $apiPath = str_replace( [], @@ -167,6 +169,14 @@ public function create(string $functionId, string $name, Runtime $runtime, ?arra $apiParams['providerRootDirectory'] = $providerRootDirectory; } + if (!is_null($providerBranches)) { + $apiParams['providerBranches'] = $providerBranches; + } + + if (!is_null($providerPaths)) { + $apiParams['providerPaths'] = $providerPaths; + } + if (!is_null($buildSpecification)) { $apiParams['buildSpecification'] = $buildSpecification; } @@ -303,7 +313,7 @@ public function get(string $functionId): \Appwrite\Models\FunctionModel * * @param string $functionId * @param string $name - * @param ?Runtime $runtime + * @param ?FunctionRuntime $runtime * @param ?array $execute * @param ?array $events * @param ?string $schedule @@ -318,13 +328,15 @@ public function get(string $functionId): \Appwrite\Models\FunctionModel * @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\FunctionModel */ - public function update(string $functionId, string $name, ?Runtime $runtime = null, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\FunctionModel + public function update(string $functionId, string $name, ?FunctionRuntime $runtime = null, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel { $apiPath = str_replace( ['{functionId}'], @@ -392,6 +404,8 @@ public function update(string $functionId, string $name, ?Runtime $runtime = nul if (!is_null($providerRootDirectory)) { $apiParams['providerRootDirectory'] = $providerRootDirectory; } + $apiParams['providerBranches'] = $providerBranches; + $apiParams['providerPaths'] = $providerPaths; if (!is_null($buildSpecification)) { $apiParams['buildSpecification'] = $buildSpecification; @@ -635,35 +649,194 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $handle = @fopen($code->getPath(), "rb"); } + $uploadId = ''; + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { - $chunk = ''; + $chunks[] = [ + 'index' => $counter, + 'start' => $start, + 'end' => min($start + Client::CHUNK_SIZE, $size), + ]; + $counter++; + $start += Client::CHUNK_SIZE; + } + + $readChunk = function(int $start, int $end) use ($handle, $code) { if(!empty($handle)) { fseek($handle, $start); - $chunk = @fread($handle, Client::CHUNK_SIZE); - } else { - $chunk = substr($code->getData(), $start, Client::CHUNK_SIZE); + return @fread($handle, $end - $start); } - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); - $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; - if(!empty($id)) { - $apiHeaders['x-appwrite-id'] = $id; + + return substr($code->getData(), $start, $end - $start); + }; + + $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); + $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; + if(!empty($currentUploadId)) { + $chunkHeaders['x-appwrite-id'] = $currentUploadId; } - $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); - $counter++; - $start += Client::CHUNK_SIZE; - if(empty($id)) { - $id = $response['$id']; + + return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); + }; + + $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']; } + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; if($onProgress !== null) { $onProgress([ '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, - 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), - 'chunksTotal' => $response['chunksTotal'], - 'chunksUploaded' => $response['chunksUploaded'], + '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)) { @fclose($handle); diff --git a/src/Appwrite/Services/Health.php b/src/Appwrite/Services/Health.php index cb1b2fd9..69005a9c 100644 --- a/src/Appwrite/Services/Health.php +++ b/src/Appwrite/Services/Health.php @@ -6,7 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\Name; +use Appwrite\Enums\HealthQueueName; class Health extends Service { @@ -470,12 +470,12 @@ public function getQueueDeletes(?int $threshold = null): \Appwrite\Models\Health * Returns the amount of failed jobs in a given queue. * * - * @param Name $name + * @param HealthQueueName $name * @param ?int $threshold * @throws AppwriteException * @return \Appwrite\Models\HealthQueue */ - public function getFailedJobs(Name $name, ?int $threshold = null): \Appwrite\Models\HealthQueue + public function getFailedJobs(HealthQueueName $name, ?int $threshold = null): \Appwrite\Models\HealthQueue { $apiPath = str_replace( ['{name}'], diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php new file mode 100644 index 00000000..f00cd221 --- /dev/null +++ b/src/Appwrite/Services/Organization.php @@ -0,0 +1,412 @@ +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\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 + { + $apiPath = str_replace( + [], + [], + '/organization/keys' + ); + + $apiParams = []; + $apiParams['keyId'] = $keyId; + $apiParams['name'] = $name; + $apiParams['scopes'] = $scopes; + $apiParams['expire'] = $expire; + + $apiHeaders = []; + $apiHeaders['content-type'] = '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); + + } + + /** + * 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 + { + $apiPath = str_replace( + ['{keyId}'], + [$keyId], + '/organization/keys/{keyId}' + ); + + $apiParams = []; + $apiParams['keyId'] = $keyId; + + $apiHeaders = []; + + $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\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 + { + $apiPath = str_replace( + ['{keyId}'], + [$keyId], + '/organization/keys/{keyId}' + ); + + $apiParams = []; + $apiParams['keyId'] = $keyId; + $apiParams['name'] = $name; + $apiParams['scopes'] = $scopes; + $apiParams['expire'] = $expire; + + $apiHeaders = []; + $apiHeaders['content-type'] = '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\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 + { + $apiPath = str_replace( + ['{keyId}'], + [$keyId], + '/organization/keys/{keyId}' + ); + + $apiParams = []; + $apiParams['keyId'] = $keyId; + + $apiHeaders = []; + $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. + * + * @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 + { + $apiPath = str_replace( + [], + [], + '/organization/projects' + ); + + $apiParams = []; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + + if (!is_null($total)) { + $apiParams['total'] = $total; + } + + $apiHeaders = []; + + $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\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 + { + $apiPath = str_replace( + [], + [], + '/organization/projects' + ); + + $apiParams = []; + $apiParams['projectId'] = $projectId; + $apiParams['name'] = $name; + + if (!is_null($region)) { + $apiParams['region'] = $region; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = '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\Project::from($response); + + } + + /** + * Get a project. + * + * @param string $projectId + * @throws AppwriteException + * @return \Appwrite\Models\Project + */ + public function getProject(string $projectId): \Appwrite\Models\Project + { + $apiPath = str_replace( + ['{projectId}'], + [$projectId], + '/organization/projects/{projectId}' + ); + + $apiParams = []; + $apiParams['projectId'] = $projectId; + + $apiHeaders = []; + + $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\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 + { + $apiPath = str_replace( + ['{projectId}'], + [$projectId], + '/organization/projects/{projectId}' + ); + + $apiParams = []; + $apiParams['projectId'] = $projectId; + $apiParams['name'] = $name; + + $apiHeaders = []; + $apiHeaders['content-type'] = '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); + + } + + /** + * Delete a project by its unique ID. + * + * @param string $projectId + * @throws AppwriteException + * @return string + */ + public function deleteProject(string $projectId): string + { + $apiPath = str_replace( + ['{projectId}'], + [$projectId], + '/organization/projects/{projectId}' + ); + + $apiParams = []; + $apiParams['projectId'] = $projectId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + $response = $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 282e8275..5d10b779 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -6,7 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\StatusCode; +use Appwrite\Enums\RedirectStatusCode; use Appwrite\Enums\ProxyResourceType; class Proxy extends Service @@ -154,13 +154,13 @@ public function createFunctionRule(string $domain, string $functionId, ?string $ * * @param string $domain * @param string $url - * @param StatusCode $statusCode + * @param RedirectStatusCode $statusCode * @param string $resourceId * @param ProxyResourceType $resourceType * @throws AppwriteException * @return \Appwrite\Models\ProxyRule */ - public function createRedirectRule(string $domain, string $url, StatusCode $statusCode, string $resourceId, ProxyResourceType $resourceType): \Appwrite\Models\ProxyRule + public function createRedirectRule(string $domain, string $url, RedirectStatusCode $statusCode, string $resourceId, ProxyResourceType $resourceType): \Appwrite\Models\ProxyRule { $apiPath = str_replace( [], diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index 660a1bbc..f74ba6be 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -6,9 +6,9 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\Framework; -use Appwrite\Enums\BuildRuntime; -use Appwrite\Enums\Adapter; +use Appwrite\Enums\SiteFramework; +use Appwrite\Enums\SiteBuildRuntime; +use Appwrite\Enums\SiteAdapter; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -74,8 +74,8 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * * @param string $siteId * @param string $name - * @param Framework $framework - * @param BuildRuntime $buildRuntime + * @param SiteFramework $framework + * @param SiteBuildRuntime $buildRuntime * @param ?bool $enabled * @param ?bool $logging * @param ?int $timeout @@ -83,20 +83,22 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @param ?string $buildCommand * @param ?string $startCommand * @param ?string $outputDirectory - * @param ?Adapter $adapter + * @param ?SiteAdapter $adapter * @param ?string $installationId * @param ?string $fallbackFile * @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 create(string $siteId, string $name, Framework $framework, BuildRuntime $buildRuntime, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?Adapter $adapter = null, ?string $installationId = null, ?string $fallbackFile = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\Site + public function create(string $siteId, string $name, SiteFramework $framework, SiteBuildRuntime $buildRuntime, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?SiteAdapter $adapter = null, ?string $installationId = null, ?string $fallbackFile = 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 { $apiPath = str_replace( [], @@ -166,6 +168,14 @@ public function create(string $siteId, string $name, Framework $framework, Build $apiParams['providerRootDirectory'] = $providerRootDirectory; } + if (!is_null($providerBranches)) { + $apiParams['providerBranches'] = $providerBranches; + } + + if (!is_null($providerPaths)) { + $apiParams['providerPaths'] = $providerPaths; + } + if (!is_null($buildSpecification)) { $apiParams['buildSpecification'] = $buildSpecification; } @@ -303,7 +313,7 @@ public function get(string $siteId): \Appwrite\Models\Site * * @param string $siteId * @param string $name - * @param Framework $framework + * @param SiteFramework $framework * @param ?bool $enabled * @param ?bool $logging * @param ?int $timeout @@ -311,21 +321,23 @@ public function get(string $siteId): \Appwrite\Models\Site * @param ?string $buildCommand * @param ?string $startCommand * @param ?string $outputDirectory - * @param ?BuildRuntime $buildRuntime - * @param ?Adapter $adapter + * @param ?SiteBuildRuntime $buildRuntime + * @param ?SiteAdapter $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, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\Site + public function update(string $siteId, string $name, SiteFramework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?SiteBuildRuntime $buildRuntime = null, ?SiteAdapter $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 { $apiPath = str_replace( ['{siteId}'], @@ -397,6 +409,8 @@ public function update(string $siteId, string $name, Framework $framework, ?bool if (!is_null($providerRootDirectory)) { $apiParams['providerRootDirectory'] = $providerRootDirectory; } + $apiParams['providerBranches'] = $providerBranches; + $apiParams['providerPaths'] = $providerPaths; if (!is_null($buildSpecification)) { $apiParams['buildSpecification'] = $buildSpecification; @@ -641,35 +655,194 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $handle = @fopen($code->getPath(), "rb"); } + $uploadId = ''; + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { - $chunk = ''; + $chunks[] = [ + 'index' => $counter, + 'start' => $start, + 'end' => min($start + Client::CHUNK_SIZE, $size), + ]; + $counter++; + $start += Client::CHUNK_SIZE; + } + + $readChunk = function(int $start, int $end) use ($handle, $code) { if(!empty($handle)) { fseek($handle, $start); - $chunk = @fread($handle, Client::CHUNK_SIZE); - } else { - $chunk = substr($code->getData(), $start, Client::CHUNK_SIZE); + return @fread($handle, $end - $start); } - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); - $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; - if(!empty($id)) { - $apiHeaders['x-appwrite-id'] = $id; + + return substr($code->getData(), $start, $end - $start); + }; + + $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); + $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; + if(!empty($currentUploadId)) { + $chunkHeaders['x-appwrite-id'] = $currentUploadId; } - $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); - $counter++; - $start += Client::CHUNK_SIZE; - if(empty($id)) { - $id = $response['$id']; + + return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); + }; + + $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']; } + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; if($onProgress !== null) { $onProgress([ '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, - 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), - 'chunksTotal' => $response['chunksTotal'], - 'chunksUploaded' => $response['chunksUploaded'], + '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)) { @fclose($handle); diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index a8661140..5fbdb216 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -443,35 +443,195 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $handle = @fopen($file->getPath(), "rb"); } + $uploadId = ''; + $uploadId = $fileId ?? ''; + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { - $chunk = ''; + $chunks[] = [ + 'index' => $counter, + 'start' => $start, + 'end' => min($start + Client::CHUNK_SIZE, $size), + ]; + $counter++; + $start += Client::CHUNK_SIZE; + } + + $readChunk = function(int $start, int $end) use ($handle, $file) { if(!empty($handle)) { fseek($handle, $start); - $chunk = @fread($handle, Client::CHUNK_SIZE); - } else { - $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); + return @fread($handle, $end - $start); } - $apiParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); - $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; - if(!empty($id)) { - $apiHeaders['x-appwrite-id'] = $id; + + return substr($file->getData(), $start, $end - $start); + }; + + $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); + $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; + if(!empty($currentUploadId)) { + $chunkHeaders['x-appwrite-id'] = $currentUploadId; } - $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); - $counter++; - $start += Client::CHUNK_SIZE; - if(empty($id)) { - $id = $response['$id']; + + return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); + }; + + $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']; + } + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; if($onProgress !== null) { $onProgress([ '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, - 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), - 'chunksTotal' => $response['chunksTotal'], - 'chunksUploaded' => $response['chunksUploaded'], + '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)) { @fclose($handle); diff --git a/src/Appwrite/Services/Usage.php b/src/Appwrite/Services/Usage.php index 75da953d..34702479 100644 --- a/src/Appwrite/Services/Usage.php +++ b/src/Appwrite/Services/Usage.php @@ -70,16 +70,16 @@ public function listEvents(?array $queries = null, ?bool $total = null): \Appwri /** * Query usage gauge metrics (point-in-time resource snapshots) from the usage - * database. Returns individual gauge snapshots with metric, value, and - * timestamp. Pass Query objects as JSON strings to filter, paginate, and - * order results. Supported query methods: equal, greaterThanEqual, - * lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter - * attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the - * most recent snapshot. When no time filter is supplied the endpoint defaults - * to the last 7 days. Default `limit(100)` is applied if none is given; - * user-supplied limits are capped at 500. The `total` field is capped at 5000 - * to keep counts predictable — pass `total=false` to skip the count - * entirely. + * database. Returns individual gauge snapshots with metric, value, timestamp, + * resourceType, and resourceId. Pass Query objects as JSON strings to filter, + * paginate, and order results. Supported query methods: equal, + * greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. + * Supported filter attributes: metric, time. Use `orderDesc("time"), + * limit(1)` to fetch the most recent snapshot. When no time filter is + * supplied the endpoint defaults to the last 7 days. Default `limit(100)` is + * applied if none is given; user-supplied limits are capped at 500. The + * `total` field is capped at 5000 to keep counts predictable — pass + * `total=false` to skip the count entirely. * * @param ?array $queries * @param ?bool $total diff --git a/tests/Appwrite/QueryTest.php b/tests/Appwrite/QueryTest.php index 6b4cd6c2..bd7de62a 100644 --- a/tests/Appwrite/QueryTest.php +++ b/tests/Appwrite/QueryTest.php @@ -22,9 +22,9 @@ final class QueryTest extends TestCase { */ private $tests; - function __construct(string $name) + protected function setUp(): void { - parent::__construct($name); + parent::setUp(); $this->tests = array( new BasicFilterQueryTest('with a string', 's', '["s"]'), new BasicFilterQueryTest('with a integer', 1, '[1]'), diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php index caa10678..70b4934c 100644 --- a/tests/Appwrite/Services/ActivitiesTest.php +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -25,10 +25,10 @@ public function testMethodListEvents(): void "events" => array( array( "\$id" => "5e5ea5c16897e", - "userType" => "user", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", + "actorType" => "user", + "actorId" => "610fc2f985ee0", + "actorEmail" => "john@appwrite.io", + "actorName" => "John Doe", "resourceParent" => "database/ID", "resourceType" => "collection", "resourceId" => "610fc2f985ee0", @@ -73,10 +73,10 @@ public function testMethodGetEvent(): void { $data = array( "\$id" => "5e5ea5c16897e", - "userType" => "user", - "userId" => "610fc2f985ee0", - "userEmail" => "john@appwrite.io", - "userName" => "John Doe", + "actorType" => "user", + "actorId" => "610fc2f985ee0", + "actorEmail" => "john@appwrite.io", + "actorName" => "John Doe", "resourceParent" => "database/ID", "resourceType" => "collection", "resourceId" => "610fc2f985ee0", diff --git a/tests/Appwrite/Services/AvatarsTest.php b/tests/Appwrite/Services/AvatarsTest.php index caf80eed..1bae9932 100644 --- a/tests/Appwrite/Services/AvatarsTest.php +++ b/tests/Appwrite/Services/AvatarsTest.php @@ -9,7 +9,7 @@ use Appwrite\Enums\Browser; use Appwrite\Enums\CreditCard; use Appwrite\Enums\Flag; -use Appwrite\Enums\Theme; +use Appwrite\Enums\BrowserTheme; use Appwrite\Enums\Timezone; use Appwrite\Enums\BrowserPermission; use Appwrite\Enums\ImageFormat; diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 6bfd281f..14192288 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -6,8 +6,8 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -69,6 +69,8 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" ) @@ -126,6 +128,8 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" ); @@ -137,7 +141,7 @@ public function testMethodCreate(): void $response = $this->functions->create( "", "", - Runtime::NODE145() + FunctionRuntime::NODE145() ); $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); @@ -235,6 +239,8 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" ); @@ -292,6 +298,8 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" ); @@ -365,6 +373,8 @@ public function testMethodUpdateFunctionDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" ); diff --git a/tests/Appwrite/Services/HealthTest.php b/tests/Appwrite/Services/HealthTest.php index 6d86f92c..eaa2f17e 100644 --- a/tests/Appwrite/Services/HealthTest.php +++ b/tests/Appwrite/Services/HealthTest.php @@ -6,7 +6,7 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\Name; +use Appwrite\Enums\HealthQueueName; final class HealthTest extends TestCase { @@ -241,7 +241,7 @@ public function testMethodGetFailedJobs(): void ->andReturn($data); $response = $this->health->getFailedJobs( - Name::V1DATABASE() + HealthQueueName::V1DATABASE() ); $this->assertInstanceOf(\Appwrite\Models\HealthQueue::class, $response); diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php new file mode 100644 index 00000000..36b7a5b3 --- /dev/null +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -0,0 +1,481 @@ +client = Mockery::mock(Client::class); + $this->organization = new Organization($this->client); + } + + 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", + "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); + + $response = $this->organization->listKeys(); + + $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); + + $response = $this->organization->createKey( + "", + "", + array(OrganizationKeyScopes::PROJECTSREAD()) + ); + + $this->assertInstanceOf(\Appwrite\Models\Key::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", + "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); + + $response = $this->organization->getKey( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); + } + + public function testMethodUpdateKey(): 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); + + $response = $this->organization->updateKey( + "", + "", + array(OrganizationKeyScopes::PROJECTSREAD()) + ); + + $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); + } + + public function testMethodDeleteKey(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->deleteKey( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListProjects(): void + { + $data = array( + "total" => 5, + "projects" => array( + 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", + "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" => "[SMTPPASSWORD]", + "smtpSecure" => "tls", + "pingCount" => 1, + "pingedAt" => "2020-10-15T06:38:00.000+00:00", + "labels" => array(), + "status" => "active", + "authMethods" => array( + array( + "\$id" => "email-password", + "enabled" => true + ) + ), + "services" => array( + array( + "\$id" => "account", + "enabled" => true + ) + ), + "protocols" => array( + array( + "\$id" => "rest", + "enabled" => true + ) + ), + "region" => "fra", + "blocks" => array( + array( + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceType" => "project", + "resourceId" => "5e5ea5c16897e", + "projectName" => "My Project", + "region" => "fra", + "organizationName" => "Acme Inc.", + "organizationId" => "5e5ea5c16897e", + "billingPlan" => "pro" + ) + ), + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ) + ) + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->listProjects(); + + $this->assertInstanceOf(\Appwrite\Models\ProjectList::class, $response); + } + + public function testMethodCreateProject(): 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", + "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" => "[SMTPPASSWORD]", + "smtpSecure" => "tls", + "pingCount" => 1, + "pingedAt" => "2020-10-15T06:38:00.000+00:00", + "labels" => array(), + "status" => "active", + "authMethods" => array( + array( + "\$id" => "email-password", + "enabled" => true + ) + ), + "services" => array( + array( + "\$id" => "account", + "enabled" => true + ) + ), + "protocols" => array( + array( + "\$id" => "rest", + "enabled" => true + ) + ), + "region" => "fra", + "blocks" => array( + array( + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceType" => "project", + "resourceId" => "5e5ea5c16897e", + "projectName" => "My Project", + "region" => "fra", + "organizationName" => "Acme Inc.", + "organizationId" => "5e5ea5c16897e", + "billingPlan" => "pro" + ) + ), + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->createProject( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); + } + + public function testMethodGetProject(): 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", + "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" => "[SMTPPASSWORD]", + "smtpSecure" => "tls", + "pingCount" => 1, + "pingedAt" => "2020-10-15T06:38:00.000+00:00", + "labels" => array(), + "status" => "active", + "authMethods" => array( + array( + "\$id" => "email-password", + "enabled" => true + ) + ), + "services" => array( + array( + "\$id" => "account", + "enabled" => true + ) + ), + "protocols" => array( + array( + "\$id" => "rest", + "enabled" => true + ) + ), + "region" => "fra", + "blocks" => array( + array( + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceType" => "project", + "resourceId" => "5e5ea5c16897e", + "projectName" => "My Project", + "region" => "fra", + "organizationName" => "Acme Inc.", + "organizationId" => "5e5ea5c16897e", + "billingPlan" => "pro" + ) + ), + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->getProject( + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); + } + + public function testMethodUpdateProject(): 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", + "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" => "[SMTPPASSWORD]", + "smtpSecure" => "tls", + "pingCount" => 1, + "pingedAt" => "2020-10-15T06:38:00.000+00:00", + "labels" => array(), + "status" => "active", + "authMethods" => array( + array( + "\$id" => "email-password", + "enabled" => true + ) + ), + "services" => array( + array( + "\$id" => "account", + "enabled" => true + ) + ), + "protocols" => array( + array( + "\$id" => "rest", + "enabled" => true + ) + ), + "region" => "fra", + "blocks" => array( + array( + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceType" => "project", + "resourceId" => "5e5ea5c16897e", + "projectName" => "My Project", + "region" => "fra", + "organizationName" => "Acme Inc.", + "organizationId" => "5e5ea5c16897e", + "billingPlan" => "pro" + ) + ), + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->updateProject( + "", + "" + ); + + $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); + } + + public function testMethodDeleteProject(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->organization->deleteProject( + "" + ); + + $this->assertSame($data, $response); + } + +} diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 4b859821..315e4c88 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -877,7 +877,7 @@ public function testMethodUpdateOAuth2Google(): void "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", - "clientSecret" => "example-google-client-secret", + "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", "prompt" => array() ); @@ -934,7 +934,7 @@ public function testMethodUpdateOAuth2Linkedin(): void "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", - "primaryClientSecret" => "example-linkedin-client-secret" + "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" ); $this->client diff --git a/tests/Appwrite/Services/ProxyTest.php b/tests/Appwrite/Services/ProxyTest.php index ea218575..a0405bca 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -6,7 +6,7 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\StatusCode; +use Appwrite\Enums\RedirectStatusCode; use Appwrite\Enums\ProxyResourceType; final class ProxyTest extends TestCase @@ -140,7 +140,7 @@ public function testMethodCreateRedirectRule(): void $response = $this->proxy->createRedirectRule( "", "https://example.com", - StatusCode::MOVEDPERMANENTLY301(), + RedirectStatusCode::MOVEDPERMANENTLY(), "", ProxyResourceType::SITE() ); diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index a42f7f41..e59598b0 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -6,9 +6,9 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\Framework; -use Appwrite\Enums\BuildRuntime; -use Appwrite\Enums\Adapter; +use Appwrite\Enums\SiteFramework; +use Appwrite\Enums\SiteBuildRuntime; +use Appwrite\Enums\SiteAdapter; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -68,6 +68,8 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", @@ -127,6 +129,8 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", @@ -141,8 +145,8 @@ public function testMethodCreate(): void $response = $this->sites->create( "", "", - Framework::ANALOG(), - BuildRuntime::NODE145() + SiteFramework::ANALOG(), + SiteBuildRuntime::NODE145() ); $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); @@ -244,6 +248,8 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", @@ -303,6 +309,8 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", @@ -317,7 +325,7 @@ public function testMethodUpdate(): void $response = $this->sites->update( "", "", - Framework::ANALOG() + SiteFramework::ANALOG() ); $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); @@ -379,6 +387,8 @@ public function testMethodUpdateSiteDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, + "providerBranches" => array(), + "providerPaths" => array(), "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", diff --git a/tests/Appwrite/Services/UsageTest.php b/tests/Appwrite/Services/UsageTest.php index 29fabee5..e7c9697a 100644 --- a/tests/Appwrite/Services/UsageTest.php +++ b/tests/Appwrite/Services/UsageTest.php @@ -55,7 +55,9 @@ public function testMethodListGauges(): void array( "metric" => "users", "value" => 1500, - "time" => "2026-04-09T12:00:00.000+00:00" + "time" => "2026-04-09T12:00:00.000+00:00", + "resourceType" => "dedicatedDatabases", + "resourceId" => "production" ) ) ); From a2e1e146b78a42cfadb8388b09e497b4c898b66b Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Jun 2026 08:04:07 +0000 Subject: [PATCH 2/4] chore: update PHP SDK to 25.0.0 --- CHANGELOG.md | 14 + docs/examples/functions/create.md | 4 +- docs/examples/functions/update.md | 4 +- .../{update-presence.md => update.md} | 2 +- docs/examples/proxy/create-redirect-rule.md | 4 +- docs/examples/sites/create.md | 12 +- docs/examples/sites/update.md | 12 +- docs/organization.md | 2 +- docs/project.md | 2 +- docs/storage.md | 4 +- src/Appwrite/Client.php | 4 +- .../Enums/{SiteAdapter.php => Adapter.php} | 16 +- src/Appwrite/Enums/BuildRuntime.php | 853 +++++++++++++++++ .../{SiteFramework.php => Framework.php} | 94 +- src/Appwrite/Enums/FunctionRuntime.php | 880 ------------------ src/Appwrite/Enums/ProjectPolicyId.php | 27 + src/Appwrite/Enums/Runtime.php | 853 +++++++++++++++++ src/Appwrite/Enums/SiteBuildRuntime.php | 880 ------------------ ...{RedirectStatusCode.php => StatusCode.php} | 28 +- .../Models/PolicyDenyAliasedEmail.php | 54 ++ .../Models/PolicyDenyDisposableEmail.php | 54 ++ src/Appwrite/Models/PolicyDenyFreeEmail.php | 54 ++ src/Appwrite/Models/Presence.php | 29 +- src/Appwrite/Services/Functions.php | 10 +- src/Appwrite/Services/Presences.php | 2 +- src/Appwrite/Services/Project.php | 16 +- src/Appwrite/Services/Proxy.php | 6 +- src/Appwrite/Services/Sites.php | 22 +- tests/Appwrite/Services/FunctionsTest.php | 4 +- tests/Appwrite/Services/PresencesTest.php | 4 +- tests/Appwrite/Services/ProjectTest.php | 10 +- tests/Appwrite/Services/ProxyTest.php | 4 +- tests/Appwrite/Services/SitesTest.php | 12 +- 33 files changed, 2057 insertions(+), 1919 deletions(-) rename docs/examples/presences/{update-presence.md => update.md} (94%) rename src/Appwrite/Enums/{SiteAdapter.php => Adapter.php} (68%) create mode 100644 src/Appwrite/Enums/BuildRuntime.php rename src/Appwrite/Enums/{SiteFramework.php => Framework.php} (51%) delete mode 100644 src/Appwrite/Enums/FunctionRuntime.php create mode 100644 src/Appwrite/Enums/Runtime.php delete mode 100644 src/Appwrite/Enums/SiteBuildRuntime.php rename src/Appwrite/Enums/{RedirectStatusCode.php => StatusCode.php} (57%) create mode 100644 src/Appwrite/Models/PolicyDenyAliasedEmail.php create mode 100644 src/Appwrite/Models/PolicyDenyDisposableEmail.php create mode 100644 src/Appwrite/Models/PolicyDenyFreeEmail.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 04807029..3ee5699c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## 25.0.0 + +* Breaking: Removed `githubImagine` and `googleImagine` from `ProjectOAuthProviderId` +* Breaking: Removed `deno-1.21`, `deno-1.24`, and `deno-1.35` from `Runtime` and `BuildRuntime` +* Breaking: Dropped numeric suffixes from `StatusCode` redirect members +* Added: `Organization` service for managing projects and API keys +* Added: `PolicyDenyAliasedEmail`, `PolicyDenyDisposableEmail`, and `PolicyDenyFreeEmail` policy models +* Added: `deny-aliased-email`, `deny-disposable-email`, and `deny-free-email` to `ProjectPolicyId` +* Added: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums +* Added: `dart-3.12` and `flutter-3.44` runtimes +* Added: `ProjectList` model and new attributes on `Function`, `Site`, and `UsageGauge` +* Updated: `functions`, `sites`, `usage`, `health`, and `avatars` services +* Updated: Renamed `updatePresence` to `update` in the `presences` service + ## 24.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 10c6c32c..4e8a23d7 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; -use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\Runtime; use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) @@ -16,7 +16,7 @@ $functions = new Functions($client); $result = $functions->create( functionId: '', name: '', - runtime: FunctionRuntime::NODE145(), + runtime: Runtime::NODE145(), execute: ["any"], // optional events: [], // optional schedule: '', // optional diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index da68d963..4eaeb871 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; -use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\Runtime; use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) @@ -16,7 +16,7 @@ $functions = new Functions($client); $result = $functions->update( functionId: '', name: '', - runtime: FunctionRuntime::NODE145(), // optional + runtime: Runtime::NODE145(), // optional execute: ["any"], // optional events: [], // optional schedule: '', // optional diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update.md similarity index 94% rename from docs/examples/presences/update-presence.md rename to docs/examples/presences/update.md index d017a136..95912f0f 100644 --- a/docs/examples/presences/update-presence.md +++ b/docs/examples/presences/update.md @@ -13,7 +13,7 @@ $client = (new Client()) $presences = new Presences($client); -$result = $presences->updatePresence( +$result = $presences->update( presenceId: '', userId: '', status: '', // optional diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 592eb1c8..1c2bbc18 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -3,7 +3,7 @@ use Appwrite\Client; use Appwrite\Services\Proxy; -use Appwrite\Enums\RedirectStatusCode; +use Appwrite\Enums\StatusCode; use Appwrite\Enums\ProxyResourceType; $client = (new Client()) @@ -16,7 +16,7 @@ $proxy = new Proxy($client); $result = $proxy->createRedirectRule( domain: '', url: 'https://example.com', - statusCode: RedirectStatusCode::MOVEDPERMANENTLY(), + statusCode: StatusCode::MOVEDPERMANENTLY(), resourceId: '', resourceType: ProxyResourceType::SITE() );``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 8dca15fa..eab5f21c 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -3,9 +3,9 @@ use Appwrite\Client; use Appwrite\Services\Sites; -use Appwrite\Enums\SiteFramework; -use Appwrite\Enums\SiteBuildRuntime; -use Appwrite\Enums\SiteAdapter; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -17,8 +17,8 @@ $sites = new Sites($client); $result = $sites->create( siteId: '', name: '', - framework: SiteFramework::ANALOG(), - buildRuntime: SiteBuildRuntime::NODE145(), + framework: Framework::ANALOG(), + buildRuntime: BuildRuntime::NODE145(), enabled: false, // optional logging: false, // optional timeout: 1, // optional @@ -26,7 +26,7 @@ $result = $sites->create( buildCommand: '', // optional startCommand: '', // optional outputDirectory: '', // optional - adapter: SiteAdapter::STATIC(), // optional + adapter: Adapter::STATIC(), // optional installationId: '', // optional fallbackFile: '', // optional providerRepositoryId: '', // optional diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index d8dbdfea..907e0c6c 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -3,9 +3,9 @@ use Appwrite\Client; use Appwrite\Services\Sites; -use Appwrite\Enums\SiteFramework; -use Appwrite\Enums\SiteBuildRuntime; -use Appwrite\Enums\SiteAdapter; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -17,7 +17,7 @@ $sites = new Sites($client); $result = $sites->update( siteId: '', name: '', - framework: SiteFramework::ANALOG(), + framework: Framework::ANALOG(), enabled: false, // optional logging: false, // optional timeout: 1, // optional @@ -25,8 +25,8 @@ $result = $sites->update( buildCommand: '', // optional startCommand: '', // optional outputDirectory: '', // optional - buildRuntime: SiteBuildRuntime::NODE145(), // optional - adapter: SiteAdapter::STATIC(), // optional + buildRuntime: BuildRuntime::NODE145(), // optional + adapter: Adapter::STATIC(), // optional fallbackFile: '', // optional installationId: '', // optional providerRepositoryId: '', // optional diff --git a/docs/organization.md b/docs/organization.md index 6bd35ae8..8af1239e 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -100,7 +100,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. | fra | ```http request diff --git a/docs/project.md b/docs/project.md index cfb294a3..9b082788 100644 --- a/docs/project.md +++ b/docs/project.md @@ -1249,7 +1249,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-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. | | +| policyId | string | **Required** Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email. | | ```http request diff --git a/docs/storage.md b/docs/storage.md index f2d206f5..c051c9b5 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -31,7 +31,7 @@ POST https://cloud.appwrite.io/v1/storage/buckets | permissions | array | An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | fileSecurity | boolean | Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. | 1 | -| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 0B. | [] | +| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 5GB. | [] | | allowedFileExtensions | array | Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. | [] | | compression | string | Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none | | encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 | @@ -67,7 +67,7 @@ PUT https://cloud.appwrite.io/v1/storage/buckets/{bucketId} | permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | fileSecurity | boolean | Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). | | | enabled | boolean | Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. | 1 | -| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 0B. | [] | +| maximumFileSize | integer | Maximum file size allowed in bytes. Maximum allowed value is 5GB. | [] | | allowedFileExtensions | array | Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. | [] | | compression | string | Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none | | encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 | diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 09df9b9b..9d46a417 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/24.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/25.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '24.0.0', + 'x-sdk-version'=> '25.0.0', ]; /** diff --git a/src/Appwrite/Enums/SiteAdapter.php b/src/Appwrite/Enums/Adapter.php similarity index 68% rename from src/Appwrite/Enums/SiteAdapter.php rename to src/Appwrite/Enums/Adapter.php index 1408c41e..b9be67f0 100644 --- a/src/Appwrite/Enums/SiteAdapter.php +++ b/src/Appwrite/Enums/Adapter.php @@ -4,10 +4,10 @@ use JsonSerializable; -class SiteAdapter implements JsonSerializable +class Adapter implements JsonSerializable { - private static SiteAdapter $STATIC; - private static SiteAdapter $SSR; + private static Adapter $STATIC; + private static Adapter $SSR; private string $value; @@ -26,17 +26,17 @@ public function jsonSerialize(): string return $this->value; } - public static function STATIC(): SiteAdapter + public static function STATIC(): Adapter { if (!isset(self::$STATIC)) { - self::$STATIC = new SiteAdapter('static'); + self::$STATIC = new Adapter('static'); } return self::$STATIC; } - public static function SSR(): SiteAdapter + public static function SSR(): Adapter { if (!isset(self::$SSR)) { - self::$SSR = new SiteAdapter('ssr'); + self::$SSR = new Adapter('ssr'); } return self::$SSR; } @@ -46,7 +46,7 @@ public static function from(string $value): self return match ($value) { 'static' => self::STATIC(), 'ssr' => self::SSR(), - default => throw new \InvalidArgumentException('Unknown SiteAdapter value: ' . $value), + default => throw new \InvalidArgumentException('Unknown Adapter value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php new file mode 100644 index 00000000..186b4de3 --- /dev/null +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -0,0 +1,853 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NODE145(): BuildRuntime + { + if (!isset(self::$NODE145)) { + self::$NODE145 = new BuildRuntime('node-14.5'); + } + return self::$NODE145; + } + public static function NODE160(): BuildRuntime + { + if (!isset(self::$NODE160)) { + self::$NODE160 = new BuildRuntime('node-16.0'); + } + return self::$NODE160; + } + public static function NODE180(): BuildRuntime + { + if (!isset(self::$NODE180)) { + self::$NODE180 = new BuildRuntime('node-18.0'); + } + return self::$NODE180; + } + public static function NODE190(): BuildRuntime + { + if (!isset(self::$NODE190)) { + self::$NODE190 = new BuildRuntime('node-19.0'); + } + return self::$NODE190; + } + public static function NODE200(): BuildRuntime + { + if (!isset(self::$NODE200)) { + self::$NODE200 = new BuildRuntime('node-20.0'); + } + return self::$NODE200; + } + public static function NODE210(): BuildRuntime + { + if (!isset(self::$NODE210)) { + self::$NODE210 = new BuildRuntime('node-21.0'); + } + return self::$NODE210; + } + public static function NODE22(): BuildRuntime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new BuildRuntime('node-22'); + } + return self::$NODE22; + } + public static function NODE23(): BuildRuntime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new BuildRuntime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): BuildRuntime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new BuildRuntime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): BuildRuntime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new BuildRuntime('node-25'); + } + return self::$NODE25; + } + public static function PHP80(): BuildRuntime + { + if (!isset(self::$PHP80)) { + self::$PHP80 = new BuildRuntime('php-8.0'); + } + return self::$PHP80; + } + public static function PHP81(): BuildRuntime + { + if (!isset(self::$PHP81)) { + self::$PHP81 = new BuildRuntime('php-8.1'); + } + return self::$PHP81; + } + public static function PHP82(): BuildRuntime + { + if (!isset(self::$PHP82)) { + self::$PHP82 = new BuildRuntime('php-8.2'); + } + return self::$PHP82; + } + public static function PHP83(): BuildRuntime + { + if (!isset(self::$PHP83)) { + self::$PHP83 = new BuildRuntime('php-8.3'); + } + return self::$PHP83; + } + public static function PHP84(): BuildRuntime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new BuildRuntime('php-8.4'); + } + return self::$PHP84; + } + public static function RUBY30(): BuildRuntime + { + if (!isset(self::$RUBY30)) { + self::$RUBY30 = new BuildRuntime('ruby-3.0'); + } + return self::$RUBY30; + } + public static function RUBY31(): BuildRuntime + { + if (!isset(self::$RUBY31)) { + self::$RUBY31 = new BuildRuntime('ruby-3.1'); + } + return self::$RUBY31; + } + public static function RUBY32(): BuildRuntime + { + if (!isset(self::$RUBY32)) { + self::$RUBY32 = new BuildRuntime('ruby-3.2'); + } + return self::$RUBY32; + } + public static function RUBY33(): BuildRuntime + { + if (!isset(self::$RUBY33)) { + self::$RUBY33 = new BuildRuntime('ruby-3.3'); + } + return self::$RUBY33; + } + public static function RUBY34(): BuildRuntime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new BuildRuntime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): BuildRuntime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new BuildRuntime('ruby-4.0'); + } + return self::$RUBY40; + } + public static function PYTHON38(): BuildRuntime + { + if (!isset(self::$PYTHON38)) { + self::$PYTHON38 = new BuildRuntime('python-3.8'); + } + return self::$PYTHON38; + } + public static function PYTHON39(): BuildRuntime + { + if (!isset(self::$PYTHON39)) { + self::$PYTHON39 = new BuildRuntime('python-3.9'); + } + return self::$PYTHON39; + } + public static function PYTHON310(): BuildRuntime + { + if (!isset(self::$PYTHON310)) { + self::$PYTHON310 = new BuildRuntime('python-3.10'); + } + return self::$PYTHON310; + } + public static function PYTHON311(): BuildRuntime + { + if (!isset(self::$PYTHON311)) { + self::$PYTHON311 = new BuildRuntime('python-3.11'); + } + return self::$PYTHON311; + } + public static function PYTHON312(): BuildRuntime + { + if (!isset(self::$PYTHON312)) { + self::$PYTHON312 = new BuildRuntime('python-3.12'); + } + return self::$PYTHON312; + } + public static function PYTHON313(): BuildRuntime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new BuildRuntime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): BuildRuntime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new BuildRuntime('python-3.14'); + } + return self::$PYTHON314; + } + public static function PYTHONML311(): BuildRuntime + { + if (!isset(self::$PYTHONML311)) { + self::$PYTHONML311 = new BuildRuntime('python-ml-3.11'); + } + return self::$PYTHONML311; + } + public static function PYTHONML312(): BuildRuntime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new BuildRuntime('python-ml-3.12'); + } + return self::$PYTHONML312; + } + public static function PYTHONML313(): BuildRuntime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new BuildRuntime('python-ml-3.13'); + } + return self::$PYTHONML313; + } + public static function DENO140(): BuildRuntime + { + if (!isset(self::$DENO140)) { + self::$DENO140 = new BuildRuntime('deno-1.40'); + } + return self::$DENO140; + } + public static function DENO146(): BuildRuntime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new BuildRuntime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): BuildRuntime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new BuildRuntime('deno-2.0'); + } + return self::$DENO20; + } + public static function DENO25(): BuildRuntime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new BuildRuntime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): BuildRuntime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new BuildRuntime('deno-2.6'); + } + return self::$DENO26; + } + public static function DART215(): BuildRuntime + { + if (!isset(self::$DART215)) { + self::$DART215 = new BuildRuntime('dart-2.15'); + } + return self::$DART215; + } + public static function DART216(): BuildRuntime + { + if (!isset(self::$DART216)) { + self::$DART216 = new BuildRuntime('dart-2.16'); + } + return self::$DART216; + } + public static function DART217(): BuildRuntime + { + if (!isset(self::$DART217)) { + self::$DART217 = new BuildRuntime('dart-2.17'); + } + return self::$DART217; + } + public static function DART218(): BuildRuntime + { + if (!isset(self::$DART218)) { + self::$DART218 = new BuildRuntime('dart-2.18'); + } + return self::$DART218; + } + public static function DART219(): BuildRuntime + { + if (!isset(self::$DART219)) { + self::$DART219 = new BuildRuntime('dart-2.19'); + } + return self::$DART219; + } + public static function DART30(): BuildRuntime + { + if (!isset(self::$DART30)) { + self::$DART30 = new BuildRuntime('dart-3.0'); + } + return self::$DART30; + } + public static function DART31(): BuildRuntime + { + if (!isset(self::$DART31)) { + self::$DART31 = new BuildRuntime('dart-3.1'); + } + return self::$DART31; + } + public static function DART33(): BuildRuntime + { + if (!isset(self::$DART33)) { + self::$DART33 = new BuildRuntime('dart-3.3'); + } + return self::$DART33; + } + public static function DART35(): BuildRuntime + { + if (!isset(self::$DART35)) { + self::$DART35 = new BuildRuntime('dart-3.5'); + } + return self::$DART35; + } + public static function DART38(): BuildRuntime + { + if (!isset(self::$DART38)) { + self::$DART38 = new BuildRuntime('dart-3.8'); + } + return self::$DART38; + } + public static function DART39(): BuildRuntime + { + if (!isset(self::$DART39)) { + self::$DART39 = new BuildRuntime('dart-3.9'); + } + return self::$DART39; + } + public static function DART310(): BuildRuntime + { + if (!isset(self::$DART310)) { + self::$DART310 = new BuildRuntime('dart-3.10'); + } + return self::$DART310; + } + public static function DART311(): BuildRuntime + { + if (!isset(self::$DART311)) { + self::$DART311 = new BuildRuntime('dart-3.11'); + } + return self::$DART311; + } + public static function DART312(): BuildRuntime + { + if (!isset(self::$DART312)) { + self::$DART312 = new BuildRuntime('dart-3.12'); + } + return self::$DART312; + } + public static function DOTNET60(): BuildRuntime + { + if (!isset(self::$DOTNET60)) { + self::$DOTNET60 = new BuildRuntime('dotnet-6.0'); + } + return self::$DOTNET60; + } + public static function DOTNET70(): BuildRuntime + { + if (!isset(self::$DOTNET70)) { + self::$DOTNET70 = new BuildRuntime('dotnet-7.0'); + } + return self::$DOTNET70; + } + public static function DOTNET80(): BuildRuntime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new BuildRuntime('dotnet-8.0'); + } + return self::$DOTNET80; + } + public static function DOTNET10(): BuildRuntime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new BuildRuntime('dotnet-10'); + } + return self::$DOTNET10; + } + public static function JAVA80(): BuildRuntime + { + if (!isset(self::$JAVA80)) { + self::$JAVA80 = new BuildRuntime('java-8.0'); + } + return self::$JAVA80; + } + public static function JAVA110(): BuildRuntime + { + if (!isset(self::$JAVA110)) { + self::$JAVA110 = new BuildRuntime('java-11.0'); + } + return self::$JAVA110; + } + public static function JAVA170(): BuildRuntime + { + if (!isset(self::$JAVA170)) { + self::$JAVA170 = new BuildRuntime('java-17.0'); + } + return self::$JAVA170; + } + public static function JAVA180(): BuildRuntime + { + if (!isset(self::$JAVA180)) { + self::$JAVA180 = new BuildRuntime('java-18.0'); + } + return self::$JAVA180; + } + public static function JAVA210(): BuildRuntime + { + if (!isset(self::$JAVA210)) { + self::$JAVA210 = new BuildRuntime('java-21.0'); + } + return self::$JAVA210; + } + public static function JAVA22(): BuildRuntime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new BuildRuntime('java-22'); + } + return self::$JAVA22; + } + public static function JAVA25(): BuildRuntime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new BuildRuntime('java-25'); + } + return self::$JAVA25; + } + public static function SWIFT55(): BuildRuntime + { + if (!isset(self::$SWIFT55)) { + self::$SWIFT55 = new BuildRuntime('swift-5.5'); + } + return self::$SWIFT55; + } + public static function SWIFT58(): BuildRuntime + { + if (!isset(self::$SWIFT58)) { + self::$SWIFT58 = new BuildRuntime('swift-5.8'); + } + return self::$SWIFT58; + } + public static function SWIFT59(): BuildRuntime + { + if (!isset(self::$SWIFT59)) { + self::$SWIFT59 = new BuildRuntime('swift-5.9'); + } + return self::$SWIFT59; + } + public static function SWIFT510(): BuildRuntime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new BuildRuntime('swift-5.10'); + } + return self::$SWIFT510; + } + public static function SWIFT62(): BuildRuntime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new BuildRuntime('swift-6.2'); + } + return self::$SWIFT62; + } + public static function KOTLIN16(): BuildRuntime + { + if (!isset(self::$KOTLIN16)) { + self::$KOTLIN16 = new BuildRuntime('kotlin-1.6'); + } + return self::$KOTLIN16; + } + public static function KOTLIN18(): BuildRuntime + { + if (!isset(self::$KOTLIN18)) { + self::$KOTLIN18 = new BuildRuntime('kotlin-1.8'); + } + return self::$KOTLIN18; + } + public static function KOTLIN19(): BuildRuntime + { + if (!isset(self::$KOTLIN19)) { + self::$KOTLIN19 = new BuildRuntime('kotlin-1.9'); + } + return self::$KOTLIN19; + } + public static function KOTLIN20(): BuildRuntime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new BuildRuntime('kotlin-2.0'); + } + return self::$KOTLIN20; + } + public static function KOTLIN23(): BuildRuntime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new BuildRuntime('kotlin-2.3'); + } + return self::$KOTLIN23; + } + public static function CPP17(): BuildRuntime + { + if (!isset(self::$CPP17)) { + self::$CPP17 = new BuildRuntime('cpp-17'); + } + return self::$CPP17; + } + public static function CPP20(): BuildRuntime + { + if (!isset(self::$CPP20)) { + self::$CPP20 = new BuildRuntime('cpp-20'); + } + return self::$CPP20; + } + public static function BUN10(): BuildRuntime + { + if (!isset(self::$BUN10)) { + self::$BUN10 = new BuildRuntime('bun-1.0'); + } + return self::$BUN10; + } + public static function BUN11(): BuildRuntime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new BuildRuntime('bun-1.1'); + } + return self::$BUN11; + } + public static function BUN12(): BuildRuntime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new BuildRuntime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): BuildRuntime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new BuildRuntime('bun-1.3'); + } + return self::$BUN13; + } + public static function GO123(): BuildRuntime + { + if (!isset(self::$GO123)) { + self::$GO123 = new BuildRuntime('go-1.23'); + } + return self::$GO123; + } + public static function GO124(): BuildRuntime + { + if (!isset(self::$GO124)) { + self::$GO124 = new BuildRuntime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): BuildRuntime + { + if (!isset(self::$GO125)) { + self::$GO125 = new BuildRuntime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): BuildRuntime + { + if (!isset(self::$GO126)) { + self::$GO126 = new BuildRuntime('go-1.26'); + } + return self::$GO126; + } + public static function RUST183(): BuildRuntime + { + if (!isset(self::$RUST183)) { + self::$RUST183 = new BuildRuntime('rust-1.83'); + } + return self::$RUST183; + } + public static function STATIC1(): BuildRuntime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new BuildRuntime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): BuildRuntime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new BuildRuntime('flutter-3.24'); + } + return self::$FLUTTER324; + } + public static function FLUTTER327(): BuildRuntime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new BuildRuntime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): BuildRuntime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new BuildRuntime('flutter-3.29'); + } + return self::$FLUTTER329; + } + public static function FLUTTER332(): BuildRuntime + { + if (!isset(self::$FLUTTER332)) { + self::$FLUTTER332 = new BuildRuntime('flutter-3.32'); + } + return self::$FLUTTER332; + } + public static function FLUTTER335(): BuildRuntime + { + if (!isset(self::$FLUTTER335)) { + self::$FLUTTER335 = new BuildRuntime('flutter-3.35'); + } + return self::$FLUTTER335; + } + public static function FLUTTER338(): BuildRuntime + { + if (!isset(self::$FLUTTER338)) { + self::$FLUTTER338 = new BuildRuntime('flutter-3.38'); + } + return self::$FLUTTER338; + } + public static function FLUTTER341(): BuildRuntime + { + if (!isset(self::$FLUTTER341)) { + self::$FLUTTER341 = new BuildRuntime('flutter-3.41'); + } + return self::$FLUTTER341; + } + public static function FLUTTER344(): BuildRuntime + { + if (!isset(self::$FLUTTER344)) { + self::$FLUTTER344 = new BuildRuntime('flutter-3.44'); + } + return self::$FLUTTER344; + } + + public static function from(string $value): self + { + return match ($value) { + 'node-14.5' => self::NODE145(), + 'node-16.0' => self::NODE160(), + 'node-18.0' => self::NODE180(), + 'node-19.0' => self::NODE190(), + 'node-20.0' => self::NODE200(), + 'node-21.0' => self::NODE210(), + 'node-22' => self::NODE22(), + 'node-23' => self::NODE23(), + 'node-24' => self::NODE24(), + 'node-25' => self::NODE25(), + 'php-8.0' => self::PHP80(), + 'php-8.1' => self::PHP81(), + 'php-8.2' => self::PHP82(), + 'php-8.3' => self::PHP83(), + 'php-8.4' => self::PHP84(), + 'ruby-3.0' => self::RUBY30(), + 'ruby-3.1' => self::RUBY31(), + 'ruby-3.2' => self::RUBY32(), + 'ruby-3.3' => self::RUBY33(), + 'ruby-3.4' => self::RUBY34(), + 'ruby-4.0' => self::RUBY40(), + 'python-3.8' => self::PYTHON38(), + 'python-3.9' => self::PYTHON39(), + 'python-3.10' => self::PYTHON310(), + 'python-3.11' => self::PYTHON311(), + 'python-3.12' => self::PYTHON312(), + 'python-3.13' => self::PYTHON313(), + 'python-3.14' => self::PYTHON314(), + 'python-ml-3.11' => self::PYTHONML311(), + 'python-ml-3.12' => self::PYTHONML312(), + 'python-ml-3.13' => self::PYTHONML313(), + 'deno-1.40' => self::DENO140(), + 'deno-1.46' => self::DENO146(), + 'deno-2.0' => self::DENO20(), + 'deno-2.5' => self::DENO25(), + 'deno-2.6' => self::DENO26(), + 'dart-2.15' => self::DART215(), + 'dart-2.16' => self::DART216(), + 'dart-2.17' => self::DART217(), + 'dart-2.18' => self::DART218(), + 'dart-2.19' => self::DART219(), + 'dart-3.0' => self::DART30(), + 'dart-3.1' => self::DART31(), + 'dart-3.3' => self::DART33(), + 'dart-3.5' => self::DART35(), + 'dart-3.8' => self::DART38(), + 'dart-3.9' => self::DART39(), + 'dart-3.10' => self::DART310(), + 'dart-3.11' => self::DART311(), + 'dart-3.12' => self::DART312(), + 'dotnet-6.0' => self::DOTNET60(), + 'dotnet-7.0' => self::DOTNET70(), + 'dotnet-8.0' => self::DOTNET80(), + 'dotnet-10' => self::DOTNET10(), + 'java-8.0' => self::JAVA80(), + 'java-11.0' => self::JAVA110(), + 'java-17.0' => self::JAVA170(), + 'java-18.0' => self::JAVA180(), + 'java-21.0' => self::JAVA210(), + 'java-22' => self::JAVA22(), + 'java-25' => self::JAVA25(), + 'swift-5.5' => self::SWIFT55(), + 'swift-5.8' => self::SWIFT58(), + 'swift-5.9' => self::SWIFT59(), + 'swift-5.10' => self::SWIFT510(), + 'swift-6.2' => self::SWIFT62(), + 'kotlin-1.6' => self::KOTLIN16(), + 'kotlin-1.8' => self::KOTLIN18(), + 'kotlin-1.9' => self::KOTLIN19(), + 'kotlin-2.0' => self::KOTLIN20(), + 'kotlin-2.3' => self::KOTLIN23(), + 'cpp-17' => self::CPP17(), + 'cpp-20' => self::CPP20(), + 'bun-1.0' => self::BUN10(), + 'bun-1.1' => self::BUN11(), + 'bun-1.2' => self::BUN12(), + 'bun-1.3' => self::BUN13(), + 'go-1.23' => self::GO123(), + 'go-1.24' => self::GO124(), + 'go-1.25' => self::GO125(), + 'go-1.26' => self::GO126(), + 'rust-1.83' => self::RUST183(), + 'static-1' => self::STATIC1(), + 'flutter-3.24' => self::FLUTTER324(), + 'flutter-3.27' => self::FLUTTER327(), + 'flutter-3.29' => self::FLUTTER329(), + 'flutter-3.32' => self::FLUTTER332(), + 'flutter-3.35' => self::FLUTTER335(), + 'flutter-3.38' => self::FLUTTER338(), + 'flutter-3.41' => self::FLUTTER341(), + 'flutter-3.44' => self::FLUTTER344(), + default => throw new \InvalidArgumentException('Unknown BuildRuntime value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/SiteFramework.php b/src/Appwrite/Enums/Framework.php similarity index 51% rename from src/Appwrite/Enums/SiteFramework.php rename to src/Appwrite/Enums/Framework.php index 54ed3c98..2dd77c5f 100644 --- a/src/Appwrite/Enums/SiteFramework.php +++ b/src/Appwrite/Enums/Framework.php @@ -4,23 +4,23 @@ use JsonSerializable; -class SiteFramework implements JsonSerializable +class Framework implements JsonSerializable { - private static SiteFramework $ANALOG; - private static SiteFramework $ANGULAR; - private static SiteFramework $NEXTJS; - private static SiteFramework $REACT; - private static SiteFramework $NUXT; - private static SiteFramework $VUE; - private static SiteFramework $SVELTEKIT; - private static SiteFramework $ASTRO; - private static SiteFramework $TANSTACKSTART; - private static SiteFramework $REMIX; - private static SiteFramework $LYNX; - private static SiteFramework $FLUTTER; - private static SiteFramework $REACTNATIVE; - private static SiteFramework $VITE; - private static SiteFramework $OTHER; + private static Framework $ANALOG; + private static Framework $ANGULAR; + private static Framework $NEXTJS; + private static Framework $REACT; + private static Framework $NUXT; + private static Framework $VUE; + private static Framework $SVELTEKIT; + private static Framework $ASTRO; + private static Framework $TANSTACKSTART; + private static Framework $REMIX; + private static Framework $LYNX; + private static Framework $FLUTTER; + private static Framework $REACTNATIVE; + private static Framework $VITE; + private static Framework $OTHER; private string $value; @@ -39,108 +39,108 @@ public function jsonSerialize(): string return $this->value; } - public static function ANALOG(): SiteFramework + public static function ANALOG(): Framework { if (!isset(self::$ANALOG)) { - self::$ANALOG = new SiteFramework('analog'); + self::$ANALOG = new Framework('analog'); } return self::$ANALOG; } - public static function ANGULAR(): SiteFramework + public static function ANGULAR(): Framework { if (!isset(self::$ANGULAR)) { - self::$ANGULAR = new SiteFramework('angular'); + self::$ANGULAR = new Framework('angular'); } return self::$ANGULAR; } - public static function NEXTJS(): SiteFramework + public static function NEXTJS(): Framework { if (!isset(self::$NEXTJS)) { - self::$NEXTJS = new SiteFramework('nextjs'); + self::$NEXTJS = new Framework('nextjs'); } return self::$NEXTJS; } - public static function REACT(): SiteFramework + public static function REACT(): Framework { if (!isset(self::$REACT)) { - self::$REACT = new SiteFramework('react'); + self::$REACT = new Framework('react'); } return self::$REACT; } - public static function NUXT(): SiteFramework + public static function NUXT(): Framework { if (!isset(self::$NUXT)) { - self::$NUXT = new SiteFramework('nuxt'); + self::$NUXT = new Framework('nuxt'); } return self::$NUXT; } - public static function VUE(): SiteFramework + public static function VUE(): Framework { if (!isset(self::$VUE)) { - self::$VUE = new SiteFramework('vue'); + self::$VUE = new Framework('vue'); } return self::$VUE; } - public static function SVELTEKIT(): SiteFramework + public static function SVELTEKIT(): Framework { if (!isset(self::$SVELTEKIT)) { - self::$SVELTEKIT = new SiteFramework('sveltekit'); + self::$SVELTEKIT = new Framework('sveltekit'); } return self::$SVELTEKIT; } - public static function ASTRO(): SiteFramework + public static function ASTRO(): Framework { if (!isset(self::$ASTRO)) { - self::$ASTRO = new SiteFramework('astro'); + self::$ASTRO = new Framework('astro'); } return self::$ASTRO; } - public static function TANSTACKSTART(): SiteFramework + public static function TANSTACKSTART(): Framework { if (!isset(self::$TANSTACKSTART)) { - self::$TANSTACKSTART = new SiteFramework('tanstack-start'); + self::$TANSTACKSTART = new Framework('tanstack-start'); } return self::$TANSTACKSTART; } - public static function REMIX(): SiteFramework + public static function REMIX(): Framework { if (!isset(self::$REMIX)) { - self::$REMIX = new SiteFramework('remix'); + self::$REMIX = new Framework('remix'); } return self::$REMIX; } - public static function LYNX(): SiteFramework + public static function LYNX(): Framework { if (!isset(self::$LYNX)) { - self::$LYNX = new SiteFramework('lynx'); + self::$LYNX = new Framework('lynx'); } return self::$LYNX; } - public static function FLUTTER(): SiteFramework + public static function FLUTTER(): Framework { if (!isset(self::$FLUTTER)) { - self::$FLUTTER = new SiteFramework('flutter'); + self::$FLUTTER = new Framework('flutter'); } return self::$FLUTTER; } - public static function REACTNATIVE(): SiteFramework + public static function REACTNATIVE(): Framework { if (!isset(self::$REACTNATIVE)) { - self::$REACTNATIVE = new SiteFramework('react-native'); + self::$REACTNATIVE = new Framework('react-native'); } return self::$REACTNATIVE; } - public static function VITE(): SiteFramework + public static function VITE(): Framework { if (!isset(self::$VITE)) { - self::$VITE = new SiteFramework('vite'); + self::$VITE = new Framework('vite'); } return self::$VITE; } - public static function OTHER(): SiteFramework + public static function OTHER(): Framework { if (!isset(self::$OTHER)) { - self::$OTHER = new SiteFramework('other'); + self::$OTHER = new Framework('other'); } return self::$OTHER; } @@ -163,7 +163,7 @@ public static function from(string $value): self 'react-native' => self::REACTNATIVE(), 'vite' => self::VITE(), 'other' => self::OTHER(), - default => throw new \InvalidArgumentException('Unknown SiteFramework value: ' . $value), + default => throw new \InvalidArgumentException('Unknown Framework value: ' . $value), }; } } diff --git a/src/Appwrite/Enums/FunctionRuntime.php b/src/Appwrite/Enums/FunctionRuntime.php deleted file mode 100644 index 49426019..00000000 --- a/src/Appwrite/Enums/FunctionRuntime.php +++ /dev/null @@ -1,880 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NODE145(): FunctionRuntime - { - if (!isset(self::$NODE145)) { - self::$NODE145 = new FunctionRuntime('node-14.5'); - } - return self::$NODE145; - } - public static function NODE160(): FunctionRuntime - { - if (!isset(self::$NODE160)) { - self::$NODE160 = new FunctionRuntime('node-16.0'); - } - return self::$NODE160; - } - public static function NODE180(): FunctionRuntime - { - if (!isset(self::$NODE180)) { - self::$NODE180 = new FunctionRuntime('node-18.0'); - } - return self::$NODE180; - } - public static function NODE190(): FunctionRuntime - { - if (!isset(self::$NODE190)) { - self::$NODE190 = new FunctionRuntime('node-19.0'); - } - return self::$NODE190; - } - public static function NODE200(): FunctionRuntime - { - if (!isset(self::$NODE200)) { - self::$NODE200 = new FunctionRuntime('node-20.0'); - } - return self::$NODE200; - } - public static function NODE210(): FunctionRuntime - { - if (!isset(self::$NODE210)) { - self::$NODE210 = new FunctionRuntime('node-21.0'); - } - return self::$NODE210; - } - public static function NODE22(): FunctionRuntime - { - if (!isset(self::$NODE22)) { - self::$NODE22 = new FunctionRuntime('node-22'); - } - return self::$NODE22; - } - public static function NODE23(): FunctionRuntime - { - if (!isset(self::$NODE23)) { - self::$NODE23 = new FunctionRuntime('node-23'); - } - return self::$NODE23; - } - public static function NODE24(): FunctionRuntime - { - if (!isset(self::$NODE24)) { - self::$NODE24 = new FunctionRuntime('node-24'); - } - return self::$NODE24; - } - public static function NODE25(): FunctionRuntime - { - if (!isset(self::$NODE25)) { - self::$NODE25 = new FunctionRuntime('node-25'); - } - return self::$NODE25; - } - public static function PHP80(): FunctionRuntime - { - if (!isset(self::$PHP80)) { - self::$PHP80 = new FunctionRuntime('php-8.0'); - } - return self::$PHP80; - } - public static function PHP81(): FunctionRuntime - { - if (!isset(self::$PHP81)) { - self::$PHP81 = new FunctionRuntime('php-8.1'); - } - return self::$PHP81; - } - public static function PHP82(): FunctionRuntime - { - if (!isset(self::$PHP82)) { - self::$PHP82 = new FunctionRuntime('php-8.2'); - } - return self::$PHP82; - } - public static function PHP83(): FunctionRuntime - { - if (!isset(self::$PHP83)) { - self::$PHP83 = new FunctionRuntime('php-8.3'); - } - return self::$PHP83; - } - public static function PHP84(): FunctionRuntime - { - if (!isset(self::$PHP84)) { - self::$PHP84 = new FunctionRuntime('php-8.4'); - } - return self::$PHP84; - } - public static function RUBY30(): FunctionRuntime - { - if (!isset(self::$RUBY30)) { - self::$RUBY30 = new FunctionRuntime('ruby-3.0'); - } - return self::$RUBY30; - } - public static function RUBY31(): FunctionRuntime - { - if (!isset(self::$RUBY31)) { - self::$RUBY31 = new FunctionRuntime('ruby-3.1'); - } - return self::$RUBY31; - } - public static function RUBY32(): FunctionRuntime - { - if (!isset(self::$RUBY32)) { - self::$RUBY32 = new FunctionRuntime('ruby-3.2'); - } - return self::$RUBY32; - } - public static function RUBY33(): FunctionRuntime - { - if (!isset(self::$RUBY33)) { - self::$RUBY33 = new FunctionRuntime('ruby-3.3'); - } - return self::$RUBY33; - } - public static function RUBY34(): FunctionRuntime - { - if (!isset(self::$RUBY34)) { - self::$RUBY34 = new FunctionRuntime('ruby-3.4'); - } - return self::$RUBY34; - } - public static function RUBY40(): FunctionRuntime - { - if (!isset(self::$RUBY40)) { - self::$RUBY40 = new FunctionRuntime('ruby-4.0'); - } - return self::$RUBY40; - } - public static function PYTHON38(): FunctionRuntime - { - if (!isset(self::$PYTHON38)) { - self::$PYTHON38 = new FunctionRuntime('python-3.8'); - } - return self::$PYTHON38; - } - public static function PYTHON39(): FunctionRuntime - { - if (!isset(self::$PYTHON39)) { - self::$PYTHON39 = new FunctionRuntime('python-3.9'); - } - return self::$PYTHON39; - } - public static function PYTHON310(): FunctionRuntime - { - if (!isset(self::$PYTHON310)) { - self::$PYTHON310 = new FunctionRuntime('python-3.10'); - } - return self::$PYTHON310; - } - public static function PYTHON311(): FunctionRuntime - { - if (!isset(self::$PYTHON311)) { - self::$PYTHON311 = new FunctionRuntime('python-3.11'); - } - return self::$PYTHON311; - } - public static function PYTHON312(): FunctionRuntime - { - if (!isset(self::$PYTHON312)) { - self::$PYTHON312 = new FunctionRuntime('python-3.12'); - } - return self::$PYTHON312; - } - public static function PYTHON313(): FunctionRuntime - { - if (!isset(self::$PYTHON313)) { - self::$PYTHON313 = new FunctionRuntime('python-3.13'); - } - return self::$PYTHON313; - } - public static function PYTHON314(): FunctionRuntime - { - if (!isset(self::$PYTHON314)) { - self::$PYTHON314 = new FunctionRuntime('python-3.14'); - } - return self::$PYTHON314; - } - public static function PYTHONML311(): FunctionRuntime - { - if (!isset(self::$PYTHONML311)) { - self::$PYTHONML311 = new FunctionRuntime('python-ml-3.11'); - } - return self::$PYTHONML311; - } - public static function PYTHONML312(): FunctionRuntime - { - if (!isset(self::$PYTHONML312)) { - self::$PYTHONML312 = new FunctionRuntime('python-ml-3.12'); - } - return self::$PYTHONML312; - } - public static function PYTHONML313(): FunctionRuntime - { - if (!isset(self::$PYTHONML313)) { - self::$PYTHONML313 = new FunctionRuntime('python-ml-3.13'); - } - return self::$PYTHONML313; - } - public static function DENO121(): FunctionRuntime - { - if (!isset(self::$DENO121)) { - self::$DENO121 = new FunctionRuntime('deno-1.21'); - } - return self::$DENO121; - } - public static function DENO124(): FunctionRuntime - { - if (!isset(self::$DENO124)) { - self::$DENO124 = new FunctionRuntime('deno-1.24'); - } - return self::$DENO124; - } - public static function DENO135(): FunctionRuntime - { - if (!isset(self::$DENO135)) { - self::$DENO135 = new FunctionRuntime('deno-1.35'); - } - return self::$DENO135; - } - public static function DENO140(): FunctionRuntime - { - if (!isset(self::$DENO140)) { - self::$DENO140 = new FunctionRuntime('deno-1.40'); - } - return self::$DENO140; - } - public static function DENO146(): FunctionRuntime - { - if (!isset(self::$DENO146)) { - self::$DENO146 = new FunctionRuntime('deno-1.46'); - } - return self::$DENO146; - } - public static function DENO20(): FunctionRuntime - { - if (!isset(self::$DENO20)) { - self::$DENO20 = new FunctionRuntime('deno-2.0'); - } - return self::$DENO20; - } - public static function DENO25(): FunctionRuntime - { - if (!isset(self::$DENO25)) { - self::$DENO25 = new FunctionRuntime('deno-2.5'); - } - return self::$DENO25; - } - public static function DENO26(): FunctionRuntime - { - if (!isset(self::$DENO26)) { - self::$DENO26 = new FunctionRuntime('deno-2.6'); - } - return self::$DENO26; - } - public static function DART215(): FunctionRuntime - { - if (!isset(self::$DART215)) { - self::$DART215 = new FunctionRuntime('dart-2.15'); - } - return self::$DART215; - } - public static function DART216(): FunctionRuntime - { - if (!isset(self::$DART216)) { - self::$DART216 = new FunctionRuntime('dart-2.16'); - } - return self::$DART216; - } - public static function DART217(): FunctionRuntime - { - if (!isset(self::$DART217)) { - self::$DART217 = new FunctionRuntime('dart-2.17'); - } - return self::$DART217; - } - public static function DART218(): FunctionRuntime - { - if (!isset(self::$DART218)) { - self::$DART218 = new FunctionRuntime('dart-2.18'); - } - return self::$DART218; - } - public static function DART219(): FunctionRuntime - { - if (!isset(self::$DART219)) { - self::$DART219 = new FunctionRuntime('dart-2.19'); - } - return self::$DART219; - } - public static function DART30(): FunctionRuntime - { - if (!isset(self::$DART30)) { - self::$DART30 = new FunctionRuntime('dart-3.0'); - } - return self::$DART30; - } - public static function DART31(): FunctionRuntime - { - if (!isset(self::$DART31)) { - self::$DART31 = new FunctionRuntime('dart-3.1'); - } - return self::$DART31; - } - public static function DART33(): FunctionRuntime - { - if (!isset(self::$DART33)) { - self::$DART33 = new FunctionRuntime('dart-3.3'); - } - return self::$DART33; - } - public static function DART35(): FunctionRuntime - { - if (!isset(self::$DART35)) { - self::$DART35 = new FunctionRuntime('dart-3.5'); - } - return self::$DART35; - } - public static function DART38(): FunctionRuntime - { - if (!isset(self::$DART38)) { - self::$DART38 = new FunctionRuntime('dart-3.8'); - } - return self::$DART38; - } - public static function DART39(): FunctionRuntime - { - if (!isset(self::$DART39)) { - self::$DART39 = new FunctionRuntime('dart-3.9'); - } - return self::$DART39; - } - public static function DART310(): FunctionRuntime - { - if (!isset(self::$DART310)) { - self::$DART310 = new FunctionRuntime('dart-3.10'); - } - return self::$DART310; - } - public static function DART311(): FunctionRuntime - { - if (!isset(self::$DART311)) { - self::$DART311 = new FunctionRuntime('dart-3.11'); - } - return self::$DART311; - } - public static function DART312(): FunctionRuntime - { - if (!isset(self::$DART312)) { - self::$DART312 = new FunctionRuntime('dart-3.12'); - } - return self::$DART312; - } - public static function DOTNET60(): FunctionRuntime - { - if (!isset(self::$DOTNET60)) { - self::$DOTNET60 = new FunctionRuntime('dotnet-6.0'); - } - return self::$DOTNET60; - } - public static function DOTNET70(): FunctionRuntime - { - if (!isset(self::$DOTNET70)) { - self::$DOTNET70 = new FunctionRuntime('dotnet-7.0'); - } - return self::$DOTNET70; - } - public static function DOTNET80(): FunctionRuntime - { - if (!isset(self::$DOTNET80)) { - self::$DOTNET80 = new FunctionRuntime('dotnet-8.0'); - } - return self::$DOTNET80; - } - public static function DOTNET10(): FunctionRuntime - { - if (!isset(self::$DOTNET10)) { - self::$DOTNET10 = new FunctionRuntime('dotnet-10'); - } - return self::$DOTNET10; - } - public static function JAVA80(): FunctionRuntime - { - if (!isset(self::$JAVA80)) { - self::$JAVA80 = new FunctionRuntime('java-8.0'); - } - return self::$JAVA80; - } - public static function JAVA110(): FunctionRuntime - { - if (!isset(self::$JAVA110)) { - self::$JAVA110 = new FunctionRuntime('java-11.0'); - } - return self::$JAVA110; - } - public static function JAVA170(): FunctionRuntime - { - if (!isset(self::$JAVA170)) { - self::$JAVA170 = new FunctionRuntime('java-17.0'); - } - return self::$JAVA170; - } - public static function JAVA180(): FunctionRuntime - { - if (!isset(self::$JAVA180)) { - self::$JAVA180 = new FunctionRuntime('java-18.0'); - } - return self::$JAVA180; - } - public static function JAVA210(): FunctionRuntime - { - if (!isset(self::$JAVA210)) { - self::$JAVA210 = new FunctionRuntime('java-21.0'); - } - return self::$JAVA210; - } - public static function JAVA22(): FunctionRuntime - { - if (!isset(self::$JAVA22)) { - self::$JAVA22 = new FunctionRuntime('java-22'); - } - return self::$JAVA22; - } - public static function JAVA25(): FunctionRuntime - { - if (!isset(self::$JAVA25)) { - self::$JAVA25 = new FunctionRuntime('java-25'); - } - return self::$JAVA25; - } - public static function SWIFT55(): FunctionRuntime - { - if (!isset(self::$SWIFT55)) { - self::$SWIFT55 = new FunctionRuntime('swift-5.5'); - } - return self::$SWIFT55; - } - public static function SWIFT58(): FunctionRuntime - { - if (!isset(self::$SWIFT58)) { - self::$SWIFT58 = new FunctionRuntime('swift-5.8'); - } - return self::$SWIFT58; - } - public static function SWIFT59(): FunctionRuntime - { - if (!isset(self::$SWIFT59)) { - self::$SWIFT59 = new FunctionRuntime('swift-5.9'); - } - return self::$SWIFT59; - } - public static function SWIFT510(): FunctionRuntime - { - if (!isset(self::$SWIFT510)) { - self::$SWIFT510 = new FunctionRuntime('swift-5.10'); - } - return self::$SWIFT510; - } - public static function SWIFT62(): FunctionRuntime - { - if (!isset(self::$SWIFT62)) { - self::$SWIFT62 = new FunctionRuntime('swift-6.2'); - } - return self::$SWIFT62; - } - public static function KOTLIN16(): FunctionRuntime - { - if (!isset(self::$KOTLIN16)) { - self::$KOTLIN16 = new FunctionRuntime('kotlin-1.6'); - } - return self::$KOTLIN16; - } - public static function KOTLIN18(): FunctionRuntime - { - if (!isset(self::$KOTLIN18)) { - self::$KOTLIN18 = new FunctionRuntime('kotlin-1.8'); - } - return self::$KOTLIN18; - } - public static function KOTLIN19(): FunctionRuntime - { - if (!isset(self::$KOTLIN19)) { - self::$KOTLIN19 = new FunctionRuntime('kotlin-1.9'); - } - return self::$KOTLIN19; - } - public static function KOTLIN20(): FunctionRuntime - { - if (!isset(self::$KOTLIN20)) { - self::$KOTLIN20 = new FunctionRuntime('kotlin-2.0'); - } - return self::$KOTLIN20; - } - public static function KOTLIN23(): FunctionRuntime - { - if (!isset(self::$KOTLIN23)) { - self::$KOTLIN23 = new FunctionRuntime('kotlin-2.3'); - } - return self::$KOTLIN23; - } - public static function CPP17(): FunctionRuntime - { - if (!isset(self::$CPP17)) { - self::$CPP17 = new FunctionRuntime('cpp-17'); - } - return self::$CPP17; - } - public static function CPP20(): FunctionRuntime - { - if (!isset(self::$CPP20)) { - self::$CPP20 = new FunctionRuntime('cpp-20'); - } - return self::$CPP20; - } - public static function BUN10(): FunctionRuntime - { - if (!isset(self::$BUN10)) { - self::$BUN10 = new FunctionRuntime('bun-1.0'); - } - return self::$BUN10; - } - public static function BUN11(): FunctionRuntime - { - if (!isset(self::$BUN11)) { - self::$BUN11 = new FunctionRuntime('bun-1.1'); - } - return self::$BUN11; - } - public static function BUN12(): FunctionRuntime - { - if (!isset(self::$BUN12)) { - self::$BUN12 = new FunctionRuntime('bun-1.2'); - } - return self::$BUN12; - } - public static function BUN13(): FunctionRuntime - { - if (!isset(self::$BUN13)) { - self::$BUN13 = new FunctionRuntime('bun-1.3'); - } - return self::$BUN13; - } - public static function GO123(): FunctionRuntime - { - if (!isset(self::$GO123)) { - self::$GO123 = new FunctionRuntime('go-1.23'); - } - return self::$GO123; - } - public static function GO124(): FunctionRuntime - { - if (!isset(self::$GO124)) { - self::$GO124 = new FunctionRuntime('go-1.24'); - } - return self::$GO124; - } - public static function GO125(): FunctionRuntime - { - if (!isset(self::$GO125)) { - self::$GO125 = new FunctionRuntime('go-1.25'); - } - return self::$GO125; - } - public static function GO126(): FunctionRuntime - { - if (!isset(self::$GO126)) { - self::$GO126 = new FunctionRuntime('go-1.26'); - } - return self::$GO126; - } - public static function RUST183(): FunctionRuntime - { - if (!isset(self::$RUST183)) { - self::$RUST183 = new FunctionRuntime('rust-1.83'); - } - return self::$RUST183; - } - public static function STATIC1(): FunctionRuntime - { - if (!isset(self::$STATIC1)) { - self::$STATIC1 = new FunctionRuntime('static-1'); - } - return self::$STATIC1; - } - public static function FLUTTER324(): FunctionRuntime - { - if (!isset(self::$FLUTTER324)) { - self::$FLUTTER324 = new FunctionRuntime('flutter-3.24'); - } - return self::$FLUTTER324; - } - public static function FLUTTER327(): FunctionRuntime - { - if (!isset(self::$FLUTTER327)) { - self::$FLUTTER327 = new FunctionRuntime('flutter-3.27'); - } - return self::$FLUTTER327; - } - public static function FLUTTER329(): FunctionRuntime - { - if (!isset(self::$FLUTTER329)) { - self::$FLUTTER329 = new FunctionRuntime('flutter-3.29'); - } - return self::$FLUTTER329; - } - public static function FLUTTER332(): FunctionRuntime - { - if (!isset(self::$FLUTTER332)) { - self::$FLUTTER332 = new FunctionRuntime('flutter-3.32'); - } - return self::$FLUTTER332; - } - public static function FLUTTER335(): FunctionRuntime - { - if (!isset(self::$FLUTTER335)) { - self::$FLUTTER335 = new FunctionRuntime('flutter-3.35'); - } - return self::$FLUTTER335; - } - public static function FLUTTER338(): FunctionRuntime - { - if (!isset(self::$FLUTTER338)) { - self::$FLUTTER338 = new FunctionRuntime('flutter-3.38'); - } - return self::$FLUTTER338; - } - public static function FLUTTER341(): FunctionRuntime - { - if (!isset(self::$FLUTTER341)) { - self::$FLUTTER341 = new FunctionRuntime('flutter-3.41'); - } - return self::$FLUTTER341; - } - public static function FLUTTER344(): FunctionRuntime - { - if (!isset(self::$FLUTTER344)) { - self::$FLUTTER344 = new FunctionRuntime('flutter-3.44'); - } - return self::$FLUTTER344; - } - - public static function from(string $value): self - { - return match ($value) { - 'node-14.5' => self::NODE145(), - 'node-16.0' => self::NODE160(), - 'node-18.0' => self::NODE180(), - 'node-19.0' => self::NODE190(), - 'node-20.0' => self::NODE200(), - 'node-21.0' => self::NODE210(), - 'node-22' => self::NODE22(), - 'node-23' => self::NODE23(), - 'node-24' => self::NODE24(), - 'node-25' => self::NODE25(), - 'php-8.0' => self::PHP80(), - 'php-8.1' => self::PHP81(), - 'php-8.2' => self::PHP82(), - 'php-8.3' => self::PHP83(), - 'php-8.4' => self::PHP84(), - 'ruby-3.0' => self::RUBY30(), - 'ruby-3.1' => self::RUBY31(), - 'ruby-3.2' => self::RUBY32(), - 'ruby-3.3' => self::RUBY33(), - 'ruby-3.4' => self::RUBY34(), - 'ruby-4.0' => self::RUBY40(), - 'python-3.8' => self::PYTHON38(), - 'python-3.9' => self::PYTHON39(), - 'python-3.10' => self::PYTHON310(), - 'python-3.11' => self::PYTHON311(), - 'python-3.12' => self::PYTHON312(), - 'python-3.13' => self::PYTHON313(), - 'python-3.14' => self::PYTHON314(), - 'python-ml-3.11' => self::PYTHONML311(), - 'python-ml-3.12' => self::PYTHONML312(), - 'python-ml-3.13' => self::PYTHONML313(), - 'deno-1.21' => self::DENO121(), - 'deno-1.24' => self::DENO124(), - 'deno-1.35' => self::DENO135(), - 'deno-1.40' => self::DENO140(), - 'deno-1.46' => self::DENO146(), - 'deno-2.0' => self::DENO20(), - 'deno-2.5' => self::DENO25(), - 'deno-2.6' => self::DENO26(), - 'dart-2.15' => self::DART215(), - 'dart-2.16' => self::DART216(), - 'dart-2.17' => self::DART217(), - 'dart-2.18' => self::DART218(), - 'dart-2.19' => self::DART219(), - 'dart-3.0' => self::DART30(), - 'dart-3.1' => self::DART31(), - 'dart-3.3' => self::DART33(), - 'dart-3.5' => self::DART35(), - 'dart-3.8' => self::DART38(), - 'dart-3.9' => self::DART39(), - 'dart-3.10' => self::DART310(), - 'dart-3.11' => self::DART311(), - 'dart-3.12' => self::DART312(), - 'dotnet-6.0' => self::DOTNET60(), - 'dotnet-7.0' => self::DOTNET70(), - 'dotnet-8.0' => self::DOTNET80(), - 'dotnet-10' => self::DOTNET10(), - 'java-8.0' => self::JAVA80(), - 'java-11.0' => self::JAVA110(), - 'java-17.0' => self::JAVA170(), - 'java-18.0' => self::JAVA180(), - 'java-21.0' => self::JAVA210(), - 'java-22' => self::JAVA22(), - 'java-25' => self::JAVA25(), - 'swift-5.5' => self::SWIFT55(), - 'swift-5.8' => self::SWIFT58(), - 'swift-5.9' => self::SWIFT59(), - 'swift-5.10' => self::SWIFT510(), - 'swift-6.2' => self::SWIFT62(), - 'kotlin-1.6' => self::KOTLIN16(), - 'kotlin-1.8' => self::KOTLIN18(), - 'kotlin-1.9' => self::KOTLIN19(), - 'kotlin-2.0' => self::KOTLIN20(), - 'kotlin-2.3' => self::KOTLIN23(), - 'cpp-17' => self::CPP17(), - 'cpp-20' => self::CPP20(), - 'bun-1.0' => self::BUN10(), - 'bun-1.1' => self::BUN11(), - 'bun-1.2' => self::BUN12(), - 'bun-1.3' => self::BUN13(), - 'go-1.23' => self::GO123(), - 'go-1.24' => self::GO124(), - 'go-1.25' => self::GO125(), - 'go-1.26' => self::GO126(), - 'rust-1.83' => self::RUST183(), - 'static-1' => self::STATIC1(), - 'flutter-3.24' => self::FLUTTER324(), - 'flutter-3.27' => self::FLUTTER327(), - 'flutter-3.29' => self::FLUTTER329(), - 'flutter-3.32' => self::FLUTTER332(), - 'flutter-3.35' => self::FLUTTER335(), - 'flutter-3.38' => self::FLUTTER338(), - 'flutter-3.41' => self::FLUTTER341(), - 'flutter-3.44' => self::FLUTTER344(), - default => throw new \InvalidArgumentException('Unknown FunctionRuntime value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/ProjectPolicyId.php b/src/Appwrite/Enums/ProjectPolicyId.php index b2bfdeee..8a7ca541 100644 --- a/src/Appwrite/Enums/ProjectPolicyId.php +++ b/src/Appwrite/Enums/ProjectPolicyId.php @@ -15,6 +15,9 @@ class ProjectPolicyId implements JsonSerializable private static ProjectPolicyId $SESSIONLIMIT; private static ProjectPolicyId $USERLIMIT; private static ProjectPolicyId $MEMBERSHIPPRIVACY; + private static ProjectPolicyId $DENYALIASEDEMAIL; + private static ProjectPolicyId $DENYDISPOSABLEEMAIL; + private static ProjectPolicyId $DENYFREEEMAIL; private string $value; @@ -96,6 +99,27 @@ public static function MEMBERSHIPPRIVACY(): ProjectPolicyId } return self::$MEMBERSHIPPRIVACY; } + public static function DENYALIASEDEMAIL(): ProjectPolicyId + { + if (!isset(self::$DENYALIASEDEMAIL)) { + self::$DENYALIASEDEMAIL = new ProjectPolicyId('deny-aliased-email'); + } + return self::$DENYALIASEDEMAIL; + } + public static function DENYDISPOSABLEEMAIL(): ProjectPolicyId + { + if (!isset(self::$DENYDISPOSABLEEMAIL)) { + self::$DENYDISPOSABLEEMAIL = new ProjectPolicyId('deny-disposable-email'); + } + return self::$DENYDISPOSABLEEMAIL; + } + public static function DENYFREEEMAIL(): ProjectPolicyId + { + if (!isset(self::$DENYFREEEMAIL)) { + self::$DENYFREEEMAIL = new ProjectPolicyId('deny-free-email'); + } + return self::$DENYFREEEMAIL; + } public static function from(string $value): self { @@ -109,6 +133,9 @@ public static function from(string $value): self 'session-limit' => self::SESSIONLIMIT(), 'user-limit' => self::USERLIMIT(), 'membership-privacy' => self::MEMBERSHIPPRIVACY(), + 'deny-aliased-email' => self::DENYALIASEDEMAIL(), + 'deny-disposable-email' => self::DENYDISPOSABLEEMAIL(), + 'deny-free-email' => self::DENYFREEEMAIL(), default => throw new \InvalidArgumentException('Unknown ProjectPolicyId value: ' . $value), }; } diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php new file mode 100644 index 00000000..e6f9f263 --- /dev/null +++ b/src/Appwrite/Enums/Runtime.php @@ -0,0 +1,853 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NODE145(): Runtime + { + if (!isset(self::$NODE145)) { + self::$NODE145 = new Runtime('node-14.5'); + } + return self::$NODE145; + } + public static function NODE160(): Runtime + { + if (!isset(self::$NODE160)) { + self::$NODE160 = new Runtime('node-16.0'); + } + return self::$NODE160; + } + public static function NODE180(): Runtime + { + if (!isset(self::$NODE180)) { + self::$NODE180 = new Runtime('node-18.0'); + } + return self::$NODE180; + } + public static function NODE190(): Runtime + { + if (!isset(self::$NODE190)) { + self::$NODE190 = new Runtime('node-19.0'); + } + return self::$NODE190; + } + public static function NODE200(): Runtime + { + if (!isset(self::$NODE200)) { + self::$NODE200 = new Runtime('node-20.0'); + } + return self::$NODE200; + } + public static function NODE210(): Runtime + { + if (!isset(self::$NODE210)) { + self::$NODE210 = new Runtime('node-21.0'); + } + return self::$NODE210; + } + public static function NODE22(): Runtime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new Runtime('node-22'); + } + return self::$NODE22; + } + public static function NODE23(): Runtime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new Runtime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): Runtime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new Runtime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): Runtime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new Runtime('node-25'); + } + return self::$NODE25; + } + public static function PHP80(): Runtime + { + if (!isset(self::$PHP80)) { + self::$PHP80 = new Runtime('php-8.0'); + } + return self::$PHP80; + } + public static function PHP81(): Runtime + { + if (!isset(self::$PHP81)) { + self::$PHP81 = new Runtime('php-8.1'); + } + return self::$PHP81; + } + public static function PHP82(): Runtime + { + if (!isset(self::$PHP82)) { + self::$PHP82 = new Runtime('php-8.2'); + } + return self::$PHP82; + } + public static function PHP83(): Runtime + { + if (!isset(self::$PHP83)) { + self::$PHP83 = new Runtime('php-8.3'); + } + return self::$PHP83; + } + public static function PHP84(): Runtime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new Runtime('php-8.4'); + } + return self::$PHP84; + } + public static function RUBY30(): Runtime + { + if (!isset(self::$RUBY30)) { + self::$RUBY30 = new Runtime('ruby-3.0'); + } + return self::$RUBY30; + } + public static function RUBY31(): Runtime + { + if (!isset(self::$RUBY31)) { + self::$RUBY31 = new Runtime('ruby-3.1'); + } + return self::$RUBY31; + } + public static function RUBY32(): Runtime + { + if (!isset(self::$RUBY32)) { + self::$RUBY32 = new Runtime('ruby-3.2'); + } + return self::$RUBY32; + } + public static function RUBY33(): Runtime + { + if (!isset(self::$RUBY33)) { + self::$RUBY33 = new Runtime('ruby-3.3'); + } + return self::$RUBY33; + } + public static function RUBY34(): Runtime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new Runtime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): Runtime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new Runtime('ruby-4.0'); + } + return self::$RUBY40; + } + public static function PYTHON38(): Runtime + { + if (!isset(self::$PYTHON38)) { + self::$PYTHON38 = new Runtime('python-3.8'); + } + return self::$PYTHON38; + } + public static function PYTHON39(): Runtime + { + if (!isset(self::$PYTHON39)) { + self::$PYTHON39 = new Runtime('python-3.9'); + } + return self::$PYTHON39; + } + public static function PYTHON310(): Runtime + { + if (!isset(self::$PYTHON310)) { + self::$PYTHON310 = new Runtime('python-3.10'); + } + return self::$PYTHON310; + } + public static function PYTHON311(): Runtime + { + if (!isset(self::$PYTHON311)) { + self::$PYTHON311 = new Runtime('python-3.11'); + } + return self::$PYTHON311; + } + public static function PYTHON312(): Runtime + { + if (!isset(self::$PYTHON312)) { + self::$PYTHON312 = new Runtime('python-3.12'); + } + return self::$PYTHON312; + } + public static function PYTHON313(): Runtime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new Runtime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): Runtime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new Runtime('python-3.14'); + } + return self::$PYTHON314; + } + public static function PYTHONML311(): Runtime + { + if (!isset(self::$PYTHONML311)) { + self::$PYTHONML311 = new Runtime('python-ml-3.11'); + } + return self::$PYTHONML311; + } + public static function PYTHONML312(): Runtime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new Runtime('python-ml-3.12'); + } + return self::$PYTHONML312; + } + public static function PYTHONML313(): Runtime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new Runtime('python-ml-3.13'); + } + return self::$PYTHONML313; + } + public static function DENO140(): Runtime + { + if (!isset(self::$DENO140)) { + self::$DENO140 = new Runtime('deno-1.40'); + } + return self::$DENO140; + } + public static function DENO146(): Runtime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new Runtime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): Runtime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new Runtime('deno-2.0'); + } + return self::$DENO20; + } + public static function DENO25(): Runtime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new Runtime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): Runtime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new Runtime('deno-2.6'); + } + return self::$DENO26; + } + public static function DART215(): Runtime + { + if (!isset(self::$DART215)) { + self::$DART215 = new Runtime('dart-2.15'); + } + return self::$DART215; + } + public static function DART216(): Runtime + { + if (!isset(self::$DART216)) { + self::$DART216 = new Runtime('dart-2.16'); + } + return self::$DART216; + } + public static function DART217(): Runtime + { + if (!isset(self::$DART217)) { + self::$DART217 = new Runtime('dart-2.17'); + } + return self::$DART217; + } + public static function DART218(): Runtime + { + if (!isset(self::$DART218)) { + self::$DART218 = new Runtime('dart-2.18'); + } + return self::$DART218; + } + public static function DART219(): Runtime + { + if (!isset(self::$DART219)) { + self::$DART219 = new Runtime('dart-2.19'); + } + return self::$DART219; + } + public static function DART30(): Runtime + { + if (!isset(self::$DART30)) { + self::$DART30 = new Runtime('dart-3.0'); + } + return self::$DART30; + } + public static function DART31(): Runtime + { + if (!isset(self::$DART31)) { + self::$DART31 = new Runtime('dart-3.1'); + } + return self::$DART31; + } + public static function DART33(): Runtime + { + if (!isset(self::$DART33)) { + self::$DART33 = new Runtime('dart-3.3'); + } + return self::$DART33; + } + public static function DART35(): Runtime + { + if (!isset(self::$DART35)) { + self::$DART35 = new Runtime('dart-3.5'); + } + return self::$DART35; + } + public static function DART38(): Runtime + { + if (!isset(self::$DART38)) { + self::$DART38 = new Runtime('dart-3.8'); + } + return self::$DART38; + } + public static function DART39(): Runtime + { + if (!isset(self::$DART39)) { + self::$DART39 = new Runtime('dart-3.9'); + } + return self::$DART39; + } + public static function DART310(): Runtime + { + if (!isset(self::$DART310)) { + self::$DART310 = new Runtime('dart-3.10'); + } + return self::$DART310; + } + public static function DART311(): Runtime + { + if (!isset(self::$DART311)) { + self::$DART311 = new Runtime('dart-3.11'); + } + return self::$DART311; + } + public static function DART312(): Runtime + { + if (!isset(self::$DART312)) { + self::$DART312 = new Runtime('dart-3.12'); + } + return self::$DART312; + } + public static function DOTNET60(): Runtime + { + if (!isset(self::$DOTNET60)) { + self::$DOTNET60 = new Runtime('dotnet-6.0'); + } + return self::$DOTNET60; + } + public static function DOTNET70(): Runtime + { + if (!isset(self::$DOTNET70)) { + self::$DOTNET70 = new Runtime('dotnet-7.0'); + } + return self::$DOTNET70; + } + public static function DOTNET80(): Runtime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new Runtime('dotnet-8.0'); + } + return self::$DOTNET80; + } + public static function DOTNET10(): Runtime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new Runtime('dotnet-10'); + } + return self::$DOTNET10; + } + public static function JAVA80(): Runtime + { + if (!isset(self::$JAVA80)) { + self::$JAVA80 = new Runtime('java-8.0'); + } + return self::$JAVA80; + } + public static function JAVA110(): Runtime + { + if (!isset(self::$JAVA110)) { + self::$JAVA110 = new Runtime('java-11.0'); + } + return self::$JAVA110; + } + public static function JAVA170(): Runtime + { + if (!isset(self::$JAVA170)) { + self::$JAVA170 = new Runtime('java-17.0'); + } + return self::$JAVA170; + } + public static function JAVA180(): Runtime + { + if (!isset(self::$JAVA180)) { + self::$JAVA180 = new Runtime('java-18.0'); + } + return self::$JAVA180; + } + public static function JAVA210(): Runtime + { + if (!isset(self::$JAVA210)) { + self::$JAVA210 = new Runtime('java-21.0'); + } + return self::$JAVA210; + } + public static function JAVA22(): Runtime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new Runtime('java-22'); + } + return self::$JAVA22; + } + public static function JAVA25(): Runtime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new Runtime('java-25'); + } + return self::$JAVA25; + } + public static function SWIFT55(): Runtime + { + if (!isset(self::$SWIFT55)) { + self::$SWIFT55 = new Runtime('swift-5.5'); + } + return self::$SWIFT55; + } + public static function SWIFT58(): Runtime + { + if (!isset(self::$SWIFT58)) { + self::$SWIFT58 = new Runtime('swift-5.8'); + } + return self::$SWIFT58; + } + public static function SWIFT59(): Runtime + { + if (!isset(self::$SWIFT59)) { + self::$SWIFT59 = new Runtime('swift-5.9'); + } + return self::$SWIFT59; + } + public static function SWIFT510(): Runtime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new Runtime('swift-5.10'); + } + return self::$SWIFT510; + } + public static function SWIFT62(): Runtime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new Runtime('swift-6.2'); + } + return self::$SWIFT62; + } + public static function KOTLIN16(): Runtime + { + if (!isset(self::$KOTLIN16)) { + self::$KOTLIN16 = new Runtime('kotlin-1.6'); + } + return self::$KOTLIN16; + } + public static function KOTLIN18(): Runtime + { + if (!isset(self::$KOTLIN18)) { + self::$KOTLIN18 = new Runtime('kotlin-1.8'); + } + return self::$KOTLIN18; + } + public static function KOTLIN19(): Runtime + { + if (!isset(self::$KOTLIN19)) { + self::$KOTLIN19 = new Runtime('kotlin-1.9'); + } + return self::$KOTLIN19; + } + public static function KOTLIN20(): Runtime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new Runtime('kotlin-2.0'); + } + return self::$KOTLIN20; + } + public static function KOTLIN23(): Runtime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new Runtime('kotlin-2.3'); + } + return self::$KOTLIN23; + } + public static function CPP17(): Runtime + { + if (!isset(self::$CPP17)) { + self::$CPP17 = new Runtime('cpp-17'); + } + return self::$CPP17; + } + public static function CPP20(): Runtime + { + if (!isset(self::$CPP20)) { + self::$CPP20 = new Runtime('cpp-20'); + } + return self::$CPP20; + } + public static function BUN10(): Runtime + { + if (!isset(self::$BUN10)) { + self::$BUN10 = new Runtime('bun-1.0'); + } + return self::$BUN10; + } + public static function BUN11(): Runtime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new Runtime('bun-1.1'); + } + return self::$BUN11; + } + public static function BUN12(): Runtime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new Runtime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): Runtime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new Runtime('bun-1.3'); + } + return self::$BUN13; + } + public static function GO123(): Runtime + { + if (!isset(self::$GO123)) { + self::$GO123 = new Runtime('go-1.23'); + } + return self::$GO123; + } + public static function GO124(): Runtime + { + if (!isset(self::$GO124)) { + self::$GO124 = new Runtime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): Runtime + { + if (!isset(self::$GO125)) { + self::$GO125 = new Runtime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): Runtime + { + if (!isset(self::$GO126)) { + self::$GO126 = new Runtime('go-1.26'); + } + return self::$GO126; + } + public static function RUST183(): Runtime + { + if (!isset(self::$RUST183)) { + self::$RUST183 = new Runtime('rust-1.83'); + } + return self::$RUST183; + } + public static function STATIC1(): Runtime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new Runtime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): Runtime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new Runtime('flutter-3.24'); + } + return self::$FLUTTER324; + } + public static function FLUTTER327(): Runtime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new Runtime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): Runtime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new Runtime('flutter-3.29'); + } + return self::$FLUTTER329; + } + public static function FLUTTER332(): Runtime + { + if (!isset(self::$FLUTTER332)) { + self::$FLUTTER332 = new Runtime('flutter-3.32'); + } + return self::$FLUTTER332; + } + public static function FLUTTER335(): Runtime + { + if (!isset(self::$FLUTTER335)) { + self::$FLUTTER335 = new Runtime('flutter-3.35'); + } + return self::$FLUTTER335; + } + public static function FLUTTER338(): Runtime + { + if (!isset(self::$FLUTTER338)) { + self::$FLUTTER338 = new Runtime('flutter-3.38'); + } + return self::$FLUTTER338; + } + public static function FLUTTER341(): Runtime + { + if (!isset(self::$FLUTTER341)) { + self::$FLUTTER341 = new Runtime('flutter-3.41'); + } + return self::$FLUTTER341; + } + public static function FLUTTER344(): Runtime + { + if (!isset(self::$FLUTTER344)) { + self::$FLUTTER344 = new Runtime('flutter-3.44'); + } + return self::$FLUTTER344; + } + + public static function from(string $value): self + { + return match ($value) { + 'node-14.5' => self::NODE145(), + 'node-16.0' => self::NODE160(), + 'node-18.0' => self::NODE180(), + 'node-19.0' => self::NODE190(), + 'node-20.0' => self::NODE200(), + 'node-21.0' => self::NODE210(), + 'node-22' => self::NODE22(), + 'node-23' => self::NODE23(), + 'node-24' => self::NODE24(), + 'node-25' => self::NODE25(), + 'php-8.0' => self::PHP80(), + 'php-8.1' => self::PHP81(), + 'php-8.2' => self::PHP82(), + 'php-8.3' => self::PHP83(), + 'php-8.4' => self::PHP84(), + 'ruby-3.0' => self::RUBY30(), + 'ruby-3.1' => self::RUBY31(), + 'ruby-3.2' => self::RUBY32(), + 'ruby-3.3' => self::RUBY33(), + 'ruby-3.4' => self::RUBY34(), + 'ruby-4.0' => self::RUBY40(), + 'python-3.8' => self::PYTHON38(), + 'python-3.9' => self::PYTHON39(), + 'python-3.10' => self::PYTHON310(), + 'python-3.11' => self::PYTHON311(), + 'python-3.12' => self::PYTHON312(), + 'python-3.13' => self::PYTHON313(), + 'python-3.14' => self::PYTHON314(), + 'python-ml-3.11' => self::PYTHONML311(), + 'python-ml-3.12' => self::PYTHONML312(), + 'python-ml-3.13' => self::PYTHONML313(), + 'deno-1.40' => self::DENO140(), + 'deno-1.46' => self::DENO146(), + 'deno-2.0' => self::DENO20(), + 'deno-2.5' => self::DENO25(), + 'deno-2.6' => self::DENO26(), + 'dart-2.15' => self::DART215(), + 'dart-2.16' => self::DART216(), + 'dart-2.17' => self::DART217(), + 'dart-2.18' => self::DART218(), + 'dart-2.19' => self::DART219(), + 'dart-3.0' => self::DART30(), + 'dart-3.1' => self::DART31(), + 'dart-3.3' => self::DART33(), + 'dart-3.5' => self::DART35(), + 'dart-3.8' => self::DART38(), + 'dart-3.9' => self::DART39(), + 'dart-3.10' => self::DART310(), + 'dart-3.11' => self::DART311(), + 'dart-3.12' => self::DART312(), + 'dotnet-6.0' => self::DOTNET60(), + 'dotnet-7.0' => self::DOTNET70(), + 'dotnet-8.0' => self::DOTNET80(), + 'dotnet-10' => self::DOTNET10(), + 'java-8.0' => self::JAVA80(), + 'java-11.0' => self::JAVA110(), + 'java-17.0' => self::JAVA170(), + 'java-18.0' => self::JAVA180(), + 'java-21.0' => self::JAVA210(), + 'java-22' => self::JAVA22(), + 'java-25' => self::JAVA25(), + 'swift-5.5' => self::SWIFT55(), + 'swift-5.8' => self::SWIFT58(), + 'swift-5.9' => self::SWIFT59(), + 'swift-5.10' => self::SWIFT510(), + 'swift-6.2' => self::SWIFT62(), + 'kotlin-1.6' => self::KOTLIN16(), + 'kotlin-1.8' => self::KOTLIN18(), + 'kotlin-1.9' => self::KOTLIN19(), + 'kotlin-2.0' => self::KOTLIN20(), + 'kotlin-2.3' => self::KOTLIN23(), + 'cpp-17' => self::CPP17(), + 'cpp-20' => self::CPP20(), + 'bun-1.0' => self::BUN10(), + 'bun-1.1' => self::BUN11(), + 'bun-1.2' => self::BUN12(), + 'bun-1.3' => self::BUN13(), + 'go-1.23' => self::GO123(), + 'go-1.24' => self::GO124(), + 'go-1.25' => self::GO125(), + 'go-1.26' => self::GO126(), + 'rust-1.83' => self::RUST183(), + 'static-1' => self::STATIC1(), + 'flutter-3.24' => self::FLUTTER324(), + 'flutter-3.27' => self::FLUTTER327(), + 'flutter-3.29' => self::FLUTTER329(), + 'flutter-3.32' => self::FLUTTER332(), + 'flutter-3.35' => self::FLUTTER335(), + 'flutter-3.38' => self::FLUTTER338(), + 'flutter-3.41' => self::FLUTTER341(), + 'flutter-3.44' => self::FLUTTER344(), + default => throw new \InvalidArgumentException('Unknown Runtime value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/SiteBuildRuntime.php b/src/Appwrite/Enums/SiteBuildRuntime.php deleted file mode 100644 index 217834df..00000000 --- a/src/Appwrite/Enums/SiteBuildRuntime.php +++ /dev/null @@ -1,880 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NODE145(): SiteBuildRuntime - { - if (!isset(self::$NODE145)) { - self::$NODE145 = new SiteBuildRuntime('node-14.5'); - } - return self::$NODE145; - } - public static function NODE160(): SiteBuildRuntime - { - if (!isset(self::$NODE160)) { - self::$NODE160 = new SiteBuildRuntime('node-16.0'); - } - return self::$NODE160; - } - public static function NODE180(): SiteBuildRuntime - { - if (!isset(self::$NODE180)) { - self::$NODE180 = new SiteBuildRuntime('node-18.0'); - } - return self::$NODE180; - } - public static function NODE190(): SiteBuildRuntime - { - if (!isset(self::$NODE190)) { - self::$NODE190 = new SiteBuildRuntime('node-19.0'); - } - return self::$NODE190; - } - public static function NODE200(): SiteBuildRuntime - { - if (!isset(self::$NODE200)) { - self::$NODE200 = new SiteBuildRuntime('node-20.0'); - } - return self::$NODE200; - } - public static function NODE210(): SiteBuildRuntime - { - if (!isset(self::$NODE210)) { - self::$NODE210 = new SiteBuildRuntime('node-21.0'); - } - return self::$NODE210; - } - public static function NODE22(): SiteBuildRuntime - { - if (!isset(self::$NODE22)) { - self::$NODE22 = new SiteBuildRuntime('node-22'); - } - return self::$NODE22; - } - public static function NODE23(): SiteBuildRuntime - { - if (!isset(self::$NODE23)) { - self::$NODE23 = new SiteBuildRuntime('node-23'); - } - return self::$NODE23; - } - public static function NODE24(): SiteBuildRuntime - { - if (!isset(self::$NODE24)) { - self::$NODE24 = new SiteBuildRuntime('node-24'); - } - return self::$NODE24; - } - public static function NODE25(): SiteBuildRuntime - { - if (!isset(self::$NODE25)) { - self::$NODE25 = new SiteBuildRuntime('node-25'); - } - return self::$NODE25; - } - public static function PHP80(): SiteBuildRuntime - { - if (!isset(self::$PHP80)) { - self::$PHP80 = new SiteBuildRuntime('php-8.0'); - } - return self::$PHP80; - } - public static function PHP81(): SiteBuildRuntime - { - if (!isset(self::$PHP81)) { - self::$PHP81 = new SiteBuildRuntime('php-8.1'); - } - return self::$PHP81; - } - public static function PHP82(): SiteBuildRuntime - { - if (!isset(self::$PHP82)) { - self::$PHP82 = new SiteBuildRuntime('php-8.2'); - } - return self::$PHP82; - } - public static function PHP83(): SiteBuildRuntime - { - if (!isset(self::$PHP83)) { - self::$PHP83 = new SiteBuildRuntime('php-8.3'); - } - return self::$PHP83; - } - public static function PHP84(): SiteBuildRuntime - { - if (!isset(self::$PHP84)) { - self::$PHP84 = new SiteBuildRuntime('php-8.4'); - } - return self::$PHP84; - } - public static function RUBY30(): SiteBuildRuntime - { - if (!isset(self::$RUBY30)) { - self::$RUBY30 = new SiteBuildRuntime('ruby-3.0'); - } - return self::$RUBY30; - } - public static function RUBY31(): SiteBuildRuntime - { - if (!isset(self::$RUBY31)) { - self::$RUBY31 = new SiteBuildRuntime('ruby-3.1'); - } - return self::$RUBY31; - } - public static function RUBY32(): SiteBuildRuntime - { - if (!isset(self::$RUBY32)) { - self::$RUBY32 = new SiteBuildRuntime('ruby-3.2'); - } - return self::$RUBY32; - } - public static function RUBY33(): SiteBuildRuntime - { - if (!isset(self::$RUBY33)) { - self::$RUBY33 = new SiteBuildRuntime('ruby-3.3'); - } - return self::$RUBY33; - } - public static function RUBY34(): SiteBuildRuntime - { - if (!isset(self::$RUBY34)) { - self::$RUBY34 = new SiteBuildRuntime('ruby-3.4'); - } - return self::$RUBY34; - } - public static function RUBY40(): SiteBuildRuntime - { - if (!isset(self::$RUBY40)) { - self::$RUBY40 = new SiteBuildRuntime('ruby-4.0'); - } - return self::$RUBY40; - } - public static function PYTHON38(): SiteBuildRuntime - { - if (!isset(self::$PYTHON38)) { - self::$PYTHON38 = new SiteBuildRuntime('python-3.8'); - } - return self::$PYTHON38; - } - public static function PYTHON39(): SiteBuildRuntime - { - if (!isset(self::$PYTHON39)) { - self::$PYTHON39 = new SiteBuildRuntime('python-3.9'); - } - return self::$PYTHON39; - } - public static function PYTHON310(): SiteBuildRuntime - { - if (!isset(self::$PYTHON310)) { - self::$PYTHON310 = new SiteBuildRuntime('python-3.10'); - } - return self::$PYTHON310; - } - public static function PYTHON311(): SiteBuildRuntime - { - if (!isset(self::$PYTHON311)) { - self::$PYTHON311 = new SiteBuildRuntime('python-3.11'); - } - return self::$PYTHON311; - } - public static function PYTHON312(): SiteBuildRuntime - { - if (!isset(self::$PYTHON312)) { - self::$PYTHON312 = new SiteBuildRuntime('python-3.12'); - } - return self::$PYTHON312; - } - public static function PYTHON313(): SiteBuildRuntime - { - if (!isset(self::$PYTHON313)) { - self::$PYTHON313 = new SiteBuildRuntime('python-3.13'); - } - return self::$PYTHON313; - } - public static function PYTHON314(): SiteBuildRuntime - { - if (!isset(self::$PYTHON314)) { - self::$PYTHON314 = new SiteBuildRuntime('python-3.14'); - } - return self::$PYTHON314; - } - public static function PYTHONML311(): SiteBuildRuntime - { - if (!isset(self::$PYTHONML311)) { - self::$PYTHONML311 = new SiteBuildRuntime('python-ml-3.11'); - } - return self::$PYTHONML311; - } - public static function PYTHONML312(): SiteBuildRuntime - { - if (!isset(self::$PYTHONML312)) { - self::$PYTHONML312 = new SiteBuildRuntime('python-ml-3.12'); - } - return self::$PYTHONML312; - } - public static function PYTHONML313(): SiteBuildRuntime - { - if (!isset(self::$PYTHONML313)) { - self::$PYTHONML313 = new SiteBuildRuntime('python-ml-3.13'); - } - return self::$PYTHONML313; - } - public static function DENO121(): SiteBuildRuntime - { - if (!isset(self::$DENO121)) { - self::$DENO121 = new SiteBuildRuntime('deno-1.21'); - } - return self::$DENO121; - } - public static function DENO124(): SiteBuildRuntime - { - if (!isset(self::$DENO124)) { - self::$DENO124 = new SiteBuildRuntime('deno-1.24'); - } - return self::$DENO124; - } - public static function DENO135(): SiteBuildRuntime - { - if (!isset(self::$DENO135)) { - self::$DENO135 = new SiteBuildRuntime('deno-1.35'); - } - return self::$DENO135; - } - public static function DENO140(): SiteBuildRuntime - { - if (!isset(self::$DENO140)) { - self::$DENO140 = new SiteBuildRuntime('deno-1.40'); - } - return self::$DENO140; - } - public static function DENO146(): SiteBuildRuntime - { - if (!isset(self::$DENO146)) { - self::$DENO146 = new SiteBuildRuntime('deno-1.46'); - } - return self::$DENO146; - } - public static function DENO20(): SiteBuildRuntime - { - if (!isset(self::$DENO20)) { - self::$DENO20 = new SiteBuildRuntime('deno-2.0'); - } - return self::$DENO20; - } - public static function DENO25(): SiteBuildRuntime - { - if (!isset(self::$DENO25)) { - self::$DENO25 = new SiteBuildRuntime('deno-2.5'); - } - return self::$DENO25; - } - public static function DENO26(): SiteBuildRuntime - { - if (!isset(self::$DENO26)) { - self::$DENO26 = new SiteBuildRuntime('deno-2.6'); - } - return self::$DENO26; - } - public static function DART215(): SiteBuildRuntime - { - if (!isset(self::$DART215)) { - self::$DART215 = new SiteBuildRuntime('dart-2.15'); - } - return self::$DART215; - } - public static function DART216(): SiteBuildRuntime - { - if (!isset(self::$DART216)) { - self::$DART216 = new SiteBuildRuntime('dart-2.16'); - } - return self::$DART216; - } - public static function DART217(): SiteBuildRuntime - { - if (!isset(self::$DART217)) { - self::$DART217 = new SiteBuildRuntime('dart-2.17'); - } - return self::$DART217; - } - public static function DART218(): SiteBuildRuntime - { - if (!isset(self::$DART218)) { - self::$DART218 = new SiteBuildRuntime('dart-2.18'); - } - return self::$DART218; - } - public static function DART219(): SiteBuildRuntime - { - if (!isset(self::$DART219)) { - self::$DART219 = new SiteBuildRuntime('dart-2.19'); - } - return self::$DART219; - } - public static function DART30(): SiteBuildRuntime - { - if (!isset(self::$DART30)) { - self::$DART30 = new SiteBuildRuntime('dart-3.0'); - } - return self::$DART30; - } - public static function DART31(): SiteBuildRuntime - { - if (!isset(self::$DART31)) { - self::$DART31 = new SiteBuildRuntime('dart-3.1'); - } - return self::$DART31; - } - public static function DART33(): SiteBuildRuntime - { - if (!isset(self::$DART33)) { - self::$DART33 = new SiteBuildRuntime('dart-3.3'); - } - return self::$DART33; - } - public static function DART35(): SiteBuildRuntime - { - if (!isset(self::$DART35)) { - self::$DART35 = new SiteBuildRuntime('dart-3.5'); - } - return self::$DART35; - } - public static function DART38(): SiteBuildRuntime - { - if (!isset(self::$DART38)) { - self::$DART38 = new SiteBuildRuntime('dart-3.8'); - } - return self::$DART38; - } - public static function DART39(): SiteBuildRuntime - { - if (!isset(self::$DART39)) { - self::$DART39 = new SiteBuildRuntime('dart-3.9'); - } - return self::$DART39; - } - public static function DART310(): SiteBuildRuntime - { - if (!isset(self::$DART310)) { - self::$DART310 = new SiteBuildRuntime('dart-3.10'); - } - return self::$DART310; - } - public static function DART311(): SiteBuildRuntime - { - if (!isset(self::$DART311)) { - self::$DART311 = new SiteBuildRuntime('dart-3.11'); - } - return self::$DART311; - } - public static function DART312(): SiteBuildRuntime - { - if (!isset(self::$DART312)) { - self::$DART312 = new SiteBuildRuntime('dart-3.12'); - } - return self::$DART312; - } - public static function DOTNET60(): SiteBuildRuntime - { - if (!isset(self::$DOTNET60)) { - self::$DOTNET60 = new SiteBuildRuntime('dotnet-6.0'); - } - return self::$DOTNET60; - } - public static function DOTNET70(): SiteBuildRuntime - { - if (!isset(self::$DOTNET70)) { - self::$DOTNET70 = new SiteBuildRuntime('dotnet-7.0'); - } - return self::$DOTNET70; - } - public static function DOTNET80(): SiteBuildRuntime - { - if (!isset(self::$DOTNET80)) { - self::$DOTNET80 = new SiteBuildRuntime('dotnet-8.0'); - } - return self::$DOTNET80; - } - public static function DOTNET10(): SiteBuildRuntime - { - if (!isset(self::$DOTNET10)) { - self::$DOTNET10 = new SiteBuildRuntime('dotnet-10'); - } - return self::$DOTNET10; - } - public static function JAVA80(): SiteBuildRuntime - { - if (!isset(self::$JAVA80)) { - self::$JAVA80 = new SiteBuildRuntime('java-8.0'); - } - return self::$JAVA80; - } - public static function JAVA110(): SiteBuildRuntime - { - if (!isset(self::$JAVA110)) { - self::$JAVA110 = new SiteBuildRuntime('java-11.0'); - } - return self::$JAVA110; - } - public static function JAVA170(): SiteBuildRuntime - { - if (!isset(self::$JAVA170)) { - self::$JAVA170 = new SiteBuildRuntime('java-17.0'); - } - return self::$JAVA170; - } - public static function JAVA180(): SiteBuildRuntime - { - if (!isset(self::$JAVA180)) { - self::$JAVA180 = new SiteBuildRuntime('java-18.0'); - } - return self::$JAVA180; - } - public static function JAVA210(): SiteBuildRuntime - { - if (!isset(self::$JAVA210)) { - self::$JAVA210 = new SiteBuildRuntime('java-21.0'); - } - return self::$JAVA210; - } - public static function JAVA22(): SiteBuildRuntime - { - if (!isset(self::$JAVA22)) { - self::$JAVA22 = new SiteBuildRuntime('java-22'); - } - return self::$JAVA22; - } - public static function JAVA25(): SiteBuildRuntime - { - if (!isset(self::$JAVA25)) { - self::$JAVA25 = new SiteBuildRuntime('java-25'); - } - return self::$JAVA25; - } - public static function SWIFT55(): SiteBuildRuntime - { - if (!isset(self::$SWIFT55)) { - self::$SWIFT55 = new SiteBuildRuntime('swift-5.5'); - } - return self::$SWIFT55; - } - public static function SWIFT58(): SiteBuildRuntime - { - if (!isset(self::$SWIFT58)) { - self::$SWIFT58 = new SiteBuildRuntime('swift-5.8'); - } - return self::$SWIFT58; - } - public static function SWIFT59(): SiteBuildRuntime - { - if (!isset(self::$SWIFT59)) { - self::$SWIFT59 = new SiteBuildRuntime('swift-5.9'); - } - return self::$SWIFT59; - } - public static function SWIFT510(): SiteBuildRuntime - { - if (!isset(self::$SWIFT510)) { - self::$SWIFT510 = new SiteBuildRuntime('swift-5.10'); - } - return self::$SWIFT510; - } - public static function SWIFT62(): SiteBuildRuntime - { - if (!isset(self::$SWIFT62)) { - self::$SWIFT62 = new SiteBuildRuntime('swift-6.2'); - } - return self::$SWIFT62; - } - public static function KOTLIN16(): SiteBuildRuntime - { - if (!isset(self::$KOTLIN16)) { - self::$KOTLIN16 = new SiteBuildRuntime('kotlin-1.6'); - } - return self::$KOTLIN16; - } - public static function KOTLIN18(): SiteBuildRuntime - { - if (!isset(self::$KOTLIN18)) { - self::$KOTLIN18 = new SiteBuildRuntime('kotlin-1.8'); - } - return self::$KOTLIN18; - } - public static function KOTLIN19(): SiteBuildRuntime - { - if (!isset(self::$KOTLIN19)) { - self::$KOTLIN19 = new SiteBuildRuntime('kotlin-1.9'); - } - return self::$KOTLIN19; - } - public static function KOTLIN20(): SiteBuildRuntime - { - if (!isset(self::$KOTLIN20)) { - self::$KOTLIN20 = new SiteBuildRuntime('kotlin-2.0'); - } - return self::$KOTLIN20; - } - public static function KOTLIN23(): SiteBuildRuntime - { - if (!isset(self::$KOTLIN23)) { - self::$KOTLIN23 = new SiteBuildRuntime('kotlin-2.3'); - } - return self::$KOTLIN23; - } - public static function CPP17(): SiteBuildRuntime - { - if (!isset(self::$CPP17)) { - self::$CPP17 = new SiteBuildRuntime('cpp-17'); - } - return self::$CPP17; - } - public static function CPP20(): SiteBuildRuntime - { - if (!isset(self::$CPP20)) { - self::$CPP20 = new SiteBuildRuntime('cpp-20'); - } - return self::$CPP20; - } - public static function BUN10(): SiteBuildRuntime - { - if (!isset(self::$BUN10)) { - self::$BUN10 = new SiteBuildRuntime('bun-1.0'); - } - return self::$BUN10; - } - public static function BUN11(): SiteBuildRuntime - { - if (!isset(self::$BUN11)) { - self::$BUN11 = new SiteBuildRuntime('bun-1.1'); - } - return self::$BUN11; - } - public static function BUN12(): SiteBuildRuntime - { - if (!isset(self::$BUN12)) { - self::$BUN12 = new SiteBuildRuntime('bun-1.2'); - } - return self::$BUN12; - } - public static function BUN13(): SiteBuildRuntime - { - if (!isset(self::$BUN13)) { - self::$BUN13 = new SiteBuildRuntime('bun-1.3'); - } - return self::$BUN13; - } - public static function GO123(): SiteBuildRuntime - { - if (!isset(self::$GO123)) { - self::$GO123 = new SiteBuildRuntime('go-1.23'); - } - return self::$GO123; - } - public static function GO124(): SiteBuildRuntime - { - if (!isset(self::$GO124)) { - self::$GO124 = new SiteBuildRuntime('go-1.24'); - } - return self::$GO124; - } - public static function GO125(): SiteBuildRuntime - { - if (!isset(self::$GO125)) { - self::$GO125 = new SiteBuildRuntime('go-1.25'); - } - return self::$GO125; - } - public static function GO126(): SiteBuildRuntime - { - if (!isset(self::$GO126)) { - self::$GO126 = new SiteBuildRuntime('go-1.26'); - } - return self::$GO126; - } - public static function RUST183(): SiteBuildRuntime - { - if (!isset(self::$RUST183)) { - self::$RUST183 = new SiteBuildRuntime('rust-1.83'); - } - return self::$RUST183; - } - public static function STATIC1(): SiteBuildRuntime - { - if (!isset(self::$STATIC1)) { - self::$STATIC1 = new SiteBuildRuntime('static-1'); - } - return self::$STATIC1; - } - public static function FLUTTER324(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER324)) { - self::$FLUTTER324 = new SiteBuildRuntime('flutter-3.24'); - } - return self::$FLUTTER324; - } - public static function FLUTTER327(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER327)) { - self::$FLUTTER327 = new SiteBuildRuntime('flutter-3.27'); - } - return self::$FLUTTER327; - } - public static function FLUTTER329(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER329)) { - self::$FLUTTER329 = new SiteBuildRuntime('flutter-3.29'); - } - return self::$FLUTTER329; - } - public static function FLUTTER332(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER332)) { - self::$FLUTTER332 = new SiteBuildRuntime('flutter-3.32'); - } - return self::$FLUTTER332; - } - public static function FLUTTER335(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER335)) { - self::$FLUTTER335 = new SiteBuildRuntime('flutter-3.35'); - } - return self::$FLUTTER335; - } - public static function FLUTTER338(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER338)) { - self::$FLUTTER338 = new SiteBuildRuntime('flutter-3.38'); - } - return self::$FLUTTER338; - } - public static function FLUTTER341(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER341)) { - self::$FLUTTER341 = new SiteBuildRuntime('flutter-3.41'); - } - return self::$FLUTTER341; - } - public static function FLUTTER344(): SiteBuildRuntime - { - if (!isset(self::$FLUTTER344)) { - self::$FLUTTER344 = new SiteBuildRuntime('flutter-3.44'); - } - return self::$FLUTTER344; - } - - public static function from(string $value): self - { - return match ($value) { - 'node-14.5' => self::NODE145(), - 'node-16.0' => self::NODE160(), - 'node-18.0' => self::NODE180(), - 'node-19.0' => self::NODE190(), - 'node-20.0' => self::NODE200(), - 'node-21.0' => self::NODE210(), - 'node-22' => self::NODE22(), - 'node-23' => self::NODE23(), - 'node-24' => self::NODE24(), - 'node-25' => self::NODE25(), - 'php-8.0' => self::PHP80(), - 'php-8.1' => self::PHP81(), - 'php-8.2' => self::PHP82(), - 'php-8.3' => self::PHP83(), - 'php-8.4' => self::PHP84(), - 'ruby-3.0' => self::RUBY30(), - 'ruby-3.1' => self::RUBY31(), - 'ruby-3.2' => self::RUBY32(), - 'ruby-3.3' => self::RUBY33(), - 'ruby-3.4' => self::RUBY34(), - 'ruby-4.0' => self::RUBY40(), - 'python-3.8' => self::PYTHON38(), - 'python-3.9' => self::PYTHON39(), - 'python-3.10' => self::PYTHON310(), - 'python-3.11' => self::PYTHON311(), - 'python-3.12' => self::PYTHON312(), - 'python-3.13' => self::PYTHON313(), - 'python-3.14' => self::PYTHON314(), - 'python-ml-3.11' => self::PYTHONML311(), - 'python-ml-3.12' => self::PYTHONML312(), - 'python-ml-3.13' => self::PYTHONML313(), - 'deno-1.21' => self::DENO121(), - 'deno-1.24' => self::DENO124(), - 'deno-1.35' => self::DENO135(), - 'deno-1.40' => self::DENO140(), - 'deno-1.46' => self::DENO146(), - 'deno-2.0' => self::DENO20(), - 'deno-2.5' => self::DENO25(), - 'deno-2.6' => self::DENO26(), - 'dart-2.15' => self::DART215(), - 'dart-2.16' => self::DART216(), - 'dart-2.17' => self::DART217(), - 'dart-2.18' => self::DART218(), - 'dart-2.19' => self::DART219(), - 'dart-3.0' => self::DART30(), - 'dart-3.1' => self::DART31(), - 'dart-3.3' => self::DART33(), - 'dart-3.5' => self::DART35(), - 'dart-3.8' => self::DART38(), - 'dart-3.9' => self::DART39(), - 'dart-3.10' => self::DART310(), - 'dart-3.11' => self::DART311(), - 'dart-3.12' => self::DART312(), - 'dotnet-6.0' => self::DOTNET60(), - 'dotnet-7.0' => self::DOTNET70(), - 'dotnet-8.0' => self::DOTNET80(), - 'dotnet-10' => self::DOTNET10(), - 'java-8.0' => self::JAVA80(), - 'java-11.0' => self::JAVA110(), - 'java-17.0' => self::JAVA170(), - 'java-18.0' => self::JAVA180(), - 'java-21.0' => self::JAVA210(), - 'java-22' => self::JAVA22(), - 'java-25' => self::JAVA25(), - 'swift-5.5' => self::SWIFT55(), - 'swift-5.8' => self::SWIFT58(), - 'swift-5.9' => self::SWIFT59(), - 'swift-5.10' => self::SWIFT510(), - 'swift-6.2' => self::SWIFT62(), - 'kotlin-1.6' => self::KOTLIN16(), - 'kotlin-1.8' => self::KOTLIN18(), - 'kotlin-1.9' => self::KOTLIN19(), - 'kotlin-2.0' => self::KOTLIN20(), - 'kotlin-2.3' => self::KOTLIN23(), - 'cpp-17' => self::CPP17(), - 'cpp-20' => self::CPP20(), - 'bun-1.0' => self::BUN10(), - 'bun-1.1' => self::BUN11(), - 'bun-1.2' => self::BUN12(), - 'bun-1.3' => self::BUN13(), - 'go-1.23' => self::GO123(), - 'go-1.24' => self::GO124(), - 'go-1.25' => self::GO125(), - 'go-1.26' => self::GO126(), - 'rust-1.83' => self::RUST183(), - 'static-1' => self::STATIC1(), - 'flutter-3.24' => self::FLUTTER324(), - 'flutter-3.27' => self::FLUTTER327(), - 'flutter-3.29' => self::FLUTTER329(), - 'flutter-3.32' => self::FLUTTER332(), - 'flutter-3.35' => self::FLUTTER335(), - 'flutter-3.38' => self::FLUTTER338(), - 'flutter-3.41' => self::FLUTTER341(), - 'flutter-3.44' => self::FLUTTER344(), - default => throw new \InvalidArgumentException('Unknown SiteBuildRuntime value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Enums/RedirectStatusCode.php b/src/Appwrite/Enums/StatusCode.php similarity index 57% rename from src/Appwrite/Enums/RedirectStatusCode.php rename to src/Appwrite/Enums/StatusCode.php index d76aa044..8a31157e 100644 --- a/src/Appwrite/Enums/RedirectStatusCode.php +++ b/src/Appwrite/Enums/StatusCode.php @@ -4,12 +4,12 @@ use JsonSerializable; -class RedirectStatusCode implements JsonSerializable +class StatusCode implements JsonSerializable { - private static RedirectStatusCode $MOVEDPERMANENTLY; - private static RedirectStatusCode $FOUND; - private static RedirectStatusCode $TEMPORARYREDIRECT; - private static RedirectStatusCode $PERMANENTREDIRECT; + private static StatusCode $MOVEDPERMANENTLY; + private static StatusCode $FOUND; + private static StatusCode $TEMPORARYREDIRECT; + private static StatusCode $PERMANENTREDIRECT; private string $value; @@ -28,31 +28,31 @@ public function jsonSerialize(): string return $this->value; } - public static function MOVEDPERMANENTLY(): RedirectStatusCode + public static function MOVEDPERMANENTLY(): StatusCode { if (!isset(self::$MOVEDPERMANENTLY)) { - self::$MOVEDPERMANENTLY = new RedirectStatusCode('301'); + self::$MOVEDPERMANENTLY = new StatusCode('301'); } return self::$MOVEDPERMANENTLY; } - public static function FOUND(): RedirectStatusCode + public static function FOUND(): StatusCode { if (!isset(self::$FOUND)) { - self::$FOUND = new RedirectStatusCode('302'); + self::$FOUND = new StatusCode('302'); } return self::$FOUND; } - public static function TEMPORARYREDIRECT(): RedirectStatusCode + public static function TEMPORARYREDIRECT(): StatusCode { if (!isset(self::$TEMPORARYREDIRECT)) { - self::$TEMPORARYREDIRECT = new RedirectStatusCode('307'); + self::$TEMPORARYREDIRECT = new StatusCode('307'); } return self::$TEMPORARYREDIRECT; } - public static function PERMANENTREDIRECT(): RedirectStatusCode + public static function PERMANENTREDIRECT(): StatusCode { if (!isset(self::$PERMANENTREDIRECT)) { - self::$PERMANENTREDIRECT = new RedirectStatusCode('308'); + self::$PERMANENTREDIRECT = new StatusCode('308'); } return self::$PERMANENTREDIRECT; } @@ -64,7 +64,7 @@ public static function from(string $value): self '302' => self::FOUND(), '307' => self::TEMPORARYREDIRECT(), '308' => self::PERMANENTREDIRECT(), - default => throw new \InvalidArgumentException('Unknown RedirectStatusCode value: ' . $value), + default => throw new \InvalidArgumentException('Unknown StatusCode value: ' . $value), }; } } diff --git a/src/Appwrite/Models/PolicyDenyAliasedEmail.php b/src/Appwrite/Models/PolicyDenyAliasedEmail.php new file mode 100644 index 00000000..1bcd1d34 --- /dev/null +++ b/src/Appwrite/Models/PolicyDenyAliasedEmail.php @@ -0,0 +1,54 @@ + $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 . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => 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 new file mode 100644 index 00000000..877bdab8 --- /dev/null +++ b/src/Appwrite/Models/PolicyDenyDisposableEmail.php @@ -0,0 +1,54 @@ + $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 . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => 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 new file mode 100644 index 00000000..3894d62c --- /dev/null +++ b/src/Appwrite/Models/PolicyDenyFreeEmail.php @@ -0,0 +1,54 @@ + $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 . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + $result = [ + '$id' => static::serializeValue($this->id), + 'enabled' => static::serializeValue($this->enabled) + ]; + + return $result; + } +} diff --git a/src/Appwrite/Models/Presence.php b/src/Appwrite/Models/Presence.php index 774127b2..a61be7a1 100644 --- a/src/Appwrite/Models/Presence.php +++ b/src/Appwrite/Models/Presence.php @@ -9,8 +9,6 @@ { use ArraySerializable; - private const ADDITIONAL_PROPERTIES = true; - /** * Presence constructor. * @@ -22,7 +20,7 @@ * @param string $source presence source. * @param string|null $status presence status. * @param string|null $expiresAt presence expiry date in iso 8601 format. - * @param array $metadata Additional properties. + * @param array|null $metadata presence metadata. */ public function __construct( public string $id, @@ -33,7 +31,7 @@ public function __construct( public string $source, public ?string $status = null, public ?string $expiresAt = null, - public array $metadata = [] + public ?array $metadata = null ) { } @@ -61,20 +59,6 @@ public static function from(array $data): static throw new \InvalidArgumentException('Missing required field "source" for ' . static::class . '.'); } - $additionalProperties = static::extractAdditionalPropertiesFromFields( - $data, - [ - '$id', - '$createdAt', - '$updatedAt', - '$permissions', - 'userId', - 'status', - 'source', - 'expiresAt' - ] - ); - return new static( id: $data['$id'], createdAt: $data['$createdAt'], @@ -84,7 +68,7 @@ public static function from(array $data): static source: $data['source'], status: array_key_exists('status', $data) ? $data['status'] : null, expiresAt: array_key_exists('expiresAt', $data) ? $data['expiresAt'] : null, - metadata: $additionalProperties + metadata: array_key_exists('metadata', $data) ? $data['metadata'] : null ); } @@ -101,13 +85,10 @@ public function toArray(): array 'userId' => static::serializeValue($this->userId), 'status' => static::serializeValue($this->status), 'source' => static::serializeValue($this->source), - 'expiresAt' => static::serializeValue($this->expiresAt) + 'expiresAt' => static::serializeValue($this->expiresAt), + 'metadata' => static::serializeValue($this->metadata) ]; - foreach (static::serializeAdditionalProperties($this->metadata) as $field => $value) { - $result[$field] = $value; - } - return $result; } } diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index 689702f1..ccbc408f 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -6,7 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\Runtime; use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; @@ -77,7 +77,7 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * * @param string $functionId * @param string $name - * @param FunctionRuntime $runtime + * @param Runtime $runtime * @param ?array $execute * @param ?array $events * @param ?string $schedule @@ -100,7 +100,7 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @throws AppwriteException * @return \Appwrite\Models\FunctionModel */ - public function create(string $functionId, string $name, FunctionRuntime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel + public function create(string $functionId, string $name, Runtime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel { $apiPath = str_replace( [], @@ -313,7 +313,7 @@ public function get(string $functionId): \Appwrite\Models\FunctionModel * * @param string $functionId * @param string $name - * @param ?FunctionRuntime $runtime + * @param ?Runtime $runtime * @param ?array $execute * @param ?array $events * @param ?string $schedule @@ -336,7 +336,7 @@ public function get(string $functionId): \Appwrite\Models\FunctionModel * @throws AppwriteException * @return \Appwrite\Models\FunctionModel */ - public function update(string $functionId, string $name, ?FunctionRuntime $runtime = null, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel + public function update(string $functionId, string $name, ?Runtime $runtime = null, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = 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\FunctionModel { $apiPath = str_replace( ['{functionId}'], diff --git a/src/Appwrite/Services/Presences.php b/src/Appwrite/Services/Presences.php index 78e43068..60fdcae6 100644 --- a/src/Appwrite/Services/Presences.php +++ b/src/Appwrite/Services/Presences.php @@ -171,7 +171,7 @@ public function upsert(string $presenceId, string $userId, string $status, ?arra * @throws AppwriteException * @return \Appwrite\Models\Presence */ - public function updatePresence(string $presenceId, string $userId, ?string $status = null, ?string $expiresAt = null, ?array $metadata = null, ?array $permissions = null, ?bool $purge = null): \Appwrite\Models\Presence + public function update(string $presenceId, string $userId, ?string $status = null, ?string $expiresAt = null, ?array $metadata = null, ?array $permissions = null, ?bool $purge = null): \Appwrite\Models\Presence { $apiPath = str_replace( ['{presenceId}'], diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index 7d2ec31d..02ab30e2 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -3629,9 +3629,9 @@ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project * * @param ProjectPolicyId $policyId * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy + * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\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 */ - public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy + public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\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 { $apiPath = str_replace( ['{policyId}'], @@ -3691,6 +3691,18 @@ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPas return \Appwrite\Models\PolicyMembershipPrivacy::from($response); } + if (($response['$id'] ?? null) === 'deny-aliased-email') { + return \Appwrite\Models\PolicyDenyAliasedEmail::from($response); + } + + if (($response['$id'] ?? null) === 'deny-disposable-email') { + return \Appwrite\Models\PolicyDenyDisposableEmail::from($response); + } + + if (($response['$id'] ?? null) === 'deny-free-email') { + return \Appwrite\Models\PolicyDenyFreeEmail::from($response); + } + throw new \UnexpectedValueException('Unable to match response to any expected response model.'); } diff --git a/src/Appwrite/Services/Proxy.php b/src/Appwrite/Services/Proxy.php index 5d10b779..282e8275 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -6,7 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\RedirectStatusCode; +use Appwrite\Enums\StatusCode; use Appwrite\Enums\ProxyResourceType; class Proxy extends Service @@ -154,13 +154,13 @@ public function createFunctionRule(string $domain, string $functionId, ?string $ * * @param string $domain * @param string $url - * @param RedirectStatusCode $statusCode + * @param StatusCode $statusCode * @param string $resourceId * @param ProxyResourceType $resourceType * @throws AppwriteException * @return \Appwrite\Models\ProxyRule */ - public function createRedirectRule(string $domain, string $url, RedirectStatusCode $statusCode, string $resourceId, ProxyResourceType $resourceType): \Appwrite\Models\ProxyRule + public function createRedirectRule(string $domain, string $url, StatusCode $statusCode, string $resourceId, ProxyResourceType $resourceType): \Appwrite\Models\ProxyRule { $apiPath = str_replace( [], diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index f74ba6be..4b36ee4b 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -6,9 +6,9 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; -use Appwrite\Enums\SiteFramework; -use Appwrite\Enums\SiteBuildRuntime; -use Appwrite\Enums\SiteAdapter; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -74,8 +74,8 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * * @param string $siteId * @param string $name - * @param SiteFramework $framework - * @param SiteBuildRuntime $buildRuntime + * @param Framework $framework + * @param BuildRuntime $buildRuntime * @param ?bool $enabled * @param ?bool $logging * @param ?int $timeout @@ -83,7 +83,7 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @param ?string $buildCommand * @param ?string $startCommand * @param ?string $outputDirectory - * @param ?SiteAdapter $adapter + * @param ?Adapter $adapter * @param ?string $installationId * @param ?string $fallbackFile * @param ?string $providerRepositoryId @@ -98,7 +98,7 @@ public function list(?array $queries = null, ?string $search = null, ?bool $tota * @throws AppwriteException * @return \Appwrite\Models\Site */ - public function create(string $siteId, string $name, SiteFramework $framework, SiteBuildRuntime $buildRuntime, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?SiteAdapter $adapter = null, ?string $installationId = null, ?string $fallbackFile = 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 create(string $siteId, string $name, Framework $framework, BuildRuntime $buildRuntime, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?Adapter $adapter = null, ?string $installationId = null, ?string $fallbackFile = 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 { $apiPath = str_replace( [], @@ -313,7 +313,7 @@ public function get(string $siteId): \Appwrite\Models\Site * * @param string $siteId * @param string $name - * @param SiteFramework $framework + * @param Framework $framework * @param ?bool $enabled * @param ?bool $logging * @param ?int $timeout @@ -321,8 +321,8 @@ public function get(string $siteId): \Appwrite\Models\Site * @param ?string $buildCommand * @param ?string $startCommand * @param ?string $outputDirectory - * @param ?SiteBuildRuntime $buildRuntime - * @param ?SiteAdapter $adapter + * @param ?BuildRuntime $buildRuntime + * @param ?Adapter $adapter * @param ?string $fallbackFile * @param ?string $installationId * @param ?string $providerRepositoryId @@ -337,7 +337,7 @@ public function get(string $siteId): \Appwrite\Models\Site * @throws AppwriteException * @return \Appwrite\Models\Site */ - public function update(string $siteId, string $name, SiteFramework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?SiteBuildRuntime $buildRuntime = null, ?SiteAdapter $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): \Appwrite\Models\Site { $apiPath = str_replace( ['{siteId}'], diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 14192288..b079df2a 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -6,7 +6,7 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\FunctionRuntime; +use Appwrite\Enums\Runtime; use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; @@ -141,7 +141,7 @@ public function testMethodCreate(): void $response = $this->functions->create( "", "", - FunctionRuntime::NODE145() + Runtime::NODE145() ); $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); diff --git a/tests/Appwrite/Services/PresencesTest.php b/tests/Appwrite/Services/PresencesTest.php index 28201ac5..bd045b8e 100644 --- a/tests/Appwrite/Services/PresencesTest.php +++ b/tests/Appwrite/Services/PresencesTest.php @@ -89,7 +89,7 @@ public function testMethodUpsert(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodUpdatePresence(): void + public function testMethodUpdate(): void { $data = array( "\$id" => "5e5ea5c16897e", @@ -104,7 +104,7 @@ public function testMethodUpdatePresence(): void ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->presences->updatePresence( + $response = $this->presences->update( "", "" ); diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 315e4c88..24f9ec3c 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -2604,14 +2604,10 @@ public function testMethodGetPolicy(): void $data = array_replace( array( "\$id" => "password-dictionary", - "userId" => true, - "userEmail" => true, - "userPhone" => true, - "userName" => true, - "userMFA" => true + "enabled" => true ), array( - "\$id" => "membership-privacy" + "\$id" => "deny-free-email" ) ); @@ -2623,7 +2619,7 @@ public function testMethodGetPolicy(): void ProjectPolicyId::PASSWORDDICTIONARY() ); - $this->assertInstanceOf(\Appwrite\Models\PolicyMembershipPrivacy::class, $response); + $this->assertInstanceOf(\Appwrite\Models\PolicyDenyFreeEmail::class, $response); } public function testMethodUpdateProtocol(): void diff --git a/tests/Appwrite/Services/ProxyTest.php b/tests/Appwrite/Services/ProxyTest.php index a0405bca..1b9f6583 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -6,7 +6,7 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\RedirectStatusCode; +use Appwrite\Enums\StatusCode; use Appwrite\Enums\ProxyResourceType; final class ProxyTest extends TestCase @@ -140,7 +140,7 @@ public function testMethodCreateRedirectRule(): void $response = $this->proxy->createRedirectRule( "", "https://example.com", - RedirectStatusCode::MOVEDPERMANENTLY(), + StatusCode::MOVEDPERMANENTLY(), "", ProxyResourceType::SITE() ); diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index e59598b0..3fbab530 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -6,9 +6,9 @@ use Appwrite\InputFile; use Mockery; use PHPUnit\Framework\TestCase; -use Appwrite\Enums\SiteFramework; -use Appwrite\Enums\SiteBuildRuntime; -use Appwrite\Enums\SiteAdapter; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -145,8 +145,8 @@ public function testMethodCreate(): void $response = $this->sites->create( "", "", - SiteFramework::ANALOG(), - SiteBuildRuntime::NODE145() + Framework::ANALOG(), + BuildRuntime::NODE145() ); $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); @@ -325,7 +325,7 @@ public function testMethodUpdate(): void $response = $this->sites->update( "", "", - SiteFramework::ANALOG() + Framework::ANALOG() ); $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); From 0f66d76e6358e22b9df83e3e083de5a8d8fab2d8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Jun 2026 08:14:56 +0000 Subject: [PATCH 3/4] chore: update PHP SDK to 25.0.0 --- docs/project.md | 2 +- tests/Appwrite/Services/ProjectTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/project.md b/docs/project.md index 9b082788..d4d5953f 100644 --- a/docs/project.md +++ b/docs/project.md @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | | -| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj | | +| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret | | | prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | | 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/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 24f9ec3c..0d1d79ce 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -877,7 +877,7 @@ public function testMethodUpdateOAuth2Google(): void "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", - "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", + "clientSecret" => "your-google-client-secret", "prompt" => array() ); From 7fcc0be6516854aef92e0b9afdca95717f522f9c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Jun 2026 08:23:14 +0000 Subject: [PATCH 4/4] chore: update PHP SDK to 25.0.0 --- docs/project.md | 82 ++++++++++++------------ tests/Appwrite/Services/ProjectTest.php | 84 ++++++++++++------------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/docs/project.md b/docs/project.md index d4d5953f..1e3a2d0e 100644 --- a/docs/project.md +++ b/docs/project.md @@ -225,7 +225,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/amazon | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 | | -| clientSecret | string | 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 | | +| clientSecret | string | 'Client Secret' of Amazon OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -257,7 +257,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/auth0 | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq | | -| clientSecret | string | 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF | | +| clientSecret | string | 'Client Secret' of Auth0 OAuth2 app. For example: your-oauth2-client-secret | | | endpoint | string | Domain of Auth0 instance. For example: example.us.auth0.com | | | 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. | | @@ -273,7 +273,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/authentik | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv | | -| clientSecret | string | 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK | | +| clientSecret | string | 'Client Secret' of Authentik OAuth2 app. For example: your-oauth2-client-secret | | | endpoint | string | Domain of Authentik instance. For example: example.authentik.com | | | 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. | | @@ -289,7 +289,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/autodesk | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 | | -| clientSecret | string | 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW | | +| clientSecret | string | 'Client Secret' of Autodesk OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -304,7 +304,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/bitbucket | Field Name | Type | Description | Default | | --- | --- | --- | --- | | key | string | 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc | | -| secret | string | 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx | | +| secret | string | 'Secret' of Bitbucket OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -319,7 +319,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/bitly | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b | | -| clientSecret | string | 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 | | +| clientSecret | string | 'Client Secret' of Bitly OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -334,7 +334,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/box | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y | | -| clientSecret | string | 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif | | +| clientSecret | string | 'Client Secret' of Box OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -349,7 +349,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/dailymotion | Field Name | Type | Description | Default | | --- | --- | --- | --- | | apiKey | string | 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f | | -| apiSecret | string | 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 | | +| apiSecret | string | 'API Secret' of Dailymotion OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -364,7 +364,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/discord | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 | | -| clientSecret | string | 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D | | +| clientSecret | string | 'Client Secret' of Discord OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -379,7 +379,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/disqus | Field Name | Type | Description | Default | | --- | --- | --- | --- | | publicKey | string | 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX | | -| secretKey | string | 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 | | +| secretKey | string | 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -394,7 +394,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/dropbox | Field Name | Type | Description | Default | | --- | --- | --- | --- | | appKey | string | 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t | | -| appSecret | string | 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw | | +| appSecret | string | 'App Secret' of Dropbox OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -409,7 +409,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/etsy | Field Name | Type | Description | Default | | --- | --- | --- | --- | | keyString | string | 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 | | -| sharedSecret | string | 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru | | +| sharedSecret | string | 'Shared Secret' of Etsy OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -424,7 +424,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/facebook | Field Name | Type | Description | Default | | --- | --- | --- | --- | | appId | string | 'App ID' of Facebook OAuth2 app. For example: 260600000007694 | | -| appSecret | string | 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 | | +| appSecret | string | 'App Secret' of Facebook OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -439,7 +439,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/figma | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 | | -| clientSecret | string | 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 | | +| clientSecret | string | 'Client Secret' of Figma OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -454,7 +454,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/fusionauth | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 | | -| clientSecret | string | 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc | | +| clientSecret | string | 'Client Secret' of FusionAuth OAuth2 app. For example: your-oauth2-client-secret | | | endpoint | string | Domain of FusionAuth instance. For example: example.fusionauth.io | | | 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. | | @@ -470,7 +470,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/github | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 | | -| clientSecret | string | 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc | | +| clientSecret | string | 'Client Secret' of GitHub OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -485,7 +485,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/gitlab | Field Name | Type | Description | Default | | --- | --- | --- | --- | | applicationId | string | 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 | | -| secret | string | 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 | | +| secret | string | 'Secret' of Gitlab OAuth2 app. For example: your-oauth2-client-secret | | | endpoint | string | Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com | | | 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. | | @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | | -| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret | | +| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: your-oauth2-client-secret | | | prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | | 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. | | @@ -517,7 +517,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/keycloak | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app | | -| clientSecret | string | 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO | | +| clientSecret | string | 'Client Secret' of Keycloak OAuth2 app. For example: your-oauth2-client-secret | | | endpoint | string | Domain of Keycloak instance. For example: keycloak.example.com | | | realmName | string | Keycloak realm name. For example: appwrite-realm | | | 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. | | @@ -534,7 +534,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/kick | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 | | -| clientSecret | string | 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b | | +| clientSecret | string | 'Client Secret' of Kick OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -549,7 +549,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/linkedin | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv | | -| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== | | +| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -564,7 +564,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/microsoft | Field Name | Type | Description | Default | | --- | --- | --- | --- | | applicationId | string | 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 | | -| applicationSecret | string | 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u | | +| applicationSecret | string | 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: your-oauth2-client-secret | | | tenant | string | Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common | | | 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. | | @@ -580,7 +580,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/notion | Field Name | Type | Description | Default | | --- | --- | --- | --- | | oauthClientId | string | 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 | | -| oauthClientSecret | string | 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 | | +| oauthClientSecret | string | 'OAuth Client Secret' of Notion OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -595,7 +595,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/oidc | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG | | -| clientSecret | string | 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV | | +| clientSecret | string | 'Client Secret' of Oidc OAuth2 app. For example: your-oauth2-client-secret | | | wellKnownURL | string | OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration | | | 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 | | @@ -614,7 +614,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/okta | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 | | -| clientSecret | string | 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV | | +| clientSecret | string | 'Client Secret' of Okta OAuth2 app. For example: your-oauth2-client-secret | | | domain | string | Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ | | | authorizationServerId | string | Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z | | | 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. | | @@ -631,7 +631,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/paypal | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB | | -| secretKey | string | 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp | | +| secretKey | string | 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -646,7 +646,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/paypalSandbox | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB | | -| secretKey | string | 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp | | +| secretKey | string | 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -661,7 +661,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/podio | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app | | -| clientSecret | string | 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN | | +| clientSecret | string | 'Client Secret' of Podio OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -676,7 +676,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/salesforce | Field Name | Type | Description | Default | | --- | --- | --- | --- | | customerKey | string | 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq | | -| customerSecret | string | 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 | | +| customerSecret | string | 'Consumer Secret' of Salesforce OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -691,7 +691,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/slack | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 | | -| clientSecret | string | 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd | | +| clientSecret | string | 'Client Secret' of Slack OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -706,7 +706,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/spotify | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace | | -| clientSecret | string | 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f | | +| clientSecret | string | 'Client Secret' of Spotify OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -721,7 +721,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/stripe | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR | | -| apiSecretKey | string | 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp | | +| apiSecretKey | string | 'API Secret Key' of Stripe OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -736,7 +736,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/tradeshift | Field Name | Type | Description | Default | | --- | --- | --- | --- | | oauth2ClientId | string | 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app | | -| oauth2ClientSecret | string | 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 | | +| oauth2ClientSecret | string | 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -751,7 +751,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/tradeshiftBox | Field Name | Type | Description | Default | | --- | --- | --- | --- | | oauth2ClientId | string | 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app | | -| oauth2ClientSecret | string | 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 | | +| oauth2ClientSecret | string | 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -766,7 +766,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/twitch | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p | | -| clientSecret | string | 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v | | +| clientSecret | string | 'Client Secret' of Twitch OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -781,7 +781,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/wordpress | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of WordPress OAuth2 app. For example: 130005 | | -| clientSecret | string | 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk | | +| clientSecret | string | 'Client Secret' of WordPress OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -796,7 +796,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/x | Field Name | Type | Description | Default | | --- | --- | --- | --- | | customerKey | string | 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT | | -| secretKey | string | 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 | | +| secretKey | string | 'Secret Key' of X OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -811,7 +811,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/yahoo | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm | | -| clientSecret | string | 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 | | +| clientSecret | string | 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -826,7 +826,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/yandex | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c | | -| clientSecret | string | 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 | | +| clientSecret | string | 'Client Secret' of Yandex OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -841,7 +841,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/zoho | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B | | -| clientSecret | string | 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e | | +| clientSecret | string | 'Client Secret' of Zoho OAuth2 app. For example: your-oauth2-client-secret | | | 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. | | @@ -856,7 +856,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/zoom | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ | | -| clientSecret | string | 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON | | +| clientSecret | string | 'Client Secret' of Zoom OAuth2 app. For example: your-oauth2-client-secret | | | 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/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 0d1d79ce..a5659cd3 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -547,7 +547,7 @@ public function testMethodUpdateOAuth2Amazon(): void "\$id" => "github", "enabled" => true, "clientId" => "amzn1.application-oa2-client.87400c00000000000000000000063d5b2", - "clientSecret" => "79ffe4000000000000000000000000000000000000000000000000000002de55" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -585,7 +585,7 @@ public function testMethodUpdateOAuth2Auth0(): void "\$id" => "github", "enabled" => true, "clientId" => "OaOkIA000000000000000000005KLSYq", - "clientSecret" => "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", + "clientSecret" => "your-oauth2-client-secret", "endpoint" => "example.us.auth0.com" ); @@ -604,7 +604,7 @@ public function testMethodUpdateOAuth2Authentik(): void "\$id" => "github", "enabled" => true, "clientId" => "dTKOPa0000000000000000000000000000e7G8hv", - "clientSecret" => "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", + "clientSecret" => "your-oauth2-client-secret", "endpoint" => "example.authentik.com" ); @@ -623,7 +623,7 @@ public function testMethodUpdateOAuth2Autodesk(): void "\$id" => "github", "enabled" => true, "clientId" => "5zw90v00000000000000000000kVYXN7", - "clientSecret" => "7I000000000000MW" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -641,7 +641,7 @@ public function testMethodUpdateOAuth2Bitbucket(): void "\$id" => "github", "enabled" => true, "key" => "Knt70000000000ByRc", - "secret" => "NMfLZJ00000000000000000000TLQdDx" + "secret" => "your-oauth2-client-secret" ); $this->client @@ -659,7 +659,7 @@ public function testMethodUpdateOAuth2Bitly(): void "\$id" => "github", "enabled" => true, "clientId" => "d95151000000000000000000000000000067af9b", - "clientSecret" => "a13e250000000000000000000000000000d73095" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -677,7 +677,7 @@ public function testMethodUpdateOAuth2Box(): void "\$id" => "github", "enabled" => true, "clientId" => "deglcs00000000000000000000x2og6y", - "clientSecret" => "OKM1f100000000000000000000eshEif" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -695,7 +695,7 @@ public function testMethodUpdateOAuth2Dailymotion(): void "\$id" => "github", "enabled" => true, "apiKey" => "07a9000000000000067f", - "apiSecret" => "a399a90000000000000000000000000000d90639" + "apiSecret" => "your-oauth2-client-secret" ); $this->client @@ -713,7 +713,7 @@ public function testMethodUpdateOAuth2Discord(): void "\$id" => "github", "enabled" => true, "clientId" => "950722000000343754", - "clientSecret" => "YmPXnM000000000000000000002zFg5D" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -731,7 +731,7 @@ public function testMethodUpdateOAuth2Disqus(): void "\$id" => "github", "enabled" => true, "publicKey" => "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", - "secretKey" => "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" + "secretKey" => "your-oauth2-client-secret" ); $this->client @@ -749,7 +749,7 @@ public function testMethodUpdateOAuth2Dropbox(): void "\$id" => "github", "enabled" => true, "appKey" => "jl000000000009t", - "appSecret" => "g200000000000vw" + "appSecret" => "your-oauth2-client-secret" ); $this->client @@ -767,7 +767,7 @@ public function testMethodUpdateOAuth2Etsy(): void "\$id" => "github", "enabled" => true, "keyString" => "nsgzxh0000000000008j85a2", - "sharedSecret" => "tp000000ru" + "sharedSecret" => "your-oauth2-client-secret" ); $this->client @@ -785,7 +785,7 @@ public function testMethodUpdateOAuth2Facebook(): void "\$id" => "github", "enabled" => true, "appId" => "260600000007694", - "appSecret" => "2d0b2800000000000000000000d38af4" + "appSecret" => "your-oauth2-client-secret" ); $this->client @@ -803,7 +803,7 @@ public function testMethodUpdateOAuth2Figma(): void "\$id" => "github", "enabled" => true, "clientId" => "byay5H0000000000VtiI40", - "clientSecret" => "yEpOYn0000000000000000004iIsU5" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -821,7 +821,7 @@ public function testMethodUpdateOAuth2FusionAuth(): void "\$id" => "github", "enabled" => true, "clientId" => "b2222c00-0000-0000-0000-000000862097", - "clientSecret" => "Jx4s0C0000000000000000000000000000000wGqLsc", + "clientSecret" => "your-oauth2-client-secret", "endpoint" => "example.fusionauth.io" ); @@ -840,7 +840,7 @@ public function testMethodUpdateOAuth2GitHub(): void "\$id" => "github", "enabled" => true, "clientId" => "e4d87900000000540733", - "clientSecret" => "5e07c00000000000000000000000000000198bcc" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -858,7 +858,7 @@ public function testMethodUpdateOAuth2Gitlab(): void "\$id" => "github", "enabled" => true, "applicationId" => "d41ffe0000000000000000000000000000000000000000000000000000d5e252", - "secret" => "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", + "secret" => "your-oauth2-client-secret", "endpoint" => "https://gitlab.com" ); @@ -877,7 +877,7 @@ public function testMethodUpdateOAuth2Google(): void "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", - "clientSecret" => "your-google-client-secret", + "clientSecret" => "your-oauth2-client-secret", "prompt" => array() ); @@ -896,7 +896,7 @@ public function testMethodUpdateOAuth2Keycloak(): void "\$id" => "github", "enabled" => true, "clientId" => "appwrite-o0000000st-app", - "clientSecret" => "jdjrJd00000000000000000000HUsaZO", + "clientSecret" => "your-oauth2-client-secret", "endpoint" => "keycloak.example.com", "realmName" => "appwrite-realm" ); @@ -916,7 +916,7 @@ public function testMethodUpdateOAuth2Kick(): void "\$id" => "github", "enabled" => true, "clientId" => "01KQ7C00000000000001MFHS32", - "clientSecret" => "34ac5600000000000000000000000000000000000000000000000000e830c8b" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -934,7 +934,7 @@ public function testMethodUpdateOAuth2Linkedin(): void "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", - "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" + "primaryClientSecret" => "your-oauth2-client-secret" ); $this->client @@ -952,7 +952,7 @@ public function testMethodUpdateOAuth2Microsoft(): void "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", - "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "applicationSecret" => "your-oauth2-client-secret", "tenant" => "common" ); @@ -971,7 +971,7 @@ public function testMethodUpdateOAuth2Notion(): void "\$id" => "github", "enabled" => true, "oauthClientId" => "341d8700-0000-0000-0000-000000446ee3", - "oauthClientSecret" => "secret_dLUr4b000000000000000000000000000000lFHAa9" + "oauthClientSecret" => "your-oauth2-client-secret" ); $this->client @@ -989,7 +989,7 @@ public function testMethodUpdateOAuth2Oidc(): void "\$id" => "github", "enabled" => true, "clientId" => "qibI2x0000000000000000000000000006L2YFoG", - "clientSecret" => "Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV", + "clientSecret" => "your-oauth2-client-secret", "wellKnownURL" => "https://myoauth.com/.well-known/openid-configuration", "authorizationURL" => "https://myoauth.com/oauth2/authorize", "tokenURL" => "https://myoauth.com/oauth2/token", @@ -1011,7 +1011,7 @@ public function testMethodUpdateOAuth2Okta(): void "\$id" => "github", "enabled" => true, "clientId" => "0oa00000000000000698", - "clientSecret" => "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", + "clientSecret" => "your-oauth2-client-secret", "domain" => "trial-6400025.okta.com", "authorizationServerId" => "aus000000000000000h7z" ); @@ -1031,7 +1031,7 @@ public function testMethodUpdateOAuth2Paypal(): void "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", - "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + "secretKey" => "your-oauth2-client-secret" ); $this->client @@ -1049,7 +1049,7 @@ public function testMethodUpdateOAuth2PaypalSandbox(): void "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", - "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + "secretKey" => "your-oauth2-client-secret" ); $this->client @@ -1067,7 +1067,7 @@ public function testMethodUpdateOAuth2Podio(): void "\$id" => "github", "enabled" => true, "clientId" => "appwrite-oauth-test-app", - "clientSecret" => "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1085,7 +1085,7 @@ public function testMethodUpdateOAuth2Salesforce(): void "\$id" => "github", "enabled" => true, "customerKey" => "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", - "customerSecret" => "3w000000000000e2" + "customerSecret" => "your-oauth2-client-secret" ); $this->client @@ -1103,7 +1103,7 @@ public function testMethodUpdateOAuth2Slack(): void "\$id" => "github", "enabled" => true, "clientId" => "23000000089.15000000000023", - "clientSecret" => "81656000000000000000000000f3d2fd" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1121,7 +1121,7 @@ public function testMethodUpdateOAuth2Spotify(): void "\$id" => "github", "enabled" => true, "clientId" => "6ec271000000000000000000009beace", - "clientSecret" => "db068a000000000000000000008b5b9f" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1139,7 +1139,7 @@ public function testMethodUpdateOAuth2Stripe(): void "\$id" => "github", "enabled" => true, "clientId" => "ca_UKibXX0000000000000000000006byvR", - "apiSecretKey" => "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" + "apiSecretKey" => "your-oauth2-client-secret" ); $this->client @@ -1157,7 +1157,7 @@ public function testMethodUpdateOAuth2Tradeshift(): void "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", - "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" + "oauth2ClientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1175,7 +1175,7 @@ public function testMethodUpdateOAuth2TradeshiftSandbox(): void "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", - "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" + "oauth2ClientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1193,7 +1193,7 @@ public function testMethodUpdateOAuth2Twitch(): void "\$id" => "github", "enabled" => true, "clientId" => "vvi0in000000000000000000ikmt9p", - "clientSecret" => "pmapue000000000000000000zylw3v" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1211,7 +1211,7 @@ public function testMethodUpdateOAuth2WordPress(): void "\$id" => "github", "enabled" => true, "clientId" => "130005", - "clientSecret" => "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1229,7 +1229,7 @@ public function testMethodUpdateOAuth2X(): void "\$id" => "github", "enabled" => true, "customerKey" => "slzZV0000000000000NFLaWT", - "secretKey" => "tkEPkp00000000000000000000000000000000000000FTxbI9" + "secretKey" => "your-oauth2-client-secret" ); $this->client @@ -1247,7 +1247,7 @@ public function testMethodUpdateOAuth2Yahoo(): void "\$id" => "github", "enabled" => true, "clientId" => "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", - "clientSecret" => "cf978f0000000000000000000000000000c5e2e9" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1265,7 +1265,7 @@ public function testMethodUpdateOAuth2Yandex(): void "\$id" => "github", "enabled" => true, "clientId" => "6a8a6a0000000000000000000091483c", - "clientSecret" => "bbf98500000000000000000000c75a63" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1283,7 +1283,7 @@ public function testMethodUpdateOAuth2Zoho(): void "\$id" => "github", "enabled" => true, "clientId" => "1000.83C178000000000000000000RPNX0B", - "clientSecret" => "fb5cac000000000000000000000000000000a68f6e" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1301,7 +1301,7 @@ public function testMethodUpdateOAuth2Zoom(): void "\$id" => "github", "enabled" => true, "clientId" => "QMAC00000000000000w0AQ", - "clientSecret" => "GAWsG4000000000000000000007U01ON" + "clientSecret" => "your-oauth2-client-secret" ); $this->client @@ -1320,7 +1320,7 @@ public function testMethodGetOAuth2Provider(): void "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", - "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "applicationSecret" => "your-oauth2-client-secret", "tenant" => "common" ), array(