diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f15349..3ee5699c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ # 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) +## 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 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..4e8a23d7 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -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..4eaeb871 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -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/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 abef3f99..1c2bbc18 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -16,7 +16,7 @@ $proxy = new Proxy($client); $result = $proxy->createRedirectRule( domain: '', url: 'https://example.com', - statusCode: StatusCode::MOVEDPERMANENTLY301(), + statusCode: StatusCode::MOVEDPERMANENTLY(), resourceId: '', resourceType: ProxyResourceType::SITE() );``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 866a89cb..eab5f21c 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -33,6 +33,8 @@ $result = $sites->create( 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..907e0c6c 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -33,6 +33,8 @@ $result = $sites->update( 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..8af1239e --- /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. | fra | + + +```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..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: example-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: example-linkedin-client-secret | | +| 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. | | @@ -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 @@ -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/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.2.0 ()', + 'user-agent' => 'AppwritePHPSDK/25.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '24.2.0', + 'x-sdk-version'=> '25.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 index 7b5369c1..186b4de3 100644 --- a/src/Appwrite/Enums/BuildRuntime.php +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -37,9 +37,6 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $PYTHONML311; private static BuildRuntime $PYTHONML312; private static BuildRuntime $PYTHONML313; - private static BuildRuntime $DENO121; - private static BuildRuntime $DENO124; - private static BuildRuntime $DENO135; private static BuildRuntime $DENO140; private static BuildRuntime $DENO146; private static BuildRuntime $DENO20; @@ -58,6 +55,7 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $DART39; private static BuildRuntime $DART310; private static BuildRuntime $DART311; + private static BuildRuntime $DART312; private static BuildRuntime $DOTNET60; private static BuildRuntime $DOTNET70; private static BuildRuntime $DOTNET80; @@ -98,6 +96,7 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $FLUTTER335; private static BuildRuntime $FLUTTER338; private static BuildRuntime $FLUTTER341; + private static BuildRuntime $FLUTTER344; private string $value; @@ -333,27 +332,6 @@ public static function PYTHONML313(): BuildRuntime } 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)) { @@ -480,6 +458,13 @@ public static function DART311(): BuildRuntime } 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)) { @@ -760,6 +745,13 @@ public static function FLUTTER341(): BuildRuntime } 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 { @@ -795,9 +787,6 @@ public static function from(string $value): self '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(), @@ -816,6 +805,7 @@ public static function from(string $value): self '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(), @@ -856,6 +846,7 @@ public static function from(string $value): self '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/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/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/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 index 667d0d3f..e6f9f263 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -37,9 +37,6 @@ class Runtime implements JsonSerializable private static Runtime $PYTHONML311; private static Runtime $PYTHONML312; private static Runtime $PYTHONML313; - private static Runtime $DENO121; - private static Runtime $DENO124; - private static Runtime $DENO135; private static Runtime $DENO140; private static Runtime $DENO146; private static Runtime $DENO20; @@ -58,6 +55,7 @@ class Runtime implements JsonSerializable private static Runtime $DART39; private static Runtime $DART310; private static Runtime $DART311; + private static Runtime $DART312; private static Runtime $DOTNET60; private static Runtime $DOTNET70; private static Runtime $DOTNET80; @@ -98,6 +96,7 @@ class Runtime implements JsonSerializable private static Runtime $FLUTTER335; private static Runtime $FLUTTER338; private static Runtime $FLUTTER341; + private static Runtime $FLUTTER344; private string $value; @@ -333,27 +332,6 @@ public static function PYTHONML313(): Runtime } 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)) { @@ -480,6 +458,13 @@ public static function DART311(): Runtime } 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)) { @@ -760,6 +745,13 @@ public static function FLUTTER341(): Runtime } 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 { @@ -795,9 +787,6 @@ public static function from(string $value): self '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(), @@ -816,6 +805,7 @@ public static function from(string $value): self '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(), @@ -856,6 +846,7 @@ public static function from(string $value): self '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/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/StatusCode.php b/src/Appwrite/Enums/StatusCode.php index 08d3ea92..8a31157e 100644 --- a/src/Appwrite/Enums/StatusCode.php +++ b/src/Appwrite/Enums/StatusCode.php @@ -6,10 +6,10 @@ class StatusCode implements JsonSerializable { - private static StatusCode $MOVEDPERMANENTLY301; - private static StatusCode $FOUND302; - private static StatusCode $TEMPORARYREDIRECT307; - private static StatusCode $PERMANENTREDIRECT308; + private static StatusCode $MOVEDPERMANENTLY; + private static StatusCode $FOUND; + private static StatusCode $TEMPORARYREDIRECT; + private static StatusCode $PERMANENTREDIRECT; private string $value; @@ -28,42 +28,42 @@ public function jsonSerialize(): string return $this->value; } - public static function MOVEDPERMANENTLY301(): StatusCode + public static function MOVEDPERMANENTLY(): StatusCode { - if (!isset(self::$MOVEDPERMANENTLY301)) { - self::$MOVEDPERMANENTLY301 = new StatusCode('301'); + if (!isset(self::$MOVEDPERMANENTLY)) { + self::$MOVEDPERMANENTLY = new StatusCode('301'); } - return self::$MOVEDPERMANENTLY301; + return self::$MOVEDPERMANENTLY; } - public static function FOUND302(): StatusCode + public static function FOUND(): StatusCode { - if (!isset(self::$FOUND302)) { - self::$FOUND302 = new StatusCode('302'); + if (!isset(self::$FOUND)) { + self::$FOUND = new StatusCode('302'); } - return self::$FOUND302; + return self::$FOUND; } - public static function TEMPORARYREDIRECT307(): StatusCode + public static function TEMPORARYREDIRECT(): StatusCode { - if (!isset(self::$TEMPORARYREDIRECT307)) { - self::$TEMPORARYREDIRECT307 = new StatusCode('307'); + if (!isset(self::$TEMPORARYREDIRECT)) { + self::$TEMPORARYREDIRECT = new StatusCode('307'); } - return self::$TEMPORARYREDIRECT307; + return self::$TEMPORARYREDIRECT; } - public static function PERMANENTREDIRECT308(): StatusCode + public static function PERMANENTREDIRECT(): StatusCode { - if (!isset(self::$PERMANENTREDIRECT308)) { - self::$PERMANENTREDIRECT308 = new StatusCode('308'); + if (!isset(self::$PERMANENTREDIRECT)) { + self::$PERMANENTREDIRECT = new StatusCode('308'); } - return self::$PERMANENTREDIRECT308; + return self::$PERMANENTREDIRECT; } public static function from(string $value): self { return match ($value) { - '301' => self::MOVEDPERMANENTLY301(), - '302' => self::FOUND302(), - '307' => self::TEMPORARYREDIRECT307(), - '308' => self::PERMANENTREDIRECT308(), + '301' => self::MOVEDPERMANENTLY(), + '302' => self::FOUND(), + '307' => self::TEMPORARYREDIRECT(), + '308' => self::PERMANENTREDIRECT(), 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/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/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 13eb02c2..ccbc408f 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -7,7 +7,7 @@ use Appwrite\Service; use Appwrite\InputFile; use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +use Appwrite\Enums\ProjectKeyScopes; use Appwrite\Enums\TemplateReferenceType; use Appwrite\Enums\VCSReferenceType; use Appwrite\Enums\DeploymentDownloadType; @@ -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, 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( [], @@ -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; } @@ -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, ?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}'], @@ -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; 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/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/Sites.php b/src/Appwrite/Services/Sites.php index cf69e3c6..4b36ee4b 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -90,13 +90,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\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, 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( [], @@ -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; } @@ -319,13 +329,15 @@ public function get(string $siteId): \Appwrite\Models\Site * @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, 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}'], @@ -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; 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..b079df2a 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -7,7 +7,7 @@ use Mockery; use PHPUnit\Framework\TestCase; use Appwrite\Enums\Runtime; -use Appwrite\Enums\Scopes; +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" ); @@ -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/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 4b859821..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" => "example-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" => "example-linkedin-client-secret" + "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( @@ -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 ea218575..1b9f6583 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -140,7 +140,7 @@ public function testMethodCreateRedirectRule(): void $response = $this->proxy->createRedirectRule( "", "https://example.com", - StatusCode::MOVEDPERMANENTLY301(), + StatusCode::MOVEDPERMANENTLY(), "", ProxyResourceType::SITE() ); diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index a42f7f41..3fbab530 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -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", @@ -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", @@ -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" ) ) );